/* ENG 511, Fall 2026. One shared theme for every page at the site root.
   Each page keeps its own layout rules in its own <style> block. This file,
   loaded after that block, sets every color, every font, and the type scale.
   Change a value here and all pages change together.

   Register: the Fall 2027 teal register. No red, no yellow.
   Deep Teal is never text on Mist or on tint. Text there is Umber or plum. */

/* 1. Palette and type. Edit here. */
:root {
  --h-white: #FFFFFF;
  --h-tint:  #E7EFEB;
  --h-mist:  #C3D6CE;
  --h-teal:  #457877;
  --h-umber: #41292B;
  --h-soft:  #5E4649;   /* Umber, lightened. Secondary text. 5.6 to 1 on Mist. */
  --h-ink:   #383140;
  --h-plum:  #583B65;
  --h-dusk:  #6C4880;
  --h-rule:      rgba(65, 41, 43, 0.22);    /* hairline on any light ground */
  --h-rule-dark: rgba(255, 255, 255, 0.18); /* hairline on Ink, plum, or teal */
  --h-on-dark: #FFFFFF;                     /* all text on a teal, dusk, plum, or Ink band */
  --h-pill: rgba(0, 0, 0, 0.22);            /* a label pill set on one of those bands */

  --font-head:  Georgia, 'Times New Roman', serif;
  --font-body:  Arial, Helvetica, sans-serif;
  --font-label: Arial, Helvetica, sans-serif;

  /* Type. Every size on every page is multiplied by --type-scale, then raised by
     --type-bump, and nothing renders below --type-min. The bump lifts small text
     more than headings: 13px body text reads at 16px, a 28px heading at 31px.
     Labels read in sentence case with no added tracking. */
  --type-scale: 1;
  --type-bump: 3px;
  --type-min: 14px;
  --label-case: none;
  --label-track: normal;
  --measure: 68ch;        /* longest line of running text, about 80 characters */
  --sidebar-width: 17.5rem;
  --radius: 6px;          /* corner of every box, label, and number marker */

  color-scheme: light;
}

/* 2. Hub pages: schedule, Perusall guide, submissions, exemplars, discussion starter. */
:root {
  --cream: var(--h-white);
  --cream-dark: var(--h-tint);
  --ink: var(--h-umber);
  --ink-mid: var(--h-umber);
  --ink-soft: var(--h-soft);
  --border: var(--h-mist);
  --preview-bg: var(--h-tint);
  --preview-border: var(--h-mist);
  --shadow: none;
  --shadow-lg: none;

  /* Tuesday: teal band, white panel. */
  --tue: var(--h-teal);
  --tue-mid: var(--h-teal);
  --tue-dark: var(--h-ink);
  --tue-light: var(--h-white);

  /* Thursday: dusk band, Mist panel. */
  --thu: var(--h-dusk);
  --thu-mid: var(--h-dusk);
  --thu-dark: var(--h-plum);
  --thu-light: var(--h-mist);

  /* Assignment due: Umber. */
  --assign: var(--h-umber);
  --assign-mid: var(--h-umber);
  --assign-light: var(--h-tint);

  /* Perusall guide accent. */
  --ann: var(--h-teal);
  --ann-mid: var(--h-teal);
  --ann-light: var(--h-white);

  /* Sidebar. */
  --sidebar-bg: var(--h-ink);
  --sidebar-text: var(--h-white);
  --sidebar-muted: var(--h-mist);
  --sidebar-hover: var(--h-plum);
  --sidebar-active: var(--h-dusk);
  --sidebar-accent: var(--h-mist);
}

/* 3. Session pages (the dated workshop and seminar pages). */
:root {
  --bg: var(--h-white);
  --surface: var(--h-white);
  --card-bg: var(--h-white);
  --white: var(--h-white);
  --text-1: var(--h-umber);
  --text-2: var(--h-umber);
  --text-3: var(--h-soft);

  --badge-bg: var(--h-tint);
  --badge-color: var(--h-umber);
  --note-bg: var(--h-tint);
  --note-border: var(--h-teal);
  --note-text: var(--h-umber);
  --quote-bg: var(--h-tint);
  --quote-color: var(--h-plum);
  --time-bg: var(--h-tint);
  --time-color: var(--h-umber);

  --assign-bg: var(--h-tint);
  --assign-border: var(--h-umber);
  --assign-text: var(--h-umber);
  --assign-text-2: var(--h-soft);

  --accent: var(--h-teal);
  --accent-hover: var(--h-umber);
  --accent-text: var(--h-white);
  --accent-muted: var(--h-white);
  --accent-muted-border: var(--h-mist);
  --active-bg: var(--h-white);
  --active-border: var(--h-teal);

  /* Colors keyed to one reading or one register on a page.
     Three values carry every set: teal, plum, Umber. */
  --pratt: var(--h-teal);    --pratt-light: var(--h-white);
  --elbow: var(--h-teal);    --elbow-light: var(--h-white);
  --perl: var(--h-teal);     --perl-light: var(--h-white);
  --doc: var(--h-teal);      --doc-light: var(--h-white);   --doc-border: var(--h-mist);
  --pad: var(--h-teal);      --pad-light: var(--h-white);   --pad-border: var(--h-mist);
  --green: var(--h-teal);    --green-light: var(--h-white); --green-border: var(--h-mist);
  --reg-ped: var(--h-teal);  --reg-ped-bg: var(--h-white);
  --anson: var(--h-plum);    --anson-light: var(--h-tint);
  --rose: var(--h-plum);     --rose-light: var(--h-tint);
  --hartwell: var(--h-plum); --hartwell-light: var(--h-tint);
  --reg-meth: var(--h-plum); --reg-meth-bg: var(--h-tint);
  --fh: var(--h-umber);      --fh-light: var(--h-tint);
  --warnock: var(--h-umber); --warnock-light: var(--h-tint);
  --design: var(--h-umber);  --design-light: var(--h-tint);
  --reg-act: var(--h-umber); --reg-act-bg: var(--h-tint);
}

/* A session page declares its day on the <html> tag. Tuesday reads in teal,
   Thursday in dusk and Mist. */
:root[data-day="tue"] {
  --thu: var(--h-teal);
  --thu-mid: var(--h-teal);
  --thu-dark: var(--h-ink);
  --thu-light: var(--h-white);
}
:root[data-day="thu"] {
  --badge-bg: var(--h-mist);
  --badge-color: var(--h-plum);
  --note-border: var(--h-dusk);
  --accent: var(--h-dusk);
  --active-border: var(--h-dusk);
}

/* 4. Shared behavior. */
/* Keyboard focus shows as a two-tone ring: Umber outside, white inside.
   One of the two reads against any ground on the site. */
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--h-umber);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--h-white);
}
.sidebar a:focus-visible, .sidebar [tabindex]:focus-visible {
  outline-color: var(--h-white);
  box-shadow: 0 0 0 2px var(--h-ink);
}
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; box-shadow: none; }   /* a skip target takes focus silently */

/* The skip link is the first stop for a keyboard and appears when it has focus. */
.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 1000;
  background: var(--h-white); color: var(--h-umber);
  padding: 0.5rem 0.875rem; border-radius: 6px;
  font-family: var(--font-body); font-size: 1rem; text-decoration: underline;
}
.skip-link:focus { left: 12px; }

/* Dimmed rows fell below 4.5 to 1. They stay at full strength, and italics mark the optional readings. */
.sidebar-week.break-week, .sidebar-week.cancelled-week, .reading-item.optional { opacity: 1; }
.expert-card-header .author { opacity: 1; }
div[style*="opacity:0.7"] { opacity: 1 !important; }   /* four inline labels on the September 3 page */

/* Icon slots emptied of pictographs take no space. */
[class*="icon"]:empty { display: none; }

/* 5. Reading comfort. */
html { font-size: 100%; }      /* the root follows the reader's browser setting, so 1rem means the same on every page */
body { line-height: 1.6; }
p, li, dd, blockquote { max-width: var(--measure); }
h1 em, h1 i { font-style: normal !important; color: inherit !important; }   /* one voice in a heading */
code, .naming-example, .decision-line { overflow-wrap: anywhere; }   /* a long file name or fill-in line wraps inside its box */
p a:not([class]), li a:not([class]), td a:not([class]), dd a:not([class]) {
  text-decoration: underline;                            /* a link never rests on color alone */
  text-underline-offset: 0.15em;
}
@media (min-width: 801px) {                              /* the sidebar hides below this width */
  .sidebar { width: var(--sidebar-width); min-width: var(--sidebar-width); }
  .sidebar ~ .main { margin-left: var(--sidebar-width); }
}

/* 6. Small screens. No page scrolls sideways. On the hub pages the sidebar
   moves above the content, and the schedule's sixteen weeks become a grid
   of week numbers. */
@media (max-width: 800px) {
  body { display: block; }
  .sidebar { position: static; transform: none; width: auto; min-width: 0; height: auto; }
  .sidebar ~ .main { margin-left: 0; }
  .topbar { position: static; height: auto; flex-wrap: wrap; gap: 0.25rem 1rem; padding: 0.75rem 1.25rem; }
  .topbar-legend { flex-wrap: wrap; gap: 0.25rem 1rem; }
  .page { padding: 1.5rem 1.25rem 3rem; }
  .quick-ref { grid-template-columns: 1fr 1fr; }
  .leader-grid, .policy-grid { grid-template-columns: 1fr; }
  .section-pace { white-space: normal; }
  .ann-thread-header { flex-wrap: wrap; }
  body > nav, .timeline-strip { max-width: 100vw; }
  table.board { display: block; overflow-x: auto; }
  html { overflow-x: clip; }      /* a guard: content reflows above, this stops stray pixels */
  #sidebar-weeks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; padding: 0 0.75rem 0.75rem; }
  #sidebar-weeks .sidebar-week { justify-content: center; min-height: 44px; padding: 0.75rem 0.25rem; border-left: 0; }
  #sidebar-weeks .week-info, #sidebar-weeks .week-assign-dot, #sidebar-weeks .current-badge { display: none; }
}

/* 7. Frame. The hub pages carry the header of the Fall 2027 site: a teal band
   with the course name and its pages, and a tint strip beneath it for the
   links within a page and the course tools. The schedule keeps its weeks in
   a light rail at the left. */
.topnav { display: block; }
.site-head { background: var(--h-teal); color: var(--h-white); }
.site-head .in, .substrip .in {
  max-width: 76rem; margin: 0 auto; padding: 0.75rem 1.5rem;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.25rem 2rem;
}
.site-head a { color: var(--h-white); }
.brand { font-family: var(--font-head); font-size: 1.375rem; font-weight: bold; text-decoration: none; padding: 0.625rem 0; }
.site-nav { display: flex; flex-wrap: wrap; gap: 0 1.5rem; font-size: 1.0625rem; }
.site-nav a { padding: 0.75rem 0; text-decoration: underline; text-underline-offset: 0.2em; }
.site-nav a:hover { text-decoration-thickness: 2px; }
.site-nav a[aria-current] { font-weight: bold; text-decoration-thickness: 3px; }
.substrip { background: var(--h-tint); font-size: 0.9375rem; }
.substrip .in { padding-block: 0.25rem; }
.substrip nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0 1.25rem; }
.substrip a { color: var(--h-umber); padding: 0.5rem 0; text-underline-offset: 0.2em; }
.substrip .lab { font-weight: bold; }
.topnav .main { margin-left: 0; min-height: 0; }
.topnav:not(.has-rail) .topbar { display: none; }
.topnav .page { margin-left: max(0px, calc((100% - 76rem) / 2)); margin-right: 0; padding-inline: 1.5rem; }   /* content starts under the course name */

.with-rail { max-width: 76rem; margin: 0 auto; display: grid; grid-template-columns: 17.5rem minmax(0, 1fr); align-items: start; }
.week-rail {
  --sidebar-text: var(--h-umber); --sidebar-muted: var(--h-soft);
  --sidebar-hover: var(--h-tint); --sidebar-active: var(--h-mist); --sidebar-accent: var(--h-teal);
  position: sticky; top: 0; max-height: 100vh; overflow-y: auto;
  padding: 1rem 0 2rem; border-right: 1px solid var(--h-mist);
}
.week-rail .sidebar-week.current-week { border-left-color: var(--h-teal); }
.week-rail .current-badge { background: var(--h-teal); color: var(--h-white); }
@media (max-width: 800px) {
  .site-head .in, .substrip .in { padding-inline: 1.25rem; }
  .brand { font-size: 1.125rem; padding: 0.375rem 0; }
  .site-nav { gap: 0 1rem; font-size: 1rem; }
  .site-nav a { padding: 0.375rem 0; }
  .substrip a { padding: 0.375rem 0; }
  .with-rail { grid-template-columns: minmax(0, 1fr); }
  .week-rail { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--h-mist); padding-bottom: 0.5rem; }
}

/* 8. Flatter blocks. A colored band inside the content becomes a heading over a
   rule, in Umber on a light ground. Each page keeps two colored blocks at
   most: its header band, and one closing block. Thursday reads on Mist. */
.session-header.tue-header, .session-header.thu-header,
.opener-header, .framework-header, .group-header, .synthesis-header,
.anatomy-header, .timeline-when, .card-week-bar, .card-week-bar.final,
.setup-banner, .naming-box, .signup-cta, .question-card {
  background: transparent;
  --h-on-dark: var(--h-umber);
  --h-pill: var(--h-tint);
}
.session-header.tue-header, .session-header.thu-header, .session-header *,
.opener-header, .opener-header *, .framework-header, .framework-header *,
.group-header, .group-header *, .synthesis-header, .synthesis-header *,
.anatomy-header, .anatomy-header *, .timeline-when, .timeline-when *,
.card-week-bar, .card-week-bar *, .setup-banner, .setup-banner *,
.naming-box, .naming-box *, .signup-cta, .signup-cta *, .question-card, .question-card * {
  color: var(--h-umber) !important;
}
.session-header.tue-header, .session-header.thu-header,
.opener-header, .framework-header, .group-header, .synthesis-header, .anatomy-header {
  border-bottom: 1px solid var(--h-mist);
}

/* The small label in a flattened heading reads as a plain eyebrow in the day's color. */
.session-day-badge, .opener-badge, .anatomy-step {
  background: none !important; padding: 0 !important; border-radius: 0; font-weight: bold;
}
.session-header.tue-header .session-day-badge, .anatomy-step { color: var(--h-teal) !important; }
.session-header.thu-header .session-day-badge { color: var(--h-plum) !important; }
.opener-header .opener-badge { color: var(--thu) !important; }

/* Schedule: Tuesday on white, Thursday on Mist with white insets. */
.session-card:has(.thu-header) { background: var(--h-mist); border-color: var(--h-mist); }
.session-card:has(.thu-header) .session-header { border-bottom-color: var(--h-rule); }
.session-card:has(.thu-header) .activity-block { background: var(--h-white); border-color: transparent; }
.meta-pill { background: none; border: 0; padding: 0; border-radius: 0; }
.meta-pill.assignment { background: none; font-weight: bold; }
.activity-time { white-space: nowrap; }

/* Guides. */
.timeline-when { background: var(--h-tint); }
.timeline-when.thu { background: var(--h-mist); }
.card-week-bar, .card-week-bar.final { background: var(--h-tint); }
.setup-banner { background: var(--h-tint); --h-pill: var(--h-white); }
.setup-banner::before { display: none; }
.naming-box, .question-card { background: var(--h-mist); }
.signup-cta { background: var(--h-tint); }
.folder-btn, .signup-btn { background: var(--h-teal) !important; color: var(--h-white) !important; box-shadow: none; }
.folder-btn *, .signup-btn * { color: var(--h-white) !important; }
.rubric-table th, .grade-table th { background: var(--h-teal); }

/* A step link reads as a link. */
.next-link { border: 0; border-radius: 0; padding: 0.5rem 0; text-decoration: underline; text-underline-offset: 0.2em; font-weight: bold; }
.next-link:hover { background: none; text-decoration-thickness: 2px; }

/* Screen-reader-only text, e.g. "(opens in a new tab)" after external links. */
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
/* One-paragraph session outline under the page title. */
.in-short { margin-top:10px; font-size:0.92rem; line-height:1.5; max-width:var(--measure); color:inherit; opacity:0.95; }
.in-short strong { font-weight:700; }
