/*
 * Rôle    : Styles globaux du site public (typographie, layout, utilities maison).
 * Scope   : Toutes pages.
 * Charge  : main/base.html
 * Dépend  : tokens Tailwind hs-*, fonts brand (cf. fonts/stylesheet.css).
 */

/* === Scroll global === */
/* Smooth scroll natif pour tous les liens d'ancre + scroll-padding-top qui compense
   la navbar fixe (sinon la section cible passe sous la barre). Remplace les scroll-mt-*
   posés au cas par cas sur les sections. Désactivé si l'utilisateur préfère moins d'animations. */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 6rem;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* === Navbar === */
/* z-index très élevé pour passer au-dessus des overlays/banners ; backdrop-filter
   pour l'effet verre dépoli (préfixe -webkit- conservé pour Safari). */
.hs-navbar {
    z-index: 99999;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Logo blanc sur fond sombre obtenu par inversion d'un PNG sombre source. */
.hs-navbar-logo {
    filter: invert(1);
}

/* === Hero === */
/* scaleX(-1) miroir horizontal de l'image de fond ; scale(1.07) pour masquer
   les bords après le miroir et éviter une bande vide. */
.hs-hero-bg {
    background-image: url('/static/images/home/background-hero.png');
    background-size: cover;
    background-position: left center;
    transform: scaleX(-1) scale(1.07);
}

/* Voile crème sur le hero pour garantir la lisibilité du texte (mobile : opaque
   sur toute la largeur ; desktop : dégradé pour révéler l'image à droite — cf. media query 768px). */
.hs-hero-wash {
    background: linear-gradient(
        to right,
        rgba(246, 242, 234, 0.97) 0%,
        rgba(246, 242, 234, 0.95) 60%,
        rgba(246, 242, 234, 0.8) 80%,
        rgba(246, 242, 234, 0.5) 100%
    );
}

@media (min-width: 768px) {
    .hs-hero-wash {
        background: linear-gradient(
            to right,
            rgba(246, 242, 234, 0.95) 0%,
            rgba(246, 242, 234, 0.65) 45%,
            rgba(246, 242, 234, 0.1) 75%,
            transparent 100%
        );
    }
}

/* Vignette sombre en bas du hero pour adoucir la transition vers la section suivante. */
.hs-hero-vignette {
    background: linear-gradient(to top, rgba(20, 16, 12, 0.25) 0%, transparent 40%);
}

/* Bloc de contenu du hero : cadre éditorial discret pour poser le texte sur le voile
   crème sans alourdir. Filet doré vertical à gauche + léger retrait. */
.hs-hero-card {
    position: relative;
    padding-left: 1.75rem;
}

.hs-hero-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.35rem;
    bottom: 0.35rem;
    width: 1px;
    background: linear-gradient(to bottom, transparent 0%, rgba(179, 139, 83, 0.55) 18%, rgba(179, 139, 83, 0.55) 82%, transparent 100%);
}

@media (max-width: 640px) {
    .hs-hero-card {
        padding-left: 1.1rem;
    }
}

/* Filet ornemental sous le titre : hairline doré dégradé + losange centré masqué sur le crème. */
.hs-hero-rule {
    position: relative;
    height: 1px;
    width: 8.5rem;
    background: linear-gradient(to right, #B38B53 0%, rgba(179, 139, 83, 0.12) 100%);
}

.hs-hero-rule::after {
    content: "";
    position: absolute;
    left: 3.4rem;
    top: 50%;
    width: 6px;
    height: 6px;
    transform: translateY(-50%) rotate(45deg);
    border: 1px solid #B38B53;
    background: #F6F2EA;
}

/* === Hero CTA === */
/* Boutons d'appel du hero, alignés sur la grammaire éditoriale du site
   (cormorant, capitales espacées, filets dorés). */
.hs-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    transition: color 0.4s ease, background-color 0.4s ease, border-color 0.4s ease;
}

/* CTA principal : pavé doré plein qui bascule en encre au survol, avec flèche filaire. */
.hs-cta--primary {
    padding: 0.85rem 1.9rem;
    color: #231D17;
    background: #B38B53;
    border: 1px solid #B38B53;
}

.hs-cta--primary:hover,
.hs-cta--primary:focus-visible {
    background: #231D17;
    border-color: #231D17;
    color: #F6F2EA;
}

.hs-cta__arrow {
    position: relative;
    display: inline-block;
    width: 1.4rem;
    height: 1px;
    background: currentColor;
    transition: width 0.4s ease;
}

.hs-cta__arrow::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    width: 5px;
    height: 5px;
    border-top: 1px solid currentColor;
    border-right: 1px solid currentColor;
    transform: translateY(-50%) rotate(45deg);
}

.hs-cta--primary:hover .hs-cta__arrow,
.hs-cta--primary:focus-visible .hs-cta__arrow {
    width: 2rem;
}

/* CTA secondaire : lien nu encre, filet doré qui s'allonge au survol. */
.hs-cta--ghost {
    color: #231D17;
    padding: 0.85rem 0;
}

.hs-cta--ghost:hover,
.hs-cta--ghost:focus-visible {
    color: #B38B53;
}

.hs-cta__line {
    display: inline-block;
    height: 1px;
    width: 1.5rem;
    background: #B38B53;
    transition: width 0.4s ease;
}

.hs-cta--ghost:hover .hs-cta__line,
.hs-cta--ghost:focus-visible .hs-cta__line {
    width: 2.6rem;
}

/* === Reveal on scroll === */
/* État initial caché — n'est appliqué que si .hs-js-ready est présent sur <html>,
   évite le flash of hidden content si JS est désactivé. */
.hs-js-ready .hs-reveal {
    opacity: 0;
    transform: translateY(26px) scale(0.985);
    transition: opacity 680ms ease, transform 680ms ease;
}

/* État visible toggle par IntersectionObserver côté JS. */
.hs-js-ready .hs-reveal.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* === Section "Univers" (cartes) === */
/* Pseudo-element de fond : double radial-gradient doré (rgb correspond au token hs-gold)
   pour des halos de lumière diagonaux + dégradé crème vertical. z-index:0 pour rester
   derrière .hs-universe-grid (z-index:1). Le parent doit être position:relative. */
.hs-universe-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 10% 16%, rgba(179, 139, 83, 0.16) 0%, transparent 38%),
        radial-gradient(circle at 86% 82%, rgba(179, 139, 83, 0.14) 0%, transparent 42%),
        linear-gradient(180deg, rgba(247, 243, 236, 0.96) 0%, rgba(242, 234, 221, 0.82) 100%);
    z-index: 0;
}

.hs-universe-grid {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 1.15rem;
}

.hs-universe-card {
    position: relative;
    display: block;
    min-height: 470px;
    overflow: hidden;
    border: 1px solid rgba(179, 139, 83, 0.32);
    background: rgba(247, 243, 236, 0.8);
    box-shadow: 0 20px 44px rgba(34, 24, 16, 0.22);
}

.hs-universe-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.02);
    transition: transform 760ms ease;
}

.hs-universe-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(247, 243, 236, 0.02) 10%, rgba(43, 31, 22, 0.46) 62%, rgba(29, 22, 17, 0.68) 100%),
        linear-gradient(115deg, rgba(179, 139, 83, 0.14) 0%, transparent 46%);
}

.hs-universe-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: clamp(1.2rem, 2.4vw, 2rem);
}

.hs-universe-kicker {
    font-family: "Cormorant Garamond", serif;
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(179, 139, 83, 0.95);
}

.hs-universe-title {
    margin-top: 0.45rem;
    font-family: "Playfair Display", serif;
    font-size: clamp(1.75rem, 2.6vw, 2.4rem);
    line-height: 1.14;
    color: rgba(250, 248, 244, 0.98);
}

.hs-universe-text {
    margin-top: 0.72rem;
    max-width: 33ch;
    font-family: "Cormorant Garamond", serif;
    font-size: 1.04rem;
    line-height: 1.46;
    color: rgba(250, 248, 244, 0.86);
}

.hs-universe-link {
    margin-top: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-family: "Cormorant Garamond", serif;
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(250, 248, 244, 0.96);
}

.hs-universe-line {
    display: inline-block;
    width: 2rem;
    height: 1px;
    background: rgba(179, 139, 83, 0.95);
    transition: width 340ms ease;
}

/* Hover/focus : zoom léger de l'image + extension de la ligne décorative (a11y : focus-visible). */
.hs-universe-card:hover .hs-universe-image,
.hs-universe-card:focus-visible .hs-universe-image {
    transform: scale(1.08);
}

.hs-universe-card:hover .hs-universe-line,
.hs-universe-card:focus-visible .hs-universe-line {
    width: 3.2rem;
}

.hs-universe-card:focus-visible {
    outline: 2px solid rgba(179, 139, 83, 0.75);
    outline-offset: 2px;
}

/* === Section "Actualités" (vignes décoratives) === */
/* !important contre le BG global de base.html ; --hs-vine-side-offset partagé entre
   ::before et ::after pour le décalage symétrique des vignes. */
.hs-actualites-section {
    overflow: hidden;
    background-color: #ffffff !important;
    --hs-vine-side-offset: clamp(-120px, -7vw, -48px);
}

/* Vignes ornementales latérales (gauche + droite). pointer-events:none pour ne pas
   capturer les clics ; le dégradé blanc superposé fait fondre l'image vers le contenu central. */
.hs-actualites-section::before,
.hs-actualites-section::after {
    content: "";
    position: absolute;
    z-index: 0;
    pointer-events: none;
    top: 0;
    bottom: 0;
    width: clamp(420px, 48vw, 860px);
    opacity: 0.58;
    background-repeat: no-repeat;
    background-size: auto 112%;
    filter: saturate(0.9) contrast(0.96);
}

.hs-actualites-section::before {
    left: var(--hs-vine-side-offset);
    background-position: left bottom;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0.44) 68%, rgba(255, 255, 255, 1) 100%),
        url("/static/images/home/piedvigne.jpeg");
}

/* Côté droit : même image miroir via scaleX(-1) (évite de stocker deux assets). */
.hs-actualites-section::after {
    right: var(--hs-vine-side-offset);
    background-position: left bottom;
    transform: scaleX(-1);
    transform-origin: center;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0.44) 68%, rgba(255, 255, 255, 1) 100%),
        url("/static/images/home/piedvigne.jpeg");
}

/* === Manifeste === */
/* Guillemet ouvrant typographique (\201C = U+201C "LEFT DOUBLE QUOTATION MARK")
   centré au-dessus de la citation, comme amorce de pull-quote. Le parent doit être
   position:relative + text-align:center. */
.hs-manifeste-quote::before {
    content: "\201C";
    position: absolute;
    left: 50%;
    top: -3rem;
    transform: translateX(-50%);
    font-family: "Playfair Display", serif;
    font-size: 5rem;
    line-height: 1;
    color: rgba(179, 139, 83, 0.28);
    pointer-events: none;
}

/* === Formulaire de contact === */
/* Reset/styling des inputs natifs dans la section #contact (border-radius:0 et
   box-shadow:none pour neutraliser les styles UA, notamment iOS Safari). */
#contact input[type="text"],
#contact input[type="email"],
#contact input[type="tel"],
#contact textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(179, 139, 83, 0.3);
    color: #231d17;
    font-family: "Cormorant Garamond", serif;
    font-size: 1rem;
    outline: none;
    border-radius: 0;
    box-shadow: none;
    transition: border-color 0.25s, background 0.25s;
}

#contact input[type="text"]::placeholder,
#contact input[type="email"]::placeholder,
#contact input[type="tel"]::placeholder,
#contact textarea::placeholder {
    color: rgba(35, 29, 23, 0.4);
}

#contact input[type="text"]:focus,
#contact input[type="email"]:focus,
#contact input[type="tel"]:focus,
#contact textarea:focus {
    border-color: #b38b53;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: none;
}

/* === Bandeau légal (cookies / RGPD) === */
.hs-legal-banner {
    background: #f7f3ec;
}

/* Classes synchronisées avec safelist Tailwind (cf. tailwind.config.js) car
   ajoutées/retirées dynamiquement par le JS du bandeau. */
.animate-banner-in {
    animation: hsBannerIn 420ms ease-out both;
}

.animate-banner-out {
    animation: hsBannerOut 320ms ease-in both;
}

@keyframes hsBannerIn {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes hsBannerOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(14px);
    }
}

/* === Responsive overrides === */
/* Grille univers en 2 colonnes au-delà de 960px (entre md=768 et lg=1024 Tailwind). */
@media (min-width: 960px) {
    .hs-universe-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Mobile : vignes plus étroites et moins opaques pour éviter qu'elles écrasent le contenu. */
@media (max-width: 767px) {
    .hs-actualites-section::before,
    .hs-actualites-section::after {
        width: clamp(240px, 64vw, 420px);
        opacity: 0.48;
        background-size: auto 106%;
    }
}
