/*
 * WEBGLOBE MAINTAINER NOTES
 *
 * Style the style interface and its responsive presentation.
 *
 * The selectors form a contract with the rendered markup and browser interactions. Preserve
 * keyboard focus, disabled/hidden states and the smaller-screen rules when adjusting the
 * cascade; an attractive desktop layout is not sufficient evidence of usable mobile forms.
 */
/* --- Language Toggle Switch --- */
.language-switcher-toggle {
    text-align: right;
    position: fixed;
    top: 106px;
    top: calc(env(safe-area-inset-top) + 106px);
    right: clamp(10px, 2vw, 24px);
    margin: 0;
    z-index: 1105;
}
.toggle-switch {
    display: inline-flex;
    align-items: center;
    background: url('/images/button.webp') center / 100% 100% no-repeat;
    border-radius: 0;
    border: 0;
    cursor: pointer;
    position: relative;
    width: 96px;
    height: 42px;
    padding: 4px;
    box-shadow: none;
    -webkit-user-select: none;
    user-select: none;
    transition: background 0.2s;
    text-decoration: none;
}
.toggle-option {
    flex: 1 1 0;
    text-align: center;
    z-index: 2;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: color 0.2s;
    padding: 0 0;
    line-height: 34px;
    letter-spacing: 0.5px;
}
.toggle-option.active {
    color: #ffffff;
    font-weight: 800;
    text-shadow: 0 1px 3px rgba(0, 15, 35, 0.85);
}
.toggle-slider {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 40px;
    height: 30px;
    background: rgba(90, 143, 214, 0.9);
    border: 1px solid rgba(190, 244, 255, 0.75);
    border-radius: 999px;
    box-shadow: 0 0 10px rgba(90, 211, 255, 0.45);
    pointer-events: none;
    transition: left 0.25s cubic-bezier(.4,2,.6,1), background 0.2s;
    z-index: 1;
}
.toggle-slider.right {
    left: 50px;
    background: rgba(24, 70, 154, 0.92);
}
:root {
    color-scheme: dark;
    /* Vaste donkere vormgeving. */
    --hero-bg-dark: var(--background-newmob, url('/images/newmob.webp'));
    --hero-logo-bg: url('/images/logoachter.webp');
    --bg-image: var(--hero-bg-dark);
    --text-color: #ffffff;
    --text-secondary: #e0e5ea;
    --primary-blue: #18469a;
    --primary-blue-light: #5a8fd6;
    --section-bg: rgba(0, 0, 0, 0.2);
    --card-bg: rgba(0, 0, 0, 0.3);
    --border-color: rgba(255, 255, 255, 0.1);
}

/* Kies de originele compositie op schermverhouding, ook bij tussenformaten
   en draaien van een tablet. Alleen de weergave schaalt; de WebP's blijven intact. */
@media (min-aspect-ratio: 2/3) {
    :root { --hero-bg-dark: var(--background-tablet, url('/images/tablet.webp')); }
}
@media (min-aspect-ratio: 1/1) {
    :root { --hero-bg-dark: var(--background-smalldesk, url('/images/smalldesk.webp')); }
}
@media (min-aspect-ratio: 3/2) {
    :root { --hero-bg-dark: var(--background-1610desk, url('/images/1610desk.webp')); }
}
@media (min-aspect-ratio: 17/10) {
    :root { --hero-bg-dark: var(--background-169desk, url('/images/169desk.webp')); }
}
@media (min-aspect-ratio: 2/1) {
    :root { --hero-bg-dark: var(--background-ultrawide, url('/images/ultrawide.webp')); }
}

/* Safari/iOS Optimalisaties */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-overflow-scrolling: touch;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

*::before,
*::after {
    box-sizing: border-box;
}

input,
select,
textarea {
    max-width: 100%;
    min-width: 0;
}

.is-hidden {
    display: none !important;
}

body {
    margin: 0;
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-image) center center / cover no-repeat fixed;
    color: var(--text-color);
    padding-top: 80px;
    padding-top: max(80px, env(safe-area-inset-top));
    padding-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom);
    margin-left: 10px;
    margin-right: 10px;
    transition: background 0.3s ease, color 0.3s ease;
}

.public-skip-link {
    position: fixed;
    z-index: 2000;
    top: max(10px, env(safe-area-inset-top));
    left: max(10px, env(safe-area-inset-left));
    padding: 11px 16px;
    border: 2px solid currentColor;
    background: #c7ff27;
    color: #071321;
    font-weight: 800;
    text-decoration: none;
    /* Hide the whole link even when the iPhone safe-area moves its origin down. */
    transform: translateY(calc(-100% - max(10px, env(safe-area-inset-top)) - 4px));
    transition: transform 0.18s ease;
}

.public-skip-link:focus,
.public-skip-link:focus-visible {
    transform: translateY(0);
}

/* Index-only: voorkom horizontaal swipen door hero overlays */
body.page-home {
    overflow-x: hidden;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    max-width: 100%;
}

body.page-home header {
    overflow: visible;
    padding-left: 0;
    padding-right: 0;
    padding-top: 0;
    max-width: 100vw;
    height: auto;
    max-height: none;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* De navigatie is fixed bovenaan; het logo volgt er direct onder. */
body.page-home .logo-container.logo-container--text {
    order: 1;
}

body.page-home .home-title-copy {
    order: 2;
}

body.page-home header > .hero-actions {
    order: 3;
}

body.page-home .wgfx-codefall {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    margin: 0 auto;
}

body.page-home .logo-container.logo-container--text::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

html,
body.page-home {
    overflow-x: hidden;
}

body.page-home .sections-container {
    width: 100%;
    max-width: 1200px;
    box-sizing: border-box;
}

body.page-home .language-switcher-toggle {
    position: fixed;
    top: 100px;
    top: calc(env(safe-area-inset-top) + 100px);
    right: clamp(8px, 1vw, 18px);
    margin-right: 0;
    padding-right: 0;
    margin-top: 0;
    width: auto;
    max-width: calc(100vw - 10px);
    text-align: right;
    box-sizing: border-box;
    z-index: 1002;
}

@media (max-width: 1024px) {
    body.page-home,
    body.page-home header,
    body.page-home .sections-container {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    body.page-home .language-switcher-toggle {
        position: fixed;
        top: 82px;
        top: calc(env(safe-area-inset-top) + 82px);
        right: 10px;
        margin: 0;
        padding: 0;
    }
}

/* Wide screen fine-tuning met smalle achtergronden */
@media (min-width: 1280px) and (min-aspect-ratio: 16/9) {
    body {
        background-position: center top;
    }
}

/* Fix voor fixed background op iOS Safari */
@supports (-webkit-overflow-scrolling: touch) {
    body {
        background-attachment: scroll;
    }
}

@media (max-width: 768px), (pointer: coarse) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="file"]):not([type="hidden"]),
    select,
    textarea {
        font-size: 16px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
