/* site.css — shared stylesheet for all pages (extracted from the single-file
   mockup in Phase 2; content styles unchanged except accessibility fixes). */

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 18px; scroll-behavior: smooth; }
body { font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif; color: #333; background: #fff; line-height: 1.65; }

/* TYPOGRAPHY (Pass 1): Spectral for headings, clean sans for body */
h1, h2, h3, nav .logo { font-family: 'Spectral', Georgia, 'Times New Roman', serif; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; }
.about-sidebar .info-block h3 { font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif; letter-spacing: 1.5px; }
a { color: #2563eb; text-decoration: none; }
a:hover { color: #1d4ed8; text-decoration: underline; }

/* Visible focus for keyboard users */
a:focus-visible, button:focus-visible { outline: 3px solid #1d4ed8; outline-offset: 2px; border-radius: 2px; }
footer a:focus-visible { outline-color: #fff; } /* blue ring is 1.72:1 against the navy footer */

/* Screen-reader-only text (filter status messages on the research page) */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Skip link — hidden until focused */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 200; background: #1e3a5f; color: #fff; padding: 10px 18px; border-radius: 0 0 6px 0; }
.skip-link:focus { left: 0; color: #fff; text-decoration: none; }

/* Anchored sections clear the sticky nav */
section[id] { scroll-margin-top: 80px; }

/* NAV (sticky, wraps on small screens — no hamburger needed) */
header { position: sticky; top: 0; z-index: 100; }
nav { background: #fff; border-bottom: 1px solid #e0e0e0; display: flex; justify-content: space-between; align-items: center; padding: 0 40px; height: 60px; }
nav .logo { font-size: 1.15rem; font-weight: 700; color: #1e3a5f; letter-spacing: 0.5px; white-space: nowrap; }
nav .nav-links { display: flex; gap: 28px; }
nav .nav-links a { font-size: 0.9rem; font-weight: 500; color: #555; text-transform: uppercase; letter-spacing: 1px; text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; transition: color 0.15s ease, border-bottom-color 0.15s ease; }
nav .nav-links a:hover, nav .nav-links a[aria-current="page"] { color: #1e3a5f; border-bottom-color: #f59e0b; text-decoration: none; }

/* HERO (Pass 2): flat deep navy, editorial title-page treatment.
   Single gold rule at the band's base is the one accent (decorative,
   on navy — not an essential indicator). */
.hero { background: linear-gradient(180deg, #23456b 0%, #1e3a5f 55%); border-bottom: 3px solid #f59e0b; }
.hero-content { display: flex; align-items: center; justify-content: space-between; gap: 50px; max-width: 940px; margin: 0 auto; padding: 72px 40px; }
.hero-photo { width: 210px; height: 210px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.35); flex-shrink: 0; overflow: hidden; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-text { color: #fff; }
.hero-text h1 { font-size: 3rem; font-weight: 500; margin-bottom: 8px; }
.hero-text .subtitle { font-size: 1.1rem; color: rgba(255,255,255,0.88); margin-bottom: 22px; font-weight: 300; }
.hero-text .interests { font-size: 0.88rem; letter-spacing: 0.04em; color: rgba(255,255,255,0.78); }

/* MINI HERO (sub-pages): same band, smaller */
.hero-mini .hero-content { padding: 36px 40px; }
.hero-mini .hero-text h1 { font-size: 2rem; }

/* SECTIONS — optimized width for readability (940px gives ~65 characters per line at 18px body text, within the ideal 60-70 range) */
section { max-width: 940px; margin: 0 auto; padding: 50px 40px; }
section h2 { font-size: 1.5rem; font-weight: 600; color: #1e3a5f; margin-bottom: 20px; padding-bottom: 8px; border-bottom: 2px solid #e8f0fe; }
section h3 { font-size: 1.15rem; color: #1e3a5f; margin: 28px 0 12px; }

/* Drop cap — book-style opening on the About text (kept from the
   redesign side-by-side: the one element Alex adopted) */
.dropcap::first-letter { font-family: 'Spectral', Georgia, 'Times New Roman', serif; font-weight: 500; font-size: 3.3em; float: left; line-height: 0.8; padding: 6px 10px 0 0; color: #1e3a5f; }

/* ABOUT — 2-column landing */
.landing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.about-sidebar .info-block { margin-bottom: 20px; }
.about-sidebar .info-block h3 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 1.5px; color: #5f6672; margin: 0 0 6px; }
.about-sidebar .info-block p { color: #444; font-size: 0.95rem; }

/* AT-A-GLANCE STATS BAND (Pass 3 — understated, no cards) */
.stats-band { display: grid; grid-template-columns: 1fr 1fr 1fr; }
.stats-band .stat { padding: 4px 28px; }
.stats-band .stat:first-child { padding-left: 0; }
.stats-band .stat:last-child { padding-right: 0; }
.stats-band .stat + .stat { border-left: 1px solid #dde3ec; }
.stats-band h3 { font-family: 'Spectral', Georgia, 'Times New Roman', serif; font-size: 1rem; font-weight: 600; color: #1e3a5f; margin: 0 0 8px; display: flex; align-items: baseline; gap: 8px; }
.stats-band .stat-num { font-size: 1.5rem; line-height: 1.2; }
.stats-band .stat-num .plus { font-size: 0.62em; vertical-align: 0.5em; margin-left: 0.04em; }
.stats-band h3 a { color: inherit; }
.stats-band p { font-size: 0.85rem; color: #5f6672; line-height: 1.5; }

/* RESEARCH THEMES — editorial blocks, uniform navy rules (color plan A:
   category colors live only on the research page, where they filter) */
.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px 40px; margin: 30px 0; }
.theme-card { border-top: 3px solid #1e3a5f; padding-top: 16px; }
.theme-card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.theme-card h3 a { color: inherit; text-decoration: none; }
.theme-card h3 a:hover { color: inherit; text-decoration: underline; }
.theme-card p { font-size: 0.9rem; color: #555; }

/* SITE PHOTOS (real images replacing placeholders as they arrive) */
.site-photo { width: 100%; border-radius: 10px; display: block; }

/* ACTION PHOTO PLACEHOLDER */
.photo-placeholder { width: 100%; height: 220px; background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%); border: 2px dashed #bfdbfe; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #4a6fa5; font-style: italic; font-size: 0.9rem; }

/* EDITORIAL LISTS — publications & grants on the landing page (Pass 3) */
.pub-list { list-style: none; margin: 0; }
.pub-list li { padding: 14px 2px; border-bottom: 1px solid #e3e7ee; }
.pub-row { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; }
.pub-title { font-weight: 600; font-size: 0.95rem; color: #333; }
.pub-title a { color: inherit; text-decoration: none; }
.pub-title a:hover { color: #1d4ed8; text-decoration: underline; }
.pub-venue { font-size: 0.85rem; color: #5f6672; font-style: italic; text-align: right; flex-shrink: 0; max-width: 40%; }
.grant-meta { font-size: 0.85rem; color: #666; margin-top: 4px; }
.grant-amount { font-weight: 600; color: #1e3a5f; }
.grant-links { font-size: 0.82rem; margin-top: 3px; }
.more-link { margin-top: 18px; font-size: 0.9rem; }
.more-link a { font-weight: 600; }

/* RESEARCH FILTERS — full category titles on desktop, chip-length
   labels on phones (Pass 5 deferred item, resolved 2026-08-23) */
.filter-btn .label-short { display: none; }
@media (max-width: 700px) {
  .filter-btn .label-full { display: none; }
  .filter-btn .label-short { display: inline; }
}

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px; }
.filter-btn { padding: 8px 20px; border-radius: 25px; border: 1.5px solid #d1d5db; background: #fff; color: #666; font-size: 0.85rem; cursor: pointer; font-weight: 500; transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease; font-family: inherit; }
.filter-btn:hover { border-color: #1e3a5f; color: #1e3a5f; }
.filter-btn[data-filter="gt"] { border-color: #0e7490; color: #0e7490; }
.filter-btn[data-filter="dc"] { border-color: #b45309; color: #b45309; }
.filter-btn[data-filter="policy"] { border-color: #047857; color: #047857; }
.filter-btn[data-filter="methods"] { border-color: #be185d; color: #be185d; }
.filter-btn.active, .filter-btn[data-filter="all"].active { background: #1e3a5f; color: #fff; border-color: #1e3a5f; }
.filter-btn[data-filter="gt"].active { background: #0e7490; color: #fff; border-color: #0e7490; }
.filter-btn[data-filter="dc"].active { background: #b45309; color: #fff; border-color: #b45309; }
.filter-btn[data-filter="policy"].active { background: #047857; color: #fff; border-color: #047857; }
.filter-btn[data-filter="methods"].active { background: #be185d; color: #fff; border-color: #be185d; }

/* PAPER CARDS */
.paper-group h2 { margin-top: 28px; }
.paper-list { display: flex; flex-direction: column; gap: 16px; }
.paper-card { padding: 18px 22px; border: 1px solid #eee; border-radius: 8px; background: #fafbfc; transition: border-color 0.2s ease, box-shadow 0.2s ease; animation: card-in 0.25s ease; }
@keyframes card-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.paper-card:hover { border-color: #bfdbfe; box-shadow: 0 2px 8px rgba(37,99,235,0.06); }
.paper-card.hidden { display: none; }
.paper-card[id] { scroll-margin-top: 90px; } /* deep links from the home page clear the sticky nav */
.paper-card:target { border-color: #1e3a5f; }
.paper-title { font-size: 0.98rem; font-weight: 600; color: #333; margin-bottom: 4px; }
.paper-authors { font-size: 0.86rem; color: #666; margin-bottom: 3px; }
.paper-venue { font-size: 0.86rem; color: #5f6672; font-style: italic; margin-bottom: 8px; }
.paper-award { font-size: 0.82rem; font-weight: 600; color: #1e3a5f; margin-bottom: 8px; }
.paper-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tag { font-size: 0.7rem; padding: 2px 10px; border-radius: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.tag-gt { background: #cffafe; color: #0e7490; }
.tag-dc { background: #fef3c7; color: #b45309; }
.tag-policy { background: #d1fae5; color: #047857; }
.tag-methods { background: #fce7f3; color: #be185d; }
.paper-links { display: flex; flex-wrap: wrap; gap: 10px; }
.paper-links a { font-size: 0.8rem; color: #2563eb; font-weight: 500; padding: 3px 10px; border: 1px solid #dbeafe; border-radius: 4px; transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease; }
.paper-links a:hover { background: #2563eb; color: #fff; border-color: #2563eb; text-decoration: none; }

/* STUDENTS — two-column grid with square photos */
.students-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 40px; }
.student-card-sq { border-radius: 10px; border: 1px solid #eee; background: #fafbfc; overflow: hidden; transition: border-color 0.2s ease, box-shadow 0.2s ease; position: relative; }
.student-card-sq:hover { border-color: #bfdbfe; box-shadow: 0 2px 8px rgba(37,99,235,0.06); }
.student-card-sq .student-photo-sq { width: 100%; aspect-ratio: 1; background: #e8f0fe; display: flex; align-items: center; justify-content: center; overflow: hidden; font-size: 0.8rem; color: #4a6fa5; text-align: center; }
.student-card-sq .student-photo-sq img { width: 100%; height: 100%; object-fit: cover; }
.student-card-sq .student-body { padding: 16px; }
.student-card-sq .student-body h3 { font-size: 0.95rem; color: #333; margin: 0 0 3px; }
.student-card-sq .student-body h3 a { color: #2563eb; }
.student-card-sq .student-body .student-title { font-size: 0.82rem; color: #666; }
.student-card-sq .student-body .student-affil { font-size: 0.82rem; color: #5f6672; margin-top: 2px; }
.market-badge { position: absolute; top: 10px; right: 10px; background: #dc2626; color: #fff; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; padding: 3px 10px; border-radius: 4px; }

/* TEACHING — category cards */
.teaching-category { margin-bottom: 32px; }
.teaching-category h2 { font-size: 1.1rem; color: #1e3a5f; margin-bottom: 12px; padding-bottom: 6px; border-bottom: 2px solid #e8f0fe; }
.course-card-full { padding: 18px 22px; border-radius: 8px; border: 1px solid #eee; background: #fafbfc; margin-bottom: 12px; }
.course-card-full .course-num { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 1px; color: #1e3a5f; font-weight: 700; }
.course-card-full .course-name { font-size: 1rem; font-weight: 600; color: #333; margin: 4px 0; }
.course-card-full .course-desc { font-size: 0.88rem; color: #666; line-height: 1.5; }
.course-card-full .course-link { font-size: 0.8rem; margin-top: 6px; }

/* FOOTER */
footer { background: #1e3a5f; color: rgba(255,255,255,0.75); text-align: center; padding: 30px 40px; font-size: 0.85rem; }
footer a { color: rgba(255,255,255,0.9); }

/* SECTION ALT BG */
.section-alt { background: #f8f9fc; }
.section-alt-wrap { padding: 50px 0; }
.section-alt-wrap section { padding-top: 0; padding-bottom: 0; }

/* RESPONSIVE */
@media (max-width: 880px) {
  nav { height: auto; flex-wrap: wrap; padding: 10px 20px; row-gap: 2px; }
  nav .nav-links { flex-wrap: wrap; gap: 14px; row-gap: 2px; }
  section[id] { scroll-margin-top: 110px; } /* wrapped nav is two rows tall */
  .hero-content { flex-direction: column-reverse; text-align: center; gap: 24px; padding: 40px 24px; }
  .hero-photo { width: 160px; height: 160px; }
  .hero-mini .hero-content { padding: 28px 24px; }
  .stats-band { grid-template-columns: 1fr; }
  .stats-band .stat { padding: 14px 0; }
  .stats-band .stat + .stat { border-left: none; border-top: 1px solid #dde3ec; }
  .theme-grid { grid-template-columns: 1fr; }
}
/* PASS 5 — designed for phones, not just reflowed */
@media (max-width: 700px) {
  nav { padding: 8px 16px; }
  nav .logo { font-size: 1.05rem; }
  nav .nav-links { gap: 12px; }
  nav .nav-links a { font-size: 0.8rem; letter-spacing: 0.5px; }
  section { padding: 36px 20px; }
  .section-alt-wrap { padding: 36px 0; }
  .landing-grid, .students-two-col { grid-template-columns: 1fr; }
  .pub-row { flex-direction: column; gap: 2px; }
  .pub-venue { text-align: left; max-width: none; }
  /* Hero: give the first screen back to the content */
  .hero-content { gap: 18px; padding: 32px 20px 36px; }
  .hero-photo { width: 120px; height: 120px; }
  .hero-text h1 { font-size: 2.1rem; }
  .hero-text .subtitle { font-size: 1rem; margin-bottom: 14px; }
  .hero-text .interests { font-size: 0.82rem; }
  /* Stats band: tighter rhythm when stacked */
  .stats-band .stat { padding: 12px 0; }
  .stats-band p { font-size: 0.82rem; }
  .theme-grid { gap: 24px; }
  /* Students: horizontal rows instead of giant full-width squares */
  .students-two-col { gap: 12px; }
  .student-card-sq { display: flex; align-items: center; }
  .student-card-sq .student-photo-sq { width: 96px; aspect-ratio: auto; flex-shrink: 0; align-self: stretch; }
  .student-card-sq .student-body { padding: 12px 14px; }
  .market-badge { font-size: 0.62rem; padding: 2px 8px; } /* carries real info (job market) — stays visible on phones */
  .filter-btn { padding: 6px 14px; font-size: 0.8rem; }
  .dropcap::first-letter { font-size: 2.6em; }
  footer { padding: 24px 20px; }
}

/* REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

/* CV PAGE */
.cv-actions { text-align: center; margin-bottom: 20px; font-size: 1.05rem; font-weight: 600; }
.cv-embed { width: 100%; height: 80vh; border: 1px solid #eee; border-radius: 8px; }
@media (max-width: 700px) {
  .cv-embed { display: none; }
}
