/* --- Global & Reset --- */
body {
    background: radial-gradient(circle at center, #FDFCFB 0%, #F2EEE9 100%);
    /* Chalk/Sand gradient */
    /* Mediterranean Chic - Warm Beige Sable */
    --grain-opacity: 0.15;
    --paper-color: #F8F5F2;
    --paper-texture-url: url('https://www.transparenttextures.com/patterns/cream-paper.png');
    background-color: var(--paper-color);
    /* Fallback */
    color: #362319;
    /* Keeping Woodland for general readability, will override specifics below */
    cursor: default;
    /* Restaure le curseur système par défaut */
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    cursor: none !important;
}

/* Custom Selection Color - Chic & Excellence */
::selection {
    background-color: rgba(212, 175, 55, 0.3);
    /* Solar Gold transparent */
    color: #362319;
    /* Woodland */
}

::-moz-selection {
    background-color: rgba(212, 175, 55, 0.3);
    color: #362319;
}


/* Hide system cursor for all interactive elements globally */
a,
button,
input,
textarea,
select,
.hover-trigger,
[role="button"],
.cursor-pointer {
    cursor: none !important;
}

/* Enhanced High-Quality Grain Texture */
.grain {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    opacity: 0.15;
    /* Increased to 15% */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
    transform: translateZ(0);
}

/* Paper Texture Layer */
.paper-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -2;
    opacity: 0.02;
    /* Reduced to ~2% */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 500 500' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='roughpaper'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.03' numOctaves='5' result='noise'/%3E%3CfeDiffuseLighting in='noise' lighting-color='%23F3EAE3' surfaceScale='3'%3E%3CfeDistantLight azimuth='45' elevation='50'/%3E%3C/feDiffuseLighting%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23roughpaper)'/%3E%3C/svg%3E");
    mix-blend-mode: multiply;
    transform: translateZ(0);
}

/* --- Custom Cursor: True Liquid Glass Effect --- */
#cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px) saturate(150%);
    -webkit-backdrop-filter: blur(8px) saturate(150%);
    border: 1.5px solid rgba(212, 175, 55, 0.6);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    box-shadow:
        0 4px 20px rgba(212, 175, 55, 0.2),
        inset 0 0 15px rgba(255, 255, 255, 0.3);
    will-change: transform, width, height, opacity;
    transition: width 0.25s cubic-bezier(0.19, 1, 0.22, 1),
        height 0.25s cubic-bezier(0.19, 1, 0.22, 1),
        opacity 0.2s ease,
        background 0.2s ease,
        border 0.2s ease,
        box-shadow 0.2s ease;
}

#cursor.hovered {
    opacity: 1;
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 2px solid rgba(212, 175, 55, 0.7);
    box-shadow:
        0 8px 32px rgba(212, 175, 55, 0.25),
        inset 0 0 25px rgba(255, 255, 255, 0.2);
}

/* --- Liquid Glass Elements (Nav, Cards) --- */
/* Correction du contraste pour faire "POP" le header */
.liquid-glass {
    background: rgba(255, 255, 255, 0.25);
    /* Plus clair que le fond beige */
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    /* Bordure plus visible */
    box-shadow:
        0 10px 40px rgba(54, 35, 25, 0.05),
        inset 0 0 20px rgba(255, 255, 255, 0.4);
    /* Reflet intérieur */
    transform: translateZ(0);
}

/* Navbar Scroll Transition */
#header.scrolled {
    background: rgba(243, 234, 227, 0.9);
    /* Plus opaque au scroll */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(147, 134, 119, 0.1);
    padding-top: 1rem;
    padding-bottom: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

/* Glass Input Fields */
.input-liquid {
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(147, 134, 119, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.4s ease;
}

.input-liquid:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.6);
    border-color: #D4AF37;
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.1);
}

/* --- Custom Chic Dropdown --- */
.custom-select-container {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: none !important;
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 1rem;
    padding: 0.5rem;
    display: none;
    /* Physically remove from layout when hidden */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 100;
    box-shadow: 0 10px 30px rgba(54, 35, 25, 0.1);
    max-height: 300px;
    overflow-y: auto;
}

.custom-select-container.active .custom-select-options {
    display: block;
    /* Show when active */
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-option {
    padding: 0.75rem 1rem;
    font-family: "Cormorant Garamond", serif;
    font-size: 1.1rem;
    color: #362319;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    cursor: none !important;
}

.custom-option:hover,
.custom-option.selected {
    background: rgba(212, 175, 55, 0.1);
    color: #D4AF37;
}

/* Custom Scrollbar for Dropdown */
.custom-select-options::-webkit-scrollbar {
    width: 4px;
}

.custom-select-options::-webkit-scrollbar-track {
    background: transparent;
}

.custom-select-options::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.3);
    border-radius: 10px;
}

/* Animation Utilities */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Lightbox Customizations */
.cursor-zoom-in {
    cursor: zoom-in;
}

.pswp {
    --pswp-bg: rgba(21, 13, 9, 0.95);
    /* Deep woodland-ish dark background */
    --pswp-placeholder-bg: #F8F5F2;
}

.pswp__button--arrow--prev,
.pswp__button--arrow--next,
.pswp__button--close,
.pswp__button--zoom {
    color: #D4AF37 !important;
    /* Solar Gold */
}

/* Ensure images in lightbox are not cropped */
.pswp__img {
    object-fit: contain !important;
}

/* --- Cookie Consent Banner (RGPD) --- */
#cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

#cookie-banner.visible {
    transform: translateY(0);
    opacity: 1;
}

#cookie-banner.hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

.cookie-banner-inner {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 -10px 40px rgba(54, 35, 25, 0.1);
    padding: 1.25rem 1.5rem;
}

@media (min-width: 768px) {
    .cookie-banner-inner {
        padding: 1.5rem 2rem;
    }
}

/* --- Accessibility: Skip Link --- */
.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: 10000;
}

.skip-link:focus {
    position: fixed;
    top: 1rem;
    left: 1rem;
    width: auto;
    height: auto;
    overflow: visible;
    background: #5D2A18;
    color: #F3EAE3;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-family: "DM Sans", sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    outline: 3px solid #D4AF37;
    outline-offset: 2px;
}

/* --- Responsive Fixes for Legal Pages --- */
@media (max-width: 640px) {
    .container {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .container p,
    .container h1,
    .container h2,
    .container h3 {
        max-width: 100%;
        overflow-wrap: break-word;
        word-break: break-word;
    }
}