/* Kersttram Vlaanderen. One stylesheet, no inline styles (CSP style-src 'self'). */

@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/fraunces-500.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/fraunces-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/inter-600.woff2") format("woff2"); }

:root {
  --accent: #F2B441;

  --night: #0E1A2B;
  --night-2: #15263D;
  --deep: #0A1422;
  --line: #2A3D58;
  --line-strong: #5B6B84;
  --cream: #F6EFE2;
  --cream-line: #E4DAC6;
  --paper: #FFFFFF;
  --muted: #B4BFCE;
  --ink: #0E1A2B;
  --ink-muted: #4A5568;
  --tram-red: #C2363B;
  --live-green: #5BD08A;
  --bulb-green: #2E7D5B;
  --map-water: #1B3A5C;
  --map-bg: #102238;

  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1200px;
  --gutter: 32px;
  --radius-card: 18px;
  --radius-pill: 999px;
  --tap: 44px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--night);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 900px) { body { font-size: 18px; } }

img, svg { display: block; max-width: 100%; height: auto; }

h1, h2, h3 { margin: 0; line-height: 1.1; }
h1, h2 { font-family: var(--font-head); font-weight: 500; }
h1 { font-size: clamp(40px, 6vw, 68px); line-height: 1.04; }
h2 { font-size: clamp(30px, 4vw, 40px); }
h3 { font-size: 18px; font-weight: 600; }
p { margin: 0; }

a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.cream :focus-visible { outline-color: var(--ink); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
@media (max-width: 599px) { :root { --gutter: 16px; } }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 10;
  background: var(--accent); color: var(--ink); font-weight: 600;
  padding: 12px 18px; border-radius: var(--radius-pill); text-decoration: none;
}
.skip-link:focus { top: 12px; }

.label, .kicker, .footer-title {
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
}

.muted { color: var(--muted); }

/* Header */
.site-header { background: var(--night); border-bottom: 1px solid var(--line); }
.header-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 4px 24px; padding-top: 12px; padding-bottom: 12px;
}
.wordmark {
  display: inline-flex; align-items: baseline; gap: 10px; min-height: var(--tap); padding: 6px 0;
  color: var(--cream); text-decoration: none;
}
.wordmark-name { font-family: var(--font-head); font-size: clamp(21px, 2.4vw, 26px); font-weight: 600; letter-spacing: 0.005em; }
.nav-list { display: flex; flex-wrap: wrap; gap: 0 26px; margin: 0; padding: 0; list-style: none; }
.nav-list a {
  display: inline-flex; align-items: center; min-height: var(--tap);
  font-size: 15px; font-weight: 500; text-decoration: none;
  border-bottom: 2px solid transparent;
}
.nav-list a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

/* Status banner */
.status-banner { background: var(--accent); color: var(--ink); }
.banner-inner {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px;
  padding-top: 12px; padding-bottom: 12px; font-size: 15px; line-height: 1.45;
}
.banner-season { font-weight: 600; }
.banner-updated { margin-left: auto; font-size: 13px; }

/* Sections */
.section { padding: 80px 0; }
@media (max-width: 599px) { .section { padding: 48px 0; } }
.cream { background: var(--cream); color: var(--ink); }
.cream a:hover { color: var(--tram-red); }
.night-2 { background: var(--night-2); }
.section h2 { margin-bottom: 8px; }
.section-lead { margin-bottom: 40px; font-size: 17px; color: var(--ink-muted); }
.night-2 h2 { margin-bottom: 28px; }

.lead { font-size: 18px; line-height: 1.65; color: var(--muted); max-width: 640px; }
.cream .lead { color: var(--ink-muted); }

/* Hero */
.hero-inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 48px 56px;
  padding-top: 72px; padding-bottom: 88px;
}
@media (max-width: 599px) { .hero-inner { padding-top: 40px; padding-bottom: 48px; } }
.hero-text, .hero-art { flex: 1 1 420px; min-width: 0; }
.kicker { margin-bottom: 18px; color: var(--accent); font-weight: 600; letter-spacing: 0.16em; font-size: 13px; }
.hero h1 { margin-bottom: 22px; }
.hero .lead { margin-bottom: 36px; max-width: 520px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 50px;
  padding: 12px 26px; border-radius: var(--radius-pill);
  font-size: 16px; font-weight: 600; text-decoration: none;
}
.btn-primary { background: var(--accent); color: var(--ink); }
.btn-primary:hover { color: var(--ink); background: var(--cream); }
.btn-ghost { border: 1px solid var(--line-strong); color: var(--cream); }
.btn-ghost:hover { border-color: var(--accent); }

/* Tram illustration */
.tram-art .stars circle { fill: var(--cream); opacity: 0.55; }
.tram-art .wire { stroke: var(--line); stroke-width: 2; }
.tram-art .pantograph { fill: none; stroke: #8FA0B8; stroke-width: 4; stroke-linejoin: round; }
.tram-art .roof { fill: #D9CFBC; }
.tram-art .body { fill: var(--cream); }
.tram-art .skirt { fill: var(--tram-red); }
.tram-art .windows rect { fill: var(--accent); }
.tram-art .garland { fill: none; stroke: var(--line-strong); stroke-width: 2; }
.tram-art .red { fill: var(--tram-red); }
.tram-art .green { fill: var(--bulb-green); }
.tram-art .amber { fill: var(--accent); }
.tram-art .glow { opacity: 0.28; }
.tram-art .wheel { fill: var(--line); }
.tram-art .halo { fill: var(--accent); opacity: 0.12; }
.tram-art .rail { stroke: var(--line-strong); stroke-width: 3; }

@media (prefers-reduced-motion: no-preference) {
  .tram-art .glow { animation: twinkle 3.2s ease-in-out infinite alternate; }
  .tram-art .bulbs .glow:nth-of-type(4n) { animation-delay: 1.1s; }
  .tram-art .bulbs .glow:nth-of-type(4n+2) { animation-delay: 2s; }
}
@keyframes twinkle { from { opacity: 0.12; } to { opacity: 0.42; } }

/* City cards */
.city-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px;
  margin: 0; padding: 0; list-style: none;
}
.city-card {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  background: var(--paper); border: 1px solid var(--cream-line); border-radius: var(--radius-card);
  padding: 28px;
}
.city-card:hover { border-color: var(--ink-muted); }
.city-card:focus-within { outline: 3px solid var(--ink); outline-offset: 3px; }
.city-card h3 { font-family: var(--font-head); font-weight: 500; font-size: 30px; }
.city-card h3 a { text-decoration: none; }
.city-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-card); }
.city-card h3 a:focus-visible { outline: none; }
.city-card-org { font-size: 15px; line-height: 1.5; color: var(--ink-muted); }
.city-card-meta { border-top: 1px solid var(--cream-line); padding-top: 14px; }
.city-card-meta .label { color: var(--ink-muted); }
.city-card-rides { margin-top: 4px; font-size: 18px; font-weight: 600; }
.city-card-more { margin-top: auto; font-weight: 600; padding: 10px 0 0; }

/* Cards and blocks */
.card-title { font-family: var(--font-head); font-weight: 500; font-size: 26px; }

.block { margin: 0; }
.prose .block { margin: 32px 0; }

.block-tracker {
  background: var(--night-2); border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 22px;
}
.night-2 .block-tracker { background: var(--night); }
/* Narrow card: the badge gets its own line under the title, so the header keeps the same
   height whatever the badge says ("Geen rit bezig" vs "Live · 21 s geleden"); otherwise a
   longer badge wraps and pushes the map down (layout shift). */
.block-tracker { container-type: inline-size; }
.tracker-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px 16px; margin-bottom: 14px;
}
@container (max-width: 520px) {
  .tracker-head { flex-direction: column; align-items: flex-start; }
}
.live-pill { white-space: nowrap; }
.live-pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px;
  border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 6px 14px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
}
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.live-pill[data-state="live"] .live-dot { background: var(--live-green); }
.tracker-status { color: var(--muted); font-size: 16px; }
.tracker-status + .tracker-status { margin-top: 8px; }
.tracker-map { aspect-ratio: 16 / 10; border-radius: 12px; background: var(--map-bg); margin-bottom: 14px; }

.block-schedule {
  background: var(--cream); color: var(--ink); border-radius: var(--radius-card); padding: 26px;
}
.block-schedule .card-title { margin-bottom: 16px; }
.ride-list { margin: 0; padding: 0; list-style: none; }
.ride-list li {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px;
  padding: 12px 0; border-top: 1px solid var(--cream-line); font-size: 15px;
}
.ride-date { font-weight: 600; }
.ride-time { color: var(--ink-muted); }
.ride-note { flex-basis: 100%; font-size: 14px; color: var(--ink-muted); }
.schedule-empty { color: var(--ink-muted); font-size: 16px; }
.ride-more > summary {
  display: flex; align-items: center; gap: 8px; min-height: var(--tap); padding-top: 4px;
  border-top: 1px solid var(--cream-line); font-size: 15px; font-weight: 600; cursor: pointer;
  list-style: none; text-decoration: underline; text-underline-offset: 3px;
}
.ride-more > summary::-webkit-details-marker { display: none; }
.ride-more > summary::before { content: "▸"; text-decoration: none; display: inline-block; }
.ride-more[open] > summary::before { content: "▾"; }
.ride-more-open, .ride-more[open] .ride-more-closed { display: none; }
.ride-more[open] .ride-more-open { display: inline; }
.ride-more[open] > summary { border-bottom: 1px solid var(--cream-line); }
.ride-more .ride-list li:first-child { border-top: 0; }

.block-notice {
  background: var(--night-2); color: var(--cream); border: 1px solid var(--accent);
  border-radius: 14px; padding: 16px 20px;
}

.block-photo img { width: 100%; border-radius: 14px; background: var(--cream-line); }
.block-photo figcaption { margin-top: 8px; font-size: 14px; color: var(--ink-muted); }

/* City page */
.city-head { padding: 40px 0 32px; }
.city-head h1 { font-size: clamp(36px, 5vw, 56px); margin-bottom: 12px; }
.breadcrumb ol { display: flex; flex-wrap: wrap; margin: 0 0 8px; padding: 0; list-style: none; font-size: 14px; color: var(--muted); }
.breadcrumb li + li::before { content: "/"; margin: 0 8px; }
.breadcrumb a { display: inline-flex; align-items: center; min-height: var(--tap); }
.breadcrumb span { display: inline-flex; align-items: center; min-height: var(--tap); }

.jump-links ul { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 0; padding: 0; list-style: none; }
.jump-links a {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 16px;
  border: 1px solid var(--accent); border-radius: var(--radius-pill); color: var(--accent);
  font-size: 15px; font-weight: 600; text-decoration: none;
}
.jump-links a:hover { background: var(--accent); color: var(--night); }
#live, #dienstregeling, #praktisch { scroll-margin-top: 16px; }

.city-main { padding-bottom: 56px; }
.city-grid { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.city-live { flex: 2 1 560px; min-width: 0; }
.city-aside { flex: 1 1 300px; min-width: 0; }

.city-body { display: flex; flex-wrap: wrap; gap: 48px; }
.city-body > .prose { flex: 2 1 480px; min-width: 0; }
.city-body > .route { flex: 1 1 280px; min-width: 0; }
.route h2 { margin-bottom: 16px; }
.stop-list { margin: 0; padding-left: 24px; line-height: 2.1; }

/* Prose */
.prose { max-width: 720px; }
.prose > * + * { margin-top: 16px; }
.prose h2 { font-size: 32px; margin-top: 40px; }
.prose h3 { margin-top: 28px; }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 24px; }
.prose li + li { margin-top: 6px; }
.prose-page { max-width: 820px; }
.prose-page h1 { margin-bottom: 16px; }
.prose-page .lead { margin-bottom: 36px; }

.prose-columns { max-width: none; columns: 3 260px; column-gap: 40px; }
.prose-columns > * + * { margin-top: 0; }
.prose-columns h3 { break-after: avoid; margin: 0 0 8px; }
.prose-columns p { break-inside: avoid; margin-bottom: 28px; color: var(--ink-muted); }

/* Mail widget */
.mail-button {
  font: inherit; color: inherit; background: none; border: 0; padding: 0;
  min-height: 32px; text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer;
}
.mail-button:hover { color: var(--accent); }

/* Footer */
/* Partner logos (src/_includes/partner-logos.njk). Both logos require a white background.
   Heights differ on purpose: De Lijn's logo carries more white space (lion + bars), so it
   needs more height to look as large as META's. Fixed width/height attributes: no layout shift. */
.partner-logos { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 28px 56px; }
.partner-logos a { display: block; border-radius: 8px; }
.partner-logos a:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.partner-logos img { display: block; width: auto; max-width: 100%; }
.partner-band { background: #fff; color: var(--ink); border-top: 1px solid var(--cream-line); padding: 36px 0 40px; text-align: center; }
.partner-band-title { margin: 0 0 18px; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.partner-logos-band li:first-child img { height: 64px; }
.partner-logos-band li:last-child img { height: 88px; }
@media (max-width: 599px) {
  .partner-band { padding: 28px 0 32px; }
  .partner-logos { gap: 24px 40px; }
  .partner-logos-band li:first-child img { height: 52px; }
  .partner-logos-band li:last-child img { height: 76px; }
}

.site-footer { background: var(--deep); border-top: 1px solid var(--line); padding: 56px 0 40px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px 40px; }
.footer-title { margin-bottom: 12px; color: var(--muted); font-weight: 600; font-family: var(--font-body); font-size: 13px; }
.footer-list { margin: 0; padding: 0; list-style: none; font-size: 15px; }
.footer-list li { min-height: var(--tap); display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; }
.footer-list a { display: inline-flex; align-items: center; min-height: var(--tap); }
.footer-note { margin-top: 40px; font-size: 13px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Live tracker (tracker.js, Leaflet) */
.tracker-map { position: relative; z-index: 0; overflow: hidden; width: 100%; max-width: 100%; min-height: 280px; }
.tracker-map[hidden] { display: none; }
.tracker-map .leaflet-container, .tracker-map.leaflet-container { font: inherit; background: var(--map-bg); }
.tracker-map .leaflet-control-attribution { font-size: 11px; }
/* Reserved map space on ride days (blocks/tracker.njk): the slot has the map's size from
   the start; the map fills it when a ride runs, the placeholder shows otherwise. */
.tracker-slot {
  position: relative; width: 100%; aspect-ratio: 16 / 10; min-height: 280px;
  border-radius: 12px; background: var(--map-bg); margin-bottom: 14px; overflow: hidden;
}
.tracker-slot > .tracker-map { position: absolute; inset: 0; min-height: 0; margin: 0; aspect-ratio: auto; }
.tracker-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; margin: 0; padding: 24px; text-align: center; color: var(--muted); font-size: 16px; overflow: hidden;
}
.tracker-placeholder p { margin: 0; }
.tracker-soon { list-style: none; margin: 0; padding: 0; color: var(--cream); font-size: 17px; line-height: 1.5; }
.tracker-soon strong { font-weight: 600; }
.tracker-map:not([hidden]) + .tracker-placeholder { display: none; }
.live-pill[data-state="live"] { border-color: var(--live-green); }
.live-pill[data-state="waiting"] .live-dot { background: var(--accent); }
.live-pill[data-state="offline"] .live-dot { background: var(--tram-red); }
@media (prefers-reduced-motion: no-preference) {
  .live-pill[data-state="live"] .live-dot { animation: pulse 1.6s ease-in-out infinite; }
}
@keyframes pulse { 50% { opacity: 0.35; } }

.vehicle-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.vehicle-list[hidden] { display: none; }
.vehicle { background: var(--night); border: 1px solid var(--line); border-radius: 14px; }
.night-2 .vehicle { background: var(--night-2); }
/* The whole card is a button (tracker.js): click = zoom to and follow this tram. */
.vehicle-btn {
  display: block; width: 100%; min-height: var(--tap); padding: 14px 16px; margin: 0;
  background: none; border: 0; border-radius: inherit; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.vehicle-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.vehicle:hover { border-color: var(--line-strong); }
.vehicle.is-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.vehicle-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.vehicle-meta { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.vehicle-label { font-size: 17px; }
.vehicle-status { font-size: 12px; font-weight: 600; border-radius: var(--radius-pill); padding: 3px 10px; background: var(--line); color: var(--cream); }
.vehicle-status.status-onderweg { background: var(--live-green); color: var(--ink); }
.vehicle-status.status-stilstaand { background: var(--accent); color: var(--ink); }
.vehicle-meta { margin-top: 4px; font-size: 14px; color: var(--muted); }

.tram-icon { background: none; border: 0; }
.tram-marker { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transform: translateY(-1px); }
.tram-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--tram-red); border: 3px solid var(--cream); box-shadow: 0 0 0 6px rgba(242, 180, 65, 0.35); flex: none; }
.tram-label { background: var(--cream); color: var(--ink); font-size: 13px; font-weight: 600; border-radius: var(--radius-pill); padding: 3px 10px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35); }
.tram-icon.is-stale .tram-dot { background: var(--line-strong); box-shadow: none; }
.tram-icon { cursor: pointer; }
.tram-icon.is-selected .tram-label { background: var(--accent); }
.tram-icon.is-selected .tram-dot { box-shadow: 0 0 0 6px rgba(242, 180, 65, 0.7); }
