/* ============================================================================
   When To Go: design system (v2)
   One stylesheet for every country and city page, and the world map app.
   Change it here, it changes everywhere.

   Look: mid-century travel brochure. Warm aged paper, poster inks, condensed
   display caps and a script accent, boxy double-ruled frames. Think Gray Line,
   Greyhound and the old cruise-line covers.

   House rules, all enforced below:
     - No gradients. Solid colour and flat paper grain only.
     - No shadows. Depth comes from tonal borders, double rules and colour blocking.
     - Display headings are condensed caps (the brochure voice); body stays sentence case.
     - No coloured bar down the left edge. Never use border-left as an accent.
     - Icons are Lucide, never emoji.
   Tokens first, then components.
   ========================================================================= */

:root {
  /* Surfaces: warm aged paper, ivory cards. */
  --paper: #f4e9cf;      /* aged cream page */
  --paper-2: #ecdcb6;    /* deeper cream band */
  --card: #fdf6e3;       /* ivory card */
  --ink: #2a2016;        /* warm sepia-black */
  --ink-2: #5f5138;      /* muted sepia body, AA on cream and the tint band */
  --line: #e2d2ab;       /* tonal border */
  --line-2: #cfb987;

  /* Poster inks: red, teal, mustard, hot pink. Teal carries the chrome and
     links so it never collides with the red-to-green data scale on the map. */
  --brand: #15645c;      /* deep teal, the one signature colour */
  --brand-press: #0f4a44;
  --brand-ink: #fdf6e3;
  --rust: #9e3d24;       /* muted terracotta, AA as small text on the band */
  --coral: #9e3d24;      /* alias kept so older rules still resolve */
  --pink: #9e3d24;       /* pink retired from the chrome */
  --sun: #d99a26;        /* mustard, small accents only */
  --mint: #2bbf8a;

  /* Season scale (data only, vivid, matches the map app) */
  --s-ideal: #0f8145;
  --s-great: #74c043;
  --s-good:  #f3c218;
  --s-fair:  #ff8f2e;
  --s-avoid: #ee4338;
  --s-none:  #cfc6b2;

  /* Type: a fat poster slab for covers, condensed caps for headers, a script
     kicker, a clean warm body. Mixed faces are the brochure way. */
  --fat: "Alfa Slab One", "Rockwell", Georgia, serif;
  --display: "Anton", "Oswald", Impact, sans-serif;
  --script: "Kaushan Script", "Brush Script MT", cursive;
  --sans: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Shape: boxy, like a printed panel. */
  --r-sm: 4px;
  --r: 7px;
  --r-lg: 10px;
  --r-pill: 999px;

  /* Rhythm */
  --pad: clamp(16px, 4vw, 28px);
  --gap: clamp(16px, 3vw, 24px);
  --maxw: 1080px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background-color: var(--paper);
  /* Flat paper grain, not a gradient. Very low contrast so text stays crisp. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration-thickness: 2px; text-underline-offset: 3px; }

h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.02; text-transform: uppercase; letter-spacing: 0.01em; margin: 0; }
h1 { font-size: clamp(38px, 6.5vw, 68px); line-height: 1.0; letter-spacing: 0.005em; color: var(--ink); }
h2 { font-size: clamp(26px, 3.6vw, 38px); color: var(--ink); }
h3 { font-size: clamp(20px, 2.4vw, 24px); letter-spacing: 0.02em; }
p { margin: 0 0 1em; }

/* Headings are one ink. (The old rainbow word-cycling is retired; the .poly
   spans are left inert so existing markup keeps working.) */
.poly .w { color: inherit; }

/* Lucide icons */
.ic { width: 1.15em; height: 1.15em; stroke-width: 2.2; vertical-align: -0.18em; display: inline-block; }
svg.lucide { width: 1.15em; height: 1.15em; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }
.section { padding: clamp(40px, 8vw, 84px) 0; }
.section--tight { padding: clamp(28px, 5vw, 48px) 0; }
.band { background: var(--paper-2); }
.lead { font-size: clamp(18px, 2.2vw, 21px); color: var(--ink-2); max-width: 62ch; }
/* Section label: a quiet small-caps line with a short rule, not a flag. */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.16em; font-weight: 800; font-size: 12px; line-height: 1; color: var(--brand); }
.eyebrow .ic { color: var(--brand); width: 1.1em; height: 1.1em; }
.eyebrow--coral, .eyebrow--warn { color: var(--rust); }
.eyebrow--coral .ic, .eyebrow--warn .ic { color: var(--rust); }
.eyebrow--sun { color: var(--ink-2); }
.eyebrow--sun .ic { color: var(--ink-2); }

/* Script kicker: one small handwritten line over the hero title. */
.kicker { font-family: var(--script); font-weight: 400; font-size: clamp(20px, 2.6vw, 26px); line-height: 1; color: var(--rust); margin: 0 0 4px; }

/* Ornamental rule: a thin centred rule with a small mark, a quiet divider. */
.orn { display: flex; align-items: center; gap: 14px; color: var(--line-2); margin: clamp(24px, 5vw, 44px) 0; }
.orn::before, .orn::after { content: ""; height: 1.5px; background: currentColor; flex: 1; }
.orn .ic { width: 18px; height: 18px; color: var(--brand); flex: none; }
.prose p { max-width: 68ch; }
.prose h2 { margin-top: 1.4em; }
.prose h3 { margin-top: 1.2em; margin-bottom: .3em; }

/* ---- Top nav ---- */
.nav { position: sticky; top: 0; z-index: 30; background: var(--paper); border-bottom: 2px solid var(--ink); }
.nav .wrap { display: flex; align-items: center; gap: 16px; height: 66px; }
.brand { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: 0.03em; font-size: 26px; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.brand .dot { width: 24px; height: 24px; border-radius: 50%; background: var(--coral); display: inline-grid; place-items: center; color: var(--brand-ink); }
.brand .dot .ic { width: 14px; height: 14px; }
.nav .spacer { flex: 1; }
.nav a.link { text-decoration: none; color: var(--ink-2); font-weight: 700; font-size: 15px; }
.nav a.link:hover { color: var(--ink); }

/* ---- Buttons (flat, bordered, no shadow) ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--sans); font-weight: 800; font-size: 15px;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 13px 24px; border-radius: var(--r-pill); border: 2px solid var(--ink);
  background: var(--brand); color: var(--brand-ink); cursor: pointer; text-decoration: none;
  transition: transform .08s ease, background .12s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--ghost { background: var(--card); color: var(--ink); }
.btn--teal { background: var(--brand); color: var(--brand-ink); }
.btn--rust { background: var(--rust); color: var(--brand-ink); }
.btn--pink { background: var(--rust); }
.btn--sun { background: var(--sun); color: var(--ink); }
.btn--lg { padding: 16px 30px; font-size: 17px; }

/* ---- Cards: boxy panel with a double rule, like a printed ticket ---- */
.card { position: relative; background: var(--card); border: 2px solid var(--ink); border-radius: var(--r-lg); padding: var(--pad); }
.card::before { content: ""; position: absolute; inset: 5px; border: 1px solid var(--line-2); border-radius: calc(var(--r-lg) - 5px); pointer-events: none; }
.card--ink { background: var(--paper-2); }
/* Card label that reads like a heading but stays out of the heading outline. */
.cardhd { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.02em; font-size: clamp(19px, 2.2vw, 23px); line-height: 1.1; color: var(--ink); }
/* Give the generic card a labelled-panel feel: heading in condensed caps,
   a hairline rule under it, no floating pastel icon puck. */
.card > .row h3, .card h3.mb-0 { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.02em; color: var(--ink); }
.card .row .ic { color: var(--coral); }

/* ---- Brochure cover hero: a thick double-ruled panel with a seal ---- */
.cover { position: relative; background: var(--card); border: 3px double var(--ink); border-radius: var(--r-lg); padding: clamp(22px, 4vw, 40px); overflow: hidden; }
.cover .lead { max-width: 56ch; }
.coverhead { display: flex; gap: 24px; align-items: flex-start; justify-content: space-between; }
.coverhead .txt { min-width: 0; }

/* Hero illustration band: a framed vintage image at the top of the cover. */
.hero-img { position: relative; margin: 0 0 clamp(18px, 3vw, 26px); border: 2px solid var(--ink); border-radius: var(--r); overflow: hidden; aspect-ratio: 21 / 9; background: var(--paper-2); }
.hero-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 640px) { .hero-img { aspect-ratio: 16 / 10; } }

/* ---- Season ticket stubs (replaces the three identical season cards) ---- */
.stubs { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
@media (max-width: 760px) { .stubs { grid-template-columns: 1fr; } }
.stub { position: relative; background: var(--card); border: 2px solid var(--ink); border-radius: var(--r); overflow: hidden; }
.stub__band { padding: 8px 16px; font-family: var(--display); text-transform: uppercase; letter-spacing: 0.05em; font-size: 14px; color: #14130f; border-bottom: 2px solid var(--ink); }
.stub__band.k-ideal { background: var(--s-ideal); color: #fff; }
.stub__band.k-good { background: var(--s-good); }
.stub__band.k-fair { background: var(--s-fair); }
.stub__v { display: block; font-family: var(--display); text-transform: uppercase; font-size: clamp(22px, 3vw, 30px); line-height: 1; padding: 16px 16px 0; }
.stub p { margin: 8px 16px 16px; color: var(--ink-2); font-size: 15px; }

/* ---- Numbered region panels (replaces the identical icon-title cards) ---- */
.panels { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
@media (max-width: 760px) { .panels { grid-template-columns: 1fr; } }
.panel { position: relative; background: var(--card); border: 2px solid var(--ink); border-radius: var(--r); padding: var(--pad); }
.panel__no { font-family: var(--fat); font-size: 30px; line-height: 1; color: var(--coral); display: block; }
.panel__no::after { content: ""; display: block; width: 34px; height: 3px; background: var(--ink); margin: 8px 0 12px; }
.panel h3 { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.02em; }
.panel p { margin: 8px 0 0; color: var(--ink-2); font-size: 15px; }
.grid { display: grid; gap: var(--gap); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 760px) { .grid--2, .grid--3 { grid-template-columns: 1fr; } .grid--4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .nav .link { display: none; } }

/* ---- Chips and badges ---- */
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px; border-radius: var(--r-pill); background: var(--card); border: 1.5px solid var(--line-2); font-weight: 700; font-size: 15px; text-decoration: none; color: var(--ink); }
.chip:hover { border-color: var(--ink); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--r-pill); font-weight: 800; font-size: 13px; color: #14130f; border: 1.5px solid rgba(0,0,0,.14); }
.badge--ideal { background: var(--s-ideal); color: #fff; }
.badge--great { background: var(--s-great); }
.badge--good { background: var(--s-good); }
.badge--fair { background: var(--s-fair); }
.badge--avoid { background: var(--s-avoid); color: #fff; }

/* ---- Month strip (the signature element) ----
   Square tiles. The score sits dead centre. On peak months a small round
   icon badge floats over the top edge, the way the highlight chips do. */
.strip { display: grid; grid-template-columns: repeat(12, 1fr); gap: 10px; }
.strip .mo { text-align: center; }
.strip .tile {
  position: relative; border-radius: var(--r); aspect-ratio: 1 / 1;
  display: grid; place-items: center; color: #14130f; font-weight: 800;
  border: 2px solid var(--ink);
}
.strip .tile .sc { font-size: clamp(15px, 2vw, 21px); }
.strip .tile.peak { border-color: var(--ink); }
.strip .tile .mk {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: var(--card); border: 2px solid var(--line-2); border-radius: 50%;
  width: 28px; height: 28px; display: grid; place-items: center; color: var(--ink);
}
.strip .tile .mk .ic { width: 15px; height: 15px; }
/* Soft, light, tinted icon badges */
.strip .tile .mk.bloom { background: #ffd6e6; border-color: #ff9cc0; color: #ff3d80; }
.strip .tile .mk.leaf { background: #ffe2c4; border-color: #ffbf85; color: #ef7d1f; }
.strip .tile .mk.snow { background: #d8eaff; border-color: #a9cdff; color: #2f7ae6; }
.strip .tile .mk.sun { background: #fff1c2; border-color: #ffe08a; color: #e0a200; }
.strip .tile .mk.fest { background: #e9e2ff; border-color: #cdbfff; color: #6d4aff; }
.strip .tile .mk.grape { background: #ecdcff; border-color: #d4b6ff; color: #8a3ffc; }
.strip .tile .mk.fish { background: #d6f0ef; border-color: #a8ddda; color: #0f9d96; }
.strip .tile .mk.sparkles { background: #fff0c9; border-color: #ffe08a; color: #d98c00; }
.strip .lab { margin-top: 12px; font-weight: 800; font-size: 13px; color: var(--ink-2); }
@media (max-width: 760px) { .strip { grid-template-columns: repeat(6, 1fr); row-gap: 20px; } }

.sw { width: 14px; height: 14px; border-radius: 5px; display: inline-block; border: 1.5px solid rgba(0,0,0,.14); }
.s-ideal { background: var(--s-ideal); } .s-great { background: var(--s-great); }
.s-good { background: var(--s-good); } .s-fair { background: var(--s-fair); } .s-avoid { background: var(--s-avoid); }

/* ---- Data table ---- */
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { text-align: left; padding: 13px 14px; border-bottom: 1.5px solid var(--line); vertical-align: top; }
.table th { font-family: var(--sans); font-weight: 800; font-size: 14px; color: var(--ink-2); }
.table .m { font-weight: 800; white-space: nowrap; }
.table td .badge { white-space: nowrap; }
.table-wrap { overflow-x: auto; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--card); }

/* ---- Stat tiles ---- */
.stat .n { font-family: var(--display); font-weight: 400; font-size: clamp(28px, 4.4vw, 40px); line-height: 1; color: var(--brand); }
.stat .k { color: var(--ink-2); font-weight: 700; font-size: 13px; margin-top: 8px; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---- FAQ (no JS) ---- */
.faq details { border: 1.5px solid var(--line); border-radius: var(--r); background: var(--card); padding: 4px 18px; margin-bottom: 12px; }
.faq summary { cursor: pointer; font-family: var(--sans); font-weight: 800; font-size: 18px; padding: 16px 0; list-style: none; display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ic { color: var(--brand); flex: none; transition: transform .15s ease; }
.faq details[open] summary .ic { transform: rotate(45deg); }
.faq .a { padding: 0 0 18px; color: var(--ink-2); }

/* ---- Affiliate links: highlighted, action-oriented, distinct colour.
   Inline so they wrap naturally inside table cells and prose. ---- */
.aff { color: var(--brand); font-weight: 800; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 2px; }
.aff .ic { width: 1em; height: 1em; vertical-align: -0.15em; }
.toursrow { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* ---- Affiliate / where to stay block ---- */
.embed { aspect-ratio: 16 / 10; border-radius: var(--r); overflow: hidden; border: 2px solid var(--ink); background: var(--paper-2); }
.staygrid { display: grid; grid-template-columns: 1.55fr 1fr; gap: var(--gap); align-items: stretch; }
.embed--stay { aspect-ratio: auto; min-height: 520px; }
@media (max-width: 760px) { .staygrid { grid-template-columns: 1fr; } .embed--stay { min-height: 380px; } }
.disc { font-size: 13px; color: var(--ink-2); }

/* ---- Footer ---- */
.foot { background: var(--ink); color: #e6d8bc; padding: clamp(40px, 7vw, 72px) 0; }
.foot a { color: var(--sun); }
.foot .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--gap); }
@media (max-width: 760px) { .foot .cols { grid-template-columns: 1fr; } }
.foot .muted { color: #b3a181; font-size: 13px; }

/* ---- Helpers ---- */
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.pop { color: var(--brand); }
.rule { height: 1.5px; background: var(--line); border: 0; margin: 0; }

/* ---- Country maps: the city heat map and the backpacker route map ----
   Inline SVG drawn by gen.js. Sea is the same tint as the world map, land
   is deeper cream, dots and stops carry the data. */
:root { --sea: #cfe1db; }
.cmap { display: block; width: 100%; height: auto; background: var(--sea); border: 2px solid var(--ink); border-radius: var(--r); }
.cmap .land { fill: var(--paper-2); stroke: var(--ink); stroke-width: 1.2; stroke-linejoin: round; }
.cmap .halo { opacity: .36; }
.cmap .dot { stroke: var(--ink); stroke-width: 2; }
.cmap .sc { font: 800 12px var(--sans); fill: #14130f; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.cmap .lab { font: 800 13px var(--sans); fill: var(--ink); paint-order: stroke; stroke: var(--card); stroke-width: 3.5px; stroke-linejoin: round; }
.cmap .leg { fill: none; stroke: var(--rust); stroke-width: 3; stroke-dasharray: 8 6; stroke-linecap: round; stroke-linejoin: round; }
.cmap .stop { fill: var(--card); stroke: var(--ink); stroke-width: 2; }
.cmap .no { font: 400 14px var(--display); fill: var(--ink); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.cmapgrid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
@media (max-width: 760px) { .cmapgrid { grid-template-columns: 1fr; } }

/* Month picker: the world map's month chips, on paper. */
.mpick { display: flex; flex-wrap: wrap; gap: 8px; }
.mpick button { padding: 9px 14px; border-radius: var(--r-pill); border: 1.5px solid var(--line-2); background: var(--card); color: var(--ink); font: 800 14px var(--sans); cursor: pointer; }
.mpick button:hover { border-color: var(--ink); }
.mpick button.on { background: var(--brand); border-color: var(--ink); color: var(--brand-ink); }

/* Side panel next to the city map: the ranked list for the chosen month. */
.cm-side { padding: clamp(16px, 3vw, 24px); }
.cm-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.cm-list .r { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.cm-list .badge { min-width: 46px; justify-content: center; }

/* City by month grid: a small heatmap table, first column sticky. */
.hgrid table { width: 100%; border-collapse: separate; border-spacing: 3px; font-size: 13px; }
.hgrid th { font: 800 13px var(--sans); color: var(--ink-2); padding: 6px 2px; text-align: center; cursor: pointer; border-radius: var(--r-sm); }
.hgrid th.on { background: var(--ink); color: var(--card); }
.hgrid th.c, .hgrid td.c { text-align: left; white-space: nowrap; padding-left: 8px; position: sticky; left: 0; background: var(--card); cursor: default; }
.hgrid td.c { font-weight: 800; }
.hgrid td.c small { display: block; font-weight: 600; color: var(--ink-2); font-size: 12px; line-height: 1.2; }
.hgrid td { min-width: 36px; height: 34px; text-align: center; font-weight: 800; color: #14130f; border-radius: var(--r-sm); cursor: pointer; }
.hgrid td.k-ideal { background: var(--s-ideal); color: #fff; }
.hgrid td.k-great { background: var(--s-great); }
.hgrid td.k-good { background: var(--s-good); }
.hgrid td.k-fair { background: var(--s-fair); }
.hgrid td.k-avoid { background: var(--s-avoid); color: #fff; }
.hgrid td.on:not(.c) { outline: 2.5px solid var(--ink); outline-offset: -2px; }

/* Route stops: a numbered list with the leg between stops as a small line. */
.route { list-style: none; margin: 0; padding: 0; }
.route li { position: relative; }
.route .via { display: block; font-size: 13px; font-weight: 700; color: var(--rust); padding: 8px 0 8px 52px; }
.route li.pass .via { color: var(--ink-2); }
.route .stop { display: flex; gap: 14px; align-items: flex-start; background: var(--card); border: 2px solid var(--ink); border-radius: var(--r); padding: 14px 16px; }
.route .no { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--ink); background: var(--card); display: grid; place-items: center; font-family: var(--display); font-size: 17px; }
.route h3 { font-size: 19px; }
.route h3 small { font-family: var(--sans); font-weight: 700; text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--rust); margin-left: 6px; }
.route p { margin: 4px 0 0; color: var(--ink-2); font-size: 15px; }
.cmap .leader { stroke: var(--ink); stroke-width: 1.5; }
.cmap .pin { fill: var(--ink); }
