/* A Day in the Past — "time-machine explorer's wall planner"
   Palette: navy #14213D, saffron #F6A800, coral #E4572E, sky teal #3AAFB9. Fonts: Fredoka (headings), Nunito (body). */

@font-face { font-family: "Fredoka"; src: url("../fonts/fredoka.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("../fonts/nunito.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("../fonts/nunito-italic.woff2") format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; }

:root {
  --navy: #14213D;
  --navy-2: #22355F;
  --saffron: #F6A800;
  --saffron-soft: #FFF3D1;
  --coral: #E4572E;
  --coral-ink: #B23714;      /* coral dark enough for text on white (AA) */
  --teal: #3AAFB9;
  --teal-ink: #1A6870;       /* teal dark enough for text on white (AA) */
  --teal-soft: #E0F3F5;
  --bg: #EAF0F7;             /* cool sky-grey page */
  --sheet: #FFFFFF;
  --ink: #14213D;
  --muted: #47546F;
  --line: #D3DCE8;
  --line-soft: #E7EDF5;
  --radius: 16px;
  --font-head: "Fredoka", "Nunito", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --weekcol: 2.6rem;
  --shadow: 0 1px 2px rgba(20, 33, 61, .08), 0 16px 36px -22px rgba(20, 33, 61, .45);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.6; overflow-wrap: break-word; }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.15; color: var(--navy); margin: 0 0 .5em; letter-spacing: -.005em; }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3rem); }
h2 { font-size: clamp(1.4rem, 1.15rem + 1vw, 1.9rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
a { color: var(--coral-ink); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--navy); }
:focus-visible { outline: 3px solid var(--coral-ink); outline-offset: 2px; border-radius: 4px; }
code { font-size: .92em; background: var(--line-soft); padding: 1px 5px; border-radius: 5px; }
.wrap { max-width: 1320px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.narrow { max-width: 820px; }
.nowrap { white-space: nowrap; }
.vh { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); font-size: .95rem; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--saffron); color: var(--navy); font-weight: 800; padding: 10px 16px; border-radius: 10px; }
.skip:focus { left: 16px; }

/* icons */
.ic { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -.2em; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: .45em; min-height: 44px; padding: 9px 18px; border: 0; border-radius: 12px; background: var(--saffron); color: var(--navy); font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; line-height: 1.2; text-decoration: none; cursor: pointer; transition: background-color .15s, transform .15s; }
.btn:hover { background: #FFBC2E; color: var(--navy); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--navy); box-shadow: inset 0 0 0 2px var(--navy); }
.btn-ghost:hover { background: var(--navy); color: #fff; }

/* ---------------------------------------------------------------- header */
.site-head { background: var(--navy); color: #fff; }
.site-head :focus-visible { outline-color: var(--saffron); }
.head-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--font-head); font-weight: 600; font-size: 1.5rem; line-height: 1; }
.brand:hover { color: #fff; }
.brand-mark { width: 46px; height: 46px; flex: none; transition: transform .6s ease; }
.brand:hover .brand-mark { transform: rotate(-30deg); }
.brand-name span { color: var(--saffron); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px; }
.site-nav a { display: flex; align-items: center; gap: 7px; padding: 9px 12px; border-radius: 10px; color: #fff; text-decoration: none; font-weight: 700; }
.site-nav a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.site-nav a[aria-current] { background: rgba(255, 255, 255, .12); box-shadow: inset 0 -3px 0 var(--saffron); }
.site-nav .ic { color: var(--saffron); width: 20px; height: 20px; }

/* ---------------------------------------------------------------- date tiles */
.bigtile { position: relative; display: flex; flex-direction: column; align-items: center; width: 150px; flex: none; background: var(--sheet); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); text-align: center; }
.bt-rings { position: absolute; top: 9px; left: 0; right: 0; height: 10px; display: block; }
.bt-rings::before, .bt-rings::after { content: ""; position: absolute; top: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35); }
.bt-rings::before { left: 30px; }
.bt-rings::after { right: 30px; }
.bt-dow { display: block; width: 100%; background: var(--navy); color: var(--saffron); font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; letter-spacing: .04em; padding: 26px 8px 8px; }
.bt-num { display: block; font-family: var(--font-head); font-weight: 600; font-size: 4.6rem; line-height: 1; color: var(--navy); padding-top: 12px; }
.bt-mon { display: block; font-weight: 900; font-size: .9rem; letter-spacing: .1em; text-transform: uppercase; color: var(--coral-ink); padding: 4px 8px 14px; }

/* ---------------------------------------------------------------- home: today */
.today { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(250px, 330px); gap: 22px 28px; align-items: start; padding-top: 30px; padding-bottom: 8px; }
.kicker { font-family: var(--font-head); font-weight: 600; color: var(--teal-ink); text-transform: uppercase; letter-spacing: .08em; font-size: .9rem; margin: 0 0 4px; }
.today-main h1 { margin-bottom: 16px; }
.story { display: grid; grid-template-columns: minmax(0, 1fr); background: var(--sheet); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.story.has-photo { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.story-photo { position: relative; margin: 0; min-height: 100%; background: var(--navy); }
.story-photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; aspect-ratio: 4 / 3.4; }
.story-photo figcaption, .dyk-main figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 5px 10px; background: rgba(20, 33, 61, .82); color: #fff; font-size: .75rem; line-height: 1.35; }
.story-photo figcaption a, .dyk-main figcaption a { color: #fff; }
.story-body { padding: 20px 22px 18px; }
.story-year { font-family: var(--font-head); font-weight: 600; font-size: 2rem; line-height: 1; color: var(--coral-ink); margin-bottom: 8px; }
.story-year span { font-family: var(--font-body); font-size: .9rem; font-weight: 700; color: var(--muted); margin-left: 6px; }
.story-title { font-size: 1.45rem; margin-bottom: 8px; }
.story-title a { color: var(--navy); text-decoration: none; }
.story-title a:hover { text-decoration: underline; }
.story-more { list-style: none; margin: 0 0 14px; padding: 12px 0 0; border-top: 2px dotted var(--line); }
.story-more li { margin: 0 0 6px; }
.story-more a { color: var(--ink); text-decoration: none; font-size: .97rem; }
.story-more a:hover { text-decoration: underline; }
.story-more b { color: var(--coral-ink); margin-right: 4px; }

.travel { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 20px 20px 18px; box-shadow: var(--shadow); }
.travel :focus-visible { outline-color: var(--saffron); }
.travel h2 { color: #fff; font-size: 1.35rem; display: flex; align-items: center; gap: 8px; }
.travel h2 .ic { color: var(--saffron); width: 26px; height: 26px; }
.picker { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 12px; }
.picker-row { display: grid; grid-template-columns: auto auto; gap: 6px 10px; align-items: center; flex: 1 1 180px; }
.picker label { font-weight: 800; font-size: .9rem; }
.picker select { min-height: 44px; width: 100%; padding: 6px 10px; border-radius: 10px; border: 2px solid transparent; background: #fff; color: var(--navy); font: inherit; font-weight: 700; }
.travel-or { margin: 0 0 14px; }
.travel-or a { color: #fff; font-weight: 700; display: inline-flex; gap: 8px; align-items: center; }
.travel-or .ic { color: var(--saffron); width: 22px; height: 22px; }
.month-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.month-grid a { display: block; text-align: center; padding: 7px 0; border-radius: 8px 8px 3px 3px; background: var(--navy-2); color: #fff; font-family: var(--font-head); font-weight: 600; text-decoration: none; border-bottom: 3px solid var(--teal); }
.month-grid a:hover { background: #2E4677; }
.month-grid a[aria-current] { background: var(--saffron); color: var(--navy); border-bottom-color: var(--coral); }

/* ---------------------------------------------------------------- planner */
.planner-wrap { padding-top: 26px; padding-bottom: 10px; }
.planner-intro { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 6px 24px; margin-bottom: 14px; }
.planner-intro p { margin: 0; max-width: 62ch; color: var(--muted); }
.legend { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--muted); font-size: .92rem; }
.legend-uk { display: inline-block; width: 5px; height: 20px; background: var(--saffron); border-radius: 3px; }
.planner { background: var(--sheet); border-radius: 0 18px 18px 18px; box-shadow: var(--shadow); }
.planner-tabs { display: flex; flex-wrap: wrap; gap: 6px; transform: translateY(-100%); position: absolute; }
.planner { position: relative; margin-top: 46px; }
.ptab { display: inline-block; padding: 9px 18px 8px; border-radius: 14px 14px 0 0; background: var(--teal-soft); color: var(--navy); font-family: var(--font-head); font-weight: 600; text-decoration: none; box-shadow: inset 0 3px 0 var(--teal); }
.ptab:hover { background: #CDEBEE; color: var(--navy); }
.ptab.is-current { background: var(--navy); color: #fff; box-shadow: inset 0 3px 0 var(--saffron); }
.planner-tabs-all .ptab { padding: 8px 11px 7px; }
.cal-head { display: grid; grid-template-columns: var(--weekcol) repeat(7, minmax(0, 1fr)); background: var(--navy); color: #fff; border-radius: 0 18px 0 0; font-family: var(--font-head); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: .85rem; }
.cal-head span { padding: 10px 10px 9px; }
.cal-head .we { color: var(--saffron); }
.cal { list-style: none; margin: 0; padding: 0; }
.cal-week { display: grid; grid-template-columns: var(--weekcol) minmax(0, 1fr); border-top: 1px solid var(--line); }
.cal-week:first-child { border-top: 0; }
.week-label { writing-mode: vertical-rl; transform: rotate(180deg); display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; padding: 12px 0; background: #F3F6FA; color: var(--muted); font-size: .85rem; letter-spacing: .03em; white-space: nowrap; }
.week-dates { font-family: var(--font-body); font-weight: 700; font-size: .75rem; opacity: .9; }
.is-this-week .week-label { background: var(--saffron); color: var(--navy); }
.cal-days { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-day { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 8px 8px 10px; border-left: 1px solid var(--line-soft); }
.cal-day.is-weekend { background: #F6FBFC; }
.cal-day.is-past { background: #F4F6F9; }
.cal-day.is-past .tile-num { color: var(--muted); }
.cal-day.is-today { background: var(--saffron-soft); box-shadow: inset 0 0 0 3px var(--saffron); }
.cal-day.is-blank { background: repeating-linear-gradient(135deg, #F7F9FC 0 8px, #F1F4F8 8px 16px); }
.tile { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; padding: 2px 4px; border-radius: 10px; color: var(--navy); text-decoration: none; }
.tile:hover .tile-num { color: var(--coral-ink); }
.tile-num { font-family: var(--font-head); font-weight: 600; font-size: 1.9rem; line-height: 1.05; }
.tile-dow { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tile-mon { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; font-weight: 900; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--coral-ink); }
.tile-mon.is-shown { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
.tile-today { margin-left: auto; align-self: center; background: var(--navy); color: var(--saffron); font-size: .7rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 8px; }
.cal-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.ci a { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; padding: 3px 4px 3px 7px; border-left: 3px solid transparent; border-radius: 2px 6px 6px 2px; color: var(--ink); text-decoration: none; font-size: .8rem; line-height: 1.3; }
.ci a:hover { background: var(--teal-soft); color: var(--navy); }
.ci-uk a { border-left-color: var(--saffron); }
.ci .ic { width: 14px; height: 14px; margin-right: 3px; color: var(--teal-ink); vertical-align: -2px; stroke-width: 2; }
.ci-year { font-weight: 900; color: var(--coral-ink); }
.cal-more { margin-top: auto; padding: 3px 4px; font-size: .8rem; font-weight: 800; color: var(--teal-ink); text-decoration: none; }
.cal-more:hover { text-decoration: underline; color: var(--navy); }
.month-note { margin: 12px 0 0; color: var(--muted); font-size: .95rem; }

/* planner as an agenda list on narrower screens */
@media (max-width: 1023px) {
  .cal-head { display: none; }
  .planner { border-radius: 0 18px 18px 18px; overflow: hidden; }
  .cal-week { grid-template-columns: minmax(0, 1fr); }
  .week-label { writing-mode: horizontal-tb; transform: none; justify-content: flex-start; padding: 10px 16px; background: var(--navy); color: #fff; font-size: 1.05rem; }
  .week-label .week-dates { color: var(--saffron); }
  .is-this-week .week-label { background: var(--navy); color: #fff; box-shadow: inset 6px 0 0 var(--saffron); }
  .cal-days { grid-template-columns: minmax(0, 1fr); }
  .cal-day { display: grid; grid-template-columns: 4.4rem minmax(0, 1fr); grid-template-areas: "tile items" "tile more"; align-items: start; gap: 4px 12px; padding: 12px 14px; border-left: 0; border-top: 1px solid var(--line-soft); }
  .cal-day.is-blank { display: none; }
  .tile { grid-area: tile; flex-direction: column; align-items: center; gap: 0; padding: 6px 4px 7px; border: 2px solid var(--line); background: var(--sheet); text-align: center; }
  .tile-dow, .tile-mon { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .tile-dow { font-weight: 900; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  .tile-num { font-size: 1.7rem; }
  .tile-today { margin: 3px 0 0; }
  .is-today .tile { border-color: var(--saffron); background: var(--saffron); }
  .is-today .tile .tile-dow, .is-today .tile .tile-mon { color: var(--navy); }
  .cal-items { grid-area: items; }
  .cal-more { grid-area: more; }
  .ci a { font-size: .93rem; -webkit-line-clamp: 2; }
  .planner { margin-top: 0; border-radius: 18px; }
  .planner-tabs { position: static; transform: none; padding: 10px 10px 0; background: var(--navy); }
  .planner-tabs .ptab { background: var(--navy-2); color: #fff; box-shadow: none; border-radius: 10px 10px 0 0; }
  .planner-tabs .ptab:hover { background: #2E4677; color: #fff; }
  .planner-tabs .ptab.is-current { background: var(--saffron); color: var(--navy); }
}

/* ---------------------------------------------------------------- key / badges */
.key { padding-top: 34px; padding-bottom: 6px; }
.key > p { color: var(--muted); max-width: 70ch; }
.key-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 16px 10px; }
.key-list a, .key-static { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: var(--ink); text-decoration: none; font-weight: 700; font-size: .9rem; line-height: 1.25; padding: 6px 4px; border-radius: 12px; }
.key-list a:hover { background: var(--sheet); }
.key-list a:hover .badge { transform: rotate(-8deg) scale(1.05); }
.badge { --c: var(--teal); --i: #fff; position: relative; display: inline-grid; place-items: center; flex: none; width: 64px; height: 64px; border-radius: 50%; background: var(--c); color: var(--i); transition: transform .2s ease; }
.badge::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, .78); }
.badge .ic { width: 30px; height: 30px; stroke-width: 1.9; }
.badge-s { width: 34px; height: 34px; }
.badge-s::after { inset: 3px; border-width: 1.5px; }
.badge-s .ic { width: 18px; height: 18px; }
.badge-l { width: 88px; height: 88px; }
.badge-l::after { inset: 7px; border-width: 2.5px; }
.badge-l .ic { width: 42px; height: 42px; }
.badge-royal, .badge-invention, .badge-buildings { --c: var(--saffron); --i: var(--navy); }
.badge-royal::after, .badge-invention::after, .badge-buildings::after { border-color: rgba(20, 33, 61, .45); }
.badge-science, .badge-exploration, .badge-nature { --c: var(--teal-ink); }
.badge-space, .badge-transport, .badge-government { --c: var(--navy); }
.badge-sport, .badge-arts, .badge-celebrations, .badge-birth { --c: var(--coral-ink); }
.badge-conflict, .badge-death { --c: #5A6782; }

/* ---------------------------------------------------------------- teachers teaser */
.teach { padding-top: 30px; padding-bottom: 48px; }
.teach-in { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px 30px; align-items: center; background: var(--teal-soft); border-radius: var(--radius); padding: 24px 26px; box-shadow: inset 6px 0 0 var(--teal); }
.teach-in p { margin: 0; }
.teach-links { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

/* ---------------------------------------------------------------- crumbs, day header */
.crumbs ol { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; font-size: .92rem; font-weight: 700; }
.crumbs li:not(:last-child)::after { content: "›"; margin-left: 6px; color: var(--muted); }
.crumbs a { color: var(--teal-ink); }
.crumbs [aria-current] { color: var(--muted); }
.day-head { background: linear-gradient(180deg, var(--sheet) 0, var(--sheet) 70%, var(--bg) 100%); padding: 20px 0 26px; }
.day-head-in { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px 28px; align-items: center; }
.day-head h1 { margin-bottom: 8px; }
.standfirst { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }
.day-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.daynav { display: flex; gap: 8px; }
.daynav a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 12px; border-radius: 12px; background: var(--bg); color: var(--navy); font-weight: 800; text-decoration: none; font-size: .95rem; }
.daynav a:hover { background: var(--navy); color: #fff; }
.daynav-foot { justify-content: space-between; flex-wrap: wrap; padding-top: 10px; padding-bottom: 48px; }
.daynav-foot a { background: var(--sheet); box-shadow: var(--shadow); }

/* ---------------------------------------------------------------- day layout */
.day-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; padding-bottom: 20px; }
.day-side { position: sticky; top: 14px; display: flex; flex-direction: column; gap: 16px; }
.toc, .howlong { background: var(--sheet); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.toc h2, .howlong h2 { font-size: 1.15rem; display: flex; align-items: center; gap: 8px; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc a { display: flex; align-items: center; gap: 9px; padding: 7px 6px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 700; }
.toc a:hover { background: var(--teal-soft); }
.toc a span { margin-left: auto; font-size: .82rem; color: var(--muted); }
.toc .ic { color: var(--teal-ink); }
.howlong p { font-size: .93rem; color: var(--muted); }
.howlong .ic { color: var(--coral-ink); }
.tunnel { position: relative; height: 54px; margin: 6px 0 12px; border-radius: 27px; background: linear-gradient(90deg, var(--saffron) 0%, var(--coral) 45%, var(--navy) 100%); }
.tunnel-now { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: .7rem; font-weight: 900; color: var(--navy); text-transform: uppercase; }
.tunnel-dot { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .35); }
.tunnel-dot span { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); font-size: .68rem; font-weight: 900; color: #fff; white-space: nowrap; }
.tunnel-dot:nth-child(odd) span { top: -16px; }
.trips { list-style: none; margin: 0 0 8px; padding: 0; }
.trips li { padding: 8px 0; border-top: 1px dotted var(--line); font-size: .92rem; line-height: 1.35; }
.trips a { display: block; color: var(--ink); text-decoration: none; font-weight: 700; }
.trips a:hover { text-decoration: underline; }
.trips b { color: var(--coral-ink); }
.trips li > span { display: block; color: var(--teal-ink); font-weight: 700; font-size: .85rem; margin-top: 2px; }
.hl-oldest { margin: 6px 0 0; }
.side-print a { display: flex; align-items: center; gap: 8px; font-weight: 800; }

/* did you know */
.dyk { margin-bottom: 30px; }
.dyk h2 { display: flex; align-items: center; gap: 10px; }
.dyk h2 .ic { color: var(--saffron); width: 30px; height: 30px; stroke-width: 2.2; }
.dyk-grid { display: grid; gap: 14px; }
.dyk-main { display: grid; background: var(--navy); color: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.dyk-main.has-photo { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.dyk-main figure { position: relative; margin: 0; }
.dyk-main img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; aspect-ratio: 4 / 3; }
.dyk-text { padding: 20px 22px; }
.dyk-text h3 { font-size: 1.4rem; }
.dyk-text h3 a { color: #fff; text-decoration: none; }
.dyk-text h3 a:hover { text-decoration: underline; color: var(--saffron); }
.dyk-text :focus-visible { outline-color: var(--saffron); }
.dyk-year { font-family: var(--font-head); font-weight: 600; color: var(--saffron); margin-bottom: 6px; }
.dyk-more { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.dyk-more a { display: block; padding: 12px 16px; border-radius: 12px; background: var(--sheet); color: var(--ink); text-decoration: none; font-weight: 700; box-shadow: inset 4px 0 0 var(--saffron); }
.dyk-more a:hover { background: var(--saffron-soft); }
.dyk-more .dyk-year { display: inline; margin-right: 6px; color: var(--coral-ink); }

/* sections */
.sec { margin-bottom: 34px; }
.sec h2 { display: flex; align-items: center; gap: 10px; }
.sec h2 .ic { color: var(--teal-ink); }
.count { display: inline-grid; place-items: center; min-width: 2em; height: 1.6em; padding: 0 .45em; border-radius: .8em; background: var(--navy); color: #fff; font-family: var(--font-body); font-weight: 800; font-size: .58em; }
.sec-uk h2 .count { background: var(--saffron); color: var(--navy); }
.sec-intro { color: var(--muted); }

/* timeline items */
.timeline { position: relative; display: flex; flex-direction: column; gap: 14px; }
.timeline::before { content: ""; position: absolute; left: 4.6rem; top: 6px; bottom: 6px; width: 3px; background: repeating-linear-gradient(180deg, var(--line) 0 8px, transparent 8px 14px); }
.item { position: relative; display: grid; grid-template-columns: 4.2rem minmax(0, 1fr); gap: 0 22px; scroll-margin-top: 16px; }
.item-when { text-align: right; padding-top: 14px; }
.item-year { display: block; font-family: var(--font-head); font-weight: 600; font-size: 1.25rem; line-height: 1.05; color: var(--coral-ink); }
.item-ago { display: block; font-size: .72rem; font-weight: 800; color: var(--muted); line-height: 1.25; margin-top: 3px; }
.item-body { position: relative; background: var(--sheet); border-radius: 14px; padding: 14px 18px 12px; box-shadow: 0 1px 2px rgba(20, 33, 61, .08); }
.item-body::before { content: ""; position: absolute; left: -15px; top: 18px; width: 11px; height: 11px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 3px var(--bg); }
.item-uk .item-body { box-shadow: inset 5px 0 0 var(--saffron), 0 1px 2px rgba(20, 33, 61, .08); }
.item-uk .item-body::before { background: var(--saffron); }
.item:target .item-body { box-shadow: 0 0 0 3px var(--coral), 0 10px 28px -16px rgba(20, 33, 61, .6); }
.item-flag { display: inline-block; margin: 0 0 4px; font-size: .72rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--navy); background: var(--saffron-soft); padding: 1px 8px; border-radius: 6px; }
.item-title { font-size: 1.22rem; margin-bottom: 6px; }
.item-body p { margin-bottom: .6em; }
.item-text { font-size: 1rem; }
.item.has-photo .item-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 38%); column-gap: 18px; align-content: start; }
.item.has-photo .item-body > * { grid-column: 1; }
.item.has-photo .item-photo { grid-column: 2; grid-row: 1 / span 6; }
.item-photo { margin: 2px 0 10px; }
.item-photo img { display: block; width: 100%; border-radius: 10px; aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 25%; background: var(--line-soft); }
.item-photo figcaption { margin-top: 4px; font-size: .78rem; line-height: 1.35; color: var(--muted); }
.item-photo figcaption a { color: var(--teal-ink); }
.item-video { margin: 8px 0 12px; }
.item-video .kit-video-frame { border-radius: 10px; }
.item-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding-top: 6px; border-top: 1px dotted var(--line); font-size: .88rem; }
.item.has-photo .item-foot { grid-column: 1 / -1; }
.item-tags { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; }
.item-tag { display: inline-flex; align-items: center; gap: 4px; color: var(--teal-ink); font-weight: 800; text-decoration: none; }
.item-tag:hover { text-decoration: underline; }
.ref { font-weight: 800; }
.ref::after { content: " ↗"; font-weight: 400; }
.ref-plain { color: var(--ink); }

/* births, deaths, special days */
.people, .obs, .older-list { list-style: none; margin: 0; padding: 0; background: var(--sheet); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(20, 33, 61, .08); }
.person, .obs > li, .older-list > li { display: flex; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--line-soft); line-height: 1.45; }
.person:first-child, .obs > li:first-child, .older-list > li:first-child { border-top: 0; }
.person-uk { box-shadow: inset 4px 0 0 var(--saffron); }
.p-year { flex: 0 0 4.2rem; font-family: var(--font-head); font-weight: 600; color: var(--coral-ink); text-align: right; }
.p-uk { display: inline-block; margin: 0 4px; padding: 0 6px; border-radius: 5px; background: var(--saffron-soft); color: var(--navy); font-size: .7rem; font-weight: 900; letter-spacing: .06em; vertical-align: 2px; }
.ref-s { margin-left: 6px; font-size: .88rem; }
.person-full { list-style: none; padding: 12px 12px 4px; border-top: 1px solid var(--line-soft); }
.person-full .item-body { box-shadow: none; background: var(--bg); }
.person-full .item-body::before { display: none; }
.obs > li > .ic { margin-top: 4px; color: var(--saffron); stroke: var(--coral-ink); }

/* older readers */
.older { background: var(--sheet); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(20, 33, 61, .08); }
.older summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 16px 18px; cursor: pointer; list-style: none; border-radius: var(--radius); }
.older summary::-webkit-details-marker { display: none; }
.older summary::before { content: "+"; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 900; font-size: 1.2rem; }
.older[open] summary::before { content: "−"; }
.older-h { font-family: var(--font-head); font-weight: 600; font-size: 1.35rem; color: var(--navy); }
.older-sub { flex-basis: 100%; padding-left: 42px; color: var(--muted); font-size: .92rem; }
.older .note { margin: 0 18px 14px; padding: 12px 14px; background: var(--saffron-soft); border-radius: 10px; font-size: .95rem; }
.older-list { box-shadow: none; border-radius: 0 0 var(--radius) var(--radius); border-top: 1px solid var(--line-soft); }

/* quiz */
.quiz { margin-bottom: 34px; background: var(--navy); color: #fff; border-radius: var(--radius); padding: 22px 22px 14px; box-shadow: var(--shadow); }
.quiz h2 { color: #fff; display: flex; align-items: center; gap: 10px; }
.quiz h2 .ic { color: var(--saffron); width: 30px; height: 30px; }
.quiz .sec-intro { color: #D6DEEC; }
.quiz :focus-visible { outline-color: var(--saffron); }
.quiz a { color: var(--saffron); }
.quiz-list { margin: 0; padding: 0 0 0 1.4em; }
.q { margin-bottom: 18px; }
.q::marker { font-family: var(--font-head); color: var(--saffron); font-weight: 600; }
.q-text { font-weight: 800; margin-bottom: 8px; }
.q-opts { margin: 0 0 8px; padding-left: 1.6em; }
.q-opts li { margin-bottom: 4px; }
.q-answer summary { cursor: pointer; font-weight: 800; color: var(--saffron); }
.q-answer p { margin: 6px 0 0; padding: 10px 12px; background: var(--navy-2); border-radius: 10px; }
/* enhanced quiz (site.js) */
.q-opts.js-opts { list-style: none; padding: 0; display: grid; gap: 8px; }
.q-opt { width: 100%; text-align: left; min-height: 44px; padding: 9px 14px; border-radius: 12px; border: 2px solid #3A4E7A; background: var(--navy-2); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.q-opt:hover { border-color: var(--saffron); }
.q-opt .q-letter { display: inline-grid; place-items: center; width: 1.7em; height: 1.7em; margin-right: 8px; border-radius: 50%; background: var(--saffron); color: var(--navy); font-weight: 900; font-size: .9em; }
.q-opt.is-right { background: #1E6B4E; border-color: #6FE0B0; }
.q-opt.is-wrong { background: #6B2A1E; border-color: #FF9C80; }
.q-feedback { margin: 6px 0 0; font-weight: 800; }

/* sources */
.sources { margin-top: 10px; padding: 18px 20px; border-radius: var(--radius); background: var(--teal-soft); font-size: .95rem; }
.sources h2 { font-size: 1.2rem; display: flex; align-items: center; gap: 8px; }
.sources p { margin: 0; }

/* ---------------------------------------------------------------- simple pages */
.page-main { padding: 26px 0 56px; }
.month-main .month-top { padding-top: 26px; }
.prose h2 { margin-top: 1.4em; }
.prose ul { padding-left: 1.3em; }
.prose li { margin-bottom: .4em; }
.note-box { padding: 14px 16px; border-radius: 12px; background: var(--saffron-soft); }
.contact-mail { margin: 18px 0 26px; }
.lost { text-align: center; padding-top: 30px; }
.lost-badge .ic { width: 90px; height: 90px; color: var(--teal-ink); animation: spin 8s linear infinite; }
@keyframes spin { to { transform: rotate(-360deg); } }
.lost .btn { margin: 4px; }

.topic-grid { list-style: none; margin: 10px auto 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.topic-grid a { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 12px 18px; border-radius: var(--radius); background: var(--sheet); box-shadow: var(--shadow); text-decoration: none; text-align: center; color: var(--ink); }
.topic-grid a:hover .badge { transform: rotate(-8deg) scale(1.05); }
.tg-label { font-family: var(--font-head); font-weight: 600; font-size: 1.15rem; color: var(--navy); }
.tg-count { font-size: .88rem; font-weight: 700; color: var(--muted); }
.topic-head { display: flex; align-items: center; gap: 18px; margin-bottom: 10px; }
.topic-head h1 { margin: 0; }
.topic-month h2 { margin-top: 1.2em; }
.topic-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.topic-list > li { background: var(--sheet); border-radius: 14px; box-shadow: 0 1px 2px rgba(20, 33, 61, .08); }
.topic-list > li > a { display: grid; grid-template-columns: 4rem minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px; color: var(--ink); text-decoration: none; border-radius: 14px; }
.topic-list > li > a:hover { background: var(--saffron-soft); }
.tl-date { text-align: center; font-weight: 800; font-size: .8rem; text-transform: uppercase; color: var(--coral-ink); line-height: 1.1; }
.tl-date b { display: block; font-family: var(--font-head); font-weight: 600; font-size: 1.8rem; color: var(--navy); }
.tl-year { font-weight: 900; color: var(--coral-ink); }
.tl-sum { display: block; color: var(--muted); font-size: .92rem; }
.tl-img img { display: block; width: 110px; height: 80px; object-fit: cover; border-radius: 10px; }
.tl-credit { margin: -4px 14px 0; padding: 0 0 10px; text-align: right; font-size: .75rem; color: var(--muted); }
.tl-credit a { color: var(--teal-ink); }

/* kit photo credits page */
.kit-credits h1 { margin-top: 10px; }
.kit-credits-list li { background: var(--sheet); padding: 12px; border-radius: 12px; }
.kit-credits-list img { border-radius: 8px; }

/* ---------------------------------------------------------------- footer */
.site-foot { background: var(--navy); color: #D9E1EE; margin-top: 10px; }
.site-foot a { color: #fff; }
.site-foot a:hover { color: var(--saffron); }
.site-foot :focus-visible { outline-color: var(--saffron); }
.foot-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 20px 40px; padding-top: 34px; padding-bottom: 30px; }
.foot-name { font-family: var(--font-head); font-weight: 600; font-size: 1.5rem; color: #fff; margin-bottom: 6px; }
.foot-name span { color: var(--saffron); }
.foot-links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 18px; font-weight: 700; }
.foot-small { grid-column: 1 / -1; border-top: 1px solid rgba(255, 255, 255, .15); padding-top: 16px; font-size: .9rem; }
.foot-small p { margin: 0 0 .5em; }
.foot-small code { background: rgba(255, 255, 255, .1); color: #fff; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .today { grid-template-columns: auto minmax(0, 1fr); }
  .travel { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 24px; }
  .travel h2 { grid-column: 1 / -1; }
  .month-grid { grid-column: 2; grid-row: 2 / span 2; align-self: start; }
  .day-grid { grid-template-columns: minmax(0, 1fr) 280px; }
}
@media (max-width: 900px) {
  .day-grid { grid-template-columns: minmax(0, 1fr); }
  .day-side { position: static; order: -1; }
  .day-side .howlong { display: none; }
  .day-side .side-print { display: none; }
  .toc ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 10px; }
  .toc a { padding: 6px 4px; font-size: .92rem; }
  .toc h2 { margin-bottom: .3em; }
  .day-head-in { grid-template-columns: auto minmax(0, 1fr); }
  .daynav { grid-column: 1 / -1; }
  .teach-in { grid-template-columns: minmax(0, 1fr); }
  .teach-links { justify-content: flex-start; }
  .foot-in { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .today { grid-template-columns: minmax(0, 1fr); padding-top: 20px; }
  .today > .bigtile { display: none; }
  .story.has-photo, .dyk-main.has-photo { grid-template-columns: minmax(0, 1fr); }
  .story-photo img { aspect-ratio: 16 / 10; }
  .travel { display: block; }
  .item.has-photo .item-body { display: block; }
  .item-photo { max-width: 420px; }
  .head-in { padding-top: 8px; padding-bottom: 6px; }
  .site-nav { width: 100%; }
  .site-nav ul { justify-content: space-between; }
  .site-nav a { flex-direction: column; gap: 2px; padding: 6px 6px; font-size: .78rem; }
  .bigtile-day { width: 104px; }
  .bigtile-day .bt-num { font-size: 3.2rem; }
  .bigtile-day .bt-dow { font-size: .9rem; padding-top: 22px; }
  .bigtile-day .bt-mon { font-size: .68rem; }
}
@media (max-width: 520px) {
  body { font-size: 1rem; }
  .timeline::before { left: 3.1rem; }
  .item { grid-template-columns: 2.8rem minmax(0, 1fr); gap: 0 16px; }
  .item-year { font-size: 1rem; }
  .item-ago { font-size: .66rem; }
  .item-body { padding: 12px 14px 10px; }
  .item-body::before { left: -12px; }
  .person, .obs > li, .older-list > li { gap: 10px; padding: 10px 12px; }
  .p-year { flex-basis: 3.3rem; }
  .day-head-in { grid-template-columns: minmax(0, 1fr); }
  .bigtile-day { display: none; }
  .daynav a { flex: 1; justify-content: center; font-size: .85rem; }
  .cal-day { grid-template-columns: 3.7rem minmax(0, 1fr); padding: 10px 10px; gap: 4px 10px; }
  .topic-list > li > a { grid-template-columns: 3.2rem minmax(0, 1fr); }
  .tl-img, .tl-credit { display: none; }
  .brand { font-size: 1.3rem; }
  .brand-mark { width: 40px; height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (max-width: 420px) {
  .site-nav ul { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; }
  .site-nav a { padding: 6px 2px; font-size: .72rem; text-align: center; line-height: 1.15; }
}
