/* ===========================
   VARIABLES ET RESET
   =========================== */
:root {
    --color-primary: #E8C9A0;      /* Sable/or plus clair */
    --color-secondary: #D9B88A;    /* Sable/or clair */
    --color-accent: #C4A876;       /* Sable/or */
    --color-danger: #7A7A7A;       /* Gris mat plus clair */
    --color-highlight: #5A5A5A;    /* Noir mat plus clair */
    --color-light: #F5F7FA;        /* Light background */
    --color-dark: #5A5A5A;         /* Dark text (noir mat) */
    --color-border: #E8EAED;       /* Border gray */
    --color-text: #6A6A6A;         /* Default text (gris) */
    --radius: 16px;                /* Border radius */
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Mode sombre - utilise les mêmes couleurs que le footer */
body.dark-mode {
    --color-light: #2C3E50;       /* Fond sombre (bleu-gris) */
    --color-text: #F5F7FA;        /* Texte clair (presque blanc) */
    --color-dark: #F5F7FA;        /* Texte clair */
    --color-border: #4A5C6E;      /* Bordure plus claire */
    --color-primary: #E8C9A0;     /* Accent sable/or (conservé) */
    --color-secondary: #D9B88A;   /* Accent sable/or (conservé) */
    --color-accent: #C4A876;      /* Accent sable/or (conservé) */
}

body.dark-mode nav {
    background-color: #3A5A7A;     /* Bleu-gris plus clair que le fond */
    border-bottom-color: #D4A574;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

body.dark-mode nav ul li a {
    color: #D4A574;
}

body.dark-mode nav ul li a:hover,
body.dark-mode nav ul li a.active {
    color: #E8C9A0;
}

body.dark-mode main {
    background-color: #2A3E54;     /* Légèrement plus clair que le fond */
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

body.dark-mode .container {
    background-color: #1A2636;
    color: #D4A574;
}

body.dark-mode .container h1,
body.dark-mode .container h2,
body.dark-mode .container h3 {
    color: #E8C9A0;
}

body.dark-mode .container p,
body.dark-mode .container li {
    color: #D4A574;
}

body.dark-mode .container a {
    color: #E8C9A0;
}

body.dark-mode footer {
    background: linear-gradient(135deg, #0F1824 0%, #1A2636 100%);
    border-top-color: #D4A574;
}

body.dark-mode footer h3 {
    color: #E8C9A0;
    border-bottom-color: #E8C9A0;
}

body.dark-mode footer p,
body.dark-mode footer a {
    color: #D4A574;
}

body.dark-mode footer a {
    color: #E8C9A0;
}

body.dark-mode footer a:hover {
    color: #D4A574;
}

body.dark-mode .address-box,
body.dark-mode article {
    background-color: #2A3E54;
    border-color: #4C5E6E;
}

body.dark-mode hr {
    border-color: #4C5E6E;
}

body.dark-mode .theme-toggle {
    color: #D4A574;
}

body.dark-mode header {
    background: linear-gradient(135deg, #D4A574 0%, #C9985E 100%);
}

body.dark-mode .grid-2,
body.dark-mode .grid-3 {
    background-color: #3C4E5E;
}

body.dark-mode .share-links a {
    background: rgba(212, 165, 116, 0.1);
    border-color: #D4A574;
}

/* Overrides pour tous les blancs en mode sombre */
body.dark-mode nav a.active {
    color: #2C3E50 !important;
}

body.dark-mode .btn {
    color: #2C3E50 !important;
}

body.dark-mode .btn:hover {
    color: #2C3E50 !important;
}

body.dark-mode footer {
    color: #D4A574;
}

body.dark-mode .share-links a:hover {
    color: #2C3E50 !important;
}

body.dark-mode footer > div:last-child {
    border-top-color: rgba(212, 165, 116, 0.2);
    color: #B39070;
}

body.dark-mode .lightbox-close,
body.dark-mode .lightbox-prev,
body.dark-mode .lightbox-next {
    color: #D4A574;
}

body.dark-mode .lightbox-close:hover,
body.dark-mode .lightbox-prev:hover,
body.dark-mode .lightbox-next:hover {
    background-color: rgba(212, 165, 116, 0.3);
}

body.dark-mode .scroll-to-top {
    color: #2C3E50 !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===========================
   TYPOGRAPHIE ET BASE
   =========================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-light);
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

/* Prevent horizontal overflow caused by large images or transforms */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Force images to never exceed their container even if inline styles exist */
.container img, .container img[style] {
    max-width: 100% !important;
    height: auto !important;
    display: block;
}

/* ===========================
   EN-TÊTE ET LOGO
   =========================== */
header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    padding: 12px 20px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 100;
}

header img {
    max-width: 80px;
    height: auto;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

header img:hover {
    transform: scale(1.05);
}

/* ===========================
   NAVIGATION
   =========================== */
nav {
    background-color: var(--color-light);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 99;
    border-bottom: 3px solid var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    gap: 20px;
    flex-wrap: wrap;
    position: relative;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}

.theme-toggle:hover {
    background-color: rgba(232, 201, 160, 0.1);
}

body.dark-mode .theme-toggle:hover {
    background-color: rgba(232, 201, 160, 0.2);
}

.nav-brand {
        display: flex;
        align-items: center;
        flex-shrink: 0;
        position: relative;
}

.nav-brand img {
    max-width: 70px;
    height: auto;
    border-radius: 8px;
    transition: transform 0.3s ease;
    box-shadow: var(--shadow);
}

    /* Badge indicating the image is clickable to open the menu (mobile) */
    .nav-brand .menu-badge {
        position: absolute;
        top: -6px;
        right: -6px;
        width: 28px;
        height: 28px;
        background: var(--color-accent);
        color: #fff;
        border-radius: 50%;
        display: none;
        align-items: center;
        justify-content: center;
        box-shadow: var(--shadow);
        cursor: pointer;
        font-size: 14px;
        z-index: 1115;
        transition: transform 200ms ease;
    }

    .nav-brand .menu-badge:active {
        transform: scale(0.96);
    }

    @keyframes pulse {
        0% { transform: scale(1); opacity: 1; }
        50% { transform: scale(1.08); opacity: 0.9; }
        100% { transform: scale(1); opacity: 1; }
    }

    .nav-brand .menu-badge.pulse {
        animation: pulse 2s infinite;
    }

/* Desktop dropdown menu icon (right side) */
.nav-menu-icon {
    display: none;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--color-dark);
    padding: 6px 10px;
    border-radius: 6px;
}

/* Mobile hamburger button (hidden by default, shown on mobile) */
.nav-hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    color: var(--color-dark);
    z-index: 1115;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
}

.nav-dropdown-panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 12px;
    background: var(--color-light);
    box-shadow: var(--shadow-lg);
    border-radius: 8px;
    padding: 8px 12px;
    z-index: 1050;
    min-width: 180px;
}

.nav-dropdown-panel a {
    display: block;
    padding: 8px 6px;
    color: var(--color-text);
    text-decoration: none;
}

.nav-dropdown-panel a:hover {
    background: var(--color-light);
}

nav.dropdown-open .nav-dropdown-panel {
    display: block;
}

/* show the desktop menu icon on wider screens */
@media (min-width: 769px) {
    .nav-menu-icon { display: inline-flex; align-items: center; }
    /* hide the mobile badge on desktop */
    .nav-brand .menu-badge { display: none !important; }
    /* hide the mobile hamburger on desktop */
    .nav-hamburger { display: none; }
}

.nav-brand img:hover {
    transform: scale(1.08);
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    flex: 1;
}

nav li {
    margin: 0;
}

nav a {
    display: block;
    padding: 12px 14px;
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    font-size: 12px;
    white-space: nowrap;
}

nav a:hover {
    background-color: var(--color-light);
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

nav a.active {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: white;
    border-bottom-color: var(--color-accent);
}

/* ===========================
   HAMBURGER / MOBILE NAV
   =========================== */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--color-dark);
    padding: 8px;
}

/* Mobile layout */
@media (max-width: 768px) {
    nav {
        padding: 10px 14px;
    }

    .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    nav ul {
        display: flex;
        flex-direction: column;
        width: 100%;
        order: 3;
        gap: 0;
        background: var(--color-light);
        border-top: 1px solid var(--color-border);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transform: translateY(-10px);
    }

    /* overlay style: full-screen menu above all content */
    nav.open ul {
        max-height: 100vh;
        opacity: 1;
        transform: translateY(0);
        box-shadow: none;
        position: fixed;
        inset: 0; /* top:0; right:0; bottom:0; left:0 */
        background: linear-gradient(180deg, rgba(15,15,20,0.98), rgba(10,10,15,0.98));
        z-index: 1100;
        padding-top: 100px;
        align-items: center;
        justify-content: center;
    }

    /* larger, centered links inside overlay */
    nav.open ul a {
        color: #fff;
        font-size: 20px;
        padding: 16px 24px;
        display: block;
        text-align: center;
        width: 100%;
        max-width: 480px;
    }

    /* keep the logo visible above the overlay */
    .nav-brand {
        position: relative;
        z-index: 1110;
    }

    .nav-brand img {
        max-width: 64px;
    }

    nav a {
        padding: 12px 18px;
        text-align: left;
        width: 100%;
        font-size: 14px;
    }

    .nav-brand {
        flex: 0 0 auto;
    }

    .nav-brand img {
        max-width: 60px;
    }

    /* Show mobile hamburger on mobile screens */
    .nav-hamburger {
        display: flex;
    }

    /* hide desktop dropdown icon on mobile */
    .nav-menu-icon { display: none; }
}

/* ===========================
   CONTENEUR PRINCIPAL
   =========================== */
.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

main {
    background: var(--color-light);
    padding: 30px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* ===========================
   TITRES
   =========================== */
h1, h2, h3, h4, h5, h6 {
    color: var(--color-primary);
    line-height: 1.4;
    margin: 25px 0 15px 0;
    font-weight: 700;
}

h1 {
    font-size: 28px;
    border-bottom: 3px solid var(--color-accent);
    padding-bottom: 15px;
    margin-top: 0;
}

h2 {
    font-size: 22px;
    margin-top: 30px;
}

h3 {
    font-size: 18px;
    color: var(--color-secondary);
}

p {
    margin: 12px 0;
    color: var(--color-text);
}

/* ===========================
   IMAGES ET MÉDIAS
   =========================== */
/* Make all images respect their container width */
img, img.content-img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* specific content image styling (keeps hover but won't overflow) */
img.content-img {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: 20px 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Prevent hover transform from creating overflow by clipping parent */
.content-img, .grid-2 > div, .grid-2 > * {
    overflow: hidden;
}

img.content-img:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* ===========================
   GRILLES
   =========================== */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 20px 0;
}

/* ensure grid cells clip children if necessary */
.grid-2 > * {
    overflow: hidden;
}

/* ===========================
   BOUTONS
   =========================== */
.btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: white;
    padding: 14px 28px;
    text-decoration: none;
    border-radius: var(--radius);
    margin: 15px 0;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow);
    font-size: 14px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, #5F3DC4 0%, #9B92F1 100%);
}

.btn:active {
    transform: translateY(0);
}

/* ===========================
   BOÎTES D'ADRESSES
   =========================== */
.address-box {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.08) 0%, rgba(162, 155, 254, 0.08) 100%);
    padding: 20px;
    border-left: 5px solid var(--color-primary);
    margin: 20px 0;
    border-radius: var(--radius);
    transition: all 0.3s ease;
}

.address-box:hover {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.12) 0%, rgba(162, 155, 254, 0.12) 100%);
    transform: translateX(5px);
}

.address-box h3 {
    color: var(--color-primary);
    margin-top: 0;
}

/* ===========================
   FOOTER
   =========================== */
footer {
    background: var(--color-light); /* Fond clair par défaut */
    color: var(--color-text);       /* Texte sombre par défaut */
    padding: 40px 20px 20px;
    margin-top: 60px;
    font-size: 14px;
    border-top: 3px solid var(--color-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.footer-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto 30px;
}

.footer-section {
    flex: 1;
    min-width: 250px;
    padding: 20px;
    background: rgba(0,0,0,0.02);
    border-radius: var(--radius);
    transition: all 0.3s ease;
    border: 1px solid var(--color-border);
}

.footer-section:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.footer-section h3 {
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 10px;
    margin-bottom: 15px;
    margin-top: 0;
}

.footer-section a {
    color: var(--color-accent);
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-section a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.share-links a {
    display: inline-block;
    margin-right: 15px;
    padding: 8px 16px;
    background: rgba(0,0,0,0.05);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.share-links a:hover {
    background: var(--color-accent);
    color: white;
}

footer > div:last-child {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}

/* Styles du footer en mode sombre */
body.dark-mode footer {
    background: #1A2636;
    color: var(--color-text);
    border-top-color: var(--color-primary);
}

body.dark-mode .footer-section {
    background: #2A3E54;
    border-color: #4A5C6E;
}

body.dark-mode .footer-section h3 {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

body.dark-mode .footer-section a {
    color: var(--color-accent);
}

body.dark-mode .footer-section a:hover {
    color: var(--color-primary);
}

body.dark-mode .share-links a {
    background: rgba(232, 201, 160, 0.1);
    border-color: var(--color-accent);
}

body.dark-mode .share-links a:hover {
    color: #2C3E50 !important;
}

body.dark-mode footer > div:last-child {
    border-top-color: #4A5C6E;
}

/* ===========================
   SÉPARATEURS
   =========================== */
hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
    margin: 40px 0;
    border-radius: 1px;
}

/* ===========================
   RESPONSIVE - TABLET
   =========================== */
@media (min-width: 768px) {
    html {
        font-size: 17px;
    }

    .grid-2 {
        grid-template-columns: 1fr 1fr;
    }

    main {
        padding: 40px;
    }

    h1 {
        font-size: 32px;
    }

    h2 {
        font-size: 26px;
    }

    nav a {
        padding: 14px 16px;
        font-size: 13px;
    }

    .nav-brand img {
        max-width: 80px;
    }
}

/* ===========================
   RESPONSIVE - DESKTOP
   =========================== */
@media (min-width: 1024px) {
    main {
        padding: 50px;
    }

    h1 {
        font-size: 36px;
    }

    h2 {
        font-size: 28px;
    }

    nav a {
        padding: 14px 18px;
        font-size: 14px;
    }

    .nav-brand img {
        max-width: 90px;
    }

    .grid-2 {
        gap: 30px;
    }
}

/* ===========================
   ANIMATIONS
   =========================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

main {
    animation: fadeIn 0.5s ease-out;
}

/* ===========================
   ACCESSIBILITÉ
   =========================== */
a:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: 4px;
}

button:focus, .btn:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Visually hidden but accessible text for screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===========================
   LIGHTBOX
   =========================== */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.lightbox-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.lightbox-prev, .lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 30px;
    color: white;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    display: none;
}

.lightbox-prev:hover, .lightbox-next:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.content-img {
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.content-img:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

/* ===========================
   BOUTON SCROLL-TO-TOP
   =========================== */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    z-index: 999;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.scroll-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 35px rgba(108, 92, 231, 0.3);
}

.scroll-to-top.show {
    display: flex;
}

