/* =========================================================
   Onde Collection — custom theme
   Look: white background, premium serif type, warm wood tones,
   split image/text layout.
   ========================================================= */

:root {
    --paper:      #ffffff;   /* white background everywhere      */
    --ink:        #2b2622;   /* body text, warm near-black        */
    --wood:       #6a4a30;   /* headings, wood brown             */
    --wood-soft:  #8c6a4a;   /* eyebrows / subtle links          */
    --line:       #e7ddd2;   /* very light rules                 */
    --cream:      #faf7f3;   /* warm off-white accent            */

    --serif-display: "Playfair Display", Georgia, "Times New Roman", serif;
    --serif-body:    "EB Garamond", Georgia, "Times New Roman", serif;

    --maxw: 1280px;
    --pad:  clamp(1.25rem, 5vw, 5rem);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--serif-body);
    font-size: clamp(1.05rem, 0.6rem + 0.7vw, 1.25rem);
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

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

h1, h2, h3 {
    font-family: var(--serif-display);
    color: var(--wood);
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: .2px;
}

/* ---------- Navigation ---------- */
.site-nav {
    position: fixed; inset: 0 0 auto 0; z-index: 50;
    display: flex; justify-content: center;
    padding: clamp(.9rem, 2vw, 1.4rem) var(--pad);
    transition: background .4s ease, box-shadow .4s ease;
}
/* Frosted background carried by a ::before (NOT the bar itself):
   a backdrop-filter on the bar would trap the fixed mobile-menu overlay. */
.site-nav.is-scrolled::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(8px);
    box-shadow: 0 1px 0 var(--line);
}
.site-nav__inner {
    width: 100%; max-width: var(--maxw);
    display: flex; align-items: center; justify-content: space-between;
}
.site-nav__brand {
    font-family: var(--serif-display);
    font-size: 1.4rem; font-weight: 700; color: var(--wood);
    letter-spacing: .5px;
}
.site-nav__brand span { font-weight: 400; opacity: .7; margin-left: .15em; }
.site-nav__links { display: flex; gap: clamp(1rem, 2.5vw, 2.4rem); }
.site-nav__links a {
    position: relative;
    font-family: var(--serif-body);
    font-size: .8rem; letter-spacing: .18em; text-transform: uppercase;
    color: var(--ink); opacity: .75; transition: opacity .3s ease;
}
/* Animated underline that grows from the left on hover */
.site-nav__links a::after {
    content: ""; position: absolute; left: 0; bottom: -.45rem;
    width: 100%; height: 1px; background: currentColor;
    transform: scaleX(0); transform-origin: left;
    transition: transform .38s cubic-bezier(.2,.7,.2,1);
}
.site-nav__links a:hover { opacity: 1; text-decoration: none; }
.site-nav__links a:hover::after { transform: scaleX(1); }

.site-nav__toggle {
    display: none; flex-direction: column; gap: 5px;
    background: none; border: 0; cursor: pointer; padding: 6px;
}
.site-nav__toggle span {
    width: 26px; height: 2px; background: var(--wood); display: block;
    transition: transform .3s, opacity .3s;
}

/* ---------- Scene (image + text) ---------- */
.scene { width: 100%; }
.scene__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: clamp(520px, 88vh, 1000px);
}
.scene__media { position: relative; overflow: hidden; background: var(--cream); }
/* Parallax layer: taller than the frame so it can drift without gaps */
.scene__media-inner { position: absolute; inset: -18% 0; will-change: transform; }
.scene__media img { width: 100%; height: 100%; object-fit: cover; }

.scene__text { display: flex; align-items: center; }
.scene__text-inner {
    max-width: 34rem;
    padding: clamp(2.5rem, 6vw, 6rem) var(--pad);
    margin: 0 auto;
}
.scene__eyebrow {
    font-size: .78rem; letter-spacing: .25em; text-transform: uppercase;
    color: var(--wood-soft); margin: 0 0 1.1rem;
}
.scene__title {
    font-size: clamp(1.9rem, 1rem + 2.4vw, 3rem);
    margin: 0 0 1.4rem;
}
.scene__body { text-align: justify; hyphens: auto; }
.scene__body p { margin: 0 0 1.1rem; }

/* Left/right alternation: image on the right => reverse the order */
.scene--img-right .scene__media { order: 2; }
.scene--img-right .scene__text  { order: 1; }

/* ---------- "Ils ont aimé" gallery ---------- */
.galerie { padding: clamp(4rem, 10vw, 8rem) var(--pad); max-width: var(--maxw); margin: 0 auto; }
.galerie__head { text-align: center; max-width: 40rem; margin: 0 auto clamp(2.5rem, 5vw, 4rem); }
.galerie__title { font-size: clamp(1.8rem, 1rem + 2vw, 2.8rem); margin: .4rem 0 1rem; }
.galerie__intro { color: var(--ink); opacity: .85; }
.galerie__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: clamp(.6rem, 1.5vw, 1.2rem);
}
.galerie__item { margin: 0; overflow: hidden; aspect-ratio: 1 / 1; background: var(--cream); }
.galerie__item img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .8s cubic-bezier(.2,.7,.2,1);
}
.galerie__item:hover img { transform: scale(1.05); }
.galerie__empty { text-align: center; color: var(--wood-soft); font-style: italic; }

/* ---------- Contact ---------- */
.contact { padding: clamp(4rem, 10vw, 8rem) var(--pad); max-width: var(--maxw); margin: 0 auto; }
.contact__grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 6vw, 5rem); align-items: start;
}
.contact__title { font-size: clamp(1.8rem, 1rem + 2vw, 2.8rem); margin: .4rem 0 1.2rem; }
.contact__direct { margin-top: 1.6rem; color: var(--wood-soft); }
.contact__direct a { font-size: 1.1rem; }

/* Text fields — minimal style, no heavy borders */
.contact__form input[type="text"],
.contact__form input[type="email"],
.contact__form textarea {
    width: 100%; background: transparent;
    border: 0; border-bottom: 1px solid var(--line);
    padding: .8rem .2rem; margin-bottom: 1.4rem;
    font-family: var(--serif-body); font-size: 1.05rem; color: var(--ink);
}
.contact__form input[type="text"]:focus,
.contact__form input[type="email"]:focus,
.contact__form textarea:focus { outline: none; border-bottom-color: var(--wood); }

/* Text field labels (as overlines) */
.contact__form label { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--wood-soft); }

.contact__form .button,
.contact__form button {
    margin-top: 1.8rem;
    background: var(--wood); color: #fff; border: 0;
    padding: .9rem 2.2rem; font-family: var(--serif-body);
    font-size: .85rem; letter-spacing: .18em; text-transform: uppercase;
    cursor: pointer; transition: background .3s;
}
.contact__form .button:hover,
.contact__form button:hover { background: #543a26; }

/* ---------- Simple page (legal notice) ---------- */
.page-simple { padding: clamp(7rem, 14vw, 11rem) var(--pad) clamp(4rem, 8vw, 6rem); }
.page-simple .container { max-width: 50rem; margin: 0 auto; }
.page-simple__title { font-size: clamp(2rem, 1rem + 2.5vw, 3rem); margin: 0 0 2rem; }
.page-simple__body h2, .page-simple__body h3 { margin-top: 2.2rem; font-size: 1.3rem; }
.page-simple__body p { margin: 0 0 1rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: clamp(3rem, 6vw, 4.5rem) var(--pad); text-align: center; }
.site-footer__brand { font-family: var(--serif-display); color: var(--wood); font-size: 1.5rem; margin: 0 0 .3rem; }
.site-footer__tagline { color: var(--wood-soft); margin: 0 0 1.4rem; }
.site-footer__links { display: flex; gap: 1.6rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1.2rem; }
.site-footer__links a { font-size: .85rem; letter-spacing: .1em; }
.site-footer__copy { font-size: .8rem; color: var(--wood-soft); opacity: .8; margin: 0; }

/* ---------- Scroll reveals (vanilla JS + CSS transitions) ----------
   js/onde.js adds .is-in to each section (.scene/.galerie/.contact) as it
   enters the viewport (IntersectionObserver). Same behaviour on every browser.
   Pre-hidden only when JS is on (.js) AND motion is allowed — so without JS or
   with reduced motion the content stays fully visible (never stuck hidden). */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

@media (prefers-reduced-motion: no-preference) {
    /* Start state (text, gallery, contact): faded + slightly lowered */
    .js .scene__eyebrow,
    .js .scene__title,
    .js .scene__body,
    .js .galerie__title,
    .js .galerie__intro,
    .js .galerie__item,
    .js .contact__title,
    .js .contact__text,
    .js .contact__direct,
    .js .contact__form {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.2,1);
    }
    /* Start state (scene image): faded + slightly zoomed (it "settles" in) */
    .js .scene__media img {
        opacity: 0;
        transform: scale(1.08);
        transition: opacity 1.1s ease, transform 1.5s cubic-bezier(.2,.7,.2,1);
    }

    /* Revealed once the section is in view */
    .js .is-in .scene__eyebrow,
    .js .is-in .scene__title,
    .js .is-in .scene__body,
    .js .is-in .scene__media img,
    .js .is-in .galerie__title,
    .js .is-in .galerie__intro,
    .js .is-in .galerie__item,
    .js .is-in .contact__title,
    .js .is-in .contact__text,
    .js .is-in .contact__direct,
    .js .is-in .contact__form {
        opacity: 1;
        transform: none;
    }

    /* Stagger */
    .js .scene.is-in .scene__media img  { transition-delay: .05s; }
    .js .scene.is-in .scene__title      { transition-delay: .14s; }
    .js .scene.is-in .scene__body       { transition-delay: .24s; }
    .js .contact.is-in .contact__text   { transition-delay: .12s; }
    .js .contact.is-in .contact__direct { transition-delay: .22s; }
    .js .contact.is-in .contact__form   { transition-delay: .16s; }
    .js .galerie.is-in .galerie__intro  { transition-delay: .10s; }
    .js .galerie__item                  { transition-delay: calc(var(--i, 0) * .07s); }

    /* Hero (first scene): a slower, more deliberate entrance on first load —
       a wider zoom-out + longer fade so the landing feels intentional. */
    .js #presentation .scene__media img {
        transform: scale(1.16);
        transition: opacity 1.6s ease, transform 2.4s cubic-bezier(.2,.7,.2,1);
    }
    .js #presentation.is-in .scene__media img { transition-delay: .12s; }
    .js #presentation .scene__title { transition-duration: 1.1s; }
    .js #presentation.is-in .scene__title { transition-delay: .35s; }
    .js #presentation.is-in .scene__body  { transition-delay: .55s; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .site-nav__links {
        position: fixed; inset: 0; z-index: 55; flex-direction: column;
        align-items: center; justify-content: center; gap: 2rem;
        background: var(--paper);
        transform: translateX(100%); transition: transform .4s ease;
    }
    .site-nav__links.is-open { transform: none; }
    .site-nav__links a { font-size: 1.1rem; }
    .site-nav__toggle { display: flex; z-index: 60; }

    .scene__grid { grid-template-columns: 1fr; min-height: 0; }
    .scene__media { aspect-ratio: 4 / 3; }
    /* On mobile, the image always sits above the text */
    .scene--img-right .scene__media { order: 0; }
    .scene--img-right .scene__text  { order: 0; }

    .contact__grid { grid-template-columns: 1fr; }
}

/* ---------- WonderCMS: inline editing + form messages ---------- */
/* The WonderCMS editable wrapper must not break the layout */
.editText.editable { display: block; }
.scene__text-inner .editText.editable { width: 100%; }

.contact__success,
.contact__error {
    padding: 1rem 1.2rem; margin-bottom: 1.4rem;
    font-size: .98rem; border-left: 3px solid;
}
.contact__success { background: #f3f7f2; border-color: #5a7d52; color: #3c5836; }
.contact__error   { background: #faf2f0; border-color: #a85b46; color: #7d3f30; }

