/*
 * routekaarten signature: "de gevouwen wegenkaart".
 * Everything a visitor touches looks like a paper road map lying open on the passenger seat:
 *  - .rk-map        map-paper panel with two fold creases and faint contour lines; holds the route drawing.
 *  - .rk-drawing    the route as a red main road with a white casing (map convention), start flag, stops as
 *                   white rings, place names in map lettering with a paper halo, km tags between stops.
 *  - .rk-legend     the route facts as a map legend (Legenda): picto + term + value, with a road swatch.
 *  - .rk-scale      a scale bar (schaalstok) used as divider and in the footer cartouche.
 *  - .rk-roadbook   the stops along a vertical road with km markers.
 *  - .rk-checked    "laatst nagelopen" date on secondary-road yellow.
 * Also styles the existing skeleton classes (rk-intro, rk-cards, rk-card, rk-how, rk-picto, rk-badge, rk-facts).
 * Load after kit.css + themes/routekaarten.css. Pictograms: icons/routekaarten/sprite.svg (rk-*), fill="currentColor".
 * Never a speed or racing tone: no chequered flags as decoration, no speedometers, no motion blur.
 */

h1, h2, h3, .zs-logo { font-family: var(--zs-font-display); font-weight: var(--zs-display-weight); letter-spacing: var(--zs-display-tracking); }
h2, h3 { color: var(--zs-brand-text); }
.zs-logo { display: inline-flex; align-items: center; gap: .55rem; }
.rk-logo-mark { width: 2.1rem; height: 2.1rem; flex: none; }
.zs-header .rk-logo-mark { --rk-mark-casing: var(--zs-surface); }
.rk-map-label, .rk-km, .rk-legend dt, .rk-card__region, .rk-scale__labels { font-family: var(--rk-font-map); }

/* ---------- Picto tile: white pictogram on forest green ---------- */
.rk-picto { display: inline-grid; place-items: center; flex: none; width: 2.4rem; height: 2.4rem; border-radius: var(--zs-radius-sm); background: var(--zs-brand); color: #fff; }
.rk-picto svg { width: 70%; height: 70%; fill: currentColor; }
.rk-picto--lg { width: 3.6rem; height: 3.6rem; border-radius: var(--zs-radius); }
.rk-picto--road { background: var(--zs-accent); color: var(--zs-accent-ink); }
.rk-picto--water { background: var(--rk-water-bg); color: var(--rk-water); }
.rk-picto--plain { background: none; color: var(--zs-picto); width: 1.4rem; height: 1.4rem; }
.rk-picto--plain svg { width: 100%; height: 100%; }

/* ---------- Map paper panel ---------- */
.rk-map {
  position: relative; display: block; background-color: var(--rk-paper); border: 1px solid var(--zs-line); border-radius: var(--zs-radius-sm); overflow: hidden;
  background-image:
    linear-gradient(90deg, transparent calc(33.33% - 1px), var(--rk-fold) calc(33.33% - 1px), var(--rk-fold) calc(33.33% + 1px), transparent calc(33.33% + 1px)),
    linear-gradient(90deg, transparent calc(66.66% - 1px), var(--rk-fold) calc(66.66% - 1px), var(--rk-fold) calc(66.66% + 1px), transparent calc(66.66% + 1px)),
    linear-gradient(180deg, transparent calc(50% - 1px), var(--rk-fold) calc(50% - 1px), var(--rk-fold) calc(50% + 1px), transparent calc(50% + 1px));
}
/* Contour lines: three loose rings in one corner, never a grid. */
.rk-map::before {
  content: ""; position: absolute; right: -12%; bottom: -18%; width: 60%; aspect-ratio: 1; border-radius: 46% 54% 50% 50%; pointer-events: none;
  box-shadow: 0 0 0 1px var(--rk-contour), 0 0 0 14px var(--rk-paper), 0 0 0 15px var(--rk-contour), 0 0 0 30px var(--rk-paper), 0 0 0 31px var(--rk-contour);
  background: var(--rk-forest); opacity: .9;
}
.rk-map > * { position: relative; }

/* ---------- Route drawing (partials/drawing.blade.php) ---------- */
.rk-drawing { display: block; width: 100%; height: auto; overflow: visible; }
.rk-drawing__casing { fill: none; stroke: var(--rk-road-casing); stroke-width: 11; stroke-linecap: round; stroke-linejoin: round; }
.rk-drawing__road { fill: none; stroke: var(--rk-road); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.rk-drawing__shadow { fill: none; stroke: rgba(23, 38, 29, .14); stroke-width: 13; stroke-linecap: round; stroke-linejoin: round; transform: translate(0, 2px); }
.rk-drawing__start { fill: var(--rk-road-casing); stroke: var(--zs-ink); stroke-width: 3; }
.rk-drawing__stop { fill: var(--rk-road-casing); stroke: var(--rk-road); stroke-width: 3; }
.rk-drawing__water { fill: none; stroke: var(--rk-water-line); stroke-width: 4; stroke-linecap: round; }
.rk-drawing__side { fill: none; stroke: var(--rk-side); stroke-width: 3.5; stroke-linecap: round; }
.rk-drawing__label { font-family: var(--rk-font-map); font-weight: 600; font-size: 24px; fill: var(--zs-ink); paint-order: stroke; stroke: var(--rk-label-halo); stroke-width: 5px; stroke-linejoin: round; }
.rk-drawing__km { font-family: var(--rk-font-map); font-weight: 700; font-size: 20px; fill: var(--rk-road); paint-order: stroke; stroke: var(--rk-label-halo); stroke-width: 5px; }
/* Sketch = waypoints only, route not built yet: dashed road, like a road under construction on the map. */
.rk-drawing--sketch .rk-drawing__road { stroke-dasharray: 10 9; }

/* km tag in running text: red figures as printed between junctions on the map */
.rk-km { display: inline-block; font-weight: 700; color: var(--zs-accent); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Home intro: photo with the map lying on top ---------- */
.rk-intro { position: relative; isolation: isolate; color: #fff; padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4.5rem); }
.rk-intro__photo { position: absolute; inset: 0; z-index: -2; }
.rk-intro__photo img { width: 100%; height: 100%; object-fit: cover; object-position: var(--zs-hero-focus, 60% 70%); }
.rk-intro::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, color-mix(in srgb, var(--zs-brand-deep) 88%, transparent) 0%, color-mix(in srgb, var(--zs-brand-deep) 62%, transparent) 55%, color-mix(in srgb, var(--zs-brand-deep) 10%, transparent) 100%); }
.rk-intro__inner { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.rk-intro h1 { color: #fff; font-size: clamp(2.1rem, 4.6vw, 3.3rem); line-height: 1.08; margin: 0 0 .4em; }
.rk-intro .zs-hero__lead { color: #fff; font-size: 1.15rem; max-width: 34rem; }
.rk-intro__map { display: block; color: var(--zs-ink); text-decoration: none; transform: rotate(-1.6deg); box-shadow: 0 18px 40px rgba(8, 20, 12, .35); border-radius: var(--zs-radius-sm); }
.rk-intro__map:hover, .rk-intro__map:focus-visible { transform: rotate(0deg); }
.rk-intro__map .rk-map { padding: .6rem; }
.rk-intro__caption { display: flex; justify-content: space-between; gap: .6rem; align-items: baseline; padding: .55rem .8rem .65rem; background: var(--zs-surface); border-top: 1px solid var(--zs-line); font-weight: 600; }
.rk-intro__caption .rk-km { font-size: .95rem; }
.zs-hero__credit, .rk-credit { font-size: .78rem; opacity: .85; margin-top: 1.2rem; }
.rk-credit a { color: inherit; }

.rk-facts { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; margin: 1.4rem 0 0; padding: 0; }
.rk-facts li { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.rk-intro .rk-facts .rk-picto { background: rgba(255, 255, 255, .16); }

/* ---------- Route cards: photo + mini map ---------- */
.rk-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 1.4rem; }
.rk-card { background: var(--zs-surface); border: 1px solid var(--zs-line); border-radius: var(--zs-radius); overflow: hidden; display: flex; }
.rk-card > a { display: flex; flex-direction: column; color: inherit; text-decoration: none; width: 100%; }
.rk-card__media { position: relative; aspect-ratio: 16 / 10; background: var(--zs-surface-alt); }
.rk-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rk-card__map { position: absolute; right: .7rem; bottom: -1.6rem; width: 38%; box-shadow: 0 6px 16px rgba(8, 20, 12, .25); border-radius: var(--zs-radius-sm); transform: rotate(2deg); }
.rk-card__map .rk-map { padding: .2rem; }
.rk-card__map .rk-drawing__casing { stroke-width: 14; }
.rk-card__map .rk-drawing__road { stroke-width: 8; }
.rk-card__body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.rk-card__region { margin: 0; font-weight: 600; color: var(--zs-muted); font-size: .95rem; padding-right: 40%; }
.rk-card h3 { margin: 0; font-size: 1.3rem; line-height: 1.2; }
.rk-card > a:hover h3, .rk-card > a:focus-visible h3 { text-decoration: underline; text-decoration-color: var(--zs-accent); text-underline-offset: .18em; }
.rk-card p { margin: 0; }
.rk-card__facts { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin-top: auto !important; padding-top: .6rem; font-weight: 600; }
.rk-card__facts > span { display: inline-flex; align-items: center; gap: .35rem; }
.rk-card__facts .rk-picto { width: 1.5rem; height: 1.5rem; border-radius: 4px; }
/* Skeleton markup without a photo: the drawing fills the media area. */
.rk-card > a > .rk-card__map:first-child { position: static; width: auto; transform: none; box-shadow: none; border-radius: 0; }

.rk-badge { display: inline-flex; align-items: center; padding: .1rem .55rem; border-radius: 999px; background: var(--zs-surface-alt); color: var(--zs-ink); font-size: .85rem; font-weight: 600; }
.rk-vehicles { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 0; padding: 0; }
.rk-vehicles li { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .65rem .2rem .3rem; border-radius: 999px; background: var(--zs-surface-alt); font-weight: 600; font-size: .92rem; }
.rk-vehicles .rk-picto { width: 1.6rem; height: 1.6rem; border-radius: 999px; }

/* ---------- Legend (route facts) ---------- */
.rk-legend { background: var(--zs-surface); border: 2px solid var(--zs-ink); border-radius: 4px; padding: .9rem 1rem 1rem; }
.rk-legend__title { font-family: var(--rk-font-map); font-weight: 700; font-size: 1.05rem; margin: 0 0 .6rem; padding-bottom: .4rem; border-bottom: 1px solid var(--zs-line); color: var(--zs-ink); }
.rk-legend dl { display: grid; grid-template-columns: auto 1fr; gap: .55rem .75rem; margin: 0; align-items: center; }
.rk-legend dt { display: flex; align-items: center; gap: .55rem; font-weight: 600; color: var(--zs-muted); }
.rk-legend dd { margin: 0; font-weight: 600; }
.rk-legend__swatch { display: inline-block; width: 2.4rem; height: .75rem; border-radius: 999px; background: var(--rk-road); box-shadow: 0 0 0 2.5px var(--rk-road-casing), 0 0 0 3.5px var(--zs-line); flex: none; }
.rk-legend__swatch--side { background: var(--rk-side); }
@media (max-width: 30rem) { .rk-legend dl { grid-template-columns: 1fr; gap: .15rem; } .rk-legend dd { margin-bottom: .45rem; padding-left: 2.2rem; } }

/* ---------- Scale bar ---------- */
.rk-scale { display: grid; gap: .25rem; width: min(12rem, 100%); }
.rk-scale__bar { height: .5rem; border: 1.5px solid currentColor; background: linear-gradient(90deg, currentColor 0 25%, transparent 25% 50%, currentColor 50% 75%, transparent 75%); }
.rk-scale__labels { display: flex; justify-content: space-between; font-size: .8rem; font-weight: 600; }
.rk-divider { display: flex; justify-content: center; color: var(--zs-muted); padding: .5rem 0; }

/* ---------- Route page ---------- */
.rk-route-hero { position: relative; isolation: isolate; color: #fff; min-height: clamp(20rem, 48vh, 28rem); display: flex; align-items: flex-end; padding: 2rem 0 1.6rem; }
.rk-route-hero img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: var(--zs-hero-focus, center); }
.rk-route-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, color-mix(in srgb, var(--zs-brand-deep) 90%, transparent) 0%, color-mix(in srgb, var(--zs-brand-deep) 35%, transparent) 60%, transparent 100%); }
.rk-route-hero h1 { color: #fff; margin: .15em 0 .3em; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.1; }
.rk-route-hero .rk-card__region { color: #fff; padding: 0; }
.rk-route-hero .rk-vehicles li { background: rgba(255, 255, 255, .16); color: #fff; }
.rk-route-hero .rk-vehicles .rk-picto { background: #fff; color: var(--zs-brand); }
.rk-route { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(16rem, 1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.rk-route__aside { display: grid; gap: 1.2rem; position: sticky; top: 1rem; }
.rk-route__map .rk-map { padding: .5rem; }
.rk-route__map-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }

.rk-gpx { background: var(--zs-brand); color: var(--zs-on-brand); border-radius: var(--zs-radius); padding: 1rem 1.1rem 1.1rem; display: grid; gap: .7rem; }
.rk-gpx h2, .rk-gpx h3 { color: inherit; margin: 0; font-size: 1.2rem; display: flex; align-items: center; gap: .6rem; }
.rk-gpx h2 .rk-picto, .rk-gpx h3 .rk-picto { background: #fff; color: var(--zs-brand); }
.rk-gpx p { margin: 0; opacity: .92; }
.rk-gpx small { opacity: .85; }
.rk-gpx small a { color: inherit; }
.rk-gpx .zs-btn--ghost { color: #fff; border-color: rgba(255, 255, 255, .6); }

.rk-checked { display: inline-flex; align-items: center; gap: .45rem; padding: .25rem .7rem .25rem .35rem; border-radius: 999px; background: var(--zs-highlight); color: var(--zs-highlight-ink); font-weight: 600; font-size: .92rem; }
.rk-checked .rk-picto { width: 1.6rem; height: 1.6rem; border-radius: 999px; background: var(--zs-highlight-ink); color: var(--zs-highlight); }

.rk-note { display: grid; grid-template-columns: auto 1fr; gap: .75rem; padding: .85rem 1rem; border-radius: var(--zs-radius-sm); background: var(--zs-surface); border: 1px solid var(--zs-line); border-left: 6px solid var(--rk-side); }
.rk-note--water { border-left-color: var(--rk-water-line); }
.rk-note p { margin: 0; }
.rk-note strong { display: block; }

/* Roadbook: stops along a vertical main road */
.rk-roadbook { list-style: none; margin: 0; padding: 0; position: relative; }
.rk-roadbook::before { content: ""; position: absolute; left: 1.05rem; top: .8rem; bottom: .8rem; width: 8px; border-radius: 4px; background: var(--rk-road); box-shadow: 0 0 0 3px var(--rk-road-casing), 0 0 0 4px var(--zs-line); }
.rk-roadbook li { position: relative; display: grid; grid-template-columns: 2.6rem 1fr; gap: .9rem; padding: .25rem 0 1.3rem; }
.rk-roadbook li:last-child { padding-bottom: 0; }
.rk-roadbook__dot { position: relative; z-index: 1; width: 1.9rem; height: 1.9rem; margin: .15rem 0 0 .4rem; border-radius: 50%; background: var(--rk-road-casing); border: 4px solid var(--rk-road); display: grid; place-items: center; }
.rk-roadbook__dot svg { width: 1rem; height: 1rem; color: #17261d; fill: currentColor; } /* dot is always the light road casing, also in dark mode */
.rk-roadbook li:first-child .rk-roadbook__dot { border-color: var(--zs-ink); }
.rk-roadbook__body { background: var(--zs-surface); border: 1px solid var(--zs-line); border-radius: var(--zs-radius-sm); padding: .7rem .9rem .8rem; }
.rk-roadbook__body h3 { margin: 0 0 .2rem; font-size: 1.15rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .6rem; }
.rk-roadbook__body p { margin: 0; }
.rk-roadbook__body img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; margin-top: .6rem; display: block; }

/* ---------- How we work ---------- */
.rk-how { display: grid; grid-template-columns: auto 1fr; gap: 1.2rem; align-items: start; }
.rk-steps { list-style: none; margin: 1.4rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: 1rem; }
.rk-steps li { background: var(--zs-surface); border: 1px solid var(--zs-line); border-radius: var(--zs-radius); padding: 1rem; display: grid; gap: .5rem; align-content: start; }
.rk-steps h3 { margin: 0; font-size: 1.1rem; }
.rk-steps p { margin: 0; }

/* ---------- Footer cartouche ---------- */
.rk-cartouche { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: center; padding: 1rem 0 1.2rem; margin-bottom: 1.2rem; border-bottom: 1px solid rgba(255, 255, 255, .25); }
.rk-cartouche .rk-logo-mark { width: 3rem; height: 3rem; --rk-mark-casing: var(--zs-brand-deep); }
.rk-cartouche p { margin: 0; }
.zs-footer .rk-scale { color: inherit; margin-top: .5rem; }

/* ---------- Photo credits page ---------- */
.rk-photos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: 1rem; }
.rk-photos li { background: var(--zs-surface); border: 1px solid var(--zs-line); border-radius: var(--zs-radius-sm); overflow: hidden; }
.rk-photos img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; }
.rk-photos p { margin: 0; padding: .6rem .8rem .8rem; font-size: .92rem; overflow-wrap: anywhere; }

@media (max-width: 52rem) {
  .rk-intro__inner, .rk-route { grid-template-columns: minmax(0, 1fr); }
  .rk-intro::before { background: linear-gradient(180deg, color-mix(in srgb, var(--zs-brand-deep) 80%, transparent) 0%, color-mix(in srgb, var(--zs-brand-deep) 70%, transparent) 60%, color-mix(in srgb, var(--zs-brand-deep) 55%, transparent) 100%); }
  .rk-intro__map { transform: none; max-width: 30rem; }
  .rk-route__aside { position: static; }
}
@media (prefers-reduced-motion: no-preference) { .rk-intro__map { transition: transform .25s ease; } }
