/* Mission Key — shared styles for task pages and the static site.
   Original Mission Key CSS. Mobile-first, no ads, no JavaScript. */

:root {
  --bg: #f6f3ee;
  --bg-elev: #fffdf8;
  --ink: #1a1a17;
  --muted: #4a4944;
  --line: #d9d2c6;
  --accent: #7a2e12;
  --accent-ink: #fffdf8;
  --callout-bg: #f1ebe1;
  --rewards-bg: #efe6d4;
  --focus: #0b57d0;
  --panel: #fffdf8;
  --max: 72rem;
  --max-text: 42rem;
  --space: 1.25rem;
  --radius: 0.4rem;
  --layout-break: 64rem;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { font-size: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-underline-offset: 0.12em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3.5rem;
  background: var(--ink);
  color: var(--bg-elev);
  padding: 0.4rem 0.75rem;
  z-index: 10;
}
.skip-link:focus { top: 0.75rem; }

.site-header,
.site-footer,
.wrap {
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 1rem 0 0.75rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.01em;
  font-family: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
}
.brand:hover { color: var(--accent); }

.site-nav { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; }
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-family: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
}

.wrap { padding: 1.25rem 0 3rem; }

.breadcrumbs {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  padding: 0;
  margin: 0 0 1.25rem;
  font-size: 0.9375rem;
  color: var(--muted);
}
.breadcrumbs li { display: flex; gap: 0.5rem; }
.breadcrumbs li:not(:last-child)::after { content: "/"; color: var(--line); }
.breadcrumbs a { color: var(--muted); }

.lede,
.intro { font-size: 1.125rem; margin: 0 0 1rem; }

.muted, .credit, .meta { color: var(--muted); }

.meta {
  font-size: 0.9375rem;
  margin: 0.25rem 0 1rem;
  font-family: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
}

h1, h2, h3 {
  font-family: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.25;
  font-weight: 700;
}
h1 { font-size: 1.85rem; margin: 0 0 0.4rem; }
h2 { font-size: 1.35rem; margin: 0 0 0.75rem; }
h3 { font-size: 1.1rem; margin: 0 0 0.4rem; }

.faction {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  vertical-align: middle;
}

/* ——— Task page layout ———
   Source / mobile order: header, hero, steps, gallery, notes, map, sources, FAQ.
   From 64rem, CSS grid areas move the gallery under the hero (left) and
   the steps panel to the right, without changing source order. */
.task-layout {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "header"
    "hero"
    "steps"
    "gallery"
    "notes"
    "map"
    "sources"
    "faq";
}

.task-header { grid-area: header; }
.task-hero { grid-area: hero; }
.task-steps { grid-area: steps; }
.task-gallery { grid-area: gallery; }
.task-notes { grid-area: notes; }
.task-map { grid-area: map; }
.task-sources { grid-area: sources; }
.task-faq { grid-area: faq; }

.summary-row {
  display: grid;
  gap: 0.85rem;
  margin: 0;
}

.rewards,
.callout,
.notes-block,
.placeholder-slot {
  background: var(--callout-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin: 0;
}
.rewards { background: var(--rewards-bg); }
.rewards h2,
.callout h2,
.callout h3,
.notes-block h3 { margin-top: 0; }

.rewards ul,
.callout ul,
.sources { margin: 0.4rem 0 0; padding-left: 1.2rem; }

figure {
  margin: 0;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
figure img { width: 100%; background: #e8e2d8; }
figcaption { padding: 0.65rem 0.8rem 0.8rem; font-size: 0.9rem; }
.credit { margin: 0.35rem 0 0; font-size: 0.82rem; }

.task-hero figure img { width: 100%; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}
.gallery-grid figure img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.panel-steps {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1rem 1.15rem;
}
.panel-steps h2 { margin-top: 0; }

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: mk-step;
}
.steps > li {
  margin: 0 0 1.25rem;
  padding: 0 0 1.15rem;
  border-bottom: 1px solid var(--line);
  counter-increment: mk-step;
}
.steps > li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}
.steps > li > h3 {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  font-size: 1.05rem;
}
.steps > li > h3::before {
  content: counter(mk-step);
  flex: 0 0 auto;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg-elev);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.5rem;
  text-align: center;
}

.step-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.7rem 0;
  padding: 0;
  list-style: none;
}
.step-thumbs a {
  display: block;
  width: 4.5rem;
  height: 4.5rem;
  border: 1px solid var(--line);
  border-radius: 0.25rem;
  overflow: hidden;
}
.step-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.steps .callout { margin-top: 0.7rem; }

.task-notes .notes-block + .notes-block { margin-top: 0.85rem; }
.task-notes figure { margin: 0.85rem 0 0; }

.faq-item { border-top: 1px solid var(--line); padding: 0.85rem 0; }
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-item h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.faq-item p { margin: 0; }

.sources { font-size: 0.95rem; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.25rem 0 2rem;
  font-size: 0.875rem;
  color: var(--muted);
}
.site-footer p { margin: 0 0 0.5rem; }
.footer-inner { padding: 0; }

/* Site chrome (home, hub, about, 404) */
.hero-card,
.section-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem 1.2rem;
  margin: 1rem 0;
}
.section-card h2 { margin-top: 0; }

.coming-soon {
  margin: 0.5rem 0 0;
  font-weight: 600;
  font-family: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
}

.narrow { width: min(var(--max-text), 100%); }

.page-404 { padding: 2.5rem 0 4rem; }
.page-404 h1 { font-size: 2rem; }

@media (min-width: 40rem) {
  .summary-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  h1 { font-size: 2.15rem; }
  body { font-size: 1.125rem; }
}

@media (min-width: 64rem) {
  /* Two-column desktop: media (hero + gallery) on the left,
     numbered guide on the right, remaining sections full width below.
     Row 3 is 1fr so a long steps panel grows beneath the gallery
     instead of opening a gap between the hero and the gallery. */
  .task-layout {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    grid-template-rows: auto auto 1fr auto auto auto auto;
    grid-template-areas:
      "header  header"
      "hero    steps"
      "gallery steps"
      "notes   notes"
      "map     map"
      "sources sources"
      "faq     faq";
    column-gap: 1.75rem;
    row-gap: 1.25rem;
    align-items: start;
  }

  .panel-steps {
    position: sticky;
    top: 0.75rem;
  }

  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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