:root {
  --bg: #f6f4ef;
  --card: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #0e7490;
  --accent-ink: #ffffff;
  --chip: #eef2f7;
  --radius: 16px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 8px 24px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  color: #fff;
  padding: 56px 20px 84px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(8, 47, 63, 0.55) 0%, rgba(8, 47, 63, 0.75) 100%),
    url("images/twelve-apostles.jpg") center 60% / cover no-repeat;
}
.hero h1 {
  margin: 0 0 6px;
  font-size: clamp(1.8rem, 6vw, 3rem);
  letter-spacing: -0.02em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}
.hero .sub {
  margin: 0 auto 18px;
  font-size: clamp(1rem, 3.5vw, 1.25rem);
  opacity: 0.95;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.hero-stats .stat {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(6px);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 600;
}
#countdown { font-variant-numeric: tabular-nums; }
.hero-cta {
  display: inline-block;
  text-decoration: none;
  margin-top: 18px;
  border: 0;
  background: #fff;
  color: #0b3948;
  font-weight: 800;
  font-size: 0.92rem;
  border-radius: 999px;
  padding: 11px 22px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.hero-cta:active { transform: scale(0.97); }

/* ---------- Bottom navigation ---------- */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 1500;
  display: flex;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
  flex: 1;
  text-align: center;
  padding: 13px 4px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
}
.bottom-nav a.active { color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }

body[data-page="home"],
body[data-page="itinerary"],
body[data-page="stays"],
body[data-page="info"] { padding-bottom: 66px; }

.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 18px; }
.page-head h1 { margin: 0; font-size: 1.45rem; letter-spacing: -0.01em; }
.page-content footer { padding-bottom: 10px; }

/* ---------- Day filter chips (in-flow, no sticking) ---------- */
.day-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 16px;
}
.day-btn {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: transform 0.1s ease;
}
.day-btn:active { transform: scale(0.96); }
.day-btn .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--dot, var(--accent));
}
.day-btn.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.today-badge {
  margin-left: 6px;
  background: #dcfce7; color: #166534;
  border-radius: 999px; padding: 1px 7px;
  font-size: 0.62rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.today-badge.big { font-size: 0.68rem; vertical-align: middle; }

/* ---------- Layout ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 14px 60px; }

/* ---------- Home ---------- */
.home-content {
  position: relative;
  margin-top: -30px;
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  padding-top: 18px;
}
.tile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.tile {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  text-decoration: none;
  color: var(--ink);
  display: grid;
  gap: 3px;
}
.tile-title { font-weight: 800; font-size: 1rem; }
.tile-sub { color: var(--muted); font-size: 0.8rem; }

.day-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 12px 14px;
  margin-bottom: 10px;
  text-decoration: none;
  color: var(--ink);
}
.dm-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--day-color); flex: 0 0 auto; }
.dm-text { flex: 1; min-width: 0; }
.dm-name { display: block; font-weight: 700; font-size: 0.92rem; }
.dm-date { display: block; color: var(--muted); font-size: 0.78rem; }
.dm-km { color: var(--muted); font-size: 0.8rem; font-weight: 700; white-space: nowrap; }

/* ---------- Info page ---------- */
.notes-card.standalone { border: 1px solid #fde68a; border-radius: var(--radius); margin-top: 14px; }
.link-list { display: grid; gap: 10px; }
.link-list a {
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 13px 15px;
  text-decoration: none;
  color: var(--ink);
  display: grid;
  gap: 2px;
}
.link-list a span { font-weight: 700; font-size: 0.94rem; }
.link-list a small { color: var(--muted); font-size: 0.78rem; }

.booked-badge {
  background: #dbeafe; color: #1e40af;
  font-size: 0.68rem; font-weight: 800;
  padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.03em;
}
section { margin-top: 28px; }
h2 {
  font-size: 1.35rem;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.section-sub { color: var(--muted); margin: 0 0 14px; font-size: 0.95rem; }

/* ---------- Map page ---------- */
.map-screen {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding-bottom: calc(48px + env(safe-area-inset-bottom));
}
.map-screen .page-head {
  padding: 14px 16px 8px;
  align-items: center;
}
.route-state { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.82rem; font-weight: 700; }
.route-swatch { width: 24px; height: 5px; border-radius: 999px; background: #2563eb; box-shadow: 0 0 0 2px #fff, 0 0 0 3px #d1d5db; }

.day-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 2px 16px 12px;
}
.day-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}
.day-toggle .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--day-color); }
.day-toggle.on {
  background: var(--day-color);
  border-color: var(--day-color);
  color: #fff;
}
.day-toggle.on .dot { background: #fff; }
.toggle-action {
  border: 1.5px solid var(--line);
  background: var(--chip);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

#map { flex: 1; width: 100%; z-index: 1; min-height: 200px; }

/* markers */
.pin {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  background: var(--pin);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.pin span { transform: rotate(45deg); font-size: 12px; line-height: 1; color: #fff; font-weight: 800; }
.pin.home-pin span { font-size: 17px; }

.pin-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--pin);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.cluster-pin {
  width: 34px; height: 34px; border-radius: 50%;
  background: #1f2937; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.85rem;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

/* popups */
.leaflet-popup-content-wrapper { border-radius: 14px; overflow: hidden; padding: 0; }
.leaflet-popup-content { margin: 0; width: 240px !important; }
.popup img { width: 100%; height: 120px; object-fit: cover; }
.popup .pbody { padding: 10px 12px 12px; font-family: inherit; }
.popup h3 { margin: 0 0 2px; font-size: 0.98rem; }
.popup .ptime { color: var(--accent); font-weight: 700; font-size: 0.78rem; }
.popup p { margin: 6px 0 8px; font-size: 0.82rem; line-height: 1.45; color: #374151; }
.popup .plinks { display: flex; flex-wrap: wrap; gap: 6px; }
.popup .plinks a {
  flex: 1 1 100px; text-align: center; text-decoration: none;
  background: var(--accent); color: #fff;
  border-radius: 8px; padding: 7px 0; font-size: 0.78rem; font-weight: 700;
}
.popup .plinks a.alt { background: var(--chip); color: var(--ink); }
.popup .plinks a.book { background: #0f766e; }

/* ---------- Itinerary ---------- */
.day-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  overflow: hidden;
  scroll-margin-top: 70px;
}
.day-head {
  padding: 13px 16px 11px;
  border-left: 6px solid var(--day-color, var(--accent));
}
.day-head .d-date { color: var(--muted); font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.day-head h3 { margin: 2px 0 6px; font-size: 1.2rem; }
.day-head .d-summary { margin: 0 0 10px; color: var(--muted); font-size: 0.92rem; }
.day-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.meta-chip {
  background: var(--chip); border-radius: 999px;
  padding: 5px 11px; font-size: 0.78rem; font-weight: 700;
}
.meta-chip.route-link {
  background: var(--day-color, var(--accent));
  color: #fff; text-decoration: none; cursor: pointer;
}

.timeline { list-style: none; margin: 0; padding: 0 16px 10px; }
.tl-item { border-top: 1px solid var(--line); padding: 10px 0 11px; }
.tl-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.tl-row h4 { margin: 0; font-size: 0.95rem; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.tl-time {
  color: var(--day-color, var(--accent));
  font-size: 0.75rem; font-weight: 800;
  text-align: right; flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}
.cat-label {
  color: var(--day-color, var(--accent));
  background: #f3f4f6;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tl-item p { margin: 3px 0 0; font-size: 0.83rem; color: #4b5563; line-height: 1.45; }
.tl-links { margin-top: 7px; display: flex; gap: 7px; flex-wrap: wrap; }
.tl-links a,
.tl-links button,
.accom-opt .o-links button {
  font-size: 0.76rem; font-weight: 700; text-decoration: none;
  background: var(--chip); border: 0; border-radius: 8px;
  padding: 5px 10px; color: var(--ink); cursor: pointer;
  font-family: inherit; line-height: inherit;
}
.tl-links .book-link { background: #0f766e; color: #fff; }
.booking-status {
  display: flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  margin-top: 8px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.72rem;
  font-weight: 800;
}
.booking-status strong { color: #7f1d1d; }
.booking-status.compact { margin: 0 0 8px; font-size: 0.68rem; }
.tl-photo {
  width: 100%;
  height: clamp(150px, 34vw, 250px);
  object-fit: cover;
  border-radius: 12px;
  margin-top: 9px;
}
.stay-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  background: #ecfeff;
  color: #155e75;
  border: 1px solid #a5f3fc;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
}
.stay-link strong { white-space: nowrap; font-size: 0.72rem; }

/* ---------- Accommodation ---------- */
.accom-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.accom-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 16px 14px;
}
.accom-card h3 { margin: 0; font-size: 1.05rem; }
.accom-card .nights { color: var(--muted); font-size: 0.8rem; font-weight: 700; margin: 2px 0 10px; }
.accom-opt { border-top: 1px solid var(--line); padding: 10px 0; scroll-margin-top: 16px; }
.o-photo {
  width: 100%; height: auto; max-width: 420px;
  border-radius: 12px; margin-bottom: 9px;
}
.accom-opt .o-name { font-weight: 700; font-size: 0.9rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pick-badge {
  background: #dcfce7; color: #166534;
  font-size: 0.68rem; font-weight: 800;
  padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.03em;
}
.accom-opt p { margin: 4px 0 8px; font-size: 0.82rem; color: #4b5563; line-height: 1.45; }
.accom-opt .o-links { display: flex; flex-wrap: wrap; gap: 8px; }
.accom-opt .o-links a {
  font-size: 0.75rem; font-weight: 700; text-decoration: none;
  background: var(--chip); border-radius: 8px; padding: 5px 10px; color: var(--ink);
}
.accom-opt .o-links .call-link { background: var(--accent); color: #fff; }

/* ---------- Secondary trip details ---------- */
.plan-details { display: grid; gap: 10px; }
.info-panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.info-panel summary { cursor: pointer; list-style: none; padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; gap: 16px; font-weight: 750; }
.info-panel summary::-webkit-details-marker { display: none; }
.info-panel summary::after { content: "+"; color: var(--muted); font-size: 1.3rem; line-height: 1; }
.info-panel[open] summary::after { content: "−"; }
.info-panel summary small { color: var(--muted); font-weight: 500; margin-left: auto; }
.panel-body { border-top: 1px solid var(--line); padding: 14px; }

/* ---------- Notes ---------- */
.notes-card {
  background: #fffbeb; padding: 14px 18px;
}
.notes-card h2 { font-size: 1.1rem; }
.notes-card ul { margin: 8px 0 0; padding-left: 20px; }
.notes-card li { font-size: 0.88rem; line-height: 1.55; margin-bottom: 6px; color: #44403c; }

footer {
  text-align: center; color: var(--muted);
  font-size: 0.8rem; padding: 26px 14px 40px;
}

@media (max-width: 560px) {
  .map-screen .page-head h1 { font-size: 1.2rem; }
  .stay-link { align-items: flex-start; flex-direction: column; gap: 3px; }
}
