/* Réinitialisation et variables */
:root {
    --primary-color: #1a3a2f;
    --secondary-color: #f5f5f5;
    --tertiary-color: #FFD700;
    --action-color: #d4af37;
    --font-primary: 'Montserrat', sans-serif;
}

/* En-tête */
header {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    flex-wrap: wrap;
}

header .logo img {
    height: 50px;
    max-width: 100%;
}

header nav ul {
    display: flex;
    list-style: none;
    flex-wrap: wrap;
}

header nav ul li {
    margin-left: 1.5rem;
}

header nav ul li a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
}

header nav ul li a.active {
    color: var(--tertiary-color);
}

.btn-header {
    background-color: var(--tertiary-color);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
}

/* ====== BANNIÈRE DE LA FÉDÉRATION AVEC ORGANIGRAMME ====== */

.hero-federation {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    padding: 8rem 2rem 4rem;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-federation .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 4rem;
    flex-wrap: wrap;
}

.hero-content {
    flex: 1;
    min-width: 300px;
}

.hero-content h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
}

.hero-content p {
    font-size: clamp(1rem, 2vw, 1.1rem);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-yellow {
    background-color: var(--tertiary-color);
    color: var(--primary-color);
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

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

.btn-dark {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    border: 2px solid var(--tertiary-color);
    transition: all 0.3s ease;
}

.btn-dark:hover {
    background-color: var(--tertiary-color);
    color: var(--primary-color);
}

/* ====== ORGANIGRAMME RESPONSIVE ====== */

.organigramme-container {
    flex: 1;
    min-width: 300px;
    position: relative;
    background-color: #000;
    padding: 2rem 1rem;
    border-radius: 10px;
    border: 2px solid var(--tertiary-color);
    overflow-x: auto;
}

/* Version Desktop - Organigramme graphique */
.organigramme {
    position: relative;
    padding: 1rem;
    min-width: 400px;
}

/* Président */
.president {
    background-color: var(--tertiary-color);
    color: #000;
    border: 2px solid #000;
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 2rem;
    font-weight: 700;
    text-align: center;
    position: relative;
}

.president::after {
    content: "";
    position: absolute;
    bottom: -2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 2rem;
    background-color: var(--tertiary-color);
}

/* Nœuds */
.node {
    background-color: var(--tertiary-color);
    color: #000;
    border: 2px solid #000;
    padding: 0.8rem;
    border-radius: 5px;
    text-align: center;
    font-weight: 600;
    position: relative;
    transition: all 0.3s ease;
}

.node:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.5);
}

.node-title {
    color: #000;
    font-size: 0.9rem;
}

/* Rangées de nœuds */
.nodes-row {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    position: relative;
    flex-wrap: wrap;
}

/* Lignes de connexion - Premier niveau */
.nodes-row.first-level::before {
    content: "";
    position: absolute;
    top: -1rem;
    left: 25%;
    right: 25%;
    height: 2px;
    background-color: var(--tertiary-color);
}

.nodes-row.first-level .node::before {
    content: "";
    position: absolute;
    top: -1rem;
    left: 50%;
    width: 2px;
    height: 1rem;
    background-color: var(--tertiary-color);
    transform: translateX(-50%);
}

/* Lignes de connexion - Second niveau */
.nodes-row.second-level::before {
    content: "";
    position: absolute;
    top: -1rem;
    left: 10%;
    right: 10%;
    height: 2px;
    background-color: var(--tertiary-color);
}

.nodes-row.second-level .node::before {
    content: "";
    position: absolute;
    top: -1rem;
    left: 50%;
    width: 2px;
    height: 1rem;
    background-color: var(--tertiary-color);
    transform: translateX(-50%);
}

/* Version Mobile - Liste hiérarchique */
.organigramme-mobile {
    display: none;
}

.organigramme-mobile .org-level {
    margin-bottom: 1.5rem;
}

.organigramme-mobile .org-level-title {
    background-color: var(--tertiary-color);
    color: #000;
    padding: 0.8rem 1rem;
    border-radius: 5px;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
}

.organigramme-mobile .org-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-left: 1rem;
}

.organigramme-mobile .org-item {
    background-color: rgba(255, 215, 0, 0.3);
    color: var(--tertiary-color);
    padding: 0.6rem 1rem;
    border-radius: 5px;
    border-left: 3px solid var(--tertiary-color);
    font-weight: 600;
    transition: all 0.3s ease;
}

.organigramme-mobile .org-item:hover {
    background-color: rgba(255, 215, 0, 0.5);
    transform: translateX(5px);
}

/* Éléments décoratifs */
.decorative-elements {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 10px;
}

.star,
.circle,
.play-button {
    width: 20px;
    height: 20px;
    opacity: 0.3;
}

/* ====== SECTION HISTORIQUE ====== */

.brief-history {
    background-color: var(--secondary-color);
    padding: 4rem 2rem;
}

.brief-history .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.history-content {
    flex: 1;
    min-width: 300px;
}

.history-content h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 1rem;
    color: var(--primary-color);
    border-bottom: 3px solid var(--tertiary-color);
    display: inline-block;
    padding-bottom: 0.5rem;
}

.history-content p {
    margin-bottom: 2rem;
    line-height: 1.6;
}

.history-images {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.image-card {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.image-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.image-caption {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    padding: 1rem;
}

.image-caption h3 {
    margin-bottom: 0.5rem;
    color: var(--tertiary-color);
}

/* ====== PARTNERS SECTION ====== */
.partners-section {
    padding: 4rem 2rem;
    background: linear-gradient(180deg, rgba(250,250,250,0.98) 0%, rgba(245,245,245,0.98) 100%);
}

.partners-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.partners-section .section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.partners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    align-items: stretch;
}

.partner-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.04);
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.partner-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.10);
}

.partner-logo-container {
    width: 78px;
    height: 78px;
    flex: 0 0 78px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(46,139,87,0.06), rgba(252,210,14,0.04));
    overflow: hidden;
}

.partner-logo {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.partner-info h3 {
    margin: 0 0 6px 0;
    font-size: 1.05rem;
    color: var(--primary-color);
}

.partner-info p {
    margin: 0;
    font-size: 0.92rem;
    color: #666;
}

.partner-badge {
    margin-left: auto;
    background: rgba(254,197,7,0.12);
    color: var(--primary-color);
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.8rem;
}

/* ====== CLUBS SECTION ====== */
.clubs-section {
    padding: 4rem 2rem;
    background-color: #ffffff;
}

.clubs-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.clubs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.club-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 22px rgba(8,24,40,0.06);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.club-card:hover {
    transform: translateY(-5px);
}

.club-image {
    position: relative;
    height: 160px;
    overflow: hidden;
}

.club-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.club-card:hover .club-image img {
    transform: scale(1.06);
}

.club-overlay {
    position: absolute;
    right: 10px;
    top: 10px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
}

.club-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.club-content h3 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--primary-color);
}

.club-location {
    color: #888;
    font-size: 0.92rem;
}

.club-description {
    color: #555;
    font-size: 0.95rem;
}

.club-disciplines {
    display: flex;
    gap: 0.5rem;
    margin-top: 4px;
    flex-wrap: wrap;
}

.discipline-tag {
    background: rgba(46,139,87,0.09);
    color: var(--primary-color);
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
}

.club-contact {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    color: #333;
    font-size: 0.92rem;
}

.clubs-cta {
    margin-top: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
    flex-direction: column;
}

.btn-see-more {
    display: inline-flex;
    gap: 0.6rem;
    align-items: center;
    background: var(--primary-color);
    color: #fff;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(46,139,87,0.12);
    transition: all 0.3s ease;
}

.btn-see-more:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(46,139,87,0.18);
}

.clubs-count {
    margin-top: 0.6rem;
    color: #666;
    font-size: 0.95rem;
}

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Tablettes (max-width: 968px) */
@media (max-width: 968px) {
    header .container {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }

    header nav ul {
        justify-content: center;
    }

    .hero-federation {
        padding: 6rem 1.5rem 3rem;
        min-height: auto;
    }

    .hero-federation .container {
        flex-direction: column;
        text-align: center;
        gap: 3rem;
        padding: 0 1rem;
    }

    .hero-content {
        width: 100%;
    }

    .hero-buttons {
        justify-content: center;
    }

    .organigramme-container {
        width: 100%;
        padding: 1.5rem 1rem;
    }

    .organigramme {
        min-width: 350px;
    }

    .nodes-row {
        gap: 0.8rem;
    }

    .node {
        padding: 0.6rem;
        font-size: 0.85rem;
    }

    .nodes-row.first-level::before {
        left: 20%;
        right: 20%;
    }

    .nodes-row.second-level::before {
        left: 5%;
        right: 5%;
    }

    .brief-history .container {
        flex-direction: column;
    }

    .partners-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .partner-badge {
        display: none;
    }

    .clubs-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}

/* Smartphones (max-width: 768px) */
@media (max-width: 768px) {
    .hero-federation {
        padding: 5rem 1rem 2rem;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    /* Masquer l'organigramme graphique, afficher la version mobile */
    .organigramme {
        display: none;
    }

    .organigramme-mobile {
        display: block;
    }

    .organigramme-container {
        padding: 1.5rem 1rem;
        overflow-x: visible;
    }

    .brief-history {
        padding: 3rem 1.5rem;
    }

    .partners-section {
        padding: 3rem 1.5rem;
    }

    .clubs-section {
        padding: 3rem 1.5rem;
    }
}

/* Très petits écrans (max-width: 576px) */
@media (max-width: 576px) {
    header .logo img {
        height: 40px;
    }

    header nav ul li {
        margin-left: 0.5rem;
        font-size: 0.9rem;
    }

    .btn-header {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    .hero-federation {
        padding: 4rem 0.8rem 2rem;
    }

    .hero-federation .container {
        gap: 2rem;
        padding: 0 0.5rem;
    }

    .hero-content h1 {
        font-size: 1.5rem;
    }

    .hero-content p {
        font-size: 0.95rem;
    }

    .btn-yellow,
    .btn-dark {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }

    .organigramme-container {
        padding: 1rem 0.8rem;
    }

    .organigramme-mobile .org-level-title {
        font-size: 0.9rem;
        padding: 0.6rem 0.8rem;
    }

    .organigramme-mobile .org-item {
        font-size: 0.85rem;
        padding: 0.5rem 0.8rem;
    }

    .organigramme-mobile .org-items {
        padding-left: 0.5rem;
    }

    .brief-history,
    .partners-section,
    .clubs-section {
        padding: 2rem 1rem;
    }

    .history-content h2 {
        font-size: 1.5rem;
    }

    .partners-grid,
    .clubs-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .partner-card {
        padding: 0.8rem;
    }

    .partner-logo-container {
        width: 60px;
        height: 60px;
    }

    .club-image {
        height: 140px;
    }
}

/* Très petits écrans (max-width: 360px) */
@media (max-width: 360px) {
    .hero-content h1 {
        font-size: 1.3rem;
    }

    .organigramme-mobile .org-level-title {
        font-size: 0.85rem;
    }

    .organigramme-mobile .org-item {
        font-size: 0.8rem;
    }
}

/* Amélioration de l'accessibilité */
@media (prefers-reduced-motion: reduce) {
    .node,
    .org-item,
    .partner-card,
    .club-card,
    .btn-yellow,
    .btn-dark {
        transition: none;
    }
}