/* =============================================================================
   De Polderhaan - Base stylesheet
   =============================================================================
   Shared design tokens, reset, typography, header, footer, and buttons.
   Loaded by every page. Page-specific styles go in their own stylesheet.

   Structure:
     1.  Design tokens (CSS variables)
     2.  Font faces (self-hosted, no Google CDN)
     3.  Reset & base
     4.  Typography
     5.  Layout utilities
     6.  Buttons
     7.  Header
     8.  Footer
     9.  Accessibility helpers
     10. Responsive breakpoints
   ============================================================================= */


/* =============================================================================
   1. DESIGN TOKENS
   ============================================================================= */
:root {
    /* --- Brand colors ---------------------------------------------------- */
    --color-orange:        #FD6000;   /* Primary CTA, headings, accents    */
    --color-orange-dark:   #C74B00;   /* Hover state for orange            */
    --color-yellow:        #F5C800;   /* Secondary CTA (booking)           */
    --color-yellow-dark:   #D4AC00;   /* Hover state for yellow            */

    /* --- Neutral palette ------------------------------------------------- */
    --color-text:          #2C2C2C;   /* Body text                          */
    --color-text-muted:    #6B6B6B;   /* Secondary body text                */
    --color-dark-bg:       #4A423A;   /* Warm brown-grey section background */
    --color-dark-bg-alt:   #3D362E;   /* Slightly darker variant            */
    --color-light-bg:      #FAFAFA;   /* Off-white section background       */
    --color-white:         #FFFFFF;
    --color-border:        #E5E5E5;

    /* --- Typography ------------------------------------------------------ */
    --font-display:        "Playfair Display", Georgia, "Times New Roman", serif;
    --font-body:           "Open Sans", -apple-system, BlinkMacSystemFont,
                           "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --fs-hero:             clamp(1.625rem, 3vw + 0.4rem, 2.75rem);
    --fs-h1:               clamp(1.625rem, 2.2vw + 0.8rem, 2.375rem);
    --fs-h2:               clamp(1.25rem, 1.6vw + 0.6rem, 1.75rem);
    --fs-h3:               clamp(1.0625rem, 1vw + 0.5rem, 1.25rem);
    --fs-body:             0.9375rem;     /* 15px */
    --fs-small:            0.8125rem;     /* 13px */

    --lh-tight:            1.2;
    --lh-normal:           1.6;

    /* --- Spacing scale --------------------------------------------------- */
    --space-xs:            0.25rem;
    --space-sm:            0.5rem;
    --space-md:            1rem;
    --space-lg:            2rem;
    --space-xl:            4rem;
    --space-xxl:           6rem;

    /* --- Layout ---------------------------------------------------------- */
    --container-max:       1280px;
    --container-padding:   1.5rem;
    --header-height:       110px;

    /* --- Effects --------------------------------------------------------- */
    --radius-sm:           4px;
    --radius-md:           8px;
    --radius-pill:         999px;

    --shadow-sm:           0 1px 2px rgba(0, 0, 0, 0.08);
    --shadow-md:           0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg:           0 12px 32px rgba(0, 0, 0, 0.15);

    --transition-fast:     150ms ease;
    --transition-base:     250ms ease;
}


/* =============================================================================
   2. FONT FACES (self-hosted for privacy / GDPR)
   =============================================================================
   Install the .woff2 files as described in /assets/fonts/README.md.
   If files are missing, the browser falls back to the system serif/sans.
   ============================================================================= */
@font-face {
    font-family: "Playfair Display";
    font-style: italic;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/playfair-display-v37-latin_latin-ext-700italic.woff2") format("woff2");
}
@font-face {
    font-family: "Playfair Display";
    font-style: italic;
    font-weight: 900;
    font-display: swap;
    src: url("../fonts/playfair-display-v37-latin_latin-ext-900italic.woff2") format("woff2");
}
@font-face {
    font-family: "Open Sans";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/open-sans-v40-latin_latin-ext-regular.woff2") format("woff2");
}
@font-face {
    font-family: "Open Sans";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/open-sans-v40-latin_latin-ext-600.woff2") format("woff2");
}
@font-face {
    font-family: "Open Sans";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/open-sans-v40-latin_latin-ext-700.woff2") format("woff2");
}


/* =============================================================================
   3. RESET & BASE
   ============================================================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--fs-body);
    line-height: var(--lh-normal);
    color: var(--color-text);
    background-color: var(--color-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

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

a {
    color: var(--color-orange);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover,
a:focus {
    color: var(--color-orange-dark);
    text-decoration: underline;
}

button {
    font-family: inherit;
    cursor: pointer;
}


/* =============================================================================
   4. TYPOGRAPHY
   ============================================================================= */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 700;
    line-height: var(--lh-tight);
    margin: 0 0 var(--space-md) 0;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p {
    margin: 0 0 var(--space-md) 0;
}

.text-center { text-align: center; }
.text-muted  { color: var(--color-text-muted); }


/* =============================================================================
   5. LAYOUT UTILITIES
   ============================================================================= */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

.section {
    padding: var(--space-xxl) 0;
}
.section--dark {
    background-color: var(--color-dark-bg);
    color: var(--color-white);
}
.section--dark h1,
.section--dark h2,
.section--dark h3 {
    color: var(--color-orange);
}
.section--light {
    background-color: var(--color-light-bg);
}

/* Fallback color voor hero-achtergronden zodat er tijdens een paginawissel
   (bv. taal switch) geen grijze flits zichtbaar is voordat de hero-foto is
   geladen. Donker-bruin matcht de gradient-overlay van .hero__bg::after. */
.hero__bg {
    background-color: var(--color-dark-bg);
}


/* =============================================================================
   6. BUTTONS
   ============================================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    font-family: var(--font-body);
    font-size: var(--fs-body);
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: 18px;
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
}
.btn:hover,
.btn:focus {
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.btn:focus-visible {
    outline: 3px solid var(--color-orange);
    outline-offset: 3px;
}

/* Primary CTA - orange (general action) */
.btn--primary {
    background-color: var(--color-orange);
    color: var(--color-white);
}
.btn--primary:hover,
.btn--primary:focus {
    background-color: var(--color-orange-dark);
    color: var(--color-white);
}

/* Secondary CTA - yellow (booking / reservation) */
.btn--booking {
    background-color: var(--color-yellow);
    color: var(--color-text);
}
.btn--booking:hover,
.btn--booking:focus {
    background-color: var(--color-yellow-dark);
    color: var(--color-text);
}

/* Outline variant - for header contact button */
.btn--outline {
    background-color: transparent;
    color: var(--color-orange);
    border-color: var(--color-orange);
}
.btn--outline:hover,
.btn--outline:focus {
    background-color: var(--color-orange);
    color: var(--color-white);
}


/* =============================================================================
   7. HEADER
   ============================================================================= */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background-color: transparent;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0);
    /* Uniform vertical fade to white over 500ms (slower than the 250ms
       base to feel more natural). No direction - the whole header fades
       together. */
    transition: background-color 500ms ease,
                box-shadow 500ms ease,
                color 500ms ease;

    /* Header foreground: white while floating over the hero,
       orange once the header turns opaque (scrolled / menu open).
       --header-fg-on is used as the foreground color when an element
       fills with --header-fg (e.g. outline button hover). */
    --header-fg:       var(--color-white);
    --header-fg-hover: rgba(255, 255, 255, 0.75);
    --header-fg-on:    var(--color-orange);
}

/* Turn the header opaque once the page has scrolled, or when the
   mobile menu is open (so nav links stay readable against the panel). */
body[data-scrolled="true"] .site-header,
body[data-menu-open="true"] .site-header {
    background-color: var(--color-white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
    --header-fg:       var(--color-orange);
    --header-fg-hover: var(--color-orange-dark);
    --header-fg-on:    var(--color-white);
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    min-height: var(--header-height);
}

/* Nav sits snug against the logo; actions are pushed away with margin-left: auto.
   Small top offset aligns nav roughly with the lower half of the oversized logo. */
.site-header__inner > nav {
    margin-left: 0;
    margin-top: 14px;
}

.site-header__logo {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 86px;
    height: 86px;
    background-color: var(--color-white);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    padding: 0;
    margin-left: var(--space-md);
    margin-top: 18px;
    transition: background-color var(--transition-base),
                box-shadow var(--transition-base);
}

/* No circle behind the logo once the header itself is white. */
body[data-scrolled="true"] .site-header__logo,
body[data-menu-open="true"] .site-header__logo {
    background-color: transparent;
    box-shadow: none;
}
.site-header__logo img {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    width: auto;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}
.site-nav a {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--header-fg);
    position: relative;
    padding: var(--space-sm) var(--space-md);
    transition: color 500ms ease;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
    color: var(--header-fg-hover);
    text-decoration: none;
}
.site-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--header-fg);
    opacity: 0;
    transition: opacity var(--transition-base);
}
.site-nav a:hover::after,
.site-nav a:focus-visible::after,
.site-nav a[aria-current="page"]::after {
    opacity: 1;
}

.site-header__actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-shrink: 0;
    margin-left: auto;
    margin-top: 14px;
}

.site-header__social {
    color: var(--header-fg);
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 500ms ease;
}
.site-header__social svg {
    width: 100%;
    height: 100%;
}

/* Language switcher - flags */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    list-style: none;
    margin: 0;
    padding: 0;
}
.lang-switcher a {
    display: block;
    width: 24px;
    height: 16px;
    border: 1px solid var(--color-border);
    border-radius: 2px;
    overflow: hidden;
    opacity: 0.65;
    transition: transform var(--transition-fast),
                opacity var(--transition-fast);
}
.lang-switcher a:hover,
.lang-switcher a[aria-current="true"] {
    opacity: 1;
}
.lang-switcher a:hover {
    transform: scale(1.15);
}
.lang-switcher svg,
.lang-switcher img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Mobile menu toggle - hidden on desktop */
.menu-toggle {
    display: none;
    background: transparent;
    border: 0;
    padding: var(--space-sm);
    color: var(--header-fg);
    transition: color 500ms ease;
}
.menu-toggle svg {
    width: 28px;
    height: 28px;
}

/* Header-scoped outline button follows the header foreground variables so
   it flips from white-on-hero to orange-on-white. */
.site-header .btn--outline {
    color: var(--header-fg);
    border-color: var(--header-fg);
    transition: color 500ms ease, border-color 500ms ease,
                background-color var(--transition-base);
}
.site-header .btn--outline:hover,
.site-header .btn--outline:focus {
    background-color: var(--header-fg);
    color: var(--header-fg-on);
}


/* =============================================================================
   8. FOOTER
   ============================================================================= */
.site-footer {
    background-color: var(--color-white);
    padding: var(--space-xxl) 0 var(--space-lg) 0;
    color: var(--color-text);
}

.site-footer__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

/* Nudge the "Over Polderhaan" column to the right. */
.site-footer__grid > :first-child {
    padding-left: var(--space-xl);
}

/* Give the Navigatie column extra breathing room from the "Over"-column. */
.site-footer__grid > nav {
    padding-left: var(--space-xl);
}

/* Pull the Contact column a step to the left. */
.site-footer__grid > :nth-child(3) {
    margin-left: calc(-1 * var(--space-xl));
}

.site-footer h3 {
    font-size: 1.125rem;
    color: var(--color-text);
    margin-bottom: var(--space-md);
}

/* "Over Polderhaan" heading in Georgia italic bold. */
.site-footer__heading--display {
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    font-weight: 700;
}

.site-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.site-footer li {
    margin-bottom: var(--space-sm);
}
.site-footer a {
    color: var(--color-text);
}
.site-footer a:hover {
    color: var(--color-orange);
}
.site-footer a[aria-current="page"] {
    color: var(--color-orange);
    font-weight: 700;
}

.site-footer__contact-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}
.site-footer__contact-item svg {
    color: var(--color-orange);
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

/* Campercontact mark below the contact items */
.site-footer__contact-logo {
    display: block;
    width: 4cm;
    height: auto;
    margin-top: var(--space-md);
}

.site-footer__logo {
    text-align: center;
    margin: var(--space-xl) 0;
}
.site-footer__logo img {
    max-width: 260px;
    margin: 0 auto;
}

.site-footer__bottom {
    border-top: 1px solid var(--color-border);
    padding-top: var(--space-md);
    font-size: var(--fs-small);
    color: var(--color-text-muted);
    text-align: center;
}
.site-footer__bottom a {
    color: var(--color-text-muted);
    margin: 0 var(--space-sm);
}


/* =============================================================================
   8b. BACK TO TOP BUTTON (injected by main.js on every page)
   ============================================================================= */
.back-to-top {
    position: fixed;
    right: var(--space-lg);
    bottom: var(--space-lg);
    z-index: 90;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 0;
    background-color: var(--color-orange);
    color: var(--color-white);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 300ms ease,
                transform 300ms ease,
                background-color var(--transition-fast);
}
.back-to-top.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.back-to-top:hover,
.back-to-top:focus-visible {
    background-color: var(--color-orange-dark);
}
.back-to-top:focus-visible {
    outline: 3px solid var(--color-orange);
    outline-offset: 3px;
}
.back-to-top svg {
    width: 20px;
    height: 20px;
}


/* =============================================================================
   9. ACCESSIBILITY HELPERS
   ============================================================================= */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip-to-content link - becomes visible on focus */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-orange);
    color: var(--color-white);
    padding: var(--space-sm) var(--space-md);
    z-index: 200;
    transition: top var(--transition-base);
}
.skip-link:focus {
    top: 0;
    color: var(--color-white);
    text-decoration: none;
}

/* Respect user's motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}


/* =============================================================================
   10. RESPONSIVE BREAKPOINTS
   ============================================================================= */

/* Tablet and below: collapse navigation into a mobile menu */
@media (max-width: 960px) {
    :root {
        --space-xxl: 4rem;
    }

    .site-footer__grid {
        grid-template-columns: 1fr;
    }

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

    .site-nav,
    .site-header__actions > .btn--outline,
    .site-header__social {
        display: none;
    }

    /* When menu is open (JS toggles [data-menu-open] on body) */
    body[data-menu-open="true"] .site-nav {
        display: flex;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        background: var(--color-white);
        padding: var(--space-md);
        box-shadow: var(--shadow-md);
    }
    body[data-menu-open="true"] .site-nav li {
        width: 100%;
        border-bottom: 1px solid var(--color-border);
    }
    body[data-menu-open="true"] .site-nav a {
        display: block;
        padding: var(--space-md);
    }
}

@media (max-width: 560px) {
    .site-header__logo {
        width: 52px;
        height: 52px;
        padding: 6px;
    }
    .lang-switcher a {
        width: 22px;
        height: 14px;
    }
}
