/*
 * Styling for the /learn/ articles.
 *
 * These pages are deliberately NOT part of the React app. The SPA uses
 * HashRouter, so every in-app route is "/#/something" -- and search engines
 * collapse fragments into the root document. Content written to be indexed
 * has to live at a real path, which means real static files under public/,
 * served ahead of the "**" rewrite the same way ads.txt is.
 *
 * Consequence: no Tailwind here. Tailwind only scans index.html and src/,
 * and the built stylesheet has a hashed filename we cannot link to reliably.
 * So the selecta palette is restated once, below, as plain custom properties.
 * If tailwind.config.js changes, change these too -- they are a copy, and
 * nothing enforces that they agree.
 */

:root {
  --cream: #faf3e3;
  --paper: #fffdf6;
  --ink: #26262e;
  --slate: #5a5a66;
  --chrome: #b9bfc8;
  --teal: #177e71;
  --teal-dark: #0f5f55;
  --teal-light: #e2f1ed;
  --coral: #e2593f;
  --brass: #c98a1b;
  --brass-light: #fbf3dc;
  --rule: rgba(38, 38, 46, 0.12);
  --shadow: 0 4px 0 0 rgba(38, 38, 46, 0.12);
}

/* Light only, deliberately. These pages used to flip to a dark palette under
   prefers-color-scheme: dark -- they were the ONLY surface on the site that
   did. The React app has no dark palette at all (no `dark:` classes, no
   darkMode in tailwind.config.js), so bg-selecta-cream is always #faf3e3 and
   navigating from the app to an article changed the ground colour mid-visit.
   Matching the app is worth more than honouring the OS scheme on six pages.
   If the app ever gains a dark theme, restore this here in the same change. */

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto,
    Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

h1,
h2,
h3,
.display {
  font-family: Futura, 'Century Gothic', 'Avenir Next', Inter, system-ui,
    sans-serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
}

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

/* Selecta-bot art --------------------------------------------------------- */

/* The <symbol> sprite each page carries. Hidden, but "display:none" on the
   host <svg> breaks <use> resolution in some engines -- size it to nothing
   instead. */
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* The scene art is drawn for a light ground: chrome body, ink outlines. The
   medallion interior is pinned to the paper colour rather than inheriting it,
   so the art always sits on the ground it was drawn for. */
.medallion {
  flex: 0 0 auto;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: #fffdf6;
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.medallion svg {
  width: 96px;
  height: auto;
}

/* Masthead ---------------------------------------------------------------- */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
  padding-bottom: 1rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
}

.masthead .bot {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
}

.masthead a.brand {
  font-family: Futura, 'Century Gothic', 'Avenir Next', Inter, system-ui,
    sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
}

.masthead a.brand:hover {
  color: var(--teal);
}

.masthead .sep {
  color: var(--chrome);
}

.masthead a.up {
  font-size: 0.95rem;
  color: var(--teal);
}

/* Article ----------------------------------------------------------------- */

article h1 {
  font-size: 2rem;
  margin: 0 0 0.75rem;
}

.standfirst {
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--slate);
  margin: 0 0 1.5rem;
}

article h2 {
  font-size: 1.35rem;
  margin: 2.5rem 0 0.75rem;
}

article h3 {
  font-size: 1.1rem;
  margin: 1.75rem 0 0.5rem;
}

p {
  margin: 0 0 1.1rem;
}

a {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--teal-dark);
}

strong {
  font-weight: 700;
}

ul,
ol {
  margin: 0 0 1.1rem;
  padding-left: 1.4rem;
}

li {
  margin-bottom: 0.4rem;
}

blockquote {
  margin: 1.5rem 0;
  padding: 0.25rem 0 0.25rem 1.1rem;
  border-left: 3px solid var(--teal);
  color: var(--slate);
  font-style: italic;
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--teal-light);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

/* Callout ----------------------------------------------------------------- */

/* Matches the payoff panel in HowItWorks.jsx: teal-light ground, teal hairline,
   teal-dark text. Same component, different medium. */
.note {
  background: var(--teal-light);
  border: 1px solid var(--teal);
  border-radius: 0.5rem;
  padding: 1rem 1.15rem;
  margin: 1.75rem 0;
  color: var(--teal-dark);
}

.note p:last-child {
  margin-bottom: 0;
}

.note .label,
.eli5 .label {
  font-family: Futura, 'Century Gothic', 'Avenir Next', Inter, system-ui,
    sans-serif;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--coral);
  display: block;
  margin-bottom: 0.35rem;
}

.note.caution {
  background: var(--brass-light);
  border-color: var(--brass);
  color: var(--ink);
}

.note.caution .label {
  color: var(--brass);
}

/* ELI5 -------------------------------------------------------------------- */

/* Selecta-bot doing the thing, in a porthole, next to the plain-language
   version of whatever the surrounding prose just argued. The kicker is the
   same coral/uppercase/wide-tracking treatment as "SELECTA-BOT PRESENTS" on
   the home page, so the two read as one system. */
.eli5 {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--paper);
  border: 2px solid var(--rule);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin: 2rem 0;
}

.eli5 .body {
  min-width: 0;
}

.eli5 p {
  margin: 0;
  color: var(--ink);
}

.eli5 p + p {
  margin-top: 0.6rem;
}

@media (max-width: 560px) {
  .eli5 {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

/* Tables ------------------------------------------------------------------ */

/* Wide content scrolls inside its own box; the page body never scrolls
   sideways. A real trip name blew past 390px once already -- see CLAUDE.md. */
.scroll-x {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--rule);
  border-radius: 0.5rem;
  background: var(--paper);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}

th,
td {
  padding: 0.6rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}

thead th {
  font-family: Futura, 'Century Gothic', 'Avenir Next', Inter, system-ui,
    sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--slate);
}

tbody tr:last-child td {
  border-bottom: 0;
}

td.num {
  font-variant-numeric: tabular-nums;
}

.good {
  color: var(--teal);
  font-weight: 700;
}

.bad {
  color: var(--coral);
  font-weight: 700;
}

/* Article index ----------------------------------------------------------- */

.cards {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
}

.cards li {
  margin-bottom: 1.25rem;
}

.cards a.card {
  display: block;
  background: var(--paper);
  border: 2px solid var(--rule);
  border-radius: 0.75rem;
  padding: 1.1rem 1.25rem;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.cards a.card:hover {
  border-color: var(--teal);
}

.cards .card-title {
  font-family: Futura, 'Century Gothic', 'Avenir Next', Inter, system-ui,
    sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
  display: block;
  margin-bottom: 0.3rem;
}

.cards .card-blurb {
  color: var(--slate);
  font-size: 0.98rem;
  display: block;
}

/* Next / prev ------------------------------------------------------------- */

.readnext {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.readnext .label {
  font-family: Futura, 'Century Gothic', 'Avenir Next', Inter, system-ui,
    sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
  display: block;
  margin-bottom: 0.5rem;
}

/* Call to action ---------------------------------------------------------- */

.cta {
  background: var(--teal-light);
  border: 2px solid var(--teal);
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin: 2.5rem 0 0;
  text-align: center;
}

.cta p {
  margin: 0 0 0.85rem;
  color: var(--ink);
}

.cta a.button {
  display: inline-block;
  background: var(--teal);
  color: #fffdf6;
  font-family: Futura, 'Century Gothic', 'Avenir Next', Inter, system-ui,
    sans-serif;
  font-weight: 700;
  padding: 0.6rem 1.4rem;
  border-radius: 0.5rem;
  text-decoration: none;
}

.cta a.button:hover {
  background: var(--teal-dark);
  color: #fffdf6;
}

/* Footer ------------------------------------------------------------------ */

.pagefoot {
  margin-top: 3.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--slate);
  text-align: center;
}

.pagefoot a {
  color: var(--slate);
}

@media (max-width: 480px) {
  body {
    font-size: 16px;
  }

  article h1 {
    font-size: 1.6rem;
  }

  .standfirst {
    font-size: 1.05rem;
  }
}
