/* DipIMC.Ninja — the public pages (/, /dipimc-exam, /faq, ...), rendered by
   the Worker (src/site.ts). Loaded after styles.css, so the tokens, type,
   buttons, the "Where this comes from" block and the feedback panel are the
   app's own; this file only lays out a reading page around them. */

body.site { display: flex; flex-direction: column; min-height: 100vh; }

.site-wrap { width: 100%; max-width: 820px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

/* ---- header ---------------------------------------------------------------- */
.site-head { background: var(--surface); border-bottom: 1px solid var(--hair); }
.site-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--topbar); }
.site-head .btn.sm { min-height: 44px; padding: 7px 14px; }
.site-head-right { display: flex; align-items: center; gap: 10px; }
.site-nav { display: flex; gap: 18px; overflow-x: auto; padding-top: 2px; padding-bottom: 10px; scrollbar-width: none; font-size: 14.5px; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a { color: var(--ink-2); text-decoration: none; white-space: nowrap; padding: 4px 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--accent); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* ---- reading column ----------------------------------------------------------- */
.site-main { flex: 1; padding-top: 28px; padding-bottom: 48px; font-size: 16.5px; line-height: 1.6; }
.site-main:focus { outline: none; }
.site-main h1 { font-size: 32px; line-height: 1.15; margin: 0 0 10px; }
.site-main h2 { font-size: 23px; margin: 34px 0 10px; scroll-margin-top: 16px; }
.site-main h3 { font-size: 18px; margin: 24px 0 8px; scroll-margin-top: 16px; }
.site-main p, .site-main ul, .site-main ol, .site-main blockquote { margin: 0 0 14px; }
.site-main ul, .site-main ol { padding-left: 22px; }
.site-main li + li { margin-top: 5px; }
.site-main li > ul { margin-top: 6px; margin-bottom: 0; }
.site-main blockquote { border-left: 3px solid var(--hair); padding: 4px 0 4px 14px; color: var(--ink-2); }
.site-main small { color: var(--muted); font-size: 14px; }
.site-main .byline { color: var(--muted); font-size: 14.5px; margin-bottom: 22px; }
.site-main mark.placeholder { background: var(--warn-bg); color: var(--warn); font-family: var(--f-mono); font-size: .9em; padding: 0 4px; border-radius: 3px; }

.table-wrap { overflow-x: auto; margin: 0 0 16px; border: 1px solid var(--hair); border-radius: var(--r-lg); background: var(--surface); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table-wrap th, .table-wrap td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--hair-soft); vertical-align: top; }
.table-wrap th { font-family: var(--f-body); font-weight: 600; font-size: 13px; color: var(--muted); background: var(--surface-2); }
.table-wrap tr:last-child td { border-bottom: 0; }
.table-wrap .num { text-align: right; }
.units td:first-child { white-space: nowrap; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 22px; }
.btn-row .btn { text-decoration: none; }

/* ---- landing -------------------------------------------------------------------- */
.landing .hero-eyebrow { margin-bottom: 8px; }
.landing h1 { font-size: 34px; max-width: 18em; }
@media (min-width: 720px) { .landing h1 { font-size: 40px; } }
ul.proof { list-style: none; padding: 0; display: grid; gap: 10px; margin: 22px 0 8px; }
@media (min-width: 720px) { ul.proof { grid-template-columns: repeat(3, 1fr); } }
ul.proof li { margin: 0; background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-lg); padding: 14px; font-size: 15px; line-height: 1.45; }
ul.proof li strong { font-size: 17px; }
.links-row { font-size: 15px; line-height: 1.9; padding-top: 14px; border-top: 1px solid var(--hair); }

.answer-panel { margin: 18px 0 8px; padding: 16px; background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-lg); }
.answer-panel figcaption { margin-bottom: 8px; }
.answer-panel .scene { font-size: 16.5px; }

/* ---- sample questions -------------------------------------------------------------- */
.samples { display: grid; gap: 14px; margin: 16px 0 8px; }
.sample-q { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-lg); padding: 16px; }
.sample-q .scene { font-size: 17px; font-weight: 500; }
.sample-opts { list-style: none; padding: 0 !important; display: grid; gap: 6px; margin: 12px 0 !important; }
.sample-opts li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; margin: 0 !important; font-size: 15.5px; line-height: 1.45; }
.sample-opts .key { font-family: var(--f-mono); font-size: 13px; color: var(--muted); border: 1px solid var(--hair); border-radius: 999px; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; }
.sample-answer > summary { cursor: pointer; font-weight: 700; color: var(--accent); padding: 6px 0; }
.sample-answer .feedback p { font-size: 15.5px; }

/* ---- reading list --------------------------------------------------------------------- */
.all-sources { margin: 22px 0; border: 1px solid var(--hair); border-radius: var(--r-lg); background: var(--surface); padding: 0 14px; }
.all-sources > summary { cursor: pointer; padding: 12px 0; font-weight: 700; }
.all-sources h3 { margin-top: 12px; }
.source-list { font-size: 15px; }

/* ---- footer ------------------------------------------------------------------------------ */
.site-foot { border-top: 1px solid var(--hair); background: var(--surface); padding: 18px 0 calc(18px + env(safe-area-inset-bottom, 0)); font-size: 14.5px; }
.foot-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 2px; margin-bottom: 10px; }
.foot-links a { color: var(--ink-2); }
.site-foot p { margin: 0; max-width: 60em; }

@media print {
  .site-head, .site-foot, .btn-row, .skip { display: none !important; }
  .sample-answer { display: block; }
}

/* ---- about: Leigh's photo, a circle beside the bio ------------------------------ */
.bio-photo { float: right; width: 160px; height: 160px; border-radius: 50%; object-fit: cover; margin: 0 0 12px 20px; border: 1px solid var(--hair); background: var(--surface-2); }
.site-main p:has(> .bio-photo:only-child) { margin: 0; }
@media (max-width: 560px) { .bio-photo { float: none; display: block; width: 128px; height: 128px; margin: 4px auto 16px; } }

/* ---- Exam.Ninja homepage (/, src/home.ts) ------------------------------------------ */
body.site-home .site-wrap { max-width: 960px; }
.home-hero { display: grid; gap: 24px; align-items: center; padding: 12px 0 8px; }
.home-hero h1 { font-size: 34px; line-height: 1.1; margin: 0 0 14px; }
.home-lede { font-size: 18px; color: var(--ink-2); max-width: 34em; }
.home-ctas { margin-bottom: 0; }
.home-hero-mark { display: none; }
@media (min-width: 760px) {
  .home-hero { grid-template-columns: 1fr 220px; }
  .home-hero h1 { font-size: 46px; }
  .home-hero-mark { display: flex; align-items: center; justify-content: center; width: 220px; height: 220px; border-radius: 50%; background: var(--surface); border: 1px solid var(--hair); }
  .home-hero-mark .mascot { width: 132px; height: 132px; }
}
.home-section { margin-top: 40px; }
.home-section > h2 { margin-top: 0; }

.exam-list { list-style: none; padding: 0 !important; display: grid; gap: 14px; }
@media (min-width: 640px) { .exam-list { grid-template-columns: repeat(2, 1fr); } }
.exam-list > li { margin: 0 !important; }
.exam-card { display: flex; flex-direction: column; min-width: 0; }
.exam-card .exam-name { font-size: 22px; margin: 0 0 4px; }
.exam-card .exam-name a { color: var(--ink); text-decoration: none; }
.exam-card .exam-name a:hover { color: var(--accent); }
.exam-card .exam-full { margin: 0 0 10px; }
.exam-card .exam-counts { font-size: 14px; color: var(--ink-2); margin: 0 0 10px; overflow-wrap: anywhere; }
.exam-card .exam-formats { font-size: 15px; margin: 0 0 14px; }
.exam-card .exam-actions { margin: auto 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.exam-card .exam-actions .btn { text-decoration: none; }
.exam-next { background: transparent; border-style: dashed; }
.exam-full-inline { font-size: .6em; font-weight: 500; }

.pillars { list-style: none; padding: 0 !important; display: grid; gap: 12px; }
@media (min-width: 640px) { .pillars { grid-template-columns: repeat(2, 1fr); } }
.pillars li { margin: 0 !important; background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-lg); padding: 16px; display: grid; align-content: start; gap: 4px; font-size: 15px; line-height: 1.5; }
.pillars strong { font-size: 17px; }
.home-who p { max-width: 40em; }

/* ---- hub navigation (src/home.ts) ------------------------------------------------ */
.hub-nav { display: none; gap: 16px; font-size: 14.5px; }
.hub-nav a { color: var(--ink-2); text-decoration: none; }
.hub-nav a:hover { color: var(--accent); }
@media (min-width: 640px) { .hub-nav { display: flex; } }
.exam-card .exam-editor { margin: 0 0 12px; }
.guide-list { columns: 1; }
@media (min-width: 720px) { .guide-list { columns: 2; column-gap: 32px; } .guide-list li { break-inside: avoid; } }

/* ---- breadcrumbs (DipIMC's pages below its landing page) --------------------------- */
.crumbs { padding-top: 14px; color: var(--muted); overflow-wrap: anywhere; }
.crumbs a { color: var(--ink-2); }
.crumbs + .site-main { padding-top: 14px; }

/* ---- revise by topic: every curriculum unit, by theme ------------------------------- */
.topic-grid { display: grid; gap: 12px; margin: 16px 0 8px; }
@media (min-width: 720px) { .topic-grid { grid-template-columns: repeat(2, 1fr); } }
.topic-card { padding: 14px 16px; }
.topic-card h3 { font-size: 16px; margin: 0 0 8px; }
.topic-card ul { list-style: none; padding: 0 !important; margin: 0 !important; font-size: 15px; }
.topic-card li + li { margin-top: 4px; }
.related-topics { font-size: 15.5px; }
.topic-grid .card + .card { margin-top: 0; }

/* ---- in-page tabs on an exam's page (landing.md "JUMP NAV") ------------------------- */
.jump-nav {
  position: sticky; top: 0; z-index: 5; margin: 18px calc(-1 * var(--gutter)) 0; padding: 10px var(--gutter);
  background: var(--ground); border-bottom: 1px solid var(--hair);
  white-space: nowrap; overflow-x: auto; scrollbar-width: none; font-size: 14.5px;
}
.jump-nav::-webkit-scrollbar { display: none; }
.jump-nav a { color: var(--ink-2); text-decoration: none; font-weight: 600; }
.jump-nav a:hover { color: var(--accent); }
.site-main h2[id] { scroll-margin-top: 56px; }

/* ---- methodology: the numbered pipeline ------------------------------------------ */
.pipeline { list-style: none; padding: 0 !important; counter-reset: step; display: grid; gap: 10px; }
.pipeline li { counter-increment: step; margin: 0 !important; background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-lg); padding: 14px 16px 14px 60px; position: relative; font-size: 15.5px; line-height: 1.55; }
.pipeline li::before { content: counter(step, decimal-leading-zero); position: absolute; left: 16px; top: 14px; font-family: var(--f-mono); font-size: 14px; color: var(--muted); }
