:root {
    /* Primary Colors */
    --primary-green: #006A4E;
    --primary-red: #D21B33;
    --primary-yellow: #FFCE15;
    --primary-blue: #116E9B;

    /* Surface Colors */
    --surface-variant: #00FF6E;
    --surface: #FFFFFF;
    /* pagination rules were removed from here and placed after :root to avoid breaking variable declarations */

    /* Backgroung Colors */
    --background-gray: #F9FAFB;

    /* Outline */
    --outline: #00FF6E;

    /* Text Colors */
    --on-primary-green: #00FF6E;
    --on-surface-variant: #D21B33;
    --on-surface: #00FF6E;
}

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

/* Smooth scrolling personnalisé avec GSAP */
html {
    scroll-behavior: smooth;
}

/* Performance optimizations */
* {
    will-change: auto;
}

/* Barre de défilement personnalisée */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: linear-gradient(45deg, #f1f1f1, #e8e8e8);
    border-radius: 10px;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, var(--primary-green), #00b366);
    border-radius: 10px;
    box-shadow: 
        0 2px 6px rgba(0, 106, 78, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 2px solid transparent;
    background-clip: content-box;
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #00b366, var(--primary-green));
    box-shadow: 
        0 4px 12px rgba(0, 106, 78, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

::-webkit-scrollbar-thumb:active {
    background: linear-gradient(45deg, var(--primary-green), #004d3a);
    box-shadow: 
        0 2px 4px rgba(0, 106, 78, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-corner {
    background: linear-gradient(45deg, #f1f1f1, #e8e8e8);
    border-radius: 10px;
}

/* Style pour Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-green) #f1f1f1;
}

/* Animation de la barre de défilement au survol de la page */
html:hover::-webkit-scrollbar-thumb {
    box-shadow: 
        0 0 15px rgba(0, 255, 110, 0.3),
        0 2px 6px rgba(0, 106, 78, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Réduction de mouvement pour accessibilité */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    body {
        overflow: auto !important;
    }
    
    ::-webkit-scrollbar-thumb {
        transition: none;
        transform: none;
    }
}

body {
    line-height: 1.6;
    padding-top: 135px !important;
    font-family: "Poppins", sans-serif;
    font-style: normal;
}

/* Navbar Styles */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--surface);
}

.navbar-container {
    position: relative;
    display: contents;
}

.navbar-top {
    background: var(--primary-green);
    color: white;
    padding: 0;
    font-size: 14px;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 50px;
    padding: 0px 72px 0px 180px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-contact {
    height: 50px;
    display: flex;
    gap: 40px;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon {
    width: 20px;
    height: 20px;
    color: var(--primary-yellow);
}

.navbar-social {
    display: flex;
    gap: 16px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transition: background 0.3s ease;
    text-decoration: none;
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.2);
}

.navbar-main {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 2px 0;
}

.navbar-main .navbar-container {
    display: flex;
    align-items: center;
    gap: 60px;
}

.navbar-logo {
    margin: 10px 112px;
    position: absolute;
    top: 40%;
    transform: translateY(-50%);
}

.navbar-logo img {
    display: block;
    height: 100px;
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 32px;
    flex: 1;
    margin: 0;
}

.nav-link {
    color: black;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-blue);
}

.dropdown {
    position: relative;
}

.dropdown-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    margin-left: 4px;
}

.dropdown-arrow img {
    width: 20px;
    height: 20px;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 12px 0;
    min-width: 240px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    z-index: 1000;
    margin-top: 8px;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    font-weight: 500;
    padding: 12px 24px;
    color: #000000;
    text-decoration: none;
    font-size: 15px;
    transition: background 0.2s ease, color 0.2s ease;
}

.dropdown-item.active,
.dropdown-item:hover {
    background: #F5F5F5;
    color: var(--primary-green);
}

.btn-primary {
    background: var(--primary-yellow);
    color: #000;
    padding: 12px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 206, 21, 0.4);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: #000;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 3px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Hero Section */
.hero {
    height: 600px;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('../images/heros_image.jpg') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding: 0 20px;
}

.hero-content {
    max-width: 900px;
}

.hero-title {
    font-size: 56px;
    font-weight: 700;
    margin-bottom: 24px;
    line-height: 1.2;
}

.hero-description {
    font-size: 18px;
    line-height: 1.7;
    margin-bottom: 40px;
    opacity: 0.95;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-secondary {
    background: white;
    color: #000;
    padding: 14px 32px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

/* Presentation Section */
.presentation {
    background: white;
    padding: 80px 112px;
}

.presentation-container {
    max-width: 1400px;
    margin: 0 auto 60px;
    display: grid;
    grid-template-columns: 1fr 1.7fr;
    gap: 80px;
    align-items: start;
}

.presentation-image {
    display: flex;
    align-items: flex-start;
}

.presentation-image img {
    width: 100%;
    height: auto;
    max-height: 400px;
    border-radius: 12px;
    object-fit: cover;
    object-position: top;
}

.section-title {
    font-size: 40px;
    font-weight: 700;
    color: #000;
    margin-bottom: 16px;
}

.presentation-text {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
    margin-bottom: 20px;
}

/* Stats Container */
.stats-container {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--background-gray);
    border-radius: 16px;
    padding: 48px 60px;
    display: grid;
    grid-template-columns: auto 1px auto 1.5fr;
    gap: 60px;
    align-items: center;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 80px;
    font-weight: 700;
    color: var(--primary-green);
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-green);
    letter-spacing: 1px;
}

.stat-divider {
    width: 1px;
    height: 100px;
    background: #E0E0E0;
}

.stat-text {
    font-size: 18px;
    line-height: 1.8;
    color: #333;
}

.stat-text p {
    margin-bottom: 12px;
}

.stat-text strong {
    font-weight: 600;
    color: #000;
}

/* Responsive */
/* Default visibility helpers: show .bnav by default (desktop/tablet), hide .bmobile */
.bnav {
    /* visible by default without forcing a particular display value */
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.bmobile {
    /* hidden by default without changing display (avoids conflicting display types) */
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 1200px) {
    .navbar-container {
        padding: 0 20px;
    }

    .navbar-menu {
        gap: 20px;
    }

    .navbar-main .navbar-container {
        gap: 30px;
    }

    .presentation-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .stats-container {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 40px 30px;
    }

    .stat-divider {
        display: none;
    }
}

@media (max-width: 992px) {
    .navbar-contact {
        justify-content: space-between;
        gap: 20px;
        align-items: center;
        width: 100%;
    }

    .contact-item span {
        font-size: 12px;
        white-space: nowrap;
    }

    .hero-title {
        font-size: 40px;
    }

    .hero-description {
        font-size: 16px;
    }

    .section-title {
        font-size: 32px;
    }

    .stat-number {
        font-size: 60px;
    }
}

/* Mobile Responsive (768px and below) */
@media (max-width: 768px) {
    body {
        padding-top: 120px;
    }

    .navbar-container {
        margin: 0 5px;
        padding: 0 5px;
    }

    .contact-item {
        padding: 0 !important;
    }

    .bnav {
        /* hide visually on mobile without altering element's display property */
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        position: absolute !important;
        left: -9999px !important;
    }

    .bmobile {
        /* show mobile elements without forcing a display value */
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        position: static !important;
        left: auto !important;
    }

    .navbar-logo {
        margin: 5px 20px;
        position: static;
        transform: none;
        text-align: center;
    }

    .navbar-logo img {
        height: 60px;
    }

    .navbar-main {
        padding: 2px 0;
        position: relative;
    }

    .navbar-main .navbar-container {
        position: relative;
        padding: 0 15px;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .navbar-menu {
        position: fixed;
        top: 120px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        gap: 0;
        width: 100%;
        text-align: center;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        z-index: 1000;
    }

    .navbar-menu.active {
        max-height: 500px;
        padding: 20px 0;
    }

    .navbar-menu li {
        border-bottom: 1px solid #f0f0f0;
    }

    .navbar-menu li:last-child {
        border-bottom: none;
    }

    .nav-link {
        font-size: 16px;
        padding: 15px 20px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        border: none;
        background: none;
    }

    .dropdown {
        position: relative;
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: #f8f9fa;
        margin-top: 0;
        border-radius: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .dropdown.active .dropdown-menu {
        max-height: 300px;
    }

    .dropdown-item {
        font-size: 14px;
        padding: 12px 40px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-bottom: 1px solid #e0e0e0;
    }

    .dropdown-item:last-child {
        border-bottom: none;
    }

    .btn-primary {
        font-size: 14px;
        padding: 12px 20px;
        width: 100%;
        text-align: center;
        min-height: 44px;
    }

    .hero {
        height: 400px;
        padding: 0 15px;
    }

    .hero-title {
        font-size: 28px;
        margin-bottom: 16px;
    }

    .hero-description {
        font-size: 14px;
        margin-bottom: 24px;
    }

    .hero-buttons {
        gap: 12px;
        align-items: center;
    }

    .btn-secondary {
        font-size: 14px;
        padding: 12px 24px;
        width: 100%;
        text-align: center;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .presentation {
        padding: 40px 15px;
    }

    .section-title {
        font-size: 24px;
        margin-bottom: 12px;
    }

    .presentation-text {
        font-size: 14px;
        line-height: 1.6;
        margin-bottom: 16px;
    }

    .stats-container {
        padding: 30px 20px;
        gap: 30px;
        grid-template-columns: 1fr;
    }

    .stats-container.stats-two-cols-mobile {
        /* three columns: left stat, thin divider, right stat */
        grid-template-columns: 1fr 1px 1fr;
        align-items: center;
        column-gap: 20px;
    }

    .stats-container.stats-two-cols-mobile .stat-item {
        justify-self: center;
    }

    .stats-container.stats-two-cols-mobile .stat-divider {
        display: block;
        width: 1px;
        height: 56px;
        background: #E0E0E0;
        align-self: center;
        justify-self: center;
    }

    .stats-container.stats-two-cols-mobile .stat-text {
        grid-column: 1 / -1;
        margin-top: 18px;
    }

    .contact-item {
        padding: auto !important;
    }

    .mobile-logo {
        height: 40px;
    }

    .stat-number {
        font-size: 48px;
    }

    .stat-label {
        font-size: 14px;
    }

    .stat-text {
        font-size: 14px;
    }

    .social-link {
        min-height: 44px;
    }
}

/* Footer adjustments on mobile: justify long list items and center the last line */
@media (max-width: 768px) {

    .footer-links .footer-list,
    .footer-links .footer-list li a {
        text-align: justify;
        text-justify: inter-word;
        /* ensure the last line is centered when wrapped */
        text-align-last: center;
        -webkit-text-align-last: center;
        /* WebKit/Safari */
        -moz-text-align-last: center;
        /* Firefox */
    }

    /* Optional: make the footer columns stack nicely */
    .footer-links {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        align-items: start;
    }

    .footer-social-label,
    .footer-brand-text {
        text-align: justify;
        text-justify: inter-word;
        text-align-last: center;
        -webkit-text-align-last: center;
        -moz-text-align-last: center;
    }
}

/* Tablet Responsive (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    body {
        padding-top: 100px;
    }

    .navbar-container {
        margin: 0 20px;
        padding: 0 30px;
    }

    .navbar-logo {
        margin: 8px 60px;
    }

    .contact-item {
        padding: 0 !important;
    }

    .navbar-logo img {
        height: 80px;
    }

    .mobile-logo {
        height: 40px;
    }

    .navbar-menu {
        gap: 20px;
    }

    .nav-link {
        font-size: 15px;
    }

    .hero {
        height: 500px;
    }

    .hero-title {
        font-size: 40px;
    }

    .hero-description {
        font-size: 16px;
    }

    .presentation {
        padding: 60px 40px;
    }

    .section-title {
        font-size: 32px;
    }

    /* Optimisation navbar-contact pour tablettes - space between */
    .navbar-contact {
        justify-content: space-between;
        gap: 20px;
        width: 100%;
    }

    .contact-item span {
        font-size: 12px;
        white-space: nowrap;
    }

    /* Optimisation footer pour tablettes */
    .footer-container {
        grid-template-columns: 1fr 1.8fr;
        gap: 40px;
    }

    .footer-links {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }
}

/* Small Tablet (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    body {
        padding-top: 130px;
    }

    .navbar-top {
        display: block;
    }

    .contact-item {
        padding: 0 !important;
    }

    /* Keep default .bnav/.bmobile behavior for this range (no override) */

    .contact-item span {
        font-size: 11px;
        white-space: nowrap;
    }

    .navbar-contact {
        justify-content: space-between;
        gap: 15px;
        align-self: center;
        width: 100%;
    }

    .hero {
        height: 450px;
    }

    .hero-title {
        font-size: 32px;
    }

    .hero-buttons {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }

    .presentation {
        padding: 50px 25px;
    }

    .section-title {
        font-size: 28px;
    }

    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .stat-text {
        grid-column: span 2;
    }

    .contact-info {
        padding: 10px !important;
    }
}

/* Pagination: keep pagination horizontal on small screens and limit visible page numbers */
.pagination-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: nowrap;
    /* prevent wrapping to multiple lines */
}

.pagination-btn {
    background: transparent;
    border: none;
    color: var(--text-color, #111);
    font-weight: 600;
    cursor: pointer;
}

/* On very small screens, force pagination numbers to not wrap and only show the first two numbers generated */
@media (max-width: 420px) {
    .pagination-container {
        gap: 8px;
    }

    /* If page numbers are generated as children inside #pageNumbers (for example as buttons or spans), hide overflow */
    #pageNumbers {
        display: inline-flex;
        gap: 6px;
        max-width: calc(2 * 2.4rem + 12px);
        /* allow roughly two number items width (adjustable) */
        overflow: hidden;
        white-space: nowrap;
    }

    /* Hide additional page number items beyond the first two using :nth-child selector */
    #pageNumbers>*:nth-child(n+3) {
        display: none !important;
    }

    /* Make sure prev/next buttons remain visible and not wrapped */
    .pagination-btn {
        flex: 0 0 auto;
    }

    .contact-info {
        padding: 10px !important;
    }
}
/* ==========================================================
   GLOBAL CONTAINER REFACTOR - UNIFICATION DES MAX-WIDTH 
   ========================================================== */
.resources-container, .gouvernance-container, .vision-container, .cultural-section-container,
.gallery-container, .tourisme-sites-container, .blog-header, .blog-grid, .mayor-container,
.contact-container, .events-list-container, .gastro-intro-container, .gastro-dishes-container,
.mission-content-container, .organi-content, .tourisme-intro-container, .tourisme-attractions-container,
.civil-container, .mots-maire-container, .footer-content, .footer-newsletter, .bureau-info-container,
.bureau-missions-container, .bureau-composition-container, .bureau-organisation-container, 
.bureau-designation-container, .footer-bottom-container, .footer-container, .navbar-container, 
.missions-container, .documents-container, .project-content-container, .page-content, .main-content {
    max-width: 1400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

