/* The Corner World. Colours follow The Corner FC: the same neutrals and the blue, orange and green of the mark. */
:root {
  color-scheme: light;
  --surface-1: #fcfcfb;
  --page-plane: #f9f9f7;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #6d6b66;
  --border: rgba(11,11,11,0.10);
  --chip-bg: #f0efec;
  --blue: #2a78d6;
  --blue-btn: #1d6fd0;
  --blue-text: #1e589e;
  --orange: #eb6834;
  --orange-text: #a13910;
  --aqua: #1baf7a;
  --warn-bg: #fff6e0;
  --warn-text: #795b00;
  --critical-text: #a22727;
  --ocean: #e9f0f7;
  --land: #d9d7ce;
  --land-guide: #8fd4b8;
  --land-line: #fcfcfb;
  --grid: rgba(11,11,11,0.06);
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --surface-1: #1a1a19;
    --page-plane: #0d0d0d;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted: #8f8d88;
    --border: rgba(255,255,255,0.10);
    --chip-bg: #26261f;
    --blue: #3987e5;
    --blue-text: #73aaed;
    --orange: #d95926;
    --orange-text: #e58e6b;
    --aqua: #199e70;
    --warn-bg: #2a2412;
    --warn-text: #f5c518;
    --critical-text: #ed8f8f;
    --ocean: #11171e;
    --land: #3a3936;
    --land-guide: #1f7556;
    --land-line: #11171e;
    --grid: rgba(255,255,255,0.05);
  }
}
/* Dark chosen with the Theme button (assets/theme.js sets data-theme) */
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-1: #1a1a19;
  --page-plane: #0d0d0d;
  --text-primary: #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted: #8f8d88;
  --border: rgba(255,255,255,0.10);
  --chip-bg: #26261f;
  --blue: #3987e5;
  --blue-text: #73aaed;
  --orange: #d95926;
  --orange-text: #e58e6b;
  --aqua: #199e70;
  --warn-bg: #2a2412;
  --warn-text: #f5c518;
  --critical-text: #ed8f8f;
  --ocean: #11171e;
  --land: #3a3936;
  --land-guide: #1f7556;
  --land-line: #11171e;
  --grid: rgba(255,255,255,0.05);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--page-plane); color: var(--text-primary); }
body {
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; height: 100dvh;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 10; background: var(--surface-1); padding: 8px 12px; border-radius: 8px; }
.muted { color: var(--text-muted); font-size: 13px; }

/* Header */
.app-bar {
  display: flex; align-items: center; gap: 16px; flex: none;
  padding: calc(env(safe-area-inset-top) + 8px) 16px 8px;
  background: var(--surface-1); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 700; font-size: 17px; white-space: nowrap; }
.brand-mark { width: 22px; height: 22px; background: url(../favicon.svg) center / contain no-repeat; }
.tabs { display: flex; gap: 4px; margin-left: auto; }
.tabs button, .tabs a, .ghost-btn { white-space: nowrap;
  border: 0; text-decoration: none; background: none; padding: 6px 12px; border-radius: 999px; color: var(--text-secondary); font-weight: 600; font-size: 14px;
}
.tabs button:hover, .tabs a:hover, .ghost-btn:hover { background: var(--chip-bg); }
.tabs button[aria-current] { background: var(--chip-bg); color: var(--text-primary); }
.count {
  display: inline-block; min-width: 18px; margin-left: 6px; padding: 0 5px; border-radius: 999px;
  background: var(--orange); color: #fff; font-size: 12px; line-height: 18px; text-align: center;
}
.ghost-btn { font-weight: 500; }

/* A narrow window */
@media (max-width: 820px) {
  .app-bar { gap: 8px; }
  .brand { font-size: 15px; }
  .tabs button, .tabs a, .ghost-btn { padding: 6px 9px; }
}
@media (max-width: 480px) { .ghost-btn { display: none; } }

/* Panels and pages (the map page's own layout is in home.css) */
.panel h1, .page h1 { font-size: 24px; line-height: 1.2; margin: 0 0 4px; }
.lede { color: var(--text-secondary); margin: 0 0 16px; }
.section { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin: 24px 0 8px; font-weight: 600; }
.empty { color: var(--text-secondary); background: var(--chip-bg); border-radius: 10px; padding: 12px 14px; }
.loading { color: var(--text-muted); }
.credits { margin: 32px 0 0; font-size: 12px; color: var(--text-muted); }
input[type="search"], input[type="text"], input[type="date"], input[type="number"], select {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--page-plane);
}
label > span { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.filters { margin-top: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { border: 1px solid var(--border); background: none; border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--text-secondary); }
.chip[aria-pressed="true"] { background: var(--blue-btn); border-color: var(--blue-btn); color: #fff; }

ul.cards, ul.rows, ul.places, ol.stops, ul.checklist { list-style: none; margin: 0; padding: 0; }
.cards { display: grid; gap: 8px; }
.card { display: grid; gap: 4px; width: 100%; text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--page-plane); }
.card:hover { border-color: var(--blue); }
.card-title { font-weight: 600; font-size: 16px; }
.card-text { color: var(--text-secondary); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.flag { margin-right: 8px; }
.flag.big { font-size: 40px; line-height: 1; margin: 0; }
.rows { margin-top: 12px; }
.row { display: flex; justify-content: space-between; gap: 12px; width: 100%; padding: 10px 4px; border: 0; border-bottom: 1px solid var(--border); background: none; text-align: left; }
.row:hover { background: var(--chip-bg); }

/* Buttons */
.primary { border: 0; border-radius: 10px; padding: 10px 16px; background: var(--blue-btn); color: #fff; font-weight: 600; text-decoration: none; }
.primary:hover { filter: brightness(1.08); }
.small { border: 1px solid var(--border); border-radius: 8px; padding: 5px 12px; background: var(--page-plane); font-size: 13px; font-weight: 600; white-space: nowrap; }
.small:hover { border-color: var(--blue); }
.small.primary { border-color: var(--blue-btn); background: var(--blue-btn); }
.small.danger { color: var(--critical-text); }
.link { border: 0; padding: 0; background: none; font-weight: 600; color: var(--blue-text); text-align: left; }
.link:hover { text-decoration: underline; }
.back { border: 0; padding: 0; background: none; color: var(--text-secondary); font-size: 14px; margin-bottom: 12px; }
.back:hover { color: var(--text-primary); }

/* Destination */
.dest-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.dest-head p { margin: 0; }
.badge { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; border: 1px solid currentColor; color: var(--warn-text); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; vertical-align: 4px; }
.summary { color: var(--text-secondary); margin: 16px 0 0; }
.months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; }
.months span { text-align: center; padding: 5px 0; border-radius: 6px; background: var(--chip-bg); color: var(--text-muted); font-size: 12px; font-weight: 600; }
.months .on { background: var(--aqua); color: #fff; }
.note { color: var(--text-secondary); font-size: 14px; margin: 8px 0 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 8px; margin: 16px 0 0; }
.stat { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--page-plane); }
.stat-v { display: block; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-l { display: block; font-size: 12px; color: var(--text-muted); line-height: 1.35; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; }
.tag { padding: 2px 10px; border-radius: 999px; background: var(--chip-bg); color: var(--text-secondary); font-size: 12px; }
.places li, .itinerary { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.places li.active { background: var(--chip-bg); margin: 0 -8px; padding: 10px 8px; border-radius: 8px; }
.places p, .itinerary p { margin: 2px 0 0; color: var(--text-secondary); font-size: 14px; }
.tips { margin: 0; padding-left: 18px; color: var(--text-secondary); }
.tips li + li { margin-top: 4px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
.facts dt { color: var(--text-muted); }
.facts dd { margin: 0; }
.book-links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 0; font-size: 13px; }
.book { color: var(--blue-text); font-weight: 600; text-decoration: none; }
.book:hover { text-decoration: underline; }
.book::after { content: " \2197"; }
.disclosure { margin: 12px 0 0; font-size: 12px; color: var(--text-muted); }

/* Trip */
.trip-fields { display: grid; gap: 10px; margin: 12px 0 20px; }
.stops li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.num { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--orange); color: #fff; font-size: 12px; font-weight: 700; line-height: 24px; text-align: center; }
.stop-main { flex: 1; min-width: 0; }
.stop-main p { margin: 0; }
.warn { margin-top: 6px !important; padding: 6px 10px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-text); font-size: 13px; }
.stop-tools { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; margin-right: auto; font-size: 13px; font-variant-numeric: tabular-nums; }
.stepper span { min-width: 64px; text-align: center; }
.stepper button, .icon { width: 30px; height: 30px; border: 0; background: none; border-radius: 8px; color: var(--text-secondary); }
.icon { border: 1px solid var(--border); }
.stepper button:hover:not(:disabled), .icon:hover:not(:disabled) { background: var(--chip-bg); }
button:disabled { opacity: .35; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.checklist label { display: flex; gap: 10px; padding: 6px 0; color: var(--text-secondary); }
.checklist span { margin: 0; font-size: 14px; color: inherit; }
.checklist input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--aqua); }

.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 20px); transform: translateX(-50%); margin: 0; padding: 8px 16px; border-radius: 999px; background: var(--text-primary); color: var(--page-plane); font-size: 14px; z-index: 5; }

@media print {
  body { height: auto; display: block; }
  .app-bar .tabs, .ghost-btn, .actions, .stop-tools button, .toast, .credits { display: none !important; }
  .stepper { border: 0; }
}
button.tag { border: 0; }

/* The guide pages (docs/guides/, written by scripts/build-pages.mjs): one scrolling column, no map */
body.page { display: block; height: auto; min-height: 100%; background: var(--surface-1); }
.page main { max-width: 720px; margin: 0 auto; padding: 24px 16px calc(env(safe-area-inset-bottom) + 48px); }
.page h3 { margin: 0; font-size: 16px; }
.page .cards a { text-decoration: none; color: inherit; }
.page .cta { display: inline-block; margin-top: 16px; }
button.tag:hover { color: var(--text-primary); }
.builder { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin: 0 0 20px; }
.builder summary { font-weight: 600; cursor: pointer; }
.builder .note { margin: 8px 0 12px; }
.builder .chips { margin: 0 0 12px; }
.primary:disabled { opacity: 0.5; cursor: default; filter: none; }
.leg { margin: 0 0 6px; font-size: 13px; color: var(--text-secondary); }
.leg a { color: var(--blue-text); }
/* Four menu items don't fit beside the name on a phone: keep the logo, drop the words */
@media (max-width: 520px) { .brand > span:last-child { display: none; } }
