/* Scotland 2026 — dark Speyside theme */
:root {
  --bg: #14100c;
  --bg-raised: #1f1913;
  --bg-card: #261e16;
  --line: #3a2f24;
  --text: #efe6d8;
  --text-dim: #a89a86;
  --amber: #e0a63c;
  --amber-soft: #f2c877;
  --urgent: #e06248;
  --ok: #6fbf8b;
  --radius: 14px;
  font-size: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  line-height: 1.55;
}
a { color: var(--amber-soft); }
.muted { color: var(--text-dim); font-size: 0.9em; }

/* ---------- hero ---------- */
.hero {
  background:
    radial-gradient(ellipse 90% 70% at 70% 10%, rgba(224, 166, 60, 0.16), transparent 60%),
    radial-gradient(ellipse 70% 60% at 20% 90%, rgba(62, 155, 110, 0.12), transparent 60%),
    linear-gradient(180deg, #191410, var(--bg));
  border-bottom: 1px solid var(--line);
  padding: 3.5rem 1.25rem 2.5rem;
  text-align: center;
}
.hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  color: var(--text-dim);
}
.hero h1 { font-size: clamp(2.6rem, 8vw, 4.5rem); letter-spacing: -0.02em; margin: 0.35rem 0 0.2rem; }
.hero .accent { color: var(--amber); }
.hero-sub { color: var(--amber-soft); font-size: 1.1rem; }
.countdown { margin-top: 1rem; font-size: 1rem; color: var(--text-dim); }
.countdown strong { color: var(--text); font-variant-numeric: tabular-nums; }

.day-nav { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
.day-pill {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  border-left: 4px solid var(--pill-color, var(--amber));
}
.day-pill:hover { background: var(--bg-card); }

/* ---------- at a glance ---------- */
.glance { padding: 1.5rem 1.25rem 0; max-width: 1080px; margin: 0 auto; }
.glance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0.9rem; }
.glance-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.glance-card h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); margin-bottom: 0.4rem; }
.glance-card .big { font-size: 1.25rem; font-weight: 700; color: var(--amber-soft); }

/* ---------- sections ---------- */
.section { max-width: 1080px; margin: 0 auto; padding: 2.75rem 1.25rem 0; }
.section h2 { font-size: 1.7rem; margin-bottom: 0.4rem; }
.section-lede { color: var(--text-dim); max-width: 62ch; margin-bottom: 1.25rem; }

/* ---------- map ---------- */
#map {
  height: 480px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-raised);
}
.map-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; margin-top: 0.75rem; font-size: 0.85rem; color: var(--text-dim); }
.legend-item { display: inline-flex; align-items: center; gap: 0.45rem; }
.legend-swatch { width: 22px; height: 0; border-top: 4px solid; border-radius: 2px; }
.legend-swatch.dashed { border-top-style: dashed; }
.legend-swatch.dotted { border-top-style: dotted; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--bg-card); color: var(--text); }
.stop-dot {
  display: block; width: 100%; height: 100%; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

/* ---------- day cards ---------- */
.day-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 1.4rem;
  overflow: hidden;
  border-top: 4px solid var(--day-color, var(--amber));
}
.day-head { padding: 1.2rem 1.3rem 0.9rem; display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: baseline; justify-content: space-between; }
.day-head-main { min-width: 0; }
.day-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--day-color, var(--amber)); font-weight: 700; }
.day-head h3 { font-size: 1.35rem; margin-top: 0.1rem; }
.day-theme { color: var(--text-dim); font-size: 0.92rem; }
.day-wx { text-align: right; font-size: 0.9rem; color: var(--text-dim); min-width: 130px; }
.day-wx .wx-icon { font-size: 1.6rem; display: block; }
.day-wx .wx-temp { color: var(--text); font-weight: 700; }

.route-choice { margin: 0 1.3rem 0.9rem; padding: 0.9rem 1rem; background: var(--bg-raised); border: 1px solid var(--line); border-radius: 10px; }
.route-choice .hint { font-size: 0.85rem; color: var(--amber-soft); margin-bottom: 0.6rem; }
.route-option { padding: 0.45rem 0; border-top: 1px solid var(--line); font-size: 0.92rem; }
.route-option:first-of-type { border-top: 0; }
.route-option strong { color: var(--text); }
.route-option .stats { color: var(--amber-soft); font-size: 0.82rem; white-space: nowrap; }
.route-option p { color: var(--text-dim); font-size: 0.88rem; }

.timeline { list-style: none; padding: 0.4rem 1.3rem 1.1rem; }
.timeline li { display: grid; grid-template-columns: 4.2rem 1fr; gap: 0.9rem; padding: 0.55rem 0; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; }
.tl-time { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--day-color, var(--amber)); font-size: 0.92rem; padding-top: 0.1rem; }
.tl-title { font-weight: 600; }
.tl-detail { color: var(--text-dim); font-size: 0.9rem; margin-top: 0.15rem; }

.badge { display: inline-block; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; border-radius: 999px; padding: 0.15rem 0.55rem; margin-left: 0.5rem; vertical-align: middle; }
.badge.confirmed { background: rgba(111, 191, 139, 0.15); color: var(--ok); border: 1px solid rgba(111, 191, 139, 0.4); }
.badge.urgent { background: rgba(224, 98, 72, 0.15); color: var(--urgent); border: 1px solid rgba(224, 98, 72, 0.5); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: 0.55; } }

.day-shapes { margin: 0 1.3rem 0.9rem; display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.day-shape { background: var(--bg-raised); border: 1px solid var(--line); border-radius: 10px; padding: 0.7rem 0.85rem; font-size: 0.88rem; }
.day-shape strong { display: block; }
.day-shape .muted { display: block; margin-bottom: 0.2rem; }

.day-tips { margin: 0 1.3rem 1.2rem; padding: 0.7rem 0.95rem; border-left: 3px solid var(--day-color, var(--amber)); background: var(--bg-raised); border-radius: 0 10px 10px 0; font-size: 0.88rem; color: var(--text-dim); }
.day-tips li { margin-left: 1rem; }

/* ---------- weather ---------- */
.wx-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 0.9rem; }
.wx-card { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.wx-card h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.wx-row { display: grid; grid-template-columns: 3.4rem 1.7rem 1fr auto; gap: 0.5rem; align-items: center; padding: 0.32rem 0; border-top: 1px solid var(--line); font-size: 0.88rem; }
.wx-row:first-of-type { border-top: 0; }
.wx-row .d { color: var(--text-dim); font-weight: 600; }
.wx-row .desc { color: var(--text-dim); }
.wx-row .t { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.wx-row .t .lo { color: var(--text-dim); font-weight: 400; }
.wx-row.trip-day { background: rgba(224, 166, 60, 0.07); margin: 0 -0.5rem; padding-left: 0.5rem; padding-right: 0.5rem; border-radius: 6px; }
.wx-meta { font-size: 0.78rem; color: var(--text-dim); margin-top: 0.55rem; }

.midge-meter { display: inline-block; font-size: 0.72rem; font-weight: 700; border-radius: 999px; padding: 0.1rem 0.5rem; }
.midge-low { background: rgba(111, 191, 139, 0.15); color: var(--ok); }
.midge-medium { background: rgba(224, 166, 60, 0.15); color: var(--amber-soft); }
.midge-high { background: rgba(224, 98, 72, 0.18); color: var(--urgent); }
.midge-negligible { background: rgba(111, 191, 139, 0.1); color: var(--text-dim); }
.weather-error, .weather-loading { color: var(--text-dim); background: var(--bg-card); border: 1px dashed var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; }

/* ---------- midges ---------- */
.midge-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0.9rem; margin-bottom: 1rem; }
.midge-card { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; font-size: 0.92rem; }
.midge-card h3 { font-size: 0.95rem; margin-bottom: 0.4rem; color: var(--amber-soft); }
.midge-card ul { margin-left: 1.1rem; color: var(--text-dim); }
.table-wrap { overflow-x: auto; }
.midge-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.midge-table th, .midge-table td { text-align: left; padding: 0.55rem 0.9rem; border-top: 1px solid var(--line); }
.midge-table th { background: var(--bg-raised); border-top: 0; color: var(--text-dim); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
.midge-table td.note { color: var(--text-dim); }

/* ---------- checklists ---------- */
.checklist-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1.2rem; }
.check-col h3 { margin-bottom: 0.6rem; font-size: 1.05rem; }
.checks { list-style: none; }
.checks li { border-top: 1px solid var(--line); }
.checks li:first-child { border-top: 0; }
.checks label { display: flex; gap: 0.65rem; align-items: flex-start; padding: 0.5rem 0.2rem; cursor: pointer; font-size: 0.92rem; }
.checks input { accent-color: var(--amber); width: 1.1rem; height: 1.1rem; margin-top: 0.15rem; flex-shrink: 0; }
.checks li.done label { color: var(--text-dim); text-decoration: line-through; }
.checks li.urgent-item label { color: var(--urgent); font-weight: 600; }
.checks li.urgent-item.done label { color: var(--text-dim); font-weight: 400; }

/* ---------- good to know ---------- */
.know-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0.9rem; }
.know-card { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; font-size: 0.92rem; }
.know-card h3 { font-size: 0.98rem; margin-bottom: 0.3rem; }
.know-card p { color: var(--text-dim); }

/* ---------- footer ---------- */
.footer { text-align: center; padding: 3rem 1.25rem 2rem; color: var(--text-dim); font-size: 0.9rem; }

@media (max-width: 560px) {
  #map { height: 380px; }
  .day-wx { text-align: left; }
  .timeline { padding-left: 1rem; padding-right: 1rem; }
  .timeline li { grid-template-columns: 3.6rem 1fr; gap: 0.6rem; }
}
