/* AI Travel Planner — a vintage travel poster.
   Sun-faded cream, deep navy, sunset coral, sea teal and sun yellow. Bebas Neue
   for poster headlines, Work Sans for reading. The search is a ticket, the
   briefing a set of postcards. Every text colour meets WCAG AA (4.5:1) on its
   background in both themes; coral text is only ever set on paper or card. */

@font-face { font-family: "Bebas Neue"; src: url("fonts/bebas-neue-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Work Sans"; src: url("fonts/work-sans-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --paper: #f4e9d2;       /* page: poster stock */
  --card: #fbf5e6;        /* tickets and postcards */
  --sand: #ead9b8;        /* insets; never behind coral text */
  --ink: #1f2a44;         /* navy */
  --ink-soft: #3b4663;
  --muted: #5a6075;
  --rule: #dccaa6;
  --coral: #ab3c17;
  --coral-bright: #ec7a4f; /* fills behind navy text (5.1:1) */
  --teal: #17606e;
  --sun: #f2b134;
  --sky: #9fd0d8;
  --sea: #2f8a99;
  --on-coral: #ffffff;
  --band: #1f2a44;        /* header and footer */
  --band-ink: #f4e9d2;
  --band-accent: #f2b134;
  --error-bg: #f8dccf;
  --error-ink: #7d2a0e;
  --shadow: 4px 4px 0 var(--ink);

  --poster: "Bebas Neue", "Oswald", "Arial Narrow", Impact, sans-serif;
  --sans: "Work Sans", "Segoe UI", system-ui, sans-serif;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  color-scheme: light;
}

/* Dark: the same poster at night. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121a2b; --card: #1a2438; --sand: #24304a; --ink: #f4e9d2; --ink-soft: #ddd3bf; --muted: #c9c3b3; --rule: #33405e;
    --coral: #ff8f63; --coral-bright: #ff8f63; --teal: #6cc6d4; --sun: #f5c25a; --sky: #2b4a63; --sea: #1f6b78; --on-coral: #121a2b;
    --band: #0b111e; --error-bg: #3d2219; --error-ink: #ffc4ad; --shadow: 4px 4px 0 #000;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #121a2b; --card: #1a2438; --sand: #24304a; --ink: #f4e9d2; --ink-soft: #ddd3bf; --muted: #c9c3b3; --rule: #33405e;
  --coral: #ff8f63; --coral-bright: #ff8f63; --teal: #6cc6d4; --sun: #f5c25a; --sky: #2b4a63; --sea: #1f6b78; --on-coral: #121a2b;
  --band: #0b111e; --error-bg: #3d2219; --error-ink: #ffc4ad; --shadow: 4px 4px 0 #000;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.6 var(--sans);
  overflow-wrap: break-word;
}
::selection { background: var(--coral); color: var(--on-coral); }
h1, h2, h3, h4 { margin: 0; font-family: var(--poster); font-weight: 400; line-height: 1; letter-spacing: .02em; text-wrap: balance; }
p { margin: 0; }
a { color: var(--teal); text-decoration-thickness: 2px; text-underline-offset: .2em; }
a:hover { color: var(--coral); }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--gutter); top: -4rem; z-index: 1000; padding: .5rem .9rem; background: var(--coral); color: var(--on-coral); font-weight: 700; }
.skip:focus { top: .75rem; }
.wrap { width: min(100% - 2 * var(--gutter), 74rem); margin-inline: auto; }
main:focus { outline: none; }

/* Header: a navy band with the sea along its edge ---------------------------------- */
.top { background: var(--band); color: var(--band-ink); }
.top::after { content: ""; display: block; height: 8px; background: repeating-linear-gradient(90deg, var(--sun) 0 24px, var(--coral-bright) 24px 48px, var(--sea) 48px 72px); }
.top__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem; padding-block: .8rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--band-ink); text-decoration: none; font: 400 1.6rem/1 var(--poster); letter-spacing: .05em; }
.brand:hover { color: var(--band-accent); }
.brand svg { flex: none; width: 2.2rem; height: 2.2rem; }
.top__nav { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.25rem; font-size: .9375rem; }
.top__nav a, .top .linkish { color: var(--band-ink); text-decoration: none; }
.top__nav a:hover, .top .linkish:hover { color: var(--band-accent); }
.top .linkish { padding: .3rem .8rem; border: 1px solid rgba(244, 233, 210, .35); }

.linkish { padding: .25rem 0; border: 0; background: none; color: var(--teal); font-size: .9375rem; font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .2em; cursor: pointer; }
.linkish:hover, .linkish[aria-pressed="true"] { color: var(--coral); }

/* The poster ------------------------------------------------------------------------ */
.intro { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem 3rem; align-items: center; padding-block: clamp(2rem, 6vw, 3.5rem) clamp(1.25rem, 3vw, 2rem); }
@media (min-width: 52rem) { .intro { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }
.intro__kicker { color: var(--teal); font: 700 .8125rem/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; }
.intro h1 { margin-top: .6rem; font-size: clamp(3.4rem, 2.2rem + 6vw, 6.5rem); line-height: .9; color: var(--ink); text-shadow: 4px 4px 0 var(--coral-bright); }
.intro h1 span { display: block; color: var(--teal); text-shadow: 4px 4px 0 var(--sun); }
.intro__lede { max-width: 34rem; margin-top: 1.1rem; font-size: clamp(1.05rem, 1rem + .3vw, 1.2rem); line-height: 1.55; color: var(--ink-soft); }
.poster { margin: 0; width: 100%; max-width: 30rem; justify-self: center; border: 3px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); background: var(--sky); }
.poster svg { display: block; width: 100%; height: auto; }
@media (max-width: 51.99rem) { .poster { order: -1; max-width: none; justify-self: stretch; box-shadow: 5px 5px 0 var(--ink); } .poster svg { height: 7.5rem; } }

/* The question, as a ticket ----------------------------------------------------------- */
.ask {
  position: relative; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem 1.25rem;
  padding: 1.25rem 1.5rem; border: 2px solid var(--ink); background: var(--card); box-shadow: var(--shadow);
  /* punched notches on both ends */
  -webkit-mask: radial-gradient(circle .75rem at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle .75rem at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle .75rem at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle .75rem at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
}
.ask__field { display: grid; gap: .35rem; flex: 1 1 12rem; max-width: 20rem; }
.ask label { color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
select, .chat input {
  width: 100%; min-height: 2.9rem; padding: .5rem .8rem; border: 2px solid var(--ink); border-radius: 0; background: var(--paper);
  font-size: 1.05rem; font-weight: 500;
}
select { appearance: none; padding-right: 2.25rem; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 1.1rem) 55%, calc(100% - .8rem) 55%; background-size: .3rem .3rem; background-repeat: no-repeat; }
select:focus-visible, .chat input:focus-visible { outline-offset: 0; }
.ask__saved { margin-left: auto; align-self: center; }
.fine { max-width: 48rem; margin-top: 1rem; color: var(--muted); font-size: .8125rem; line-height: 1.5; }

.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 2.9rem; padding: .5rem 1.25rem .4rem;
  border: 2px solid var(--ink); background: var(--coral-bright); color: #1f2a44; box-shadow: 3px 3px 0 var(--ink);
  font: 400 1.35rem/1 var(--poster); letter-spacing: .06em; text-decoration: none; cursor: pointer; transition: transform .1s, box-shadow .1s;
}
.button:hover:not(:disabled) { background: var(--sun); }
.button:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.button--quiet { background: var(--card); color: var(--ink); font-size: 1.15rem; }
.button--quiet:hover:not(:disabled) { background: var(--sun); color: #1f2a44; }
.button:disabled { opacity: .55; cursor: progress; }

.status { min-height: 1.5rem; margin-top: 1.25rem; color: var(--ink-soft); font-size: .9375rem; }
.status--error { padding: .75rem 1rem; border: 2px solid currentColor; background: var(--error-bg); color: var(--error-ink); }
.status--busy::before { content: ""; display: inline-block; width: .75rem; height: .75rem; margin-right: .6rem; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 3px var(--coral-bright); animation: pulse 1.2s ease-in-out infinite; vertical-align: -.05em; }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .status--busy::before { animation: none; } .button { transition: none; } }

/* The briefing --------------------------------------------------------------------------- */
.result, .saved { padding-bottom: clamp(2.5rem, 6vw, 4rem); outline: none; }
.result__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; padding-block: 1.75rem 1.1rem; border-bottom: 4px double var(--ink); }
.kicker { display: inline-block; padding: .3rem .6rem; border: 2px solid var(--coral); color: var(--coral); font: 700 .75rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; transform: rotate(-2deg); }
.result h2, .saved h2 { margin-top: .6rem; font-size: clamp(2.8rem, 2rem + 3.5vw, 4.5rem); color: var(--ink); text-shadow: 3px 3px 0 var(--sun); }
.result__meta { margin-top: .5rem; color: var(--muted); font-size: .875rem; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; }

.result__body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem clamp(2rem, 5vw, 3.5rem); padding-top: 1.75rem; }
@media (min-width: 60rem) {
  .result__body { grid-template-columns: minmax(0, 1fr) minmax(0, 24rem); }
  .where { position: sticky; top: 1.5rem; align-self: start; }
}

/* Each section of the guide is a postcard. */
.guide { display: grid; gap: 1.5rem; max-width: 44rem; }
.guide h3 {
  margin: .75rem 0 -1.5rem; padding: .55rem 1rem .4rem; justify-self: start; position: relative; z-index: 1;
  background: var(--teal); color: var(--card); font-size: 1.7rem; letter-spacing: .05em; box-shadow: 3px 3px 0 var(--ink);
}
.guide h3:first-child { margin-top: 0; }
.guide ul { margin: 0; padding: 1.6rem 1.25rem .5rem; list-style: none; border: 2px solid var(--ink); background: var(--card); }
.guide li { padding: .7rem 0; border-bottom: 1px dashed var(--rule); color: var(--ink-soft); }
.guide li:last-child { border-bottom: 0; }
.guide li strong:first-child { display: block; color: var(--ink); font-size: 1.05rem; font-weight: 700; }
.guide li.sub { margin-left: 1rem; padding-left: .9rem; border-left: 3px solid var(--sun); border-bottom: 0; }
.guide li.sub strong:first-child { font-size: 1rem; }
.guide li:has(+ li.sub) { border-bottom: 0; }
.guide p { color: var(--ink-soft); }
.guide a { color: var(--teal); }
/* Sources: the small print on the back of the card */
.guide h3.sources { padding: 0; background: none; box-shadow: none; color: var(--muted); font: 700 .75rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; margin: .5rem 0 -1rem; }
.guide ul.sources { padding: .5rem 0 0; border: 0; background: none; }
.guide ul.sources li { padding: .2rem 0; border: 0; font-size: .8125rem; }

/* The map, as a framed photo with its own caption */
.map { height: 18rem; border: 10px solid var(--card); outline: 2px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); background: var(--sand); }
@media (min-width: 60rem) { .map { height: 22rem; } }
.map--empty { display: grid; place-items: center; padding: 1rem; color: var(--muted); font-size: .875rem; text-align: center; }
.places { margin: 1.5rem 0 0; padding: 0; list-style: none; font-size: .9375rem; }
.places li { border-bottom: 1px dashed var(--rule); }
.places button { display: flex; align-items: center; gap: .75rem; width: 100%; padding: .55rem 0; border: 0; background: none; text-align: left; font-weight: 500; cursor: pointer; }
.places button:hover { color: var(--coral); }
.places .n { flex: none; width: 1.6rem; height: 1.6rem; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: var(--coral-bright); color: #1f2a44; font: 400 1rem/1 var(--poster); }
.hint { margin-top: .6rem; color: var(--muted); font-size: .8125rem; }

/* Numbered map pins: coral, navy outline */
.pin { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: #ec7a4f; border: 2px solid #1f2a44; box-shadow: 2px 2px 0 #1f2a44; }
.pin span { transform: rotate(45deg); color: #1f2a44; font: 15px/1 var(--poster); }
.leaflet-container { font: .875rem var(--sans); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--card); color: var(--ink); border-radius: 0; }

/* Questions: a second ticket -------------------------------------------------------------- */
.chat { max-width: 44rem; margin-top: 2.5rem; padding: 1.25rem 1.5rem 1.5rem; border: 2px solid var(--ink); background: var(--card); box-shadow: var(--shadow); }
.chat h3 { font-size: 1.9rem; color: var(--teal); }
.chat__form { display: flex; gap: .6rem; margin-top: .9rem; }
.chat__form input { flex: 1; min-width: 0; }
.chat__answer { margin-top: 1rem; color: var(--ink-soft); }
.chat__answer > * + * { margin-top: .6rem; }
.chat__answer ul { padding-left: 1.2rem; }

/* Saved trips: a rack of postcards ---------------------------------------------------------- */
.trips { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 1rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.trips button {
  position: relative; display: grid; gap: .5rem; width: 100%; min-height: 7.5rem; padding: 1rem 1.1rem; align-content: space-between;
  border: 2px solid var(--ink); background: var(--card); box-shadow: var(--shadow); text-align: left; cursor: pointer; transition: transform .1s;
}
.trips button::after { content: ""; position: absolute; top: .75rem; right: .75rem; width: 2rem; height: 2.4rem; border: 2px dashed var(--coral); background: linear-gradient(var(--sun) 0 50%, var(--sea) 50%); opacity: .9; }
.trips button:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.trips button:hover .trips__name { color: var(--coral); }
.trips__name { padding-right: 2.75rem; font: 400 1.75rem/1 var(--poster); letter-spacing: .03em; }
.trips__date { color: var(--muted); font-size: .8125rem; }
.trips__empty { padding: 1rem 0; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .trips button { transition: none; } }

/* Footer ------------------------------------------------------------------------------------- */
.foot { margin-top: 1rem; background: var(--band); color: var(--band-ink); font-size: .9375rem; }
.foot::before { content: ""; display: block; height: 8px; background: repeating-linear-gradient(90deg, var(--sea) 0 24px, var(--coral-bright) 24px 48px, var(--sun) 48px 72px); }
.foot__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 2rem; padding-block: 1.75rem 2.25rem; }
.foot ul { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin: 0; padding: 0; list-style: none; }
.foot a { color: var(--band-accent); }
.foot a:hover { color: var(--band-ink); }

@media (max-width: 40rem) {
  .ask { padding-inline: 1.25rem; }
  .ask__field { max-width: none; }
  .ask .button { flex: 1 1 100%; }
  .ask__saved { margin-left: 0; }
}

@media print {
  body { background: #fff; color: #000; }
  .top, .intro, .ask, .fine, .status, .actions, .chat, .foot, .skip, .saved { display: none !important; }
  .result__body { display: block; }
  .guide h3 { background: none; color: #000; box-shadow: none; padding: 0; margin: 1rem 0 .25rem; }
  .guide ul { border: 0; padding: 0; background: none; }
  .map { height: 16rem; break-inside: avoid; box-shadow: none; }
}

@media (forced-colors: active) {
  .pin, .places .n { forced-color-adjust: none; }
  .guide h3 { forced-color-adjust: none; background: Canvas; color: CanvasText; border: 2px solid CanvasText; }
}

/* Leaflet controls in the poster's colours (and readable at night) */
.leaflet-bar a, .leaflet-bar a:hover { background: var(--card); color: var(--ink); border-bottom-color: var(--rule); }
.leaflet-bar { border: 2px solid var(--ink) !important; border-radius: 0 !important; box-shadow: none !important; }
.leaflet-bar a:first-child, .leaflet-bar a:last-child { border-radius: 0; }
.leaflet-container .leaflet-control-attribution { background: color-mix(in srgb, var(--card) 85%, transparent); color: var(--muted); }
.leaflet-control-attribution a { color: var(--ink-soft); }
