/* matkalla.css — /matkalla/ travel map page (WP-KUITUNEN-TRAVEL-MAP-V1;
   presentation redesign WP-KUITUNEN-TRAVEL-MAP-UX-V2: hero -> compact map ->
   timeline, editorial travel-journal tone).
   All page-specific styles live here (no inline style attributes on the page:
   the /matkalla/ path ships a strict CSP without 'unsafe-inline'). Relies on
   the site-wide variables from /style.css (--text, --text-2, --border, ...). */

.matkalla { padding: 6.5rem 0 3rem; }

.matkalla-head h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 5vw, 2.8rem);
  margin: 0 0 0.75rem;
}
.matkalla-intro {
  color: var(--text-2, #a8a496);
  max-width: 42rem;
  line-height: 1.6;
  margin: 0 0 2.25rem;
}

/* --- Hero: the current stage is the page's first visual element --- */
.matkalla-hero {
  border-top: 1px solid var(--border-2, rgba(255, 255, 255, 0.12));
  padding: 1.75rem 0 2rem;
  margin: 0 0 1.75rem;
}
.matkalla-hero__eyebrow {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent, #e85d2a);
  margin: 0 0 0.6rem;
}
.matkalla-hero__paikka {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.4rem, 8vw, 4rem);
  line-height: 1.05;
  margin: 0;
}
.matkalla-hero__paikka--tyhja {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.1rem;
  color: var(--text-2, #a8a496);
}
.matkalla-hero__maa {
  font-size: 1.05rem;
  color: var(--text-2, #a8a496);
  margin: 0.4rem 0 0;
}
.matkalla-hero__aika {
  font-size: 0.9rem;
  color: var(--text-3, #6b6860);
  margin: 0.35rem 0 0;
}

/* --- Kartta (progressive enhancement; compact, part of the page) --- */
.matkalla-kartta { margin: 0 0 2.5rem; }
.matkalla-kartta__canvas {
  position: relative;
  width: 100%;
  height: clamp(360px, 46vh, 420px);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.07));
  border-radius: 14px;
  overflow: hidden;
  background: #f4f2ee;
}
.matkalla-kartta__fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  color: #555;
  margin: 0;
}
/* When the map has successfully initialised, the JS stamps this class. */
.matkalla-kartta__canvas.is-live .matkalla-kartta__fallback { display: none; }

/* Markers (DOM markers, styled here — no inline styles).
   Hierarchy: current = strongest (accent + halo), past = neutral, planned =
   hollow outline. The map tiles are light, so marker chrome is dark-on-light. */
.matkalla-marker {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #4a4741;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}
.matkalla-marker--current {
  width: 18px;
  height: 18px;
  background: var(--accent, #e85d2a);
  box-shadow: 0 0 0 6px rgba(232, 93, 42, 0.22), 0 1px 4px rgba(0, 0, 0, 0.35);
}
.matkalla-marker--planned {
  background: #fff;
  border: 2px dashed #6b6860;
}
/* Licence attribution: always visible (compact toggle would auto-reopen and
   cover markers) but discreet — one slim line in the bottom-right corner. */
.matkalla-kartta__canvas .maplibregl-ctrl-attrib {
  font-size: 0.62rem;
  line-height: 1.4;
  padding: 0.1rem 0.45rem;
  background: rgba(255, 255, 255, 0.78);
  border-radius: 6px 0 0 0;
}
.maplibregl-popup-content {
  font-family: 'DM Sans', sans-serif;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
}
/* The popup floats on a white MapLibre card inside a dark-themed page, so the
   inherited site colours (light text for the dark background) are unreadable
   here — pin explicit dark-on-white colours. */
.matkalla-popup h4 { margin: 0 0 0.15rem; font-size: 0.95rem; color: #1d1d1d; }
.matkalla-popup p { margin: 0; color: #555; font-size: 0.82rem; }
.matkalla-popup ul { margin: 0.4rem 0 0; padding-left: 1rem; font-size: 0.82rem; }
.matkalla-popup a { color: #1a5c8a; }

/* --- Matkareitti-timeline (the no-JS surface): newest first, light cards on a
   rail. Editorial rhythm, not a dashboard. --- */
.matkalla-etapit h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  margin: 0 0 1.25rem;
}
.etapit {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
/* The rail: runs behind the dots, stops with the list. */
.etapit::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: var(--border-2, rgba(255, 255, 255, 0.12));
}
.etappi {
  position: relative;
  padding: 0 0 1.1rem 2rem;
}
.etappi:last-child { padding-bottom: 0; }
.etappi::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.5rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-3, #6b6860);
  border: 2px solid var(--bg, #0e0e0b);
  z-index: 1;
}
.etappi--current::before {
  background: var(--accent, #e85d2a);
  box-shadow: 0 0 0 4px rgba(232, 93, 42, 0.18);
}
.etappi--planned::before {
  background: var(--bg, #0e0e0b);
  border: 2px dashed var(--text-3, #6b6860);
}
.etappi__kortti {
  background: var(--bg-2, #161612);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.07));
  border-radius: 10px;
  padding: 0.9rem 1.1rem 1rem;
}
.etappi--current .etappi__kortti {
  border-color: rgba(232, 93, 42, 0.35);
}
.etappi--planned .etappi__kortti {
  border-style: dashed;
  background: transparent;
}
.etappi__status {
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3, #6b6860);
  margin: 0 0 0.3rem;
}
.etappi--current .etappi__status { color: var(--accent, #e85d2a); }
.etappi__paikka {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  margin: 0;
}
.etappi__seutu {
  color: var(--text-2, #a8a496);
  font-size: 0.9rem;
  margin: 0.15rem 0 0;
}
.etappi__aika {
  color: var(--text-3, #6b6860);
  font-size: 0.85rem;
  margin: 0.25rem 0 0;
}
.etappi__linkit {
  margin: 0.55rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
}
.etappi__linkit li { margin: 0.15rem 0; }

.matkalla-footer {
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.07));
  padding: 1.5rem 0 2.5rem;
  font-size: 0.85rem;
  color: var(--text-2, #a8a496);
}

@media (max-width: 640px) {
  .matkalla { padding-top: 5.5rem; }
  .matkalla-hero { padding: 1.4rem 0 1.6rem; margin-bottom: 1.4rem; }
  .matkalla-kartta__canvas { height: clamp(230px, 34vh, 280px); }
  .maplibregl-popup { max-width: calc(100vw - 3rem); }
  .maplibregl-popup-content { max-width: calc(100vw - 4rem); }
}
