/* =================================
   CONTENEUR PRINCIPAL
================================= */
.reglementation-container {
    max-width: 100%;
    margin: var(--section-margin);
}



/* =================================
   LAYOUT DEUX COLONNES
================================= */
.reglementation-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 3rem;
    align-items: start;
}

.reglementation-content {
    min-width: 0;
}

.intros-text {
    max-width: 800px;
    /* width: 90vw; */
    margin: 0 auto 40px auto !important;
    text-align: center;
    font-family: var(--font-secondary);
}

/* =================================
   PLAN DE LA PAGE (SIDEBAR)
================================= */
.plan-page {
    background: var(--white);
}

.plan-page h3 {
    font-size: 1.25rem;
    font-weight: 600;
    font-family: var(--font-primary);
    color: var(--subtitle-color);
}

.plan-page ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.plan-page>ul>li {
    padding: 0.625rem 0;
    border-left: 3px solid transparent;
    padding-left: 1rem;
    transition: border-color 0.2s ease;
}

.plan-page>ul>li.active {
    border-left-color: var(--primary-blue);
}

.plan-page>ul>li.active>a {
    color: var(--primary-blue);
    font-weight: 600;
}

.plan-page ul li a {
    color: var(--subtitle-color);
    text-decoration: none;
    font-size: 14px;
    font-family: var(--font-secondary);
    font-weight: 400;
    transition: color 0.2s ease;
    display: block;
    line-height: 1.6;
}

.plan-page ul li a:hover {
    color: var(--primary-blue);
}

/* Sous-catégories de la sidebar */
.plan-page ul ul {
    margin-top: 0.5rem;
    margin-left: 0;
    /* padding-left: 0.5rem; */
}

.plan-page ul ul li {
    font-size: 13px;
    padding: 0.25rem 0.5rem;
    border: none;
}

.plan-page ul ul li a {
    font-size: 13px;
    color: #666;
}

/* =================================
   TITRES ET DESCRIPTIONS
================================= */
.reglementation-container h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    font-family: var(--font-primary);
    color: var(--subtitle-color);
    margin: 0 0 1.5rem;
}

.description-text {
    font-size: 16px;
    line-height: 1.7;
    color: var(--paragraph-color);
    max-width: 900px;
    margin-bottom: 2rem;
}

/* =================================
   SECTIONS CATÉGORIES
================================= */
/* =================================
   SECTIONS
================================= */
.section-reglementation {
    margin-bottom: 3rem;
}

.section-reglementation h2 {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    font-weight: 700;
    color: var(--subtitle-color);
    margin-bottom: 1rem;
}

/* =================================
   SECTIONS CATÉGORIES (ACCORDÉON)
================================= */
.accordion-categories {
    margin-top: 1.5rem;
}

.categorie-section {
    border: 1px solid #eee;
    margin-bottom: 10px;
    border-radius: 4px;
    background: #F5F5F5;
}

.categorie-section:last-child {
    margin-bottom: 0;
}

/* =================================
   TITRE CATÉGORIE (BOUTON ACCORDÉON)
================================= */
.categorie-titre {
    width: 100%;
    padding: 20px;
    background: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-primary);
    color: var(--subtitle-color);
    transition: background-color 0.2s ease;
    user-select: none;
    border: none;
    text-align: left;
}

.categorie-titre:hover {
    background: #F5F5F5;
}

.categorie-titre h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--subtitle-color);
    flex: 1;
    /* Prend toute la place disponible */
    margin-right: 15px;
    /* Évite que le texte colle à l'icône */
}

/* =================================
   ICÔNE TOGGLE
================================= */
.categorie-titre .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    /* Force l'icône à droite */
    flex-shrink: 0;
}

.categorie-titre i {
    font-size: 0.875rem;
    color: #999;
    transition: transform 0.3s ease;
}

.categorie-titre i.rotated {
    transform: rotate(180deg);
}

/* Fallback si la classe active est utilisée sur le parent */
.categorie-titre.active i {
    transform: rotate(180deg);
}


/* =================================
   LISTE DES ARTICLES
================================= */
/* =================================
   LISTE DES ARTICLES
================================= */
.liste-articles {
    display: none;
    padding: 0 15px 20px 35px;
    /* Ajusté pour l'indentation de liste */
    margin: 0;
    list-style-type: disc;
    list-style-position: outside;
    background: #F5F5F5;
}

.liste-articles.show {
    display: block;
    animation: slideDown 0.3s ease-out;
}

.liste-articles li {
    padding: 0.2rem 0;
    color: var(--paragraph-color);
    font-size: 13px;
    font-family: var(--font-secondary);
    margin-left: 0;
}

.liste-articles li:last-child {
    border-bottom: none;
}

.liste-articles li::marker {
    font-size: 1em;
}

/* Liens dans les articles */
.liste-articles li a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 400;
}

.liste-articles li a:hover {
    color: #004c99;
    text-decoration: underline;
}

/* =================================
   ANIMATIONS
================================= */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.liste-articles.show {
    animation: slideDown 0.3s ease-out;
}

/* =================================
   ACCESSIBILITÉ
================================= */
.categorie-titre[aria-expanded="true"]::after {
    content: "";
}

.categorie-titre[aria-expanded="false"]::after {
    content: "";
}

/* Lecteurs d'écran */
.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;
}

/* =================================
   RESPONSIVE - TABLETTES
================================= */
@media (max-width: 992px) {
    :root {
        --section-margin: 30px 5rem;
    }

    .reglementation-layout {
        grid-template-columns: 280px 1fr;
        gap: 2rem;
    }

    .plan-page {
        padding: 1.25rem;
    }
}

@media (max-width: 992px) {
    :root {
        --section-margin: 30px 2rem;
    }

    .reglementation-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .plan-page {
        position: static;
        margin-bottom: 2rem;
    }

    .hero-banner {
        height: 180px;
    }
}

/* =================================
   RESPONSIVE - MOBILE
================================= */
@media (max-width: 768px) {
    :root {
        --section-margin: 20px 1rem;
    }

    .reglementation-container {
        padding: 0;
    }

    .hero-banner {
        height: 150px;
        border-radius: 4px;
    }

    .reglementation-container h2 {
        font-size: 1.5rem;
    }

    .categorie-titre {
        padding: 1rem;
        font-size: 1rem;
    }

    .liste-articles {
        padding: 1rem 1.5rem 1rem 2rem;
    }

    .liste-articles li {
        font-size: 14px;
        padding: 0.625rem 0;
    }

    .plan-page {
        padding: 0;
        border-radius: 8px;
        overflow: hidden;
        border: 1px solid #eee;
    }

    /* Header accordéon mobile */
    .plan-page h3 {
        font-size: 1rem;
        background: #F5C400;
        color: #333;
        margin: 0;
        padding: 12px 16px;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .plan-page h3::after {
        content: '\f077';
        /* chevron-up */
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        font-size: 12px;
        transition: transform 0.3s ease;
    }

    .plan-page.collapsed h3::after {
        transform: rotate(180deg);
    }

    .plan-page>ul {
        max-height: 1000px;
        overflow: hidden;
        transition: max-height 0.3s ease;
        background: #fff;
    }

    .plan-page.collapsed>ul {
        max-height: 0;
    }

    .plan-page>ul>li {
        padding: 12px 16px;
        border-bottom: 1px solid #eee;
        border-left: none;
    }

    .plan-page>ul>li:last-child {
        border-bottom: none;
    }

    .plan-page>ul>li>a {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-weight: 500;
        color: #333;
    }

    .plan-page>ul>li>a::after {
        content: '\f077';
        /* chevron-up */
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        font-size: 10px;
        color: #999;
        transition: transform 0.3s ease;
    }

    .plan-page>ul>li.collapsed>a::after {
        transform: rotate(180deg);
    }

    .plan-page ul ul {
        max-height: 500px;
        overflow: hidden;
        transition: max-height 0.3s ease;
        margin-top: 8px;
        padding-left: 0;
    }

    .plan-page>ul>li.collapsed ul {
        max-height: 0;
        margin-top: 0;
    }

    .plan-page ul ul li {
        padding: 8px 0;
        border: none;
    }

    .plan-page ul ul li a {
        font-size: 13px;
        color: #555;
    }
}

@media (max-width: 480px) {
    .hero-banner {
        height: 120px;
    }

    .hero-banner h1 {
        font-size: 1.5rem !important;
        letter-spacing: 1px;
    }

    .reglementation-container h2 {
        font-size: 1.25rem;
    }

    .categorie-titre {
        padding: 0.875rem;
        font-size: 0.95rem;
    }

    .toggle-icon {
        font-size: 1rem;
    }

    .liste-articles {
        padding: 1rem 1.25rem 1rem 1.75rem;
    }

    .liste-articles li {
        font-size: 13px;
    }

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



@media (hover: hover) {
    .categorie-titre:hover .toggle-icon {
        transform: scale(1.1);
    }
}

/* =================================
   OPTIMISATION PERFORMANCE
================================= */
.categorie-section {
    will-change: box-shadow;
}

.toggle-icon {
    will-change: transform;
}

/* =================================
   IMPRESSION
================================= */
@media print {
    .hero-banner {
        display: none;
    }

    .plan-page {
        display: none;
    }

    .reglementation-layout {
        grid-template-columns: 1fr;
    }

    .toggle-icon {
        display: none;
    }

    .liste-articles {
        display: block !important;
        page-break-inside: avoid;
    }

    .categorie-section {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--border-color);
    }

    .categorie-titre {
        background: transparent;
        border-bottom: 2px solid var(--border-color);
    }
}

/* Fallback pour navigateurs sans grid */
@supports not (display: grid) {
    .reglementation-layout {
        display: flex;
        flex-wrap: wrap;
    }

    .plan-page {
        flex: 0 0 350px;
    }

    .reglementation-content {
        flex: 1;
    }
}