/*
 * "Seekarte": the page reads like a chart of the lake.
 * Atkinson Hyperlegible (legibility, BFSG) for everything you read and press; Spectral Italic only where a
 * chart would use italic serif: water names and section titles. Self-hosted, font-display: optional
 * (no reflow; see memory note on Lighthouse font-fallback CLS).
 * Mobile first; min-width queries add columns. One spacing scale (--s-*).
 * Contrast (checked): moor on nebel 13:1, seegruen on nebel 5.5:1, muted on nebel 6.4:1, moor on boje 8.3:1,
 * nebel on moor 13:1.
 */
@font-face { font-family: "Atkinson"; src: url("/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: optional; }
@font-face { font-family: "Atkinson"; src: url("/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: optional; }
@font-face { font-family: "Spectral"; src: url("/fonts/spectral-latin-500-italic.woff2") format("woff2"); font-weight: 500; font-style: italic; font-display: optional; }

:root {
    --nebel: #eef2ef;      /* page: morning mist over the lake */
    --nebel-dark: #e1e9e5;
    --wasser: #d6e5e1;     /* lake fill on the chart */
    --moor: #12302f;       /* text, dark surfaces */
    --muted: #46605c;
    --seegruen: #2a6b68;   /* links, chart lines */
    --schilf: #b89a4e;     /* reed belt, decoration only */
    --boje: #f0c24b;       /* actions: the yellow buoy */
    --boje-dark: #ddab2e;
    --line: rgb(18 48 47 / .16);

    --f-sans: "Atkinson", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --f-chart: "Spectral", "Iowan Old Style", Palatino, Georgia, serif;

    --s-1: .25rem; --s-2: .5rem; --s-3: .75rem; --s-4: 1rem; --s-5: 1.25rem; --s-6: 1.5rem; --s-7: 2rem; --s-8: 3rem; --s-9: 4.5rem;
    --wrap: 76rem;
    --gutter: clamp(1rem, 4vw, 2rem);
    --space-section: clamp(3rem, 2rem + 3vw, 4.5rem);

    color-scheme: light;
    font-family: var(--f-sans);
    font-size: 106.25%; /* 17px: Atkinson runs small */
    line-height: 1.6;
    color: var(--moor);
    background: var(--nebel);
    -webkit-text-size-adjust: 100%;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 5rem; } /* WCAG 2.2 focus not obscured by the sticky header */
body { margin: 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--seegruen); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: var(--moor); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--moor); outline-offset: 3px; border-radius: 3px; }

h1, h3 { font-weight: 700; line-height: 1.1; margin: 0; }
h1 { font-size: clamp(2.2rem, 1.5rem + 3vw, 3.7rem); letter-spacing: -.025em; text-wrap: balance; }
h2 { font-family: var(--f-chart); font-style: italic; font-weight: 500; font-size: clamp(1.7rem, 1.35rem + 1.4vw, 2.5rem); line-height: 1.1; color: var(--seegruen); margin: 0 0 var(--s-5); }
h3 { font-size: 1.15rem; line-height: 1.25; }
p { text-wrap: pretty; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--space-section); }
.section + .section { padding-top: 0; }
.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; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--moor); color: var(--nebel); padding: var(--s-3) var(--s-4); z-index: 100; }
.skip-link:focus { left: var(--s-4); top: var(--s-2); }
.i { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }

/* ---------- Buttons: the buoy ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; white-space: nowrap;
    padding: var(--s-3) var(--s-6); border-radius: 999px; border: 0;
    background: var(--boje); color: var(--moor); font: 700 1rem/1.2 var(--f-sans); text-decoration: none;
    transition: background-color .15s ease;
}
.btn:hover { background: var(--boje-dark); color: var(--moor); }
.btn-small { min-height: 2.5rem; padding: var(--s-2) var(--s-3); font-size: .8rem; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: rgb(238 242 239 / .9); border-bottom: 1px solid var(--line); }
@supports (backdrop-filter: blur(8px)) { .site-header { backdrop-filter: blur(8px); } }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding-block: var(--s-2); }
.brand { display: flex; align-items: center; gap: var(--s-2); text-decoration: none; color: var(--moor); min-width: 0; }
.brand img { width: 2rem; height: 2rem; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand strong { font-size: .86rem; }
.brand-text span { display: none; font-size: .8rem; color: var(--muted); }
.brand:hover { color: var(--moor); }

/* ---------- Hero: the chart ---------- */
.hero { padding-block: var(--s-7) var(--s-4); }
.hero-grid { display: grid; gap: var(--s-6); align-items: center; }
.lead { margin: var(--s-4) 0 0; max-width: 34rem; font-size: 1.1rem; color: var(--muted); }

.chart { position: relative; margin-block: 3rem 5rem; max-width: 40rem; justify-self: center; width: 100%; }
.chart-map { display: block; width: 100%; height: auto; overflow: visible; }
.chart-map .shore { fill: var(--wasser); stroke: var(--seegruen); stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.chart-map .water { font: italic 500 54px var(--f-chart); letter-spacing: .14em; fill: var(--seegruen); opacity: .9; }
.chart-map .place-small { font: italic 500 22px var(--f-chart); fill: var(--muted); }
.chart-map .place { font: 400 22px var(--f-sans); fill: var(--muted); }
.chart-map .town { fill: var(--moor); stroke: #fff; stroke-width: 3; }
/* Town and island names are 7px on a phone: only from tablet width on. */
.chart-map .place-small, .chart-map .place, .chart-map .town-minor { display: none; }
.chart-credit { position: absolute; right: 0; bottom: -3.6rem; margin: 0; font-size: .72rem; color: var(--muted); }
.chart-credit a { color: inherit; }

/* One orchestrated moment: the shoreline draws itself once, then the water fills in. */
@media (prefers-reduced-motion: no-preference) {
    html:not(.chart-seen) .chart-map .shore { stroke-dasharray: 1; stroke-dashoffset: 1; fill-opacity: 0; animation: draw 1.6s cubic-bezier(.4, 0, .2, 1) forwards, fill .6s ease 1.1s forwards; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fill { to { fill-opacity: 1; } }

/* Pins: real links positioned on the chart; the tip marks the shore. */
.pin {
    position: absolute; display: flex; flex-direction: column; min-height: 2.75rem; justify-content: center;
    padding: var(--s-1) var(--s-3); border-radius: 6px; background: #fff; color: var(--moor); text-decoration: none;
    line-height: 1.2; border: 1px solid var(--line); box-shadow: 0 1px 0 var(--line); white-space: nowrap;
}
.pin-name { font-weight: 700; font-size: .9rem; }
.pin-count { font-size: .78rem; color: var(--muted); }
.pin:hover { background: var(--nebel-dark); color: var(--moor); }
.pin[aria-current="page"] { background: var(--boje); border-color: var(--boje-dark); }
.pin[aria-current="page"] .pin-count { color: var(--moor); }
.pin-above { translate: -50% calc(-100% - .7rem); }
.pin-below { translate: -50% .7rem; }
.pin-free { translate: 0 0; }
/* Mardorf sits near the left edge: the label opens to the right of its dot. */
.pin-above-right { translate: -1rem calc(-100% - .7rem); }

/* ---------- Filters ---------- */
.filters { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-3); padding-top: var(--s-6); }
.filter-group { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-1); }
.filter-label { margin: 0; font: italic 500 1.05rem/1.2 var(--f-chart); color: var(--seegruen); }
.filters ul {
    list-style: none; margin: 0 calc(var(--gutter) * -1); padding: var(--s-1) var(--gutter); display: flex; gap: var(--s-2);
    overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter); scrollbar-width: none;
    mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent);
}
.filters ul::-webkit-scrollbar { display: none; }
.filters li { flex: none; scroll-snap-align: start; }
.filters li:last-child { padding-right: var(--s-7); }
.filters a {
    display: inline-flex; align-items: center; gap: var(--s-2); min-height: 2.75rem; padding: var(--s-2) var(--s-4);
    border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--moor); text-decoration: none; font-size: .95rem;
}
.filters a .i { color: var(--seegruen); }
.filters a:hover { border-color: var(--seegruen); }
.filters a[aria-current="page"] { background: var(--moor); border-color: var(--moor); color: var(--nebel); font-weight: 700; }
.filters a[aria-current="page"] .i { color: var(--boje); }
.count { color: var(--muted); font-size: .85rem; }
.filters a[aria-current="page"] .count { color: var(--nebel); }

/* ---------- Results ---------- */
.results { padding-top: var(--s-7); }
.results-head { margin-bottom: var(--s-6); }
.results-head h2 { margin-bottom: var(--s-1); }
.results-head p { margin: 0; font-size: .85rem; color: var(--muted); }

/* Cards are not boxes: a photo, then text on the page itself. */
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-8) var(--s-6); grid-template-columns: 1fr; }
.card { display: flex; flex-direction: column; }
.card-media { position: relative; aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden; background: var(--wasser); }

/* Photo gallery: native scroll-snap, swipeable without JS; gallery.js adds arrows + counter. */
.gallery { list-style: none; margin: 0; padding: 0; height: 100%; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery li { flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; }
.gallery a, .gallery picture { display: block; height: 100%; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery-count {
    position: absolute; right: var(--s-2); bottom: var(--s-2); margin: 0; display: inline-flex; align-items: center; gap: var(--s-1);
    padding: .15rem var(--s-2); border-radius: 4px; background: rgb(18 48 47 / .82); color: var(--nebel); font-size: .75rem; font-weight: 700; pointer-events: none;
}
.gallery-btn { display: none; }
@media (hover: hover) and (pointer: fine) {
    .gallery-btn {
        position: absolute; top: 50%; translate: 0 -50%; display: grid; place-items: center; width: 2.25rem; height: 2.25rem;
        border: 0; border-radius: 50%; background: rgb(255 255 255 / .94); color: var(--moor); cursor: pointer; opacity: 0; transition: opacity .15s ease;
    }
    .gallery-prev { left: var(--s-2); }
    .gallery-prev .i { rotate: 180deg; }
    .gallery-next { right: var(--s-2); }
    .card:hover .gallery-btn:not(:disabled) { opacity: 1; }
    .gallery-btn:disabled { visibility: hidden; }
}
.card-flag {
    position: absolute; top: var(--s-2); left: var(--s-2); margin: 0; padding: .15rem var(--s-2); border-radius: 4px;
    background: var(--boje); color: var(--moor); font-size: .75rem; font-weight: 700; pointer-events: none;
}

/* The title link covers the text block; the photos have their own links. */
.card-body { position: relative; display: flex; flex-direction: column; gap: var(--s-2); padding-top: var(--s-4); }
.card-body > * { margin: 0; }
.card-kind { font-size: .85rem; color: var(--seegruen); }
.card h3 a { color: var(--moor); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; }
.card h3 a:focus-visible { outline: none; }
.card:has(h3 a:focus-visible) .card-body { outline: 3px solid var(--moor); outline-offset: 4px; border-radius: 3px; }
@media (hover: hover) { .card-body:hover h3 a { text-decoration: underline; text-decoration-thickness: 2px; } }
.card-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; color: var(--muted); }
.facts { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); font-size: .85rem; color: var(--muted); }
.facts li { display: inline-flex; align-items: center; gap: var(--s-1); }
.facts .i { color: var(--seegruen); }

/* Affiliate box: always labelled as an ad */
.ad { margin-top: var(--s-8); padding: var(--s-4) var(--s-5); border: 1px dashed rgb(18 48 47 / .3); border-radius: 6px; }
.ad p { margin: 0; }
.ad-label { font-size: .8rem; font-weight: 700; color: var(--muted); margin-bottom: var(--s-1) !important; }

/* ---------- Host call to action ---------- */
.band { background: var(--moor); color: var(--nebel); padding-block: var(--s-8); }
.band h2 { color: var(--nebel); margin-bottom: var(--s-2); }
.band p { margin: 0; max-width: 38rem; color: rgb(238 242 239 / .88); }
.band-inner { display: grid; gap: var(--s-5); }
.band :focus-visible { outline-color: var(--boje); }

/* ---------- Webcams: a wall of live pictures; a swipeable row on phones ---------- */
.section-note { margin: -.5rem 0 var(--s-5); max-width: 40rem; color: var(--muted); }
.webcams {
    list-style: none; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter) var(--s-2); display: grid;
    grid-auto-flow: column; grid-auto-columns: 72%; gap: var(--s-4);
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); scrollbar-width: thin;
}
.webcams li { scroll-snap-align: start; }
.webcams a { display: flex; flex-direction: column; gap: var(--s-1); color: var(--moor); text-decoration: none; }
.webcams img, .webcam-empty { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; background: var(--wasser); }
.webcam-empty { display: grid; place-items: center; color: var(--seegruen); font-size: 2rem; }
.webcam-name { margin-top: var(--s-1); font-weight: 700; }
.webcam-time { font-size: .8rem; color: var(--muted); }
.webcams a:hover .webcam-name { text-decoration: underline; }

/* ---------- Events: an agenda, one block per day ---------- */
.agenda { display: grid; gap: var(--s-6); margin-bottom: var(--s-5); }
.agenda-day h3 { font: italic 500 1.3rem/1.2 var(--f-chart); color: var(--seegruen); padding-bottom: var(--s-2); border-bottom: 1px solid var(--line); margin-bottom: var(--s-3); }
.agenda-day ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); }
.agenda-day li { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: var(--s-2); }
.agenda-time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .9rem; padding-top: .1rem; }
.agenda-day a { font-weight: 700; color: var(--moor); }
.agenda-venue { display: block; font-size: .85rem; color: var(--muted); }

/* ---------- More results ---------- */
.more-results { margin-top: var(--s-7); }
.more-results > summary {
    list-style: none; cursor: pointer; display: flex; justify-content: center; align-items: center; min-height: 3rem;
    padding: var(--s-3) var(--s-6); border: 2px solid var(--moor); border-radius: 999px; font-weight: 700; color: var(--moor);
    width: fit-content; margin-inline: auto;
}
.more-results > summary::-webkit-details-marker { display: none; }
.more-results > summary:hover { background: var(--moor); color: var(--nebel); }
.more-results .when-open, .more-results[open] .when-closed { display: none; }
.more-results[open] .when-open { display: inline; }
.more-results[open] > summary { margin-bottom: var(--s-7); }

/* ---------- Text pages ---------- */
.prose > * { max-width: 40rem; }
.prose p { color: var(--muted); }
.prose h2 { margin-top: 1.6em; }

/* ---------- Footer ---------- */
.site-footer { background: var(--nebel-dark); border-top: 1px solid var(--line); padding-block: var(--s-8); font-size: .9rem; }
.footer-grid { display: grid; gap: var(--s-7); }
.footer-grid p { margin: 0; color: var(--muted); max-width: 30rem; }
.footer-grid .footer-title { font: italic 500 1.15rem/1.2 var(--f-chart); color: var(--seegruen); margin: 0 0 var(--s-3); }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li + li { margin-top: var(--s-2); }

/* ---------- Tablet ---------- */
@media (min-width: 40rem) {
    html { scroll-padding-top: 5.5rem; }
    .chart-map .place-small, .chart-map .place, .chart-map .town-minor { display: inline; }
    .brand-text span { display: block; }
    .brand strong { font-size: 1.05rem; }
    .brand img { width: 2.5rem; height: 2.5rem; }
    .btn-small { font-size: .95rem; padding: var(--s-2) var(--s-5); }
    .filter-group { grid-template-columns: 3rem minmax(0, 1fr); align-items: center; }
    .filters ul { flex-wrap: wrap; overflow: visible; mask-image: none; margin: 0; padding: 0; }
    .filters li:last-child { padding-right: 0; }
    .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .band-inner { grid-template-columns: 1fr auto; align-items: center; }
    .webcams { grid-auto-columns: 40%; }
    .agenda { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); column-gap: var(--s-7); }
    .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Desktop ---------- */
@media (min-width: 64rem) {
    .hero { padding-block: var(--s-8) var(--s-4); }
    .hero-grid { grid-template-columns: 5fr 7fr; gap: var(--s-8); }
    .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    /* Desktop: all cams at once, six per row, no scrolling. */
    .webcams { grid-auto-flow: row; grid-template-columns: repeat(6, minmax(0, 1fr)); overflow: visible; margin: 0; padding: 0; }
}
