/* ============================================
   DATS Practicum & Thesis — Stylesheet
   Penn hybrid theme: modern + subtle Penn colors
   ============================================ */

/* --- Variables --- */
:root {
  --penn-navy: #011F5B;
  --penn-red: #990000;
  --penn-red-light: #b81a1a;
  --text: #2d2d2d;
  --text-light: #555;
  --bg: #ffffff;
  --bg-alt: #f7f8fa;
  --border: #e2e5ea;
  --radius: 6px;
  --max-width: 860px;
  --header-height: 64px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 1rem); }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--penn-navy); text-decoration: none; }
a:hover { color: var(--penn-red); }

/* --- Focus styles (keyboard navigation) --- */
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--penn-red);
  outline-offset: 3px;
  border-radius: 2px;
}

img { max-width: 100%; height: auto; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }

/* --- Screen-reader-only utility --- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Respect reduced-motion preference --- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- Skip link (accessibility) --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--penn-navy);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0 0 var(--radius) var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 200;
  transition: top 0.1s;
}
.skip-link:focus { top: 0; color: #fff; }

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--penn-navy);
  height: var(--header-height);
  display: flex;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 960px;
}

.site-title {
  color: #fff;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  text-decoration: none;
}
.site-title:hover { color: #fff; opacity: 0.9; }
.site-title-main { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; }
.site-title-sub { font-size: 0.75rem; opacity: 0.7; font-weight: 400; }

.site-nav { display: flex; gap: 0.15rem; }
.site-nav a {
  color: rgba(255,255,255,0.8);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.site-nav a:hover,
.site-nav a.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.nav-toggle { display: none; }

/* --- Main Content --- */
.content { padding: 2.5rem 0 4rem; }

/* --- Typography --- */
h1, h2, h3, h4 { color: var(--penn-navy); line-height: 1.3; }
h1 { font-size: 2rem; margin-bottom: 1rem; font-weight: 800; }
h2 { font-size: 1.5rem; margin-top: 2.5rem; margin-bottom: 0.75rem; font-weight: 700; }
h3 { font-size: 1.15rem; margin-top: 1.75rem; margin-bottom: 0.5rem; font-weight: 600; }
h4 { font-size: 1rem; margin-top: 1.25rem; margin-bottom: 0.4rem; font-weight: 600; }

p { margin-bottom: 1rem; }
ul, ol { margin-bottom: 1rem; padding-left: 1.5rem; }
li { margin-bottom: 0.35rem; }

/* --- Hero --- */
.hero {
  background: linear-gradient(135deg, var(--penn-navy) 0%, #0a3a8a 100%);
  color: #fff;
  padding: 3rem 0;
  margin: -2.5rem 0 2.5rem;
  text-align: center;
}
.hero .container { max-width: 700px; }
.hero h1 { color: #fff; font-size: 2.2rem; margin-bottom: 0.75rem; }
.hero p { color: rgba(255,255,255,0.85); font-size: 1.1rem; margin-bottom: 1.5rem; }

.btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  background: var(--penn-red);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.15s;
  text-decoration: none;
}
.btn:hover { background: var(--penn-red-light); color: #fff; }

.btn-outline {
  background: transparent;
  border: 2px solid rgba(255,255,255,0.5);
  margin-left: 0.75rem;
}
.btn-outline:hover { border-color: #fff; background: rgba(255,255,255,0.1); }

/* --- Comparison Cards --- */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 1.5rem 0 2rem;
}
.compare-grid.three-col { grid-template-columns: repeat(3, 1fr); }

/* --- Phase wayfinding (Before / During / After) --- */
.phase-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 1.5rem 0 2rem;
}
.phase-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-top: 3px solid var(--penn-red);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.phase-card h3 { margin-top: 0; font-size: 1.05rem; }
.phase-card .phase-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--penn-red);
  margin-bottom: 0.4rem;
}
.phase-card ul { margin: 0; padding-left: 1.1rem; font-size: 0.92rem; }
.phase-card li { margin-bottom: 0.3rem; }
.compare-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  border-top: 3px solid var(--penn-navy);
}
.compare-card.industry { border-top-color: var(--penn-red); }
.compare-card h3 {
  margin-top: 0;
  font-size: 1.1rem;
  color: var(--penn-navy);
}
.compare-card .tag {
  display: inline-block;
  background: var(--penn-navy);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  margin-bottom: 0.75rem;
}

/* --- Steps --- */
.steps { counter-reset: step; list-style: none; padding-left: 0; }
.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 3rem;
  margin-bottom: 1.5rem;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2rem;
  height: 2rem;
  background: var(--penn-navy);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}
.proposal-items { margin-top: 0.5rem; padding-left: 0.25rem; }
.proposal-items div { margin-bottom: 0.35rem; }

/* --- Timeline Table --- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.timeline-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  min-width: 480px;
}
.timeline-table th {
  background: var(--penn-navy);
  color: #fff;
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
}
.timeline-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.timeline-table tr:nth-child(even) { background: var(--bg-alt); }
.timeline-table .note { font-size: 0.85rem; color: var(--text-light); margin-top: 0.25rem; }

/* Rubric reuses timeline-table styling but needs more room for 4 columns */
.rubric-table { min-width: 680px; }
.rubric-table th, .rubric-table td { font-size: 0.88rem; }
.rubric-table td:first-child { font-weight: 600; color: var(--penn-navy); white-space: nowrap; }

/* --- FAQ --- */
.faq-item { border-bottom: 1px solid var(--border); padding: 1.25rem 0; }
.faq-item:last-child { border-bottom: none; }

details.faq-item summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  color: var(--penn-navy);
}
details.faq-item summary::before {
  content: "▸";
  display: inline-block;
  transition: transform 0.2s;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
details.faq-item[open] summary::before { transform: rotate(90deg); }
details.faq-item summary::-webkit-details-marker { display: none; }

.faq-answer { padding: 0.75rem 0 0 1.5rem; color: var(--text); }

/* --- On-this-page TOC --- */
.page-toc {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0 2.5rem;
}
.page-toc strong {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}
.page-toc ul {
  margin: 0;
  padding-left: 1.1rem;
  columns: 2;
  font-size: 0.95rem;
}
.page-toc li { margin-bottom: 0.25rem; }

@media (max-width: 480px) {
  .page-toc ul { columns: 1; }
}

/* --- Info Box --- */
.info-box {
  background: var(--bg-alt);
  border-left: 4px solid var(--penn-navy);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0;
}
.info-box.warning { border-left-color: var(--penn-red); }

/* --- Resource Links --- */
.resource-card {
  display: block;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.resource-card:hover {
  border-color: var(--penn-navy);
  box-shadow: 0 2px 8px rgba(1,31,91,0.08);
  color: var(--text);
}
.resource-card h4 { margin: 0 0 0.25rem; color: var(--penn-navy); }
.resource-card p { margin: 0; color: var(--text-light); font-size: 0.9rem; }

/* --- Contact Cards --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 1.5rem 0;
}
.contact-card {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--border);
}
.contact-card h4 { margin: 0 0 0.25rem; }
.contact-card .role { color: var(--text-light); font-size: 0.9rem; margin-bottom: 0.5rem; }

/* --- Footer --- */
.site-footer {
  background: var(--penn-navy);
  color: rgba(255,255,255,0.8);
  padding: 2.5rem 0 1.5rem;
  margin-top: 3rem;
}
.site-footer .container { max-width: 960px; }
.site-footer a { color: rgba(255,255,255,0.9); }
.site-footer a:hover { color: #fff; }
.site-footer h4 { color: #fff; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.75rem; }
.site-footer p { font-size: 0.9rem; line-height: 1.6; }

.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.15); padding-top: 1rem; font-size: 0.8rem; opacity: 0.85; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .compare-grid, .compare-grid.three-col, .contact-grid, .footer-grid, .phase-grid { grid-template-columns: 1fr; }
  .hero { padding: 2rem 0; }
  .hero h1 { font-size: 1.7rem; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }

  /* Hero CTAs stack as blocks on mobile */
  .hero .btn {
    display: block;
    width: fit-content;
    margin: 0 auto;
  }
  .btn-outline { margin-left: auto; margin-top: 0.75rem; }

  .nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
  }
  .nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
  }

  /* Mobile nav with larger touch targets */
  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--penn-navy);
    flex-direction: column;
    padding: 0.5rem 1rem 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  }
  .nav-open .site-nav { display: flex; }
  .site-nav a {
    padding: 0.75rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .timeline-table { font-size: 0.85rem; }
  .timeline-table th, .timeline-table td { padding: 0.5rem 0.6rem; }
}

@media (max-width: 480px) {
  .container { padding: 0 1rem; }
  .steps > li { padding-left: 2.5rem; }
}
