/* ===== Variables ===== */
:root {
    --cftc-blue-dark: #003A70;   /* bleu foncé topbar */
    --cftc-blue: #005BAA;        /* bleu principal CFTC */
    --cftc-blue-light: #0072CE; /* bleu clair hover */
    --cftc-red: #E30613;         /* rouge CFTC accent */
    --cftc-bg: #F5F7FA;
    --cftc-text: #1F2937;
    --header-height: 72px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--cftc-text);
    background: var(--cftc-bg);
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Bandeau bleu foncé supérieur ===== */
.topbar {
    background: var(--cftc-blue-dark);
    color: #fff;
    font-size: 0.82rem;
}

.topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 42px;
    gap: 16px;
}

.topbar-left {
    display: flex;
    gap: 22px;
}

.topbar-link {
    color: #fff;
    opacity: 0.85;
    transition: opacity 0.2s;
}
.topbar-link:hover { opacity: 1; }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.social-links {
    display: flex;
    gap: 8px;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 50%;
    color: #fff;
    transition: background 0.2s, border-color 0.2s;
}
.social-icon:hover {
    background: var(--cftc-blue-light);
    border-color: var(--cftc-blue-light);
}

.btn-topbar {
    background: var(--cftc-red);
    color: #fff;
    padding: 6px 14px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.5px;
    transition: background 0.2s;
}
.btn-topbar:hover { background: #c00510; }

/* ===== En-tête principal ===== */
.site-header {
    --header-h: 70px; /* hauteur du bandeau bleu */
    background: #114F9F;             /* bleu exact du site CFTC */
    min-height: var(--header-h);
    padding: 0 0 10px 0;            /* espace sous le bandeau pour le logo débordant */
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: var(--header-h);
    gap: 18px;
}

/* ===== Logo : zone blanche arrondie débordant du bandeau ===== */
.logo-wrap {
    position: relative;
    z-index: 1001;
    margin-top: -10px;
    flex-shrink: 0;
}

.logo {
    display: block;
    background: #fff;
    border-radius: 12px;
    padding: 10px 16px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    line-height: 0;
    margin-bottom: -10px;
}

.logo img {
    display: block;
    max-height: 80px;
    width: auto;
    max-width: 220px;
}

/* ===== Navigation intégrée au bandeau ===== */
.main-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.nav-list {
    display: flex;
    flex-wrap: wrap;
}

.nav-link {
    display: block;
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    padding: 6px 10px;
    letter-spacing: 0.3px;
    transition: color 0.2s;
}

.nav-link:hover {
    color: #a9d1ff;
}

/* Actions à droite : recherche + boutons */
.nav-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-form input {
    background: rgba(255, 255, 255, 0.93);
    border: none;
    outline: none;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.85rem;
    width: 150px;
    min-width: 0;
}

.btn-search {
    background: #fff;
    color: #114F9F;
    border: none;
    border-radius: 4px;
    padding: 8px 9px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: background 0.2s;
}
.btn-search:hover { background: #e6f0ff; }

.btn-adherer {
    background: #EA4F70;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 9px 16px;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    text-decoration: none;
    transition: background 0.2s;
}
.btn-adherer:hover { background: #d63f60; }

.btn-nos-sites {
    background: var(--cftc-red);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 9px 16px;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    transition: background 0.2s;
}
.btn-nos-sites:hover { background: #c00510; }

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    margin-right: 4px;
}

.hamburger span {
    width: 26px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.hamburger.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ===== Hero ===== */
.hero {
    background: linear-gradient(135deg, var(--cftc-blue-dark), var(--cftc-blue));
    color: #fff;
    padding: 90px 0;
    text-align: center;
}

.hero h1 { font-size: 2.4rem; margin-bottom: 14px; }
.hero p { font-size: 1.15rem; max-width: 640px; margin: 0 auto 28px; }

.btn-primary {
    display: inline-block;
    background: var(--cftc-red);
    color: #fff;
    font-weight: 700;
    padding: 13px 30px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    transition: background 0.2s, transform 0.2s;
}
.btn-primary:hover { background: #c00510; transform: translateY(-2px); }

/* ===== Sections ===== */
.section { padding: 60px 0; }

.section h2 {
    color: var(--cftc-blue);
    font-size: 1.7rem;
    margin-bottom: 28px;
    position: relative;
    padding-bottom: 10px;
}
.section h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 56px;
    height: 4px;
    background: var(--cftc-red);
    border-radius: 2px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0,0,0,.07);
    transition: transform 0.25s, box-shadow 0.25s;
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 26px rgba(0,0,0,.12);
}

.card-body { padding: 22px; }

.card-date {
    display: inline-block;
    color: var(--cftc-blue);
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.card h3 { font-size: 1.1rem; margin-bottom: 10px; color: var(--cftc-blue-dark); }
.card p { font-size: 0.94rem; color: #4b5563; }

/* ===== Footer ===== */
.site-footer {
    background: var(--cftc-blue-dark);
    color: #fff;
    margin-top: 40px;
}

.footer-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    padding: 48px 20px;
}

.footer-col h4 {
    font-size: 0.9rem;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.footer-col a {
    display: block;
    padding: 5px 0;
    font-size: 0.9rem;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.footer-col a:hover { opacity: 1; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.15);
    padding: 16px 0;
    text-align: center;
    font-size: 0.82rem;
    opacity: 0.75;
}

/* ===== Responsive ===== */
@media (max-width: 1100px) {
    .search-form { display: none; }
}

@media (max-width: 992px) {
    .main-nav {
        display: none;
        position: absolute;
        top: calc(var(--header-h) + 10px);
        left: 0;
        right: 0;
        background: #fff;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
        padding: 16px;
        flex-direction: column;
        align-items: stretch;
    }
    .main-nav.open { display: flex; }

    .nav-list { flex-direction: column; }

    .nav-link {
        color: #114F9F;
        font-size: 1.05rem;
        padding: 12px 8px;
        border-bottom: 1px solid #e5e9f0;
    }
    .nav-link:hover { color: #114F9F; background: #f0f5fb; }

    .nav-actions {
        margin-left: 0;
        flex-wrap: wrap;
        margin-top: 12px;
    }

    .search-form { display: flex; }
    .search-form input { width: 100%; flex: 1; }

    .hamburger { display: flex; margin-left: auto; }
}

@media (max-width: 768px) {
    .topbar-left { display: none; }
    .topbar-inner { justify-content: center; }
    .hero h1 { font-size: 1.7rem; }
}

/* ===== Ancienne topbar : conservée mais masquée sur le site de référence ===== */

/* ===== Page Actualités (blog) ===== */
.news-page {
    padding: 50px 0 30px;
}

.news-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 40px;
    align-items: start;
}

.news-page-title {
    color: var(--cftc-blue);
    font-size: 2rem;
    margin-bottom: 4px;
}

.news-count {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.news-card {
    display: flex;
    flex-direction: column;
}

.card-thumb {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #e8edf3;
}

.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.news-card:hover .card-thumb img {
    transform: scale(1.04);
}

.news-card h3 a {
    color: var(--cftc-blue-dark);
    font-size: 1.05rem;
    line-height: 1.35;
}
.news-card h3 a:hover { color: var(--cftc-blue-light); }

.news-card p {
    font-size: 0.88rem;
    color: #4b5563;
    margin-bottom: 12px;
    flex: 1;
}

.card-more {
    color: var(--cftc-blue);
    font-weight: 700;
    font-size: 0.85rem;
    transition: color 0.2s;
}
.card-more:hover { color: var(--cftc-blue-light); }

.news-loading,
.news-error {
    padding: 30px 0;
    color: #6b7280;
    text-align: center;
}

.news-error a { color: var(--cftc-blue); text-decoration: underline; }

.btn-load-more {
    display: block;
    margin: 32px auto 0;
    background: #20B29E;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 12px 28px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-load-more:hover { background: #1a9887; }

/* Bouton TOUTE L'ACTUALITÉ (accueil) — RVB(32, 178, 158) */
.btn-all-news {
    display: inline-block;
    background: #20B29E;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 13px 30px;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    transition: background 0.2s, transform 0.2s;
}
.btn-all-news:hover {
    background: #1a9887;
    transform: translateY(-2px);
}

/* ---- Colonne archives ---- */
.news-archive {
    background: #fff;
    border-radius: 8px;
    padding: 22px;
    box-shadow: 0 4px 14px rgba(0,0,0,.07);
    position: sticky;
    top: calc(var(--header-h, 70px) + 20px);
}

.news-archive h2 {
    color: var(--cftc-blue);
    font-size: 1.15rem;
    margin-bottom: 14px;
    padding-bottom: 10px;
    position: relative;
}
.news-archive h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 3px;
    background: var(--cftc-red);
    border-radius: 2px;
}

.archive-years { margin: 0; padding: 0; }

.archive-year-btn {
    width: 100%;
    background: transparent;
    border: none;
    text-align: left;
    font-size: 1rem;
    font-weight: 800;
    color: var(--cftc-blue-dark);
    padding: 9px 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.archive-year-btn::after {
    content: "▾";
    font-size: 0.75rem;
    transition: transform 0.25s;
}
.archive-year-btn.expanded::after { transform: rotate(180deg); }

.archive-year-count { color: #6b7280; font-weight: 500; font-size: 0.85rem; }

.archive-months {
    display: none;
    padding-left: 10px;
}
.archive-months.open { display: block; }

.archive-months a {
    display: flex;
    justify-content: space-between;
    padding: 6px 8px;
    font-size: 0.9rem;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}
.archive-months a:hover {
    background: var(--cftc-bg);
    color: var(--cftc-blue);
}

.archive-count {
    background: #eef2f7;
    border-radius: 10px;
    padding: 1px 8px;
    font-size: 0.75rem;
    color: #4b5563;
}

/* Responsive page actualités */
@media (max-width: 992px) {
    .news-layout { grid-template-columns: 1fr; }
    .news-archive { position: static; }
}

/* ===== Page Équipe ===== */
.team-page {
    padding: 50px 0 40px;
}

.team-title {
    color: var(--cftc-blue);
    font-size: 2rem;
    margin-bottom: 8px;
}

.team-intro {
    color: #4b5563;
    max-width: 760px;
    margin-bottom: 34px;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 28px;
}

.team-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0,0,0,.07);
    transition: transform 0.25s, box-shadow 0.25s;
    display: flex;
    flex-direction: column;
}
.team-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 26px rgba(0,0,0,.12);
}

.team-photo {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #e8edf3;
}

.team-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.3s;
}
.team-card:hover .team-photo img {
    transform: scale(1.04);
}

.team-info {
    padding: 14px 16px 16px;
    text-align: center;
}

.team-info h2 {
    color: var(--cftc-blue-dark);
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.team-info p {
    color: #4b5563;
    font-size: 0.88rem;
}

@media (max-width: 768px) {
    .team-title { font-size: 1.6rem; }
}

/* ===== Page Contact ===== */
.contact-page {
    padding: 50px 0 60px;
}

.contact-title {
    color: var(--cftc-blue);
    font-size: 2rem;
    margin-bottom: 8px;
}

.contact-intro {
    color: #4b5563;
    margin-bottom: 34px;
}

.contact-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0,0,0,.07);
    padding: 44px 30px;
    max-width: 520px;
    margin: 0 auto;
    text-align: center;
}

.contact-icon {
    color: var(--cftc-blue);
    margin-bottom: 14px;
}

.contact-card h2 {
    color: var(--cftc-blue-dark);
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.contact-card p {
    color: #4b5563;
    font-size: 0.98rem;
    margin: 4px 0;
}

.contact-email {
    margin-top: 14px !important;
}

.contact-teams {
    margin-top: 22px !important;
    padding-top: 16px;
    border-top: 1px solid #e5e9f0;
    font-size: 0.92rem;
    color: #6b7280;
}

.email-link {
    display: inline-block;
    color: var(--cftc-blue);
    font-weight: 800;
    font-size: 1.15rem;
    padding: 10px 18px;
    border: 2px solid var(--cftc-blue);
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
    cursor: pointer;
    word-break: break-all;
}
.email-link:hover {
    background: var(--cftc-blue);
    color: #fff;
}

/* ===== Page Mentions légales ===== */
.legal-page {
    padding: 50px 0 60px;
}

.legal-content {
    max-width: 820px;
}

.legal-content h1 {
    color: var(--cftc-blue);
    font-size: 2rem;
    margin-bottom: 4px;
}

.legal-updated {
    color: #6b7280;
    font-size: 0.85rem;
    margin-bottom: 28px;
}

.legal-content h2 {
    color: var(--cftc-blue-dark);
    font-size: 1.2rem;
    margin-top: 30px;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid #e5e9f0;
}

.legal-content p {
    color: #374151;
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.legal-list {
    margin: 10px 0 14px 0;
    padding-left: 0;
    list-style: none;
}

.legal-list li {
    color: #374151;
    font-size: 0.95rem;
    padding: 4px 0 4px 18px;
    position: relative;
}

.legal-list li::before {
    content: "•";
    color: var(--cftc-blue);
    position: absolute;
    left: 2px;
}

.legal-content a {
    color: var(--cftc-blue);
    text-decoration: underline;
}
