/* Zwolsche Zeeverkenners — Scouting Nederland huisstijl
   Kleuren en typografie volgens Huisstijlhandleiding v6.0 (april 2024):
   rood #e2001a, blauw #005ea8, geel #ffdd00, groen #009036;
   Arial als huisstijlletter, Impact voor koppen. */
:root {
    --rood: #e2001a;
    --blauw: #005ea8;
    --geel: #ffdd00;
    --groen: #009036;
    --blauw-donker: #004a87;
    --ink: #22313f;
    --muted: #5b6b7a;
    --paper: #ffffff;
    --wash: #eef4f9;
    --line: #d9e2ea;

    /* Layout constants, stated once. --nav-h, --logo-ratio and --logo-base-y
       are the no-JS fallbacks for values the script measures at runtime
       (nav.offsetHeight, the SVG viewBox, --logo-base-y is read back by JS). */
    --content-max: 68rem;
    --nav-h: 53px;                              /* 52px min-height + 1px border */
    --band-h: clamp(160px, 25vw, 300px);
    --logo-w: clamp(260px, 42vw, 560px);
    --logo-ratio: 0.49514;                      /* SVG viewBox height / width */
    --logo-base-y: 6.66%;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    position: relative;
    overflow-x: clip;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: var(--paper);
    line-height: 1.6;
}
img { max-width: 100%; }
a { color: var(--blauw); }

h1, h2, h3, .gallery h1, .gallery h2 {
    font-family: Impact, 'Arial Black', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 400;
    letter-spacing: .02em;
}

/* ---------- top nav ---------- */
.site-nav {
    position: sticky; top: 0; z-index: 50;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}
.nav-inner {
    max-width: var(--content-max); margin: 0 auto; padding: 0 1rem;
    display: flex; align-items: center; gap: 1rem; min-height: 52px;
}
.nav-toggle { display: none; }
.nav-toggle-label { display: none; margin-left: auto; font-size: 1.6rem; cursor: pointer; padding: .4rem .6rem; }
ul.menu {
    display: flex; flex-wrap: wrap; margin: 0 0 0 auto; padding: 0; list-style: none;
}
ul.menu > li { position: relative; }
ul.menu > li > a {
    display: block; padding: .9rem .75rem; text-decoration: none;
    color: var(--ink); font-weight: 700; font-size: .95rem;
}
ul.menu > li:hover > a { color: var(--blauw); }
ul.menu > li.active > a { color: var(--blauw); box-shadow: inset 0 -3px 0 var(--rood); }
ul.menu li ul {
    display: none; position: absolute; left: 0; top: 100%; min-width: 14rem;
    margin: 0; padding: .3rem 0; list-style: none;
    background: var(--paper); border: 1px solid var(--line); border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,.1);
}
ul.menu li:hover > ul, ul.menu li:focus-within > ul { display: block; }
ul.menu li ul a {
    display: block; padding: .45rem 1rem; text-decoration: none; color: var(--ink); font-size: .92rem;
}
ul.menu li ul li:hover > a, ul.menu li ul li.active > a { background: var(--wash); color: var(--blauw); }

@media (max-width: 800px) {
    .nav-toggle-label { display: block; }
    ul.menu { display: none; flex-direction: column; width: 100%; flex-basis: 100%; padding-bottom: .5rem; }
    .nav-inner { flex-wrap: wrap; }
    .nav-toggle:checked ~ ul.menu { display: flex; }
    ul.menu > li { border-top: 1px solid var(--line); }
    ul.menu > li:first-child { border-top: none; }
    ul.menu > li > a { padding: .7rem .5rem; }
    ul.menu > li.active > a { box-shadow: inset 3px 0 0 var(--rood); padding-left: .8rem; }
    ul.menu li ul {
        display: block; position: static; border: none; box-shadow: none;
        padding: 0 0 .4rem 1.2rem;
    }
    ul.menu li ul a { padding: .45rem .5rem; }
}

/* ---------- header band ---------- */
.site-header {
    height: var(--band-h);
    background-size: cover; background-position: center;
}
.site-header .header-inner {
    max-width: var(--content-max); height: 100%; margin: 0 auto; padding: 0 1rem;
    display: flex; align-items: center; justify-content: flex-end;
}
/* Full-height rail carrying the sticky logo (compositor-driven pinning).
   Below the nav (50) by default so open dropdown menus cover the logo;
   JS raises it once the logo overlaps the nav bar, where dropdowns
   (which hang below the bar) can no longer collide with it. */
.logo-rail {
    position: absolute; inset: 0;
    pointer-events: none; z-index: 40;
}
.logo-rail.over-nav { z-index: 60; }
.logo-rail-inner { max-width: var(--content-max); height: 100%; margin: 0 auto; padding: 0 1rem; }
.header-logo {
    display: block; position: sticky;
    width: var(--logo-w); height: auto;
    overflow: visible;
    /* waterline (at 93.43% + 6.66% base offset = the box bottom) rides the
       band's bottom edge, then sticks to the nav; JS refines top/margin */
    transform: translateY(var(--logo-base-y));
    transform-origin: 0 93.43%;
    top: calc(var(--nav-h) - var(--logo-ratio) * var(--logo-w));
    margin-top: calc(var(--nav-h) + var(--band-h) - var(--logo-ratio) * var(--logo-w));
}
/* shadow on the artwork only, not on the waterline segments */
.header-logo > g {
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.55)) drop-shadow(0 4px 16px rgba(0,0,0,.45));
}
/* docked against the nav bar: white art turns huisstijl-blauw */
.header-logo [style*="fill:#ffffff"],
.header-logo [style*="stroke:#ffffff"],
.header-logo text { transition: fill .35s, stroke .35s; }
.header-logo.docked [style*="fill:#ffffff"] { fill: var(--blauw) !important; }
.header-logo.docked [style*="stroke:#ffffff"] { stroke: var(--blauw) !important; }
.header-logo.docked text { fill: var(--blauw) !important; }
.header-logo.docked > g { filter: none; }
/* Scouting Nederland logo rechts; witte rand-effect voor gebruik op foto's. */
.site-header .header-logo-sn {
    width: clamp(70px, 9vw, 120px); height: auto; align-self: center;
    filter: drop-shadow(1.5px 0 0 #fff) drop-shadow(-1.5px 0 0 #fff)
            drop-shadow(0 1.5px 0 #fff) drop-shadow(0 -1.5px 0 #fff);
}
@media (max-width: 600px) {
    /* scale the composition down instead of hiding it; the SVG keeps
       drawing the waterline at every size */
    .header-logo { --logo-w: min(72vw, 300px); }
    .site-header .header-logo-sn {
        width: 52px; align-self: flex-start; margin-top: .7rem;
    }
}

/* ---------- content ---------- */
main { min-height: 40vh; padding-top: 1.75rem; }
.page-body, .gallery { max-width: 52rem; margin: 0 auto; padding: 1rem 1rem 3rem; }
.gallery { max-width: var(--content-max); }
.page-body h1, .gallery h1 { margin: 1.2rem 0 .8rem; color: var(--blauw); font-size: 2.1rem; }
.page-body h2, .page-body h3, .gallery h2 { color: var(--blauw); margin-top: 1.6rem; }
.page-body iframe { max-width: 100%; border: 0; }

.body-image { margin: 1.2rem 0; text-align: center; }
.body-image img { border-radius: 8px; max-height: 420px; width: auto; max-width: 100%; }
figcaption { color: var(--muted); font-size: .88rem; margin-top: .3rem; text-align: center; }

/* Inline images inside rich text: small emblems float beside the text. */
.page-body .richtext-image.left {
    float: left; margin: .2rem 1.2rem .6rem 0; max-width: min(40%, 220px); height: auto;
}
.page-body .richtext-image.right {
    float: right; margin: .2rem 0 .6rem 1.2rem; max-width: min(40%, 220px); height: auto;
}
.page-body .richtext-image.full-width {
    display: block; margin: 1.2rem auto; max-width: 100%; width: auto;
    height: auto; max-height: 420px; border-radius: 8px;
}
.page-body h1, .page-body h2, .page-body h3, .page-body h4,
.page-body .body-image, .page-body .image-row, .page-body .button-row { clear: both; }

/* Image rows: uncropped tiles (photos and sponsor logos alike). */
.image-row {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: .8rem; margin: 1.2rem 0;
}
.image-row figure { margin: 0; display: flex; flex-direction: column; }
.image-row .tile {
    aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center;
    background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .4rem;
}
.image-row .tile a { display: contents; }
.image-row img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }

/* Plain tables pasted into rich text (e.g. leiding lists). The body's
   overflow-x clip removed the viewport scrollbar, so a too-wide table
   must scroll within its own box. */
.page-body table {
    border-collapse: collapse; margin: 1rem 0;
    display: block; max-width: 100%; overflow-x: auto;
}
.page-body th, .page-body td { padding: .35rem .8rem; text-align: left; }
.page-body table:not([style]) tr { border-bottom: 1px solid var(--line); }
.page-body table:not([style]) th { border-bottom: 2px solid var(--blauw); }

.button-row { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.2rem 0; }
a.button, .contact-form button {
    display: inline-block; padding: .5rem 1.1rem;
    background: var(--blauw); color: #fff; text-decoration: none;
    border: none; border-radius: 6px; font-weight: 700; font-size: .95rem; cursor: pointer;
}
a.button:hover, .contact-form button:hover { background: var(--blauw-donker); }

.responsive-video { position: relative; aspect-ratio: 16/9; margin: 1.2rem 0; }
.responsive-video iframe, .responsive-video video {
    position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 8px;
}

/* ---------- contact form ---------- */
.contact-form { margin: 2rem 0; padding: 1.5rem; background: var(--wash); border-radius: 10px; }
.contact-form > div { margin-bottom: 1rem; }
.contact-form label { display: block; font-weight: 700; margin-bottom: .3rem; }
.contact-form input, .contact-form textarea {
    width: 100%; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 6px;
    font: inherit; background: var(--paper);
}
.contact-form textarea { min-height: 8rem; }

/* ---------- footer: huisstijl iconenpatroon op Scouting-blauw ---------- */
.site-footer {
    margin-top: 2rem;
    background: var(--blauw) url('../website/images/pattern-blauw.svg') repeat;
    background-size: 320px auto;
    color: #eaf2fa;
}
.footer-inner { max-width: var(--content-max); margin: 0 auto; padding: 1.8rem 1rem; font-size: .92rem; }
.site-footer a { color: #fff; }
