:root {
    --primary-color: #c89b3c;
    --bg-dark: #1a1614;
    --bg-accent: #2a2420;
    --text-main: #e8e1d9;
    --text-muted: #b5afa9;
    --white: #ffffff;
    --black: #000000;

    --font-heading: 'Bebas Neue', sans-serif;
    --font-body: 'Montserrat', sans-serif;

    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Texture */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../img/background/main_bg.png');
    background-size: cover;
    background-attachment: fixed;
    opacity: 0.3;
    pointer-events: none;
    z-index: -1;
    filter: contrast(1.1) brightness(0.9);
}

/* Noise overlay */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 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.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.12;
    pointer-events: none;
    z-index: 10000;
}

/* Simple helper for custom drop-shadow on headings if needed */
.text-outline {
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.8);
}

/* Transitions for non-tailwind elements if any */
.transition-standard {
    transition: var(--transition);
}

/* -----------------------------
   Lightbox (Galerie)
------------------------------ */

/* Prevent background scroll when lightbox is open */
body.lightbox-lock {
    overflow: hidden;
}

.lightbox-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10001;
}

.lightbox-overlay.is-open {
    display: flex;
}

.lightbox-panel {
    position: relative;
    width: min(1100px, 100%);
}

.lightbox-image {
    width: 100%;
    height: auto;
    max-height: 82vh;
    object-fit: contain;
    display: block;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.lightbox-counter {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -40px;
    font-family: var(--font-body);
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
}

.lightbox-nav,
.lightbox-close {
    appearance: none;
    border: 0;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.55);
    color: var(--white);
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, background 0.15s ease;
    user-select: none;
}

.lightbox-nav:hover,
.lightbox-close:hover {
    transform: scale(1.05);
    background: rgba(0, 0, 0, 0.7);
}

.lightbox-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    font-size: 28px;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 999px;
    font-size: 36px;
}

.lightbox-prev {
    left: -14px;
}

.lightbox-next {
    right: -14px;
}

@media (max-width: 640px) {
    .lightbox-overlay {
        padding: 14px;
    }

    .lightbox-nav {
        width: 46px;
        height: 46px;
        font-size: 32px;
    }

    .lightbox-prev {
        left: -10px;
    }

    .lightbox-next {
        right: -10px;
    }

    .lightbox-close {
        top: -12px;
        right: -12px;
    }

    .lightbox-counter {
        bottom: -34px;
    }
}

/* ---------------------------------------
   CSEF - Fallback classes (robustesse)
   Permet de conserver les couleurs / polices même si Tailwind n'applique
   pas la config custom (primary/dark/accent, fonts).
--------------------------------------- */

.font-bebas {
    font-family: var(--font-heading, 'Bebas Neue', sans-serif) !important;
}

.font-montserrat {
    font-family: var(--font-body, 'Montserrat', sans-serif) !important;
}

/* Couleurs custom (classes Tailwind "primary/dark/accent") */
.text-primary { color: var(--primary-color) !important; }
.bg-primary { background-color: var(--primary-color) !important; }
.border-primary { border-color: var(--primary-color) !important; }
.fill-primary { fill: var(--primary-color) !important; }

.bg-dark { background-color: var(--bg-dark) !important; }
.bg-accent { background-color: var(--bg-accent) !important; }

/* Variants (hover / focus) */
.hover\:text-primary:hover { color: var(--primary-color) !important; }
.hover\:bg-primary:hover { background-color: var(--primary-color) !important; }
.hover\:border-primary:hover { border-color: var(--primary-color) !important; }

/* Opacités utilisées dans le site */
.border-primary\/20 { border-color: rgba(var(--primary-rgb, 200, 155, 60), 0.2) !important; }
.border-primary\/10 { border-color: rgba(var(--primary-rgb, 200, 155, 60), 0.1) !important; }
.border-primary\/50 { border-color: rgba(var(--primary-rgb, 200, 155, 60), 0.5) !important; }

.bg-accent\/80 { background-color: rgba(var(--accent-rgb, 42, 36, 32), 0.8) !important; }
.bg-accent\/40 { background-color: rgba(var(--accent-rgb, 42, 36, 32), 0.4) !important; }
.bg-accent\/30 { background-color: rgba(var(--accent-rgb, 42, 36, 32), 0.3) !important; }

.bg-dark\/60 { background-color: rgba(var(--dark-rgb, 26, 22, 20), 0.6) !important; }

/* Ring color (quand Tailwind ring est présent mais la couleur custom ne l'est pas) */
.focus\:ring-primary\/50:focus { --tw-ring-color: rgba(var(--primary-rgb, 200, 155, 60), 0.5) !important; }
.focus\:ring-primary\/60:focus { --tw-ring-color: rgba(var(--primary-rgb, 200, 155, 60), 0.6) !important; }


/* -------------------------------------------------
   File inputs (bouton "Choisir un fichier")
   ------------------------------------------------- */
.csef-file-input {
    color: rgba(232, 225, 217, 0.85);
}

.csef-file-input::file-selector-button {
    background: var(--primary-color);
    color: #000;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.75rem;
    padding: 0.55rem 0.9rem;
    margin-right: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease;
}

.csef-file-input::file-selector-button:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

/* Safari / WebKit */
.csef-file-input::-webkit-file-upload-button {
    background: var(--primary-color);
    color: #000;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.75rem;
    padding: 0.55rem 0.9rem;
    margin-right: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease;
}

.csef-file-input::-webkit-file-upload-button:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

/* -------------------------------------------------
   Drag & drop (admin événements)
   ------------------------------------------------- */
.csef-dragging {
    outline: 2px dashed rgba(var(--primary-rgb, 200, 155, 60), 0.6);
    outline-offset: 4px;
    opacity: 0.92;
}

.csef-img-dragging {
    opacity: 0.6;
}
