/* Lato, self-hosted, same two weights and same files the app uses -- these
   pages are served straight out of public/, so the path climbs one level to
   /fonts/ rather than being rewritten by the bundler. */
@font-face {
  font-family: Lato;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local("Lato Regular"), local("Lato-Regular"),
       url(../fonts/lato-latin-400.woff2) format("woff2");
}
@font-face {
  font-family: Lato;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local("Lato Bold"), local("Lato-Bold"),
       url(../fonts/lato-latin-700.woff2) format("woff2");
}

/* The palette the about and terms pages declare, mirroring src/styles.css, so the
   three standalone surfaces and the app resolve the brand colours identically. */
:root {
  --ink: #292928;
  --muted: #696967;
  --paper: #fffef9;
  --line: #dcdcd8;
  --blue: #003c65;
  --gold: #c89b14;
  --story-header-height: 82px;
  font-family: Lato, Arial, sans-serif;
  font-synthesis: none;
}

.locale-pending body { visibility: hidden; }

/* The app's skip link, added by shell.js: first in the page, shown only once focused,
   above the sticky header. Its target stops below that header, not under it. */
.skip-link {
  position: fixed; z-index: 900; top: 0; left: 0;
  padding: 10px 16px; border-bottom-right-radius: 8px;
  color: white; background: var(--blue); font-weight: 700; text-decoration: none;
  transform: translateY(-110%);
}
.skip-link:focus { transform: translateY(0); }
.skip-target { scroll-margin-top: var(--story-header-height); }

.story-site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--story-header-height);
  padding: 0 max(24px, calc((100% - 1360px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--ink);
  background: rgb(255 255 255 / 96%);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  font-family: Lato, Arial, sans-serif;
}

.story-brand,
.story-navigation a,
.story-catalogue-link {
  color: inherit;
  text-decoration: none;
}

/* Brand lockup. The same mark, wordmark and tagline as the app masthead in
   src/styles.css, and as the about and terms headers. */
.story-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  font-size: 1.05rem;
  font-weight: 700;
}

.story-brand-mark { width: 42px; height: 42px; display: inline-flex; flex: 0 0 auto; }
.story-brand-mark svg { width: 100%; height: 100%; overflow: visible; }
.brand-mark__place { fill: var(--blue); }
.brand-mark__future { fill: none; stroke: var(--gold); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.story-brand-text { display: flex; flex-direction: column; gap: 1px; line-height: 1.15; }
.story-brand-name { color: var(--blue); }
.story-brand-tagline { color: var(--muted); font-size: .68rem; font-weight: 400; letter-spacing: .01em; }

/* The stories are a demonstration of the method, not a quality-assured product; the
   badge says so on every story page, next to the brand. */
.story-badge {
  flex: 0 0 auto;
  padding: 3px 9px;
  border: 1px solid #e6c766;
  border-radius: 999px;
  background: #fff4d6;
  color: var(--ink);
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.story-about-link {
  color: var(--muted);
  font-size: .75rem;
  font-weight: 700;
  text-decoration: none;
}
.story-about-link:hover, .story-about-link:focus-visible { color: var(--blue); }

.story-landing-notice {
  max-width: 690px;
  margin: 0 0 28px;
  padding: 10px 14px;
  border-left: 4px solid #e6c766;
  background: #fff4d6;
  color: var(--ink);
  font-size: .92rem;
  line-height: 1.5;
}

.story-navigation {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 700;
}

.story-navigation a {
  padding: 10px 11px 8px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.story-navigation a > span {
  margin-right: 7px;
  color: #9b9b98;
  font-size: .63rem;
}

.story-navigation a:hover,
.story-navigation a:focus-visible,
.story-navigation a[aria-current="page"] {
  color: var(--blue);
  border-color: var(--gold);
}

/* About moves into the collapsed menu on narrow screens, where the header has no
   room for it beside the language switch. */
.story-navigation__about { display: none; }

.story-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.locale-switch { display: flex; padding: 2px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); }
.locale-switch button { padding: 5px 8px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; font: inherit; font-size: .72rem; font-weight: 700; cursor: pointer; }
.locale-switch button[aria-pressed="true"] { color: white; background: var(--blue); }

/* Same button as `.about-back` and `.terms-back`: one primary way back to the
   climate data, wherever the reader is. */
.story-catalogue-link {
  padding: 8px 12px;
  border-radius: 7px;
  color: white;
  background: var(--blue);
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
}

.story-menu {
  display: none;
  border: 1px solid #c0c0bb;
  border-radius: 7px;
  color: var(--blue);
  background: var(--paper);
  padding: 8px 11px;
  font: inherit;
  font-size: .72rem;
  font-weight: 700;
}

/* The landing is the only page under /background that has no story stylesheet of
   its own, so it sets the page surface here rather than inline. */
.story-landing-page { margin: 0; background: white; }

/* The landing takes the header's own gutter rather than a narrower centred column,
   so the eyebrow starts directly under the wordmark. The measures that matter for
   reading are set per element below. */
.story-landing {
  padding: clamp(64px, 10vw, 130px) max(24px, calc((100% - 1360px) / 2)) 90px;
  color: var(--ink);
  font-family: Lato, Arial, sans-serif;
}

.story-landing .eyebrow {
  margin: 0 0 14px;
  color: var(--blue);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.story-landing h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.02em;
}

.story-landing-intro {
  max-width: 690px;
  margin: 28px 0 54px;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.55;
}

.story-cards {
  max-width: 1100px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.story-card {
  min-height: 230px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: inherit;
  background: var(--paper);
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.story-card:hover,
.story-card:focus-visible {
  border-color: var(--gold);
  box-shadow: 0 16px 40px rgb(41 41 40 / 9%);
  transform: translateY(-2px);
}

.story-card-number {
  color: #9b9b98;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
}

.story-card h2 {
  margin: 34px 0 10px;
  font-size: 1.75rem;
  font-weight: 700;
}

.story-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.story-card-action {
  margin-top: auto;
  padding-top: 22px;
  color: var(--blue);
  font-size: .78rem;
  font-weight: 700;
}

/* Same shape as the app footer in src/styles.css: the product and its developer on
   one side, the cross-links on the other. */
.story-footer {
  padding: 24px max(24px, calc((100% - 1360px) / 2)) 40px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: Lato, Arial, sans-serif;
  font-size: .88rem;
}
.story-footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.story-footer a {
  color: var(--blue); font-weight: 700; text-decoration-color: var(--gold);
  text-decoration-thickness: 2px; text-underline-offset: 3px;
}

/* The nav is the dense part of this header, so the tagline goes earlier here than
   on the app masthead; below 980px the nav collapses into the menu button. */
@media (max-width: 1180px) {
  .story-brand-tagline { display: none; }
}

@media (max-width: 980px) {
  .story-site-header, .story-landing, .story-footer { padding-inline: 20px; }
  .story-catalogue-link { display: none; }
  .story-menu { display: block; }
  .story-navigation {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 10px 20px 14px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 25px rgb(41 41 40 / 9%);
  }
  .story-navigation.is-open { display: grid; }
  .story-navigation a { padding: 12px; }
  .story-about-link { display: none; }
  .story-navigation__about { display: block; border-top: 1px solid var(--line); border-bottom: 0; }
}

@media (max-width: 680px) {
  :root { --story-header-height: 72px; }
  /* Brand and controls on the first row, the demo badge on its own below: at phone
     width the three of them cannot share a line without the menu falling off it. */
  .story-site-header { flex-wrap: wrap; min-height: 0; gap: 8px 10px; padding: 10px 16px; }
  .story-landing, .story-footer { padding-inline: 16px; }
  .story-brand { order: 1; }
  .story-header-actions { order: 2; margin-left: auto; gap: 8px; }
  .story-site-header::after { content: ""; order: 3; flex-basis: 100%; height: 0; }
  .story-badge { order: 4; }
  .story-brand { gap: 8px; font-size: .95rem; }
  .story-brand-mark { width: 34px; height: 34px; }
  .locale-switch button { padding-inline: 5px; font-size: .64rem; }
  .story-cards { grid-template-columns: 1fr; }
  .story-card { min-height: 205px; }
  .story-footer { flex-direction: column; gap: 10px; }
  .story-footer-links { align-items: flex-start; flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .story-card { transition: none; }
}
