/* ============================================================
   Annapurna Vadaparty — academic site
   ONE shared stylesheet for the whole site.

   Vibe modeled on shannon-ellis.com: clean white background,
   light-gray header band, Montserrat body / Lato headings,
   a single narrow reading column, and one accent color used
   for headings (h3) and links. Her indigo accent is replaced
   here with maroon.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&family=Montserrat:wght@400;600;700&display=swap');

:root {
  --bg:          #fafaf7;  /* page background (soft off-white) */
  --band:        #f5f5f5;  /* header / table band    */
  --text:        #333333;  /* body text              */
  --heading:     #222222;  /* headings, nav          */
  --accent:      #5f1a20;  /* maroon (replaces Ellis indigo); 12.7:1 on white */
  --accent-dark: #4a1418;  /* visited / stronger; 15:1 on white */
  --accent-soft: #e0c9ca;  /* link hover background (maroon text ≥8:1 on it) */
  --rule:        #eaeaea;  /* hairline borders        */
  --rule-soft:   #e5e5e5;  /* faint dividers          */
  --muted:       #595959;  /* footer / secondary; 7:1 on white (AAA) */
  --faint:       #6a6a6a;  /* dates / least important; 5.4:1 on white (AA) */
  --maxw:        64rem;    /* reading measure         */
}

/* ---- reset-ish ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
@media (min-width: 600px) {
  body { font-size: 19px; line-height: 1.8; }
}

/* ---- skip link ---- */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--bg);
  color: var(--accent);
  padding: .5rem .75rem;
  border: 2px solid var(--accent);
}
.skip:focus { left: .5rem; top: .5rem; z-index: 10; }

/* ---- layout ---- */
.wrap {
  max-width: var(--maxw);
  margin: 40px auto 10px;
  padding: 0 15px 3rem;
}
.wrap--wide { max-width: 64rem; }   /* schedule page needs room */

/* homepage: identity panel on the left, prose on the right */
.home {
  max-width: 58rem;
  display: grid;
  grid-template-columns: 16rem 1fr;
  gap: 2.5rem;
  align-items: start;
}
.profile {
  margin: 0;
  /* soft tint that fades out to the white background — no hard edge */
  background: radial-gradient(110% 80% at 50% 50%, var(--band), rgba(245, 245, 245, 0) 72%);
  border-radius: 14px;
  padding: 1.5rem 1.25rem;
  text-align: center;
}
.profile h1 { margin-top: 0; }
.profile .lead { font-size: 1rem; color: var(--muted); }
.home-body > :first-child { margin-top: 0; }
.headshot {
  display: block;
  width: 100%;
  max-width: 170px;
  aspect-ratio: 4 / 5;          /* portrait oval, not a tight circle */
  height: auto;
  border-radius: 50%;           /* with the 4:5 ratio this renders an ellipse */
  object-fit: cover;
  object-position: center 30%;  /* bias toward the face */
  border: 3px solid var(--bg);
  margin: 0 auto 1.1rem;
}
@media (max-width: 700px) {
  .home {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    max-width: var(--maxw);
  }
}

/* ---- masthead + primary nav ---- */
.masthead {
  background: var(--band);
  border-bottom: 1px solid var(--rule);
  padding: 20px 0;
}
@media (min-width: 600px) { .masthead { padding: 25px 0; } }
.topnav {
  max-width: var(--maxw);   /* match the content column so the name lines up with the page h1 */
  margin: 0 auto;
  padding: 0 15px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .5rem 1.5rem;
  font-family: 'Lato', sans-serif;
}
.topnav .site-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--heading);
  text-decoration: none;
  margin-right: auto;
  letter-spacing: .01em;
}
.topnav .site-name:hover,
.topnav .site-name:focus { color: var(--accent); }
.topnav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  font-size: 14px;
}
@media (min-width: 600px) {
  .topnav ul { font-size: 18px; gap: 1.875rem; }
}
.topnav a {
  color: var(--heading);
  text-decoration: none;
}
.topnav a:hover,
.topnav a:focus { color: var(--accent); }
.topnav a[aria-current="page"] {
  font-weight: 700;
  border-bottom: 2px solid var(--accent);
}

/* ---- course sub-nav ---- */
.coursenav {
  font-family: 'Lato', sans-serif;
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1.25rem;
  margin: 0 0 2rem;
  padding: .65rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-size: .95rem;
}
.coursenav a {
  color: var(--accent);
  text-decoration: none;
}
.coursenav a:hover,
.coursenav a:focus { background: var(--accent-soft); }
.coursenav a[aria-current="page"] {
  color: var(--heading);
  font-weight: 700;
  background: transparent;
  border-bottom: 2px solid var(--accent);
}

/* ---- typography ---- */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Lato', sans-serif;
  color: var(--heading);
  line-height: 1.3;
}
h1 {
  font-size: 2.125rem;
  font-weight: 700;
  margin: .25rem 0 1rem;
}
@media (min-width: 600px) { h1 { font-size: 2.625rem; } }
h2 {
  font-size: 1.5rem;
  margin: 2.25rem 0 .6rem;
}
h3 {
  font-size: 1.2rem;
  color: var(--accent);   /* Ellis accents h3; maroon here */
  margin: 1.5rem 0 .35rem;
}
p, ul, ol, dl, table { margin: 0 0 1rem; }
.lead { font-size: 1.12rem; }
.kicker {
  font-family: 'Lato', sans-serif;
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 .35rem;
}

/* ---- links in body content ----
   Ellis style is color + a soft highlight on hover. But maroon links sit at
   essentially the same luminance as the body text, so colour alone is not a
   sufficient cue (WCAG 1.4.1 / technique G183). Links embedded in prose and
   lists therefore carry an underline; the grouped nav bars (topnav, coursenav,
   footer) read as navigation and keep the clean, underline-free look. */
a { color: var(--accent); }
a:visited { color: var(--accent-dark); }
main a:not(.btn-link) { transition: background 150ms ease; }
main a:not(.btn-link):hover,
main a:not(.btn-link):focus { background: var(--accent-soft); }
main p a, main li a, main dd a, main dt a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---- lists ---- */
ul, ol { padding-left: 1.25rem; }
li { margin: .2rem 0; }
.plain-list { list-style: none; padding-left: 0; }
.plain-list > li { margin: .55rem 0; }

/* ---- description / metadata blocks ---- */
.meta { margin: 0 0 1.25rem; }
.meta dt { font-weight: 700; margin-top: .5rem; }
.meta dd { margin: 0 0 .25rem; }

/* ---- TBD placeholder (visibly marked) ---- */
.tbd {
  display: inline-block;
  font-style: italic;
  color: var(--muted);
  border-bottom: 1px dotted var(--muted);
}

/* ---- generic tables ---- */
table { border-collapse: collapse; width: 100%; }
caption { text-align: left; font-style: italic; color: var(--muted); margin-bottom: .4rem; }
th, td {
  border: 1px solid var(--rule);
  padding: .5rem .6rem;
  vertical-align: top;
  text-align: left;
}
thead th, th[scope="col"], th[scope="row"] {
  background: var(--band);
  font-weight: 700;
}


/* ============================================================
   SCHEDULE — new lane-keyed renderer (.sch-*)
   Rendered by render-schedule.js into <div id="schedule" class="schedule">.
   Two stakes hues scoped here so they can't leak site-wide.
   ============================================================ */

/* Scoped stakes tokens — plum = deadline, amber = assessment.
   Both pass WCAG AA on their respective backgrounds. */
.schedule {
  --sch-due-bg:    #ece1ee;   /* plum tint  */
  --sch-due-fg:    #5f2c6b;   /* plum text  — 7.3:1 on --sch-due-bg  */
  --sch-assess-bg: #faeeda;   /* amber tint */
  --sch-assess-fg: #6b3d08;   /* amber text — 7.1:1 on --sch-assess-bg */
}

.sch-sr-only { position:absolute; width:1px; height:1px; margin:-1px; padding:0;
  overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }

.sch-wk  { margin:1.5rem 0 .35rem; font-size:1rem; font-weight:600; }
.sch-rng { font-weight:400; color:var(--muted); }

.sch-legend { display:flex; flex-wrap:wrap; gap:1.25rem; align-items:center;
  margin:.25rem 0 .5rem; font-size:.8rem; color:var(--muted); }
.sch-legend > span { display:inline-flex; align-items:center; gap:.4rem; }
.sch-key { width:.85rem; height:.85rem; display:inline-block; border:1px solid var(--rule); }
.sch-key--due    { background:var(--sch-due-bg); }
.sch-key--assess { background:var(--sch-assess-bg); }

.sch-scroll { overflow-x:auto; }
.sch-scroll:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }

.sch { width:100%; min-width:38rem; border-collapse:collapse; table-layout:fixed;
  margin:.25rem 0 .75rem; font-size:.8rem; }
.sch th, .sch td { border:1px solid var(--rule); vertical-align:top;
  padding:.4rem .5rem; text-align:left; font-weight:400; }
.sch thead th { font-weight:600; background:var(--band); }
.sch thead th span { display:block; font-weight:400; font-size:.72rem; color:var(--muted); }

.sch-lane { width:7.5rem; background:var(--band); font-weight:600; }
.sch-ic-wrap { display:inline-block; vertical-align:-2px; margin-right:.35rem; line-height:0; }
.sch-ic-wrap svg { width:.85rem; height:.85rem; fill:none; stroke:currentColor;
  stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }

.sch-i { display:block; }
a.sch-i { color:var(--accent); text-decoration:underline; }
a.sch-i:hover { text-decoration:none; }
a.sch-i:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }

.sch td.sch-em { color:var(--muted); text-align:center; }

/* two scoped hues: plum = deadline, amber = assessment */
.sch-due    td:not(.sch-lane) { background:var(--sch-due-bg);    color:var(--sch-due-fg); }
.sch-due    .sch-lane         { color:var(--sch-due-fg); }
.sch-assess td:not(.sch-lane) { background:var(--sch-assess-bg); color:var(--sch-assess-fg); }
.sch-assess .sch-lane         { color:var(--sch-assess-fg); }
/* keep empty cells quiet even inside a tinted row */
.sch-due td.sch-em, .sch-assess td.sch-em { color:var(--muted); }
.sch-prehw td { padding-top:.25rem; padding-bottom:.25rem; }

/* ---- focus visibility (keyboard) ---- */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ---- footer ---- */
.foot {
  font-family: 'Lato', sans-serif;
  border-top: 1px solid var(--rule);
  max-width: var(--maxw);   /* match nav + content column */
  margin: 0 auto;
  padding: 25px 15px;
  text-align: center;
  font-size: .9rem;
  color: var(--muted);
}
.foot a { color: var(--muted); text-decoration: underline; }
.foot a:hover, .foot a:focus { color: var(--heading); }

/* ---- reduced motion (we use none, but honor intent) ---- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---- small screens: tighten masthead ---- */
@media (max-width: 480px) {
  .topnav { gap: .4rem 1rem; }
  .topnav ul { gap: 1rem; }
}
