/* Shared styles for publications.html, teaching.html, and students.html.
   Load once per page, after css/site.css. Header/footer styles stay in site.css.
   Content rules are scoped to .content-page to protect site navigation. */

/* Design tokens and document defaults */
:root {
  color-scheme: light;
  --ink: #202c38;
  --muted: #526170;
  --accent: #215a80;
  --line: #dce3e9;
  --page-width: 920px;
  --section-gap: 2.5rem;
  --surface: #fff;
  --surface-subtle: #f3f7fa;
  --surface-hover: #f1f6fa;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--surface); color: var(--ink); font: 1rem/1.65 system-ui, sans-serif; }

/* Common page layout, headings, introductory text, and links */
.content-page { max-width: var(--page-width); margin: 0 auto; padding: 3rem 1.5rem; }
.content-page h1 { margin: 0; font-size: clamp(1.8rem, 5vw, 2.5rem); line-height: 1.2; letter-spacing: -.035em; }
.content-page h2 { margin: 0 0 1.25rem; padding-bottom: .5rem; border-bottom: 1px solid var(--line); font-size: 1.35rem; }
.content-page p { margin: .15rem 0; }
.page-intro { margin-bottom: var(--section-gap); }
.page-intro h1 { margin-bottom: .5rem; }
.page-intro p { color: var(--muted); font-size: .95rem; }
.content-page a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .18em; }
.content-page a:focus-visible,
.content-page summary:focus-visible,
.content-page .student-table-wrap:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 2px; }

/* Shared year-navigation bubbles (publications and teaching) */
.content-page .year-nav { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 var(--section-gap); }
.content-page .year-nav a { padding: .3rem .85rem; border: 1px solid var(--line); border-radius: 999px; font-size: .9rem; text-decoration: none; font-variant-numeric: tabular-nums; }
.content-page .year-nav a:hover { background: var(--surface-hover); border-color: var(--accent); }

/* Publications */
.publications-page .year-group { margin: 0 0 var(--section-gap); }
.publications-page .year-group h2 { scroll-margin-top: 2rem; }
.publications-page .publications { list-style: none; padding: 0; margin: 0; }
.publications-page .publication { margin-bottom: 1.75rem; }
.publications-page h3 { margin: 0 0 .2rem; font-size: 1.08rem; line-height: 1.45; font-weight: 650; }
.publications-page h3 a { text-decoration: none; }
.publications-page h3 a:hover { text-decoration: underline; }
.publications-page .venue, .publications-page .empty { color: var(--muted); }
.publications-page .award { color: #76521a; font-weight: 650; font-size: .9rem; }
.publications-page .links { display: flex; flex-wrap: wrap; gap: .35rem 1rem; margin-top: .45rem; font-size: .9rem; }
.publications-page details { margin-top: .45rem; font-size: .9rem; }
.publications-page summary { width: fit-content; cursor: pointer; color: var(--accent); }
.publications-page pre { padding: 1rem; border: 1px solid var(--line); background: #f6f8fa; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .85rem; }

/* Student tables and disclosure headings */
.students-page .student-section { margin: 0 0 var(--section-gap); }
.students-page .student-section:last-child { margin-bottom: 0; }
.students-page .student-section > summary { cursor: pointer; margin-bottom: 1.25rem; padding-bottom: .5rem; border-bottom: 1px solid var(--line); font-size: 1.35rem; font-weight: 700; }
.students-page .student-section > summary h2 { display: inline; margin: 0; padding: 0; border: 0; }
.students-page .student-section > summary:hover { color: var(--accent); }
.students-page .student-table-wrap { overflow-x: auto; }
.students-page .student-table { width: 100%; border-collapse: collapse; text-align: left; }
.students-page .student-table th, .students-page .student-table td { padding: .9rem .75rem; vertical-align: top; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.students-page .student-table th:first-child, .students-page .student-table td:first-child { padding-left: 0; }
.students-page .student-table th:last-child, .students-page .student-table td:last-child { padding-right: 0; }
.students-page .student-table thead th { padding-top: 0; font-size: .85rem; font-weight: 650; color: var(--muted); }
.students-page .student-table tbody th { font-size: 1rem; font-weight: 650; }
.students-page .student-table tbody tr:last-child > * { border-bottom: 0; }
.students-page .student-table--phd { min-width: 680px; table-layout: fixed; }
.students-page .student-table--phd .student-name-col { width: 22%; }
.students-page .student-table--phd .student-years-col { width: 18%; }
.students-page .student-table--phd .student-dissertation-col { width: 42%; }
.students-page .student-table--phd .student-profile-col { width: 18%; }
.students-page .student-links { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .9rem; }
.students-page .student-status { display: block; margin-top: .2rem; color: var(--muted); font-size: .8rem; }
.students-page .student-missing, .students-page .student-empty { color: var(--muted); }
.students-page .student-dissertation { font-style: italic; }
.students-page .student-year { white-space: nowrap; }

/* Teaching timeline and semester cards */
.teaching-page .teaching-year { display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: 1.5rem; position: relative; padding-bottom: var(--section-gap); scroll-margin-top: 2rem; }
.teaching-page .teaching-year::before { content: ''; position: absolute; left: 5.7rem; top: .9rem; bottom: 0; border-left: 1px solid var(--line); }
.teaching-page .teaching-year:last-child { padding-bottom: 0; }
.teaching-page .teaching-year:last-child::before { bottom: 1rem; }
.teaching-page .teaching-year > h2 { margin: .2rem 0 0; padding: 0; border: 0; font-size: 1.35rem; line-height: 1.4; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.teaching-page .teaching-year > h2::after { content: ''; position: absolute; top: .8rem; left: 5.45rem; width: .55rem; height: .55rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--surface); }
.teaching-page .teaching-semesters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.teaching-page .teaching-semester { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; min-width: 0; background: var(--surface); }
.teaching-page .teaching-semester > h3 { display: flex; align-items: center; gap: .65rem; margin: 0; padding: .8rem 1.1rem; border-bottom: 1px solid var(--line); background: var(--surface-subtle); font-size: 1rem; font-weight: 650; }
.teaching-page .teaching-semester > h3::before { content: ''; width: .4rem; height: .4rem; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.teaching-page .teaching-semester--fall > h3 { background: #f8f6f2; }
.teaching-page .teaching-semester--fall > h3::before { background: #89633b; }
.teaching-page .teaching-courses { list-style: none; margin: 0; padding: 0 1.1rem; }
.teaching-page .teaching-course { padding: 1rem 0; overflow-wrap: anywhere; }
.teaching-page .teaching-course + .teaching-course { border-top: 1px solid var(--line); }
.teaching-page .teaching-code { color: var(--accent); font-size: .8rem; font-weight: 700; letter-spacing: .045em; }
.teaching-page .teaching-title { margin: .2rem 0 0; font-size: 1rem; line-height: 1.45; font-weight: 650; }
.teaching-page .teaching-title a { color: var(--ink); text-decoration-color: #b2c5d2; }
.teaching-page .teaching-title a:hover { color: var(--accent); }
.teaching-page .teaching-meta { margin: .35rem 0 0; color: var(--muted); font-size: .85rem; }
.teaching-page .teaching-empty { padding: 1rem 1.1rem; margin: 0; color: var(--muted); font-size: .9rem; }
.teaching-page > .teaching-empty { padding: 0; }

/* Consistent page gutters; teaching cards adapt independently */
@media (max-width: 640px) {
  .content-page { padding: 2rem 1rem; }
  .teaching-page .teaching-year { grid-template-columns: 1fr; gap: .8rem; padding-bottom: 2rem; }
  .teaching-page .teaching-year::before, .teaching-page .teaching-year > h2::after { display: none; }
}
@media (max-width: 540px) {
  .students-page .student-table th, .students-page .student-table td { padding: .75rem .5rem; }
  .students-page .student-table th:first-child, .students-page .student-table td:first-child { padding-left: 0; }
  .students-page .student-table th:last-child, .students-page .student-table td:last-child { padding-right: 0; }
}
@media (max-width: 420px) { .teaching-page .teaching-semesters { grid-template-columns: 1fr; } }

/* Print only the page-specific elements that benefit from print overrides */
@media print {
  .content-page { max-width: none; padding: 0; }
  .content-page .year-nav { display: none; }
  .publications-page .publication, .teaching-page .teaching-year { break-inside: avoid; }
  .publications-page details { display: none; }
  .students-page .student-table-wrap { overflow: visible; }
  .students-page .student-table--phd { min-width: 0; }
  .students-page .student-table { font-size: .85rem; }
  .students-page .student-table tr { break-inside: avoid; }
  .teaching-page .teaching-year::before, .teaching-page .teaching-year > h2::after { display: none; }
}
