/* ========================================================================
   Building HVAC Engineering – Kalme, witte UI
   ======================================================================== */

:root {
    /* Kleuren */
    --bg: #ffffff;
    --bg-weak: #fafafa;
    --text: #1a1a1a;
    --text-weak: #555;
    --muted: #eaeaea;
    --line: #e6e6e6;

    /* Accent */
    --brand: #255ee9;
    --brand-weak: #eaf1ff;
    --brand-strong: #1b49b3;

    /* Lay-out & effects */
    --radius: 16px;
    --shadow: 0 8px 24px rgba(0, 0, 0, .05);
    --shadow-soft: 0 2px 10px rgba(0, 0, 0, .04);
    --maxw: 1100px;
    --nav-h: 68px; /* min-hoogte header/nav op desktop */

    /* Typografie */
    --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    --leading: 1.6;

    color-scheme: light;
}

/* Resets & basis */
* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    line-height: var(--leading);
    color: var(--text);
    background: var(--bg);
    background: radial-gradient(1400px 900px at 100% -5%, var(--bg-weak), var(--bg)) no-repeat;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 64px 0;
}

.section > .container > h2 {
    margin: 0 0 6px;
}

small {
    color: var(--text-weak);
}

/* Utilities */
.mt-6 {
    margin-top: .75rem;
}

.mb-6 {
    margin-bottom: .75rem;
}

.mt-10 {
    margin-top: 2.5rem;
}

.mt-12 {
    margin-top: 3rem;
}

.mb-14 {
    margin-bottom: 3.5rem;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

/* Accessible hide */
.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Voor legacy compat, liever .sr-only gebruiken */
.hidden-trap {
    position: absolute !important;
    left: -9999px !important;
    height: 0;
    width: 0;
    overflow: hidden;
}

/* Typo schalen */
h1 {
    font-size: clamp(1.9rem, 3.6vw, 3rem);
    line-height: 1.15;
    margin: 0 0 .5rem;
}

h2 {
    font-size: clamp(1.4rem, 2.2vw, 2rem);
    line-height: 1.25;
}

h3 {
    font-size: 1.15rem;
    margin: 0 0 .35rem;
}

/* Header / nav */
header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    will-change: backdrop-filter;
}

@supports (backdrop-filter: blur(8px)) {
    header {
        backdrop-filter: saturate(180%) blur(8px);
        background: color-mix(in oklab, var(--bg) 90%, transparent);
    }
}

/* Belangrijk: geen vaste hoogte → wrap-vriendelijk */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--nav-h);
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: .65rem;
    font-weight: 800;
    letter-spacing: .2px;
}

.logo .mark {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 800;
    color: #fff;
    background: var(--brand);
    box-shadow: var(--shadow-soft);
}

/* Menu basis */
nav ul {
    display: flex;
    align-items: center;
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

nav a {
    text-decoration: none;
    color: var(--text-weak);
    padding: .35rem .5rem;
    border-radius: 8px;
    white-space: nowrap;
}

nav a:hover {
    color: var(--text);
    background: var(--bg-weak);
}

nav .btn {
    margin-left: .25rem;
}

/* Desktop-structuur primaire nav (rechts uitlijnen + veilig wrappen) */
.primary-nav {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-left: auto;
    flex-wrap: wrap;
}

.primary-nav #primary-menu {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.primary-nav .lang {
    display: flex;
    gap: .4rem;
}

/* Taal badges & tags – gedeelde basis */
.badge, .tag {
    display: inline-block;
    font-size: .85rem;
    padding: .25rem .55rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    text-decoration: none;
    color: var(--text-weak);
    background: var(--bg);
}

.badge:hover, .tag:hover {
    color: var(--text);
    border-color: var(--brand);
}

.taglist {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.tag.active {
    background: var(--brand-weak);
    border-color: var(--brand);
    color: var(--text);
}

/* Knoppen */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .85rem 1rem;
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform .06s ease, box-shadow .18s ease, background .2s ease, color .2s ease;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
}

.btn.primary {
    background: var(--brand);
    border-color: transparent;
    color: #fff;
}

.btn.primary:hover {
    background: var(--brand-strong);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .08);
}

.btn.secondary {
    background: var(--bg);
    color: var(--text);
}

.btn.secondary:hover {
    background: var(--bg-weak);
    transform: translateY(-1px);
}

/* Hero */
.hero {
    padding: 72px 0 48px;
}

.hero p {
    color: var(--text-weak);
    max-width: 68ch;
}

.ctas {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
    margin-top: 14px;
}

/* USP balk */
.kv {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .6rem;
    margin-top: 18px;
}

.kv--mt {
    margin-top: 22px;
}

.kv > div {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: .65rem .75rem;
    background: var(--bg);
    color: var(--text-weak);
}

/* Grid helpers */
.grid {
    display: grid;
    gap: 16px;
}

.grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Cards */
.card {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

.article-wide {
    padding: 28px;
}

/* Quote */
.quote {
    border-left: 4px solid var(--brand);
    margin: 10px 0 0;
    padding: .25rem .75rem;
    color: var(--text-weak);
    background: var(--bg-weak);
    border-radius: 8px;
}

/* Blogkaarten & cover */
.blog-card-cover {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 12px;
}

.blog-cover {
    width: 100%;
    height: 260px;
    object-fit: cover;
    border-radius: 12px;
    margin: 12px 0 0;
}

/* Pager */
.pager {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-top: 16px;
}

.pager-info {
    color: var(--text-weak);
}

/* Notices */
.notice {
    border-left: 4px solid #18a957;
    background: #eaf9f0;
    border: 1px solid #cceedd;
    color: #145c35;
    padding: .75rem 1rem;
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
}

.notice.error {
    border-left-color: #d13b3b;
    background: #fdecec;
    color: #7b1d1d;
    border-color: #f5c7c7;
}

/* Formulieren */
.form {
    display: grid;
    gap: 12px;
}

label {
    font-weight: 600;
    font-size: .95rem;
}

input, textarea, select {
    width: 100%;
    padding: .7rem .8rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg);
    color: var(--text);
    transition: border-color .2s ease, box-shadow .2s ease;
}

/* Focus: fallback + modern */
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(37, 94, 233, .20);
}

@supports (color: color-mix(in oklab, red, blue)) {
    input:focus, textarea:focus, select:focus {
        box-shadow: 0 0 0 4px color-mix(in oklab, var(--brand) 20%, transparent);
    }
}

input[type="file"] {
    padding: .6rem;
}

/* Slider */
.slider {
    position: relative;
    overflow: hidden;
    margin: 18px auto;
    max-width: var(--maxw);
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--bg);
    box-shadow: var(--shadow);
    width: 100%;
    aspect-ratio: 16 / 9;
}

.slides {
    display: flex;
    transition: transform .5s ease;
    height: 100%;
    will-change: transform;
}

.slide {
    position: relative;
    min-width: 100%;
    background: var(--bg-weak);
    height: 100%;
}

.slide img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background-color: var(--bg-weak);
}

.slider .prev, .slider .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg);
    background: color-mix(in oklab, var(--bg) 90%, transparent);
    border: 1px solid var(--line);
    border-radius: 999px;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    touch-action: manipulation;
}

.slider .prev {
    left: 10px;
}

.slider .next {
    right: 10px;
}

.slider .prev:hover, .slider .next:hover {
    background: var(--bg);
}

.captionbar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: .6rem;
    background: var(--bg);
    background: color-mix(in oklab, var(--bg) 86%, transparent);
    backdrop-filter: blur(6px);
    border-top: 1px solid var(--line);
    padding: .6rem .8rem;
    color: var(--text);
}

.captionbar .captext {
    color: var(--text-weak);
}

.dots {
    display: flex;
    justify-content: center;
    gap: .4rem;
    margin-top: 10px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--bg);
    cursor: pointer;
}

.dot.active {
    background: var(--brand);
    border-color: var(--brand);
}

/* Focus zichtbaar voor keyboardgebruikers */
:focus-visible {
    outline-offset: 2px;
    border-radius: 8px;
}

:focus-visible {
    outline: 3px solid var(--brand);
}

@supports (color: color-mix(in oklab, red, blue)) {
    :focus-visible {
        outline: 3px solid color-mix(in oklab, var(--brand) 55%, transparent);
    }
}

.dot:focus-visible, .slider .prev:focus-visible, .slider .next:focus-visible {
    outline: 3px solid var(--brand);
    outline-offset: 2px;
}

/* Profiel */
.profile-img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    margin: 0 auto 12px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
}

/* Footer */
footer {
    border-top: 1px solid var(--line);
    color: var(--text-weak);
    padding: 28px 0;
}

.footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

footer a {
    color: inherit;
}

footer a:hover {
    color: var(--text);
    text-decoration: underline;
}

/* Links algemeen */
a {
    color: var(--brand-strong);
}

a:hover {
    color: var(--brand);
}

/* --- Privacy modal --- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-backdrop.open {
    display: flex;
}

.modal {
    background: var(--card-bg, #111);
    color: inherit;
    width: min(920px, 92vw);
    max-height: 86vh;
    overflow: auto;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
    padding: 1rem 1rem 1.25rem;
}

.modal header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    position: sticky;
    top: 0;
    background: inherit;
    padding-bottom: .5rem;
    margin-bottom: .5rem;
}

.modal header h2 {
    margin: .5rem 0;
    font-size: 1.25rem;
}

.modal .close-btn {
    border: 0;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.modal .content {
    padding: .25rem .25rem 0;
}

/* Verberg de privacysectie volledig uit de layout */
.is-hidden-privacy[aria-hidden="true"] {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0; padding: 0; margin: -1px;
}


.modal .content img {
    max-width: 100%;
    height: auto;
}

@media (prefers-color-scheme: light) {
    .modal {
        background: #fff;
    }
}


/* High-contrast/forced colors */
@media (forced-colors: active) {
    :focus-visible {
        outline: 2px solid CanvasText;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }

    .slides {
        transition: none !important;
    }

    .btn:hover, .btn.primary:hover, .btn.secondary:hover {
        transform: none !important;
    }
}

/* Responsiviteit: desktop→tablet */
@media (max-width: 1080px) {
    .grid.cols-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* === Mobiele navigatie === */
.menu-toggle {
    display: none; /* desktop: verborgen */
    border: 1px solid var(--line);
    background: var(--bg);
    border-radius: 10px;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    color: var(--text);
}

.primary-nav {
    position: relative;
}

/* Mobiel gedrag (één overlaypaneel) */
@media (max-width: 760px) {
    :root {
        --nav-h: 62px;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .nav {
        gap: .5rem;
        min-height: var(--nav-h);
    }

    /* standaard: dicht */
    .primary-nav {
        position: static;
    }

    .primary-nav #primary-menu,
    .primary-nav .lang {
        display: none;
    }

    /* OPEN: .primary-nav wordt het overlaypaneel */
    .primary-nav.nav-open {
        position: absolute;
        left: 0;
        right: 0;
        top: var(--nav-h);
        z-index: 60;
        background: var(--bg);
        border-bottom: 1px solid var(--line);
        box-shadow: 0 16px 30px rgba(0, 0, 0, .06);
        padding: .75rem;
        display: flex;
        flex-direction: column;
        gap: .5rem;
    }

    /* Items in normale flow onder elkaar */
    .primary-nav.nav-open #primary-menu,
    .primary-nav.nav-open .lang {
        display: flex;
        position: static;
    }

    .primary-nav.nav-open #primary-menu {
        flex-direction: column;
        gap: .25rem;
    }

    .primary-nav.nav-open #primary-menu a {
        padding: .8rem 1rem;
        border-radius: 10px;
        font-size: 1rem;
    }

    .primary-nav.nav-open #primary-menu a:hover {
        background: var(--bg-weak);
    }

    .primary-nav.nav-open #primary-menu .btn.secondary {
        justify-content: center;
        margin: .25rem 0 0;
    }

    /* taalbadges eronder */
    .primary-nav.nav-open .lang {
        gap: .5rem;
        margin-top: .25rem;
    }

    /* body achter overlay niet scrollen */
    body.mobile-nav-open {
        overflow: hidden;
    }

    /* Kleine mobiele polish */
    .hero {
        padding: 56px 0 36px;
    }

    .section {
        padding: 48px 0;
    }

    nav a {
        padding: .6rem .75rem;
    }

    /* grotere tap targets */
}

/* KV + grids op smal */
@media (max-width: 760px) {
    .kv {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid.cols-2, .grid.cols-3 {
        grid-template-columns: 1fr;
    }

    .footer-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .form .grid.cols-2 > * {
        min-width: 0;
    }
}

/* --- Slider: mobielvriendelijk (beeld zichtbaar, caption eronder) --- */
@media (max-width: 760px) {
    .slider {
        aspect-ratio: 4 / 3;
    }

    .slide img {
        object-fit: cover;
        object-position: center;
    }

    .captionbar {
        position: static;
        display: block;
        background: var(--bg);
        backdrop-filter: none;
        border-top: 1px solid var(--line);
        padding: .5rem .75rem;
    }

    .captionbar strong {
        display: block;
        margin-bottom: .25rem;
    }

    .captionbar .captext {
        display: block;
    }

    .dots {
        margin-top: 8px;
    }
}

@media (max-width: 380px) {
    .slider {
        aspect-ratio: 1 / 1;
    }
}
