/* 38th Annual University of Alabama System Applied Mathematics Meeting
   Hand-written stylesheet. No frameworks, no external fonts or scripts.

   Page structure: each top-level block (masthead, nav, section, footer) is a
   full-bleed "band" that carries the background; an inner .wrap holds the
   measure. Sections alternate paper / tint and each opens with a crimson rule,
   so every section reads as its own block. */

:root {
  --crimson: #9e1b32;          /* UA crimson */
  --crimson-deep: #7a1427;
  --crimson-wash: #eddfe3;     /* shading for breaks in the schedule */
  --paper: #ffffff;
  --band: #f5f1f2;             /* alternating section background */
  --ink: #000000;
  --ink-body: #2a2a2a;
  --ink-muted: #5f5f5f;
  --rule: #d6d6d6;
  --rule-strong: #8a8a8a;
  --tbd-bg: #fff4c2;
  --tbd-ink: #5a4300;
  --sticky-shadow: 0 1px 0 rgba(0, 0, 0, 0.09), 0 6px 14px rgba(0, 0, 0, 0.07);
  --measure: 62rem;
  --measure-wide: 78rem;
  --nav-height: 4.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --crimson: #e2647b;
    --crimson-deep: #f08ea0;
    --crimson-wash: #3d1922;
    --paper: #161616;
    --band: #1e1a1c;
    --ink: #ffffff;
    --ink-body: #dcdcdc;
    --ink-muted: #a3a3a3;
    --rule: #3a3a3a;
    --rule-strong: #7a7a7a;
    --tbd-bg: #4a3a00;
    --tbd-ink: #ffe9a3;
    --sticky-shadow: 0 1px 0 rgba(0, 0, 0, 0.6), 0 6px 14px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }

html { color-scheme: light dark; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-body);
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  border-top: 0.6rem solid var(--crimson);
}

a {
  color: var(--crimson);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}
a:hover { color: var(--crimson-deep); }
a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--crimson);
  outline-offset: 3px;
}

/* Keep anything scrolled to by a link or by keyboard focus clear of the
   pinned navigation bar. */
:is(a, summary, [tabindex]) { scroll-margin-top: calc(var(--nav-height) + 1rem); }

/* Bands and the measure inside them */

.wrap {
  max-width: var(--measure-wide);
  margin: 0 auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

.band { padding: 4.5rem 0; }
.band--tint { background: var(--band); }

@media (max-width: 34rem) {
  .wrap { padding-left: 1.25rem; padding-right: 1.25rem; }
  .band { padding: 3rem 0; }
}

/* Masthead */

.masthead { padding: 3rem 0 3.25rem; }

.masthead h1 {
  margin: 0;
  color: var(--ink);
  font-weight: 400;
  font-size: clamp(1.9rem, 4.6vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.masthead .when-where {
  margin: 1.25rem 0 0;
  font-size: 1.25rem;
  line-height: 1.45;
  color: var(--ink);
}
.masthead .when-where span { display: block; }
.masthead .when-where .date { font-weight: 700; }

.masthead .tentative {
  margin: 1rem 0 0;
  color: var(--ink-muted);
  max-width: var(--measure);
}

.actions {
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}
.actions a.primary {
  display: inline-block;
  background: var(--crimson);
  color: #fff;
  padding: 0.6rem 1.1rem;
  text-decoration: none;
  border-radius: 2px;
}
.actions a.primary:hover { background: var(--crimson-deep); color: #fff; }
.actions li { display: flex; align-items: center; }

/* In-page navigation, pinned to the top while scrolling */

.toc {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 0;
  padding: 0.8rem 0;
  background: var(--paper);
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule);
}
.toc.is-stuck {
  border-top-color: transparent;
  box-shadow: var(--sticky-shadow);
}
.toc .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 2rem;
}
.toc-home {
  color: var(--ink-muted);
  font-size: 0.95rem;
  text-decoration: none;
}
.toc-home:hover { color: var(--crimson); text-decoration: underline; }
@media (max-width: 48rem) { .toc-home { display: none; } }

.toc ul {
  margin: 0 0 0 auto;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.6rem;
}
.toc a:not(.toc-home) {
  display: inline-block;
  color: var(--ink);
  text-decoration: none;
  padding-bottom: 0.15rem;
  border-bottom: 2px solid transparent;
}
.toc a:not(.toc-home):hover {
  color: var(--crimson);
  border-bottom-color: var(--rule-strong);
}
.toc a.is-current {
  color: var(--crimson);
  font-weight: 700;
  border-bottom-color: var(--crimson);
}

/* Keep the pinned bar to a single row on a phone: it stays on screen the whole
   time, so it must not eat the viewport. --nav-height is the static fallback
   for the no-JavaScript case; the script replaces it with the measured height. */
@media (max-width: 34rem) {
  :root { --nav-height: 6.5rem; }
  .toc { padding: 0.6rem 0; }
  .toc ul { gap: 0.25rem 1rem; font-size: 0.95rem; }
}

/* Sections */

section { scroll-margin-top: var(--nav-height); }

h2 {
  margin: 0 0 1.25rem;
  color: var(--ink);
  font-weight: 700;
  font-size: clamp(1.8rem, 3vw, 2.3rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
}
section h2::before {
  content: "";
  display: block;
  width: 3.5rem;
  height: 3px;
  margin-bottom: 1.1rem;
  background: var(--crimson);
}

h3 {
  margin: 1.75rem 0 0.5rem;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.125rem;
}

p, ul, ol, dl { max-width: var(--measure); }
p { margin: 0 0 1rem; }

/* Schedule table: the centerpiece of the page */

.schedule {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 1rem;
  font-variant-numeric: tabular-nums;
}
.schedule caption {
  text-align: left;
  caption-side: top;
  padding: 0 0 0.6rem;
  color: var(--ink-muted);
}
.schedule th,
.schedule td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.75rem 0.55rem 0;
  border-bottom: 1px solid var(--rule);
}
.schedule thead th {
  color: var(--ink);
  border-bottom: 1px solid var(--rule-strong);
  font-weight: 700;
}
.schedule th[scope="row"] {
  width: 11.5rem;
  white-space: nowrap;
  font-weight: 400;
  color: var(--crimson);
}
.schedule tr.break td,
.schedule tr.break th {
  background: var(--crimson-wash);
  font-weight: 700;
  color: var(--ink);
}
.schedule tr.break th { padding-left: 0.5rem; }
.schedule tr.break td { padding-right: 0.5rem; }
.schedule .slot { color: var(--ink-muted); font-style: italic; }
.schedule tr.session td {
  padding-top: 1rem;
  font-weight: 700;
  color: var(--ink);
  border-bottom: 1px solid var(--rule-strong);
}
.schedule tr.session .chair {
  display: block;
  font-weight: 400;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

/* Talk cells: title, speaker, and a collapsible abstract */
.schedule .talk-title { display: block; color: var(--ink); font-weight: 600; }
.schedule .speaker { display: block; color: var(--ink-muted); }
.schedule details { margin-top: 0.35rem; }
.schedule summary {
  cursor: pointer;
  color: var(--crimson);
  width: max-content;
  max-width: 100%;
  font-size: 0.95rem;
}
.schedule summary:hover { color: var(--crimson-deep); text-decoration: underline; }
.schedule details p { margin: 0.5rem 0 0; max-width: var(--measure); }

.schedule-note {
  font-size: 0.95rem;
  color: var(--ink-muted);
}

@media (max-width: 34rem) {
  .schedule th[scope="row"] {
    width: 7.5rem;
    white-space: normal;
  }
}

/* Definition lists (call for talks, venue) */

dl { margin: 0 0 1rem; }
dt { font-weight: 700; color: var(--ink); margin-top: 0.75rem; }
dd { margin: 0.15rem 0 0; }

address { font-style: normal; }

/* Lunch options (inside the venue list) */
.lunch { scroll-margin-top: var(--nav-height); }
.lunch p { margin: 0 0 0.5rem; }
.lunch h3 { margin: 0.9rem 0 0.25rem; font-size: 1rem; }
.lunch-list { margin: 0; padding-left: 1.25rem; }
.lunch-list li { margin: 0.3rem 0; }
.lunch .pick { color: var(--crimson); font-weight: 600; }
.lunch .rating { color: var(--ink-muted); font-weight: 400; font-size: 0.95em; }

.map { max-width: var(--measure-wide); margin: 1.25rem 0 0; }
.map iframe {
  display: block;
  width: 100%;
  height: 360px;
  border: 0;
  border-radius: 2px;
}
.map p { margin: 0.5rem 0 0; font-size: 0.95rem; }
@media (max-width: 34rem) { .map iframe { height: 260px; } }

/* Organizers */

.people {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  max-width: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
/* Explicit column counts rather than auto-fit: there are five organizers, and
   auto-fit leaves a lone card stranded on a second row at common widths. */
@media (min-width: 34rem) { .people { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 56rem) { .people { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 72rem) { .people { grid-template-columns: repeat(3, 1fr); } }
.people li {
  padding: 1rem 1.1rem 1.1rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--crimson);
}
.people .name {
  display: block;
  color: var(--ink);
  font-weight: 700;
}
.people .aff {
  display: block;
  color: var(--ink-muted);
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

/* Placeholders that must be filled in before announcing */

.tbd {
  background: var(--tbd-bg);
  color: var(--tbd-ink);
  padding: 0 0.3em;
  border-radius: 2px;
  font-style: normal;
}

/* Meeting history page (previous-meetings.html) */

.meeting { margin-top: 2.75rem; scroll-margin-top: var(--nav-height); }
.meeting:first-of-type { margin-top: 0; }
.meeting h3 { font-size: 1.35rem; margin-top: 0; }
.unknown { color: var(--ink-muted); font-style: italic; }
.schedule.history th[scope="row"] { width: 7rem; }
.schedule.history tr.gap th,
.schedule.history tr.gap td { color: var(--ink-muted); }
@media (max-width: 34rem) {
  .schedule.history th[scope="row"] { width: 4.5rem; }
  .schedule.history td:nth-child(3) { font-size: 0.95rem; }
}

/* Previous meeting: talk list with collapsible abstracts */

.talks {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  max-width: var(--measure);
}
.talks > li {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--rule);
}
.talks > li:first-child { border-top: 1px solid var(--rule-strong); }
.talks .title { color: var(--ink); }
.talks .speaker { display: block; color: var(--ink-muted); }
.talks details { margin-top: 0.4rem; }
.talks summary {
  cursor: pointer;
  color: var(--crimson);
  width: max-content;
  max-width: 100%;
}
.talks summary:hover { color: var(--crimson-deep); text-decoration: underline; }
.talks details p { margin: 0.5rem 0 0; }

footer {
  padding: 1.75rem 0;
  border-top: 1px solid var(--rule);
  color: var(--ink-muted);
  font-size: 0.95rem;
}
footer p { margin: 0; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media print {
  body { border-top: none; color: #000; }
  .actions, .toc { display: none; }
  a { color: #000; text-decoration: none; }
  .band { padding: 1.25rem 0; }
  .band--tint,
  .people li,
  .schedule tr.break td,
  .schedule tr.break th { background: none; }
  .people li { border: 1px solid #999; }
  section h2::before { background: #000; }
  .map iframe { display: none; }
}
