/* Dad-Girls Roadtrip — Warm Coastal Design System */

:root {
  /* Sun-bleached coastal palette */
  --sand-50:  #fbf5ec;
  --sand-100: #f5ebd9;
  --sand-200: #ead9b8;
  --sand-300: #d9c195;
  --sand-400: #c4a574;

  --terra-300: #e8a076;   /* sunset peach */
  --terra-500: #d97556;   /* clay */
  --terra-700: #a84f34;   /* burnt sienna */

  --ocean-200: #a9c8c5;
  --ocean-400: #6a9a98;
  --ocean-600: #3f6c6c;
  --ocean-800: #23434a;

  --sun-300:   #f4c86a;
  --sun-500:   #e89a3b;

  --ink:       #2a2219;
  --ink-soft:  #5a4a3a;
  --ink-muted: #8a7863;

  --paper:     #fbf5ec;
  --paper-2:   #f5ebd9;
  --line:      rgba(42, 34, 25, 0.12);
  --line-soft: rgba(42, 34, 25, 0.06);

  --shadow-sm: 0 1px 2px rgba(42, 34, 25, 0.06), 0 2px 6px rgba(42, 34, 25, 0.04);
  --shadow-md: 0 2px 8px rgba(42, 34, 25, 0.08), 0 8px 24px rgba(42, 34, 25, 0.06);
  --shadow-lg: 0 8px 32px rgba(42, 34, 25, 0.14);

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;

  --font-display: 'Fraunces', 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Inter Tight', 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --app-header-h: 66px;
  --app-tabbar-h: 58px;
}

/* Override defaults — using these fonts intentionally for warm coastal editorial feel */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.005em;
}

/* Mobile-first — designed for iPhone. Desktop gets a framed phone view. */

.app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  height: 100dvh;
  background: var(--paper);
  position: relative;
  overflow: hidden;
  /* Disable browser scroll anchoring — it can fight programmatic scrolls when content
     shifts (e.g. images loading). Critical for reliable section navigation. */
  overflow-anchor: none;
  /* Flex column so the bottom tabbar always sits at the bottom of the phone frame,
     even when page content is shorter than the viewport (Map / Tickets / Budget). */
  display: flex;
  flex-direction: column;
}
.app > .tabbar { margin-top: auto; }
.app-main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-top: 0;
  padding-bottom: 0;
}

@media (min-width: 500px) {
  body {
    background: linear-gradient(180deg, #1a1410 0%, #2a1f17 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 0;
  }
  /* iPhone 15 / 15 Pro Max mockup frame — 430x932. Width stays at 430 on any
     desktop window (browser-window width permitting); height adjusts up to 932
     and scrolls internally beyond. The phone shape stays consistent across all
     5 tabs because both dimensions are independent of which tab is showing. */
  .app {
    width: min(430px, 100vw);
    height: min(932px, calc(100vh - 48px));
    min-height: 600px;
    border-radius: 44px;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 0 0 10px #0b0907, 0 0 0 12px #2a211a, 0 40px 80px rgba(0,0,0,0.5);
    scrollbar-width: thin;
    scrollbar-color: rgba(42,34,25,0.3) transparent;
  }
  .app::-webkit-scrollbar { width: 6px; }
  .app::-webkit-scrollbar-thumb { background: rgba(42,34,25,0.3); border-radius: 3px; }
  .app::-webkit-scrollbar-track { background: transparent; }
  .app-main {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: 0;
    padding-bottom: 0;
  }

  /* Sticky elements scroll within the .app container on desktop */
  .statusbar, .day-nav, .page-header { position: sticky; left: auto; width: 100%; transform: none; }
}

/* ====== Typography ====== */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.02em;
  line-height: 1;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.num {
  font-family: var(--font-display);
  font-variant-numeric: lining-nums;
  font-weight: 300;
}

/* ====== Buttons / chips ====== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  background: var(--sand-100);
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
.chip.warn {
  background: #fde9dc;
  color: var(--terra-700);
  border-color: rgba(168, 79, 52, 0.22);
}
.chip.ocean {
  background: #dceae9;
  color: var(--ocean-800);
  border-color: rgba(63, 108, 108, 0.18);
}

/* ====== Hero / Status bar area ====== */
.statusbar {
  height: 44px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  position: sticky;
  top: 0;
  z-index: 100;
  /* Fully opaque so scrolled content can't bleed through to the iPhone notch area */
  background: var(--sand-100);
  border-bottom: 1px solid rgba(42, 34, 25, 0.06);
}
.statusbar-glyphs { display: inline-flex; gap: 6px; align-items: center; }

/* ====== Day navigation pills — sticky header at the very top of the Itinerary ====== */
.day-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  min-height: calc(var(--app-header-h) + env(safe-area-inset-top, 0px));
  background: #ead9b8 !important;
  padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  align-items: center;
  border-bottom: 1px solid rgba(42, 34, 25, 0.18);
  box-shadow: 0 2px 6px rgba(42, 34, 25, 0.08);
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.day-nav::-webkit-scrollbar { display: none; }

.day-pill {
  flex-shrink: 0;
  padding: 11px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(42, 34, 25, 0.18);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-body);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
/* Chrome drops padding-right inside flex+overflow-x containers; this margin guarantees
   the last pill always has 16px of breathing room from the right edge of the frame. */
.day-pill:last-child { margin-right: 16px; }
.day-pill .pill-num {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}
.day-pill.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.day-pill.active .pill-num { color: var(--sand-300); }

/* ====== Section anchor element (negative-offset anchor pattern) ======
   The anchor span is positioned ABSOLUTELY at top: -72px inside its position:relative
   parent (Cover or DaySection). When scrollIntoView({block:'start'}) is called on the
   anchor, the browser scrolls the anchor to viewport top — which physically places the
   parent section's top exactly 72px below viewport top, i.e. flush under the sticky
   header. No JS math, no scroll-margin-top quirks, no race conditions. */
.section-anchor {
  position: absolute;
  /* -84px = 72px header + 12px breathing room. Anchor sits this far above section top,
     so when scrollIntoView lands the anchor at viewport y=0, section top sits at y=84,
     leaving a 12px clean gap between header bottom (y=72) and section. */
  top: -84px;
  left: 0;
  width: 1px;
  height: 1px;
  visibility: hidden;
  pointer-events: none;
}
section.day {
  /* 8px top padding lets the hero scene sit close under the header on a section jump */
  padding: 8px 20px 32px;
  position: relative; /* required so .section-anchor anchors to this element */
}

/* ====== Illustrated scene banners ====== */
.scene {
  height: 180px;
  border-radius: var(--r-lg);
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
  isolation: isolate;
}
.scene .scene-label {
  position: absolute;
  top: 14px;
  left: 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  mix-blend-mode: screen;
  z-index: 5;
}
.scene .scene-temp {
  position: absolute;
  top: 14px;
  right: 16px;
  font-family: var(--font-display);
  font-size: 24px;
  color: rgba(255,255,255,0.95);
  z-index: 5;
  font-weight: 300;
}

/* ====== Day header ====== */
.day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}
.day-head .d-num {
  font-family: var(--font-display);
  font-size: 72px;
  font-weight: 300;
  line-height: 0.9;
  font-style: italic;
  color: var(--terra-500);
}
.day-head .d-date {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  text-transform: uppercase;
  text-align: right;
}
.day-title {
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.05;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 4px 0 6px;
  color: var(--ink);
}
.day-subtitle {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.45;
  margin-bottom: 18px;
  max-width: 34ch;
}

/* ====== Drive callout ====== */
.drive {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--sand-100), var(--sand-50));
  border: 1px solid var(--line);
  margin-bottom: 20px;
  position: relative;
}
.drive-route {
  flex: 1;
  min-width: 0;
}
.drive-route .from-to {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.drive-route .via {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
  margin-top: 2px;
}
.drive-stat {
  text-align: right;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}
.drive-stat .time {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  color: var(--terra-700);
  line-height: 1;
}
.drive-stat .dist {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-muted);
  margin-top: 3px;
  letter-spacing: 0.04em;
}

/* ====== Section label ====== */
.sec-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 10px;
}
.sec-label .bar {
  height: 1px;
  flex: 1;
  background: var(--line);
}
.sec-label .label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ====== Cards (meals / hotel / attractions) ====== */
.card {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: white;
  margin-bottom: 10px;
  overflow: hidden;
  transition: all 0.2s ease;
}
.card summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}
.card summary::-webkit-details-marker { display: none; }
.card summary::after {
  content: '';
  width: 10px;
  height: 10px;
  border-right: 1.5px solid var(--ink-muted);
  border-bottom: 1.5px solid var(--ink-muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-left: auto;
  margin-top: -4px;
}
.card[open] summary::after { transform: rotate(-135deg); margin-top: 2px; }

.card .meal-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 300;
  font-style: italic;
  color: white;
}
.meal-icon.lunch { background: linear-gradient(135deg, var(--sun-300), var(--terra-300)); }
.meal-icon.dinner { background: linear-gradient(135deg, var(--terra-500), var(--terra-700)); }
.meal-icon.hotel { background: linear-gradient(135deg, var(--ocean-400), var(--ocean-800)); }
.meal-icon.attr { background: linear-gradient(135deg, var(--sand-300), var(--sand-400)); color: var(--ink); }

.card .meal-head {
  flex: 1;
  min-width: 0;
}
.card .meal-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.card .meal-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
  margin-top: 2px;
  display: flex;
  gap: 10px;
}

.card .meal-body {
  padding: 0 16px 16px 66px;
  border-top: 1px dashed var(--line);
  margin-top: 0;
  padding-top: 12px;
}
.options {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.option .o-idx {
  font-family: var(--font-display);
  font-size: 22px;
  font-style: italic;
  color: var(--terra-500);
  line-height: 1;
  flex-shrink: 0;
  width: 22px;
  font-weight: 300;
}
.option .o-body { flex: 1; min-width: 0; }
.option .o-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.option .o-desc {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.45;
  margin-top: 2px;
}
.option .o-meta {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.star {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--terra-700);
  font-weight: 600;
}
.star::before {
  content: '★';
  font-size: 11px;
  color: var(--sun-500);
}

/* ====== Contact links ====== */
.links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink-soft);
  background: var(--paper-2);
  border: 1px solid var(--line);
  transition: all 0.15s ease;
  white-space: nowrap;
}
.link-btn:hover, .link-btn:active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.link-btn .lb-ico {
  font-size: 11px;
  line-height: 1;
}
.link-btn.phone { color: var(--terra-700); border-color: rgba(168,79,52,0.2); background: #fde9dc; }
.link-btn.phone:hover { background: var(--terra-700); color: white; border-color: var(--terra-700); }
.link-btn.web { color: var(--ocean-800); border-color: rgba(63,108,108,0.2); background: #dceae9; }
.link-btn.web:hover { background: var(--ocean-800); color: white; border-color: var(--ocean-800); }
.link-btn.map { }

/* Hotel card special styling */
.hotel-card {
  background: linear-gradient(135deg, #f5ebd9 0%, #fbf5ec 100%);
  border: 1px solid var(--line);
  padding: 18px;
  border-radius: var(--r-md);
  margin-top: 10px;
}
.hotel-card .h-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ocean-600);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.hotel-card .h-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-style: italic;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.hotel-card .h-location {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 3px;
}
.hotel-card .h-stats {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(42, 34, 25, 0.1);
}
.hotel-card .h-stat {
  flex: 1;
}
.hotel-card .h-stat .h-stat-val {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 300;
  color: var(--ink);
  line-height: 1;
}
.hotel-card .h-stat .h-stat-lbl {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--ink-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 3px;
}
.hotel-card .h-note {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 12px;
  font-style: italic;
  line-height: 1.4;
}

/* ====== Map section ====== */
.map-wrap {
  margin: 30px 16px 0;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  position: relative;
  background: var(--sand-100);
}
.map-header {
  padding: 16px 18px 12px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  background: white;
  border-bottom: 1px solid var(--line-soft);
}
.map-header .mh-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-style: italic;
  font-weight: 400;
  line-height: 1;
}
.map-header .mh-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
#route-map {
  height: 420px;
  width: 100%;
  background: #e9dec6;
  position: relative;
}
.map-legend {
  padding: 10px 16px 14px;
  background: white;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  border-top: 1px solid var(--line-soft);
}
.legend-pin {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-soft);
}
.legend-pin .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--terra-500);
  border: 1.5px solid white;
  box-shadow: 0 0 0 1px var(--terra-700);
}

/* Map placeholder when no key */
.map-placeholder {
  padding: 40px 24px;
  text-align: center;
  background: repeating-linear-gradient(45deg, var(--sand-100) 0 10px, var(--sand-200) 10px 20px);
}
.map-placeholder .mp-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 20px;
  color: var(--ink);
  margin-bottom: 6px;
}
.map-placeholder .mp-desc {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.5;
  max-width: 36ch;
  margin: 0 auto;
}
.map-placeholder code {
  font-family: var(--font-mono);
  background: var(--paper);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
  border: 1px solid var(--line);
}

/* ====== Cover / Hero ====== */
.cover {
  padding: 8px 20px 24px;
  position: relative;
}
.cover-art {
  height: 280px;
  border-radius: var(--r-xl);
  position: relative;
  overflow: hidden;
  margin-bottom: 22px;
  box-shadow: var(--shadow-lg);
  isolation: isolate;
}
.cover-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  font-size: 44px;
  line-height: 0.95;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.cover-title .amp {
  color: var(--terra-500);
  font-weight: 300;
}
.cover-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--terra-700);
  margin-bottom: 14px;
}
.cover-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.cover-meta-item .val {
  font-family: var(--font-display);
  font-size: 22px;
  font-style: italic;
  font-weight: 400;
  color: var(--ink);
  line-height: 1;
}
.cover-meta-item .lbl {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 5px;
}

/* ====== Footer ====== */
.tripfoot {
  text-align: center;
  padding: 40px 20px 50px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.tripfoot .heart { color: var(--terra-500); }

/* Smooth scroll */
html { scroll-behavior: smooth; }

/* Fade-in helper */
.fade-in {
  animation: fadeIn 0.4s ease both;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
