/* ViajaSigurd Travel Map — design system
   Mid-century European rail poster meets cartography. */

:root {
  --navy: #14304A;
  --navy-deep: #0D2236;
  --ochre: #E8A13D;
  --vermilion: #C0492F;
  --water: #DEE8EB;
  --paper: #FBF9F3;
  --ink: #1C2B38;
  --muted: #5B6E7C;
  --green: #3E7A4E;
  --line: #D8D2C4;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(13, 34, 54, .12);
  --font-display: 'Jost', sans-serif;
  --font-body: 'Karla', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font-body); background: var(--water); color: var(--ink); line-height: 1.55; }
a { color: var(--navy); }
img { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--navy); line-height: 1.15; margin: 0 0 .4em; }
main { min-height: 60vh; }

/* ── Topbar ─────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 1000;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 10px 22px; background: var(--navy-deep); color: #fff;
  border-bottom: 3px solid var(--ochre);
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand-mark { font-size: 22px; color: var(--ochre); transform: rotate(-8deg); }
.brand-text { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: .5px; }
.brand-text em { font-style: normal; color: var(--ochre); font-weight: 500; }
.mainnav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.mainnav a {
  color: #E8EDF2; text-decoration: none; font-weight: 600; font-size: 14px;
  padding: 7px 12px; border-radius: 8px;
}
.mainnav a:hover { background: rgba(255,255,255,.1); }
.mainnav .admin-link { color: var(--ochre); }
.lang-switch { display: flex; gap: 2px; background: rgba(255,255,255,.08); border-radius: 8px; padding: 3px; }
.lang-switch a {
  color: #C6D2DC; text-decoration: none; font-family: var(--font-mono); font-size: 11px;
  padding: 4px 8px; border-radius: 6px;
}
.lang-switch a.active { background: var(--ochre); color: var(--navy-deep); font-weight: 600; }

/* Search in navbar + suggestions */
.nav-search { position: relative; flex: 1 1 220px; max-width: 420px; }
.nav-search input {
  width: 100%; padding: 9px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.1); color: #fff; font-family: var(--font-body); font-size: 14px;
}
.nav-search input::placeholder { color: #9FB2C0; }
.nav-search input:focus { outline: 2px solid var(--ochre); background: rgba(255,255,255,.16); }
.suggest {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--paper); border-radius: 12px; box-shadow: var(--shadow);
  overflow: hidden; max-height: 380px; overflow-y: auto;
}
.suggest a {
  display: flex; align-items: baseline; gap: 8px; padding: 10px 14px;
  text-decoration: none; border-bottom: 1px solid var(--line); font-size: 14px;
}
.suggest a:hover, .suggest a.sel { background: #F2EDE1; }
.suggest .s-kind { font-family: var(--font-mono); font-size: 10px; color: var(--vermilion); text-transform: uppercase; min-width: 62px; }
.suggest .s-ctx { color: var(--muted); font-size: 12px; margin-left: auto; }

/* ── Hero ───────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden; color: #fff; text-align: center;
  background: linear-gradient(160deg, var(--navy-deep) 0%, var(--navy) 55%, #1B4463 100%);
  padding: 84px 20px 96px;
}
.hero-route { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .5; pointer-events: none; }
.hero-inner { position: relative; max-width: 860px; margin: 0 auto; }
.hero .eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--ochre); margin-bottom: 14px;
}
.hero h1 {
  color: #fff; font-size: clamp(38px, 7vw, 72px); font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; margin-bottom: 8px;
}
.hero h1 .accent { color: var(--ochre); }
.hero .tagline { font-size: clamp(16px, 2.4vw, 20px); color: #C9D6E0; max-width: 620px; margin: 0 auto 30px; }
.hero-search { max-width: 560px; margin: 0 auto 26px; position: relative; }
.hero-search input {
  width: 100%; padding: 16px 22px; font-size: 17px; border: none; border-radius: 999px;
  box-shadow: var(--shadow); font-family: var(--font-body);
}
.hero-search button {
  position: absolute; right: 6px; top: 6px; bottom: 6px; padding: 0 22px;
  border: none; border-radius: 999px; background: var(--vermilion); color: #fff;
  font-family: var(--font-display); font-weight: 600; font-size: 15px; cursor: pointer;
}
.hero-search button:hover { background: #A93C24; }
.hero-stats { display: flex; gap: 34px; justify-content: center; flex-wrap: wrap; margin-top: 34px; }
.hero-stats .stat { text-align: center; }
.hero-stats .num { font-family: var(--font-display); font-size: 34px; font-weight: 700; color: var(--ochre); }
.hero-stats .lbl { font-family: var(--font-mono); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: #AFC2D0; }
.hero-cta { margin-top: 30px; }

.btn {
  display: inline-block; padding: 11px 22px; border-radius: 999px; border: none; cursor: pointer;
  font-family: var(--font-display); font-weight: 600; font-size: 15px; text-decoration: none;
  background: var(--ochre); color: var(--navy-deep);
}
.btn:hover { filter: brightness(1.06); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-ghost { background: transparent; border: 2px solid var(--navy); color: var(--navy); }
.btn-sm { padding: 6px 13px; font-size: 13px; }
.btn-danger { background: var(--vermilion); color: #fff; }

/* ── Sections / grids ───────────────────────────────── */
.section { max-width: 1180px; margin: 0 auto; padding: 54px 22px; }
.section-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.section-head h2 { font-size: clamp(24px, 3.6vw, 34px); text-transform: uppercase; letter-spacing: 1px; margin: 0; }
.section-head .rule { flex: 1; height: 3px; background: repeating-linear-gradient(90deg, var(--ochre) 0 14px, transparent 14px 24px); }
.section-head .more { font-weight: 600; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 22px; }
.pcard {
  background: var(--paper); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  text-decoration: none; color: var(--ink); display: flex; flex-direction: column;
  transition: transform .18s ease;
}
.pcard:hover { transform: translateY(-4px); }
.pcard .ph { position: relative; aspect-ratio: 16/10; background: var(--navy); overflow: hidden; }
.pcard .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard .ph .ph-fallback {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 54px; color: rgba(255,255,255,.25); font-weight: 700;
}
.pcard .ph img[src] ~ .ph-fallback { display: none; }
.pcard .ph .flag {
  position: absolute; left: 12px; top: 12px; background: var(--vermilion); color: #fff;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
  padding: 4px 9px; border-radius: 4px;
}
.pcard .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pcard h3 { font-size: 20px; margin: 0; }
.pcard .sub { color: var(--muted); font-size: 13px; }
.pcard .desc { font-size: 14px; color: var(--ink); }

/* ── Location "ticket" cards ────────────────────────── */
.tickets { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 24px; }
.ticket {
  background: var(--paper); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column; position: relative;
}
.ticket .ph { position: relative; aspect-ratio: 16/9; background: var(--navy); }
.ticket .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ticket .ph .ph-fallback {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 46px; color: rgba(255,255,255,.25); font-weight: 700;
}
.ticket .ph img[src] ~ .ph-fallback { display: none; }
.ticket .stamp {
  position: absolute; right: 14px; top: 14px; transform: rotate(6deg);
  background: var(--vermilion); color: #fff; font-family: var(--font-mono); font-weight: 600;
  padding: 6px 12px; border-radius: 4px; font-size: 13px; box-shadow: 0 4px 10px rgba(0,0,0,.25);
}
.ticket .stamp.free { background: var(--green); }
.ticket .tbody { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.ticket .kicker {
  display: flex; gap: 8px; align-items: center; font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--vermilion);
}
.ticket h3 { font-size: 21px; margin: 0; }
.ticket h3 a { text-decoration: none; }
.ticket .desc { font-size: 14px; }
.ticket .hours { font-size: 12.5px; color: var(--muted); font-family: var(--font-mono); }
.ticket .hours .closed-now { color: var(--vermilion); font-weight: 600; }
.ticket .tear { border-top: 2px dashed var(--line); margin: 6px -18px 0; position: relative; }
.ticket .tear::before, .ticket .tear::after {
  content: ''; position: absolute; top: -8px; width: 16px; height: 16px; border-radius: 50%; background: var(--water);
}
.ticket .tear::before { left: -8px; } .ticket .tear::after { right: -8px; }
.ticket .save {
  margin-top: 10px; background: #F6E9CF; border-left: 4px solid var(--ochre);
  padding: 10px 12px; border-radius: 6px; font-size: 13px;
}
.ticket .save b { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase; color: #8A6416; display: block; margin-bottom: 3px; }
.ticket .foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.ticket .foot .site { margin-left: auto; font-size: 13px; font-weight: 600; }

.imp { color: var(--ochre); font-size: 13px; letter-spacing: 1px; white-space: nowrap; }
.imp.imp-5 { color: var(--vermilion); }
.imp.imp-1, .imp.imp-2 { color: #B7A87F; }

.list-actions { display: flex; gap: 6px; }
.list-btn { background: #EDE7D8; color: var(--navy); border: 1px solid var(--line); }
.list-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }

.badge {
  display: inline-block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 1px;
  text-transform: uppercase; padding: 3px 8px; border-radius: 4px; background: var(--navy); color: #fff;
}
.badge.ochre { background: var(--ochre); color: var(--navy-deep); }
.badge.green { background: var(--green); }
.badge.red { background: var(--vermilion); }

/* Pass banner */
.pass-banner {
  background: var(--navy); color: #fff; border-radius: var(--radius); padding: 18px 22px;
  margin-bottom: 26px; box-shadow: var(--shadow);
}
.pass-banner h4 { color: var(--ochre); margin: 0 0 10px; text-transform: uppercase; letter-spacing: 1.5px; font-size: 13px; font-family: var(--font-mono); }
.pass-banner .pass { display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline; padding: 7px 0; border-top: 1px solid rgba(255,255,255,.12); font-size: 14px; }
.pass-banner .pass:first-of-type { border-top: none; }
.pass-banner .pname { font-weight: 700; }
.pass-banner .pprice { font-family: var(--font-mono); color: var(--ochre); }
.pass-banner .pnote { color: #C9D6E0; flex-basis: 100%; font-size: 13px; }
.pass-banner a { color: #fff; }

/* ── Map ────────────────────────────────────────────── */
.map-wrap { position: relative; }
#map { height: calc(100vh - 130px); min-height: 460px; }
.map-filters {
  position: absolute; z-index: 800; top: 14px; right: 14px; width: 250px;
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px;
  font-size: 13.5px; max-height: calc(100% - 28px); overflow-y: auto;
}
.map-filters h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 1.5px; font-family: var(--font-mono); }
.map-filters label { display: flex; gap: 8px; align-items: center; padding: 3px 0; cursor: pointer; }
.map-filters hr { border: none; border-top: 1px dashed var(--line); margin: 10px 0; }
.map-filters input[type=range] { width: 100%; accent-color: var(--vermilion); }

.city-marker { background: transparent !important; border: none !important; }
.city-marker .dot {
  display: flex; align-items: center; gap: 6px; font-family: var(--font-display); font-weight: 600;
  color: var(--navy-deep); font-size: 13px; text-shadow: 0 1px 0 #fff, 0 0 6px #fff; white-space: nowrap;
}
.city-marker .dot::before { content: ''; width: 12px; height: 12px; border-radius: 50%; background: var(--vermilion); border: 2.5px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.4); flex: 0 0 auto; }

.loc-marker { background: transparent !important; border: none !important; }
.loc-marker .pin {
  border-radius: 50%; border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35);
  display: block;
}

.leaflet-popup-content { font-family: var(--font-body); }
.popup h4 { margin: 0 0 4px; font-size: 16px; }
.popup .pmeta { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.popup img { width: 100%; border-radius: 8px; margin-bottom: 6px; aspect-ratio: 16/9; object-fit: cover; }

/* ── Detail pages ───────────────────────────────────── */
.detail-hero { position: relative; height: 340px; background: var(--navy); overflow: hidden; }
.detail-hero img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.detail-hero .overlay {
  position: absolute; inset: 0; background: linear-gradient(0deg, rgba(13,34,54,.85), rgba(13,34,54,.1) 60%);
  display: flex; align-items: flex-end;
}
.detail-hero .inner { max-width: 1180px; margin: 0 auto; width: 100%; padding: 26px 22px; color: #fff; }
.detail-hero h1 { color: #fff; font-size: clamp(30px, 5vw, 52px); text-transform: uppercase; margin: 0; }
.crumbs { font-family: var(--font-mono); font-size: 12px; margin-bottom: 8px; }
.crumbs a { color: var(--ochre); text-decoration: none; }
.detail-cols { display: grid; grid-template-columns: 2fr 1fr; gap: 32px; }
@media (max-width: 860px) { .detail-cols { grid-template-columns: 1fr; } }
.info-box { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 20px; }
.info-box h4 { font-family: var(--font-mono); font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--vermilion); margin-bottom: 10px; }
.info-row { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.info-row:last-child { border-bottom: none; }
.info-row .k { font-family: var(--font-mono); font-size: 12px; color: var(--muted); min-width: 105px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-top: 14px; }
.gallery img { border-radius: 10px; aspect-ratio: 4/3; object-fit: cover; width: 100%; }

/* ── Forms & auth ───────────────────────────────────── */
.form-card { max-width: 440px; margin: 60px auto; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px 32px; }
.form-card.wide { max-width: 860px; }
.f-row { margin-bottom: 14px; }
.f-row label { display: block; font-family: var(--font-mono); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.f-row input[type=text], .f-row input[type=email], .f-row input[type=password], .f-row input[type=url],
.f-row input[type=number], .f-row input[type=time], .f-row input[type=date], .f-row select, .f-row textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-family: var(--font-body); font-size: 14px; background: #fff;
}
.f-row textarea { min-height: 90px; }
.f-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.f-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .f-grid, .f-grid-3 { grid-template-columns: 1fr; } }
.f-days { display: flex; gap: 10px; flex-wrap: wrap; }
.f-days label { display: flex; gap: 5px; align-items: center; font-size: 13px; text-transform: none; letter-spacing: 0; font-family: var(--font-body); color: var(--ink); }
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.flash.ok { background: #DFF0E2; border-left: 4px solid var(--green); }
.flash.err { background: #F6DFDA; border-left: 4px solid var(--vermilion); }

/* ── Tables (admin, lists) ──────────────────────────── */
.table-wrap { overflow-x: auto; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); }
table.data { border-collapse: collapse; width: 100%; font-size: 14px; }
table.data th { font-family: var(--font-mono); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; text-align: left; color: var(--muted); background: #F2EDE1; }
table.data th, table.data td { padding: 10px 14px; border-bottom: 1px solid var(--line); }
table.data tr:hover td { background: #FDFBF5; }
.admin-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.admin-cards a { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; text-decoration: none; text-align: center; }
.admin-cards .num { font-family: var(--font-display); font-size: 34px; font-weight: 700; color: var(--vermilion); }
.admin-cards .lbl { font-family: var(--font-mono); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }

/* Filter chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.chip {
  font-family: var(--font-display); font-weight: 600; font-size: 14px; text-decoration: none;
  padding: 7px 15px; border-radius: 999px; background: var(--paper); color: var(--navy);
  border: 1.5px solid var(--line); cursor: pointer;
}
.chip.active, .chip:hover { background: var(--navy); color: #fff; border-color: var(--navy); }

@media (max-width: 720px) {
  .topbar { gap: 10px; }
  .nav-search { order: 3; flex-basis: 100%; max-width: none; }
  #map { height: 70vh; }
  .map-filters { width: 200px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
:focus-visible { outline: 3px solid var(--vermilion); outline-offset: 2px; }
