/* ==========================================================================
   base.css: shared by every page.
   Theme tokens below are defaults (the pink scrapbook look). Each trip page
   overrides them in a small <style> block in its own <head>.
   ========================================================================== */

:root {
  color-scheme: light;
  --bg: #fff4ea;          /* page background */
  --card: #ffffff;        /* cards, tickets */
  --paper: #fffdf9;       /* polaroid frames */
  --ink: #3d0816;         /* text, outlines */
  --soft: #6e2438;        /* secondary text */
  --muted: #8c5a67;       /* ticked items */
  --tint: #ffd3e4;        /* chips, date boxes, kickers */
  --hairline: #e9a3bf;    /* dashed dividers, input borders */
  --accent: #d81b72;      /* highlights, countdown, focus */
  --title: #c41e33;       /* headline colour, primary buttons */
  --mint: #d4f3df;        /* "moving" notes */
  --butter: #fff1bd;      /* tips, word of the day */
  --tape: rgba(255, 156, 198, .85);
  --shadow: rgba(61, 8, 22, .25);
  --gingham: rgba(212, 42, 60, .55);
  --gingham-base: #ff9cc6;
}

*, *::before, *::after { box-sizing: border-box; min-width: 0; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 Outfit, system-ui, sans-serif; overflow-x: clip; }
h1, h2, h3 { font-family: Fraunces, Georgia, serif; font-variation-settings: "SOFT" 100; font-weight: 600; line-height: 1.08; margin: 0; text-wrap: balance; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ---------- Gingham lid (top band with scalloped edge) ---------- */
.lid {
  position: relative;
  padding: calc(env(safe-area-inset-top) + 16px) 16px 46px;
  background:
    repeating-linear-gradient(90deg, var(--gingham) 0 22px, transparent 22px 44px),
    repeating-linear-gradient(0deg, var(--gingham) 0 22px, transparent 22px 44px),
    var(--gingham-base);
  -webkit-mask: radial-gradient(14px at 50% calc(100% - 14px), #000 98%, #0000) 50% 100% / 28px 100% repeat-x, linear-gradient(#000 0 0) top / 100% calc(100% - 14px) no-repeat;
          mask: radial-gradient(14px at 50% calc(100% - 14px), #000 98%, #0000) 50% 100% / 28px 100% repeat-x, linear-gradient(#000 0 0) top / 100% calc(100% - 14px) no-repeat;
}
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 auto 14px; }
.logo { display: inline-block; font-family: Fraunces, serif; font-weight: 700; font-size: 19px; line-height: 1.2; color: var(--title); background: #fff; border: 2px solid var(--ink); border-radius: 12px; padding: 4px 12px; box-shadow: 0 3px 0 var(--ink); text-decoration: none; margin: 0; }
.pill { background: #fff; color: var(--ink); border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--ink); border-radius: 99px; padding: 4px 12px; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }

/* ---------- Building blocks ---------- */
.card { background: var(--card); border: 2px solid var(--ink); border-radius: 18px; padding: 16px; margin-bottom: 12px; }
.kicker { display: inline-block; background: var(--tint); color: var(--ink); font-size: 14px; font-weight: 600; border-radius: 6px; padding: 2px 8px; margin-bottom: 10px; }
.sec { margin: 30px 0 10px; font-size: 26px; }
.sub { color: var(--soft); margin: 0 0 12px; font-size: 15px; }
.note { font-size: 14px; color: var(--soft); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border: 2px solid var(--ink); border-radius: 14px; background: var(--title); color: #fff; font-weight: 600; padding: 0 18px; text-decoration: none; box-shadow: 0 4px 0 var(--ink); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.ghost { min-height: 48px; border: 2px solid var(--ink); border-radius: 14px; background: var(--card); font-weight: 600; padding: 0 16px; }

/* Checkbox rows (packing lists, day plans) */
.chk { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; min-height: 44px; cursor: pointer; }
.chk input { appearance: none; -webkit-appearance: none; width: 24px; height: 24px; flex: none; border: 2px solid var(--ink); border-radius: 7px; margin: 0; display: grid; place-items: center; background: var(--card); }
.chk input:checked { background: var(--accent); border-color: var(--accent); }
.chk input:checked::after { content: ""; width: 6px; height: 11px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg) translate(-1px, -1px); }
.chk input:checked + span { text-decoration: line-through; color: var(--muted); }

/* Taped polaroid */
.pola { all: unset; box-sizing: border-box; display: block; background: var(--paper); padding: 9px 9px 0; border-radius: 3px; box-shadow: 0 0 0 2px var(--ink), 0 6px 0 var(--shadow); transform: rotate(var(--r, 0deg)); position: relative; }
.pola::before { content: ""; position: absolute; top: -10px; left: 50%; width: 56px; height: 18px; margin-left: -28px; background: var(--tape); transform: rotate(-4deg); border-radius: 2px; }
.pola svg, .pola img { width: 100%; height: auto; aspect-ratio: 6 / 5; object-fit: cover; border-radius: 2px; box-shadow: 0 0 0 2px var(--ink); }
.cap { font-family: Caveat, cursive; font-weight: 700; font-size: 24px; color: var(--ink); text-align: center; line-height: 1; padding: 8px 0 6px; }
.cap small { display: block; font-family: Outfit, sans-serif; font-size: 13px; font-weight: 600; color: var(--soft); padding-top: 4px; }
.cap .local { font-size: 20px; color: var(--accent); }

/* Footer */
.foot { text-align: center; padding: 26px 16px 34px; color: var(--soft); font-size: 15px; }
.foot .sig { font-family: Caveat, cursive; font-size: 26px; color: var(--accent); display: block; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Low-key way back home from a trip page: a small chevron inside the logo pill */
.logo-back { display: inline-flex; align-items: center; gap: 6px; padding-left: 8px; }
.logo-back h1 { font: inherit; margin: 0; }
.logo-back .back { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--tint); color: var(--ink); flex: none; transition: transform .15s; }
.logo-back .back svg { width: 14px; height: 14px; }
.logo-back:hover .back, .logo-back:focus-visible .back { transform: translateX(-2px); }

/* Small status note (offline ready, etc.) */
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 50; transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: #fff; font-weight: 600; font-size: 14px; padding: 10px 16px; border-radius: 99px; box-shadow: 0 4px 0 var(--shadow); transition: opacity .25s, transform .25s; white-space: nowrap; pointer-events: none; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
