/* ==========================================================
   La Grange d'Ernest — feuille de style de la vitrine
   ========================================================== */
/* Montserrat auto-hébergée (licence OFL, voir fonts/OFL.txt) — pas d'appel à Google Fonts */
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/montserrat-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/montserrat-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/montserrat-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/montserrat-latin-700-normal.woff2') format('woff2'); }

:root {
    --green: #3c654d;     /* charte : vert */
    --green-dark: #2d4c3a;
    --blue: #012958;      /* charte : bleu */
    --text: #1f2a23;
    --muted: #5e6f64;
    --divider: #c4cac5;
    --bg-light: #faf9f7;
    --bg-sand: #f2f0ec;
    --white: #ffffff;
    --radius: 16px;
    --shadow: 0 18px 40px rgba(31, 42, 35, .12);
    --header-h: 4rem;
    --container: 1320px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) - 8px); }
body {
    margin: 0;
    font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--muted);
    background: var(--bg-light);
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { color: var(--green); line-height: 1.15; margin: 0; font-weight: 700; }
p { margin: 0 0 1.2em; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.container--narrow { max-width: 900px; }
.text-center { text-align: center; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* ---------- Header ---------- */
.site-header {
    position: fixed; inset: 0 0 auto 0; z-index: 50;
    background: rgba(250, 249, 247, .96);
    box-shadow: 0 2px 14px rgba(0, 0, 0, .07);
    backdrop-filter: blur(6px);
    transition: background .3s, box-shadow .3s;
}
.site-header__inner {
    max-width: 1920px; margin: 0 auto; height: var(--header-h);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 2rem;
}
.site-logo {
    display: flex; align-items: center; gap: .75rem;
    font-size: 1.6rem; font-weight: 700; color: var(--green);
    text-decoration: none; letter-spacing: -.3px; white-space: nowrap;
}
/* Montagnes du logo : PNG utilisé en masque pour prendre la couleur du texte */
.site-logo__mark {
    width: 4.2rem; aspect-ratio: 600 / 169; background: currentColor; flex: none;
    -webkit-mask: url(../images/logo-mark.png) center / contain no-repeat;
            mask: url(../images/logo-mark.png) center / contain no-repeat;
}
.site-footer__logo { display: block; width: 220px; height: auto; margin-bottom: 1.2rem; }
.site-nav { display: flex; gap: 2.4rem; }
.site-nav a {
    font-size: .95rem; font-weight: 500; color: var(--text);
    text-decoration: none; position: relative; padding: 4px 0;
}
.site-nav a::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
    background: currentColor; transform: scaleX(0); transition: transform .25s;
}
.site-nav a:hover::after, .site-nav a.is-active::after { transform: scaleX(1); }

.site-header.is-transparent { background: transparent; box-shadow: none; backdrop-filter: none; }
.site-header.is-transparent .site-logo,
.site-header.is-transparent .site-nav a { color: var(--white); }
.site-header.is-transparent .nav-toggle span { background: var(--white); }

.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 26px; height: 2px; background: var(--text); margin: 6px 0; transition: .3s; }

/* ---------- Hero ---------- */
.hero {
    position: relative; min-height: 100vh; min-height: 100svh;
    display: flex; align-items: center; justify-content: center;
    text-align: center; color: var(--white); overflow: hidden;
    padding: calc(var(--header-h) + 40px) 24px 120px;
}
.hero__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero::after {
    content: ''; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(180deg, rgba(20, 30, 45, .25) 0%, rgba(20, 30, 45, .1) 55%, rgba(250, 249, 247, 0) 82%, var(--bg-light) 100%);
}
.hero__content { max-width: 70rem; margin-top: 10vh; }
.hero__title {
    color: var(--white); font-weight: 700;
    font-size: clamp(2.6rem, 6.4vw, 7rem); letter-spacing: -1px; line-height: 1.05;
    text-shadow: 0 2px 30px rgba(0, 0, 0, .25);
}
.hero__subtitle {
    font-size: clamp(1.1rem, 2.1vw, 2rem); font-weight: 500; line-height: 1.45;
    max-width: 52rem; margin: 1.4rem auto 3.4rem; text-shadow: 0 1px 18px rgba(0, 0, 0, .3);
}

/* ---------- Boutons ---------- */
.btn {
    display: inline-block; border: 0; cursor: pointer; font: inherit;
    background: var(--green); color: var(--white); text-decoration: none;
    font-weight: 500; font-size: 1.05rem; padding: .9rem 2rem; border-radius: 8px;
    transition: background .2s, transform .2s, box-shadow .2s;
}
.btn:hover { background: var(--green-dark); transform: translateY(-1px); box-shadow: 0 10px 24px rgba(54, 76, 61, .3); }
.btn--pill { border-radius: 999px; padding: 1.15rem 3.2rem; font-size: clamp(1rem, 1.5vw, 1.4rem); }
.btn--small { font-size: .95rem; padding: .7rem 1.6rem; margin-top: 2rem; }
.btn--block { display: block; width: 100%; font-size: 1.15rem; padding: 1.05rem; }

/* ---------- Sections ---------- */
.section { padding: 6.5rem 0; }
.section--light { background: var(--bg-light); }
.section--sand { background: var(--bg-sand); }
.welcome { padding-top: 2rem; }
.section-title { font-size: clamp(1.9rem, 3.2vw, 3rem); }
.section-title--xl { font-size: clamp(2.1rem, 3.4vw, 3.2rem); }
.divider { display: block; width: 3.8rem; height: 3px; border-radius: 2px; background: var(--divider); margin: 1.6rem 0 2.2rem; }
.divider--center { margin-left: auto; margin-right: auto; }
.lead { font-size: clamp(1.02rem, 1.5vw, 1.25rem); line-height: 1.85; font-weight: 500; }
.lead--narrow { max-width: 42rem; margin: 0 auto 4rem; line-height: 1.6; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; align-items: center; }
.split--top { align-items: start; }
.split__text p { font-size: clamp(1rem, 1.35vw, 1.15rem); line-height: 1.75; font-weight: 500; }
.split--reverse .split__text { order: 2; }
.split--reverse .split__media { order: 1; }
.split__media { margin: 0; }
.split__media img {
    width: 100%; aspect-ratio: 15 / 16; object-fit: cover;
    border-radius: var(--radius); box-shadow: var(--shadow);
}

/* ---------- Cuvées ---------- */
/* Gammes : chaque gamme prend une largeur proportionnelle à son nombre de cuvées (--n) */
.gammes { display: flex; gap: 2rem; align-items: stretch; }
.gamme { flex: var(--n, 1) 1 0; min-width: 0; display: flex; flex-direction: column; }
.gamme__name { font-size: 1.35rem; color: var(--text); margin: 0 0 .3rem; }
.gamme__tagline { font-size: .9rem; line-height: 1.4; color: var(--muted); margin: 0 0 1.4rem; min-height: 2.8em; }
.cuvees { display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); gap: 2rem; flex: 1; }
.gamme--bleu { --accent: var(--blue); }
.gamme--vert { --accent: var(--green); }
.cuvee {
    background: var(--white); border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow); display: flex; flex-direction: column;
    transition: transform .3s, box-shadow .3s;
}
.cuvee:hover { transform: translateY(-6px); box-shadow: 0 26px 50px rgba(31, 42, 35, .16); }
.cuvee__media { position: relative; }
.cuvee__media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.cuvee__badge {
    position: absolute; top: 1rem; right: 1rem;
    background: var(--accent, var(--green)); color: var(--white); font-weight: 500; font-size: .95rem;
    padding: .3rem .85rem; border-radius: 6px;
}
.cuvee__body { padding: 1.9rem 1.6rem 2.2rem; }
.cuvee__type {
    font-size: .8rem; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase;
    color: var(--accent, var(--green)); margin-bottom: .4rem;
}
.cuvee__name { color: var(--text); font-size: clamp(1.4rem, 1.9vw, 1.6rem); margin-bottom: 1.2rem; }
.cuvee__desc { font-size: .98rem; line-height: 1.75; margin: 0; }
.cuvee__link { display: inline-block; margin-top: 24px; color: var(--green); font-weight: 600; }

/* ---------- Contact ---------- */
.contact-list { list-style: none; padding: 0; margin: 2.4rem 0 3rem; display: grid; gap: 1.4rem; }
.contact-list li { display: flex; align-items: center; gap: 1rem; }
.contact-list__icon {
    flex: 0 0 3rem; height: 3rem; border-radius: 50%;
    background: #e3e5e0; color: var(--green);
    display: grid; place-items: center;
}
.contact-list__icon .icon { width: 1.25rem; height: 1.25rem; }
.contact-list small { display: block; font-size: .85rem; color: var(--muted); line-height: 1.3; }
.contact-list a, .contact-list strong {
    display: block; font-size: 1.05rem; font-weight: 600;
    color: var(--text); text-decoration: none; line-height: 1.4;
}
.contact-list a:hover { color: var(--green); }

.map { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); height: 22rem; background: #dfe7df; }
.map iframe { width: 100%; height: 100%; border: 0; }
/* Carte chargée seulement après accord (pas de cookie Google par défaut) */
.map__consent {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 1rem; padding: 1.5rem;
    text-align: center; color: var(--green-dark);
    background: linear-gradient(rgba(242, 240, 236, .82), rgba(242, 240, 236, .82)), url(../images/terroir.jpg) center / cover;
}
.map__consent .btn { margin-top: 0; }
.map__consent p { margin: 0; max-width: 22rem; font-size: .95rem; font-weight: 500; }
.map__open {
    position: absolute; top: 16px; left: 16px; display: inline-flex; align-items: center; gap: 8px;
    background: var(--white); color: #1a73e8; font-family: Roboto, Arial, sans-serif; font-weight: 500;
    font-size: .9rem; padding: .5rem .8rem; border-radius: 3px; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); text-decoration: none;
}
.map__open .icon { width: 1rem; height: 1rem; }

.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); }
.form-card { padding: 2.6rem 2.4rem 2.8rem; }
.form-card__title { font-size: clamp(1.5rem, 2.2vw, 1.9rem); margin-bottom: 2rem; }
.field { margin-bottom: 1.4rem; }
.field__label { display: block; font-weight: 600; color: var(--text); font-size: .9rem; margin-bottom: .45rem; }
.field__input {
    width: 100%; font: inherit; font-size: .95rem; color: var(--text);
    background: var(--bg-light); border: 1.5px solid #d9dcd8; border-radius: 8px;
    padding: .7rem 1rem; transition: border-color .2s, box-shadow .2s;
}
.field__input::placeholder { color: #7d8681; }
.field__input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(70, 97, 78, .15); }
textarea.field__input { min-height: 9rem; resize: vertical; }
.has-error .field__input { border-color: #b4483c; }
.field__error { color: #b4483c; font-size: .85rem; margin: .35rem 0 0; }
.hp-wrap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.alert { padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1.4rem; font-weight: 500; font-size: .95rem; }
.alert--success { background: #e5efe7; color: var(--green-dark); }
.alert--error { background: #f7e4e1; color: #8a3127; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-sand); border-top: 1.5px solid #dadcd8; padding: 5rem 0 2rem; }
.site-footer__grid { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 3rem; padding-bottom: 3.5rem; }
.site-footer__text { font-size: .95rem; line-height: 1.8; max-width: 17rem; }
.site-footer__title { font-size: 1.2rem; font-weight: 600; color: var(--green); margin-bottom: 1.4rem; }
.site-footer__social { display: flex; gap: 1.2rem; margin-top: 1.8rem; }
.site-footer__social a { color: var(--muted); }
.site-footer__social a:hover { color: var(--green); }
.site-footer__social .icon { width: 1.5rem; height: 1.5rem; }
.site-footer__links, .site-footer__contact { list-style: none; padding: 0; margin: 0; }
.site-footer__links li { margin-bottom: .7rem; }
.site-footer__links a, .site-footer__contact a { text-decoration: none; font-weight: 500; font-size: .95rem; color: var(--muted); }
.site-footer__links a:hover, .site-footer__contact a:hover { color: var(--green); }
.site-footer__contact li { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.1rem; font-size: .95rem; font-weight: 500; }
.site-footer__contact .icon { flex: 0 0 auto; width: 1.35rem; height: 1.35rem; color: var(--green); }
.site-footer__bottom {
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px;
    border-top: 1px solid #dadcd8; padding-top: 2rem; font-size: .95rem;
}
.site-footer__bottom p { margin: 0; }
.site-footer__legal { display: flex; gap: 1.6rem; }
.site-footer__legal a { text-decoration: none; font-weight: 500; }
.site-footer__legal a:hover { color: var(--green); }
.site-footer__alcohol { font-size: .75rem; opacity: .8; margin-top: 1.2rem; }

/* ---------- Pages légales ---------- */
.page-legal main { padding-top: var(--header-h); }
.prose h2 { font-size: 1.3rem; margin: 2rem 0 .6rem; }
.prose p { font-size: 1rem; }

/* ---------- Animations ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .site-nav { gap: 1.6rem; }
    .split { gap: 3rem; }
}
@media (max-width: 960px) {
    :root { --header-h: 3.8rem; }
    .site-header__inner { padding: 0 1.25rem; }
    .site-logo { font-size: 1.35rem; }
    .site-logo__mark { width: 3.2rem; }
    .nav-toggle { display: block; }
    .site-nav {
        position: fixed; top: var(--header-h); left: 0; right: 0;
        flex-direction: column; gap: 0; background: var(--bg-light);
        box-shadow: 0 12px 24px rgba(0, 0, 0, .08); padding: 8px 24px 20px;
        transform: translateY(-12px); opacity: 0; pointer-events: none; transition: .25s;
    }
    .site-nav a { color: var(--text) !important; padding: 14px 0; border-bottom: 1px solid #ecebe7; }
    .site-nav a::after { display: none; }
    .site-header.nav-open .site-nav { transform: none; opacity: 1; pointer-events: auto; }
    .site-header.nav-open { background: var(--bg-light); box-shadow: 0 2px 14px rgba(0, 0, 0, .07); }
    .site-header.nav-open .site-logo { color: var(--green); }
    .site-header.nav-open .nav-toggle span { background: var(--text); }
    .site-header.nav-open .nav-toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .site-header.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
    .site-header.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    .split { grid-template-columns: 1fr; gap: 2.5rem; }
    .split--reverse .split__text { order: 1; }
    .split--reverse .split__media { order: 2; }
    .split__media img { aspect-ratio: 4 / 3; }
    .gammes { flex-direction: column; gap: 3.5rem; }
    .gamme__tagline { min-height: 0; }
    .cuvees { grid-template-columns: repeat(2, 1fr); }
    .site-footer__grid { grid-template-columns: 1fr 1fr; }
    .site-footer__grid > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
    .section { padding: 4.5rem 0; }
    .welcome { padding-top: 1.5rem; }
    .hero__content { margin-top: 0; }
    .btn--pill { padding: 1rem 2.2rem; }
    .cuvees { grid-template-columns: 1fr; }
    .form-card { padding: 2rem 1.25rem 2.2rem; }
    .contact-list a, .contact-list strong { word-break: break-word; }
    .map { height: 18rem; }
    .site-footer { padding-top: 3.5rem; }
    .site-footer__grid { grid-template-columns: 1fr; gap: 2.2rem; padding-bottom: 2.5rem; }
    .site-footer__contact li { word-break: break-word; }
    .site-footer__bottom { flex-direction: column; gap: 1rem; }
    .site-footer__legal { flex-direction: column; gap: .6rem; }
}
@media (min-width: 1600px) { html { font-size: 17px; } }
@media (min-width: 1900px) { html { font-size: 18px; } }
