@charset "utf-8";

/* ========================================= */
/* FICHIER : css/ep2027.css                 */
/* Cohérent avec popularites / pays /     */
/* dirigeants (glass + capsule + accents)   */
/* Adapté pour topbar.php + menu_droit.php  */
/* ========================================= */

html, body {
    margin: 0;
    padding: 0;
}
body {
    font-family: 'Noto Sans Display', sans-serif;
    background: #ffffff;
}
*, *::before, *::after { box-sizing: border-box; }

/* ========================================= */
/* PAS DE BACKGROUND DE PAGE GLOBAL :         */
/* l'image n'apparait QUE dans les cadres     */
/* gris (.sticky-header, .main-content-area), */
/* comme dans pays.php / dirigeants.php.   */
/* Le fond du body reste blanc/gradient clair */
/* (defini par styles.css).                  */
/* ========================================= */

.content-block { background: none !important; box-shadow: none !important; padding: 0; }

/* ========================================= */
/* STICKY HEADER (cadre titre figé)          */
/* ========================================= */
.sticky-header {
    position: sticky;
    top: 110px; /* topbar (64px) + ticker (~46px) */
    z-index: 80;
    background: rgba(72, 92, 116, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    width: 100%;
    max-width: 100%;
    margin: 0 0 24px 0;
    padding: 22px 26px 14px 26px;
    border-radius: 20px;
    box-shadow: 0 0 18px rgba(187, 187, 187, 0.53);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-sizing: border-box;
}

/* ========================================= */
/* BLOC PRINCIPAL DÉFILANT (Glassmorphism)   */
/* ========================================= */
.page-wrapper .main-content-area {
    position: relative;
    z-index: 1;
    background: rgba(72, 92, 116, 0.45) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 20px;
    padding: 28px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 24px 0 !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 0 18px rgba(187, 187, 187, 0.53) !important;
    box-sizing: border-box;
}

/* ========================================= */
/* HERO (Capsule bleu foncé)                 */
/* ========================================= */
.election-hero {
    background-color: rgba(45, 65, 85, 0.95);
    border-radius: 16px;
    padding: 22px 28px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    margin: 0 auto 18px auto;
    max-width: 100%;
    text-align: center;
    position: relative;
    z-index: 1;
}
.election-hero h1 {
    color: #ffffff;
    font-size: clamp(1.1rem, 2.5vw, 2.1rem);
    margin: 0;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    text-transform: uppercase;
}
.election-hero .hero-subtitle {
    color: #FFD290;
    font-size: clamp(0.7rem, 1.1vw, 0.95rem);
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    margin-top: 8px;
    display: block;
}

/* Bandeau "Dernier sondage" (remplace l'ancien titre "Derniers resultats"
   et est desormais positionne dans .main-content-area, juste au-dessus
   des graphes de sondages) */
.latest-poll-banner {
    background: #ffffff;
    border-radius: 14px;
    padding: 14px 20px;
    box-shadow: 0 4px 18px rgba(45, 65, 85, 0.1);
    max-width: 100%;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    z-index: 10;
    border-left: 5px solid #FF6A00;
    flex-wrap: wrap;
}
.latest-poll-banner .lp-icon {
    width: 42px; height: 42px;
    background: #F2F8FB;
    color: #00507D;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.latest-poll-banner .lp-content { flex: 1; min-width: 0; }
.latest-poll-banner .lp-label {
    font-size: 0.7rem;
    color: #FF6A00;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 3px;
}
.latest-poll-banner .lp-text {
    color: #2d4155;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
    word-break: break-word;
}
.latest-poll-banner .lp-text strong {
    color: #00507D;
    font-weight: 800;
}
.latest-poll-banner .lp-date {
    background: #00507D;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 8px 13px;
    border-radius: 10px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 80, 125, 0.25);
    white-space: nowrap;
}

/* Bouton pilule vers présidentielle FR */
.btn-container-small {
    text-align: center;
    margin: 0 0 4px 0;
}
.btn-presidentielle-small {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    background: #f1f5f9;
    color: #002b49;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 700;
    transition: all 0.2s ease;
}
.btn-presidentielle-small i { color: #FF6A00; }
.btn-presidentielle-small:hover {
    background: #002b49;
    color: #ffffff;
    border-color: #002b49;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 43, 73, 0.2);
}
.btn-presidentielle-small:hover i { color: #FFD290; }

/* ========================================= */
/* TITRES DE SECTION                         */
/* ========================================= */
.inner-section-title {
    font-size: clamp(0.85rem, 1.2vw, 1.05rem);
    color: #ffffff;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 24px 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 3px solid #FF6A00;
    display: inline-block;
}

/* ========================================= */
/* CARTES (chart, moyennes, tableau)         */
/* ========================================= */
.charts-flex {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin-bottom: 20px;
}

.box-container {
    background: #ffffff;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f2f5;
    overflow: hidden;
    min-width: 0;
}
.full-width {
    grid-column: 1 / -1;
    margin-bottom: 18px;
}

.box-title {
    color: #00507D;
    font-size: 0.95rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 0 0 14px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #FF6A00;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.box-title i { color: #FF6A00; }

.box-subtitle {
    font-size: 0.78rem;
    color: #64748b;
    margin: -8px 0 14px 0;
    font-style: italic;
}

/* ========================================= */
/* GRAPHIQUE BARRES                          */
/* ========================================= */
.modern-chart-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 14px;
    /* Scrollbar discrète */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.modern-chart-wrapper::-webkit-scrollbar { height: 6px; }
.modern-chart-wrapper::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }

.chart-content {
    display: inline-flex;
    align-items: flex-end;
    justify-content: flex-start;
    min-width: max-content;
    padding: 18px 8px 0 8px;
    border-bottom: 2px solid #cbd5e1;
    height: 220px;
    box-sizing: border-box;
    gap: 14px;
}
.cand-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 80px;
    width: 80px;
    height: 100%;
}
.bar-value {
    font-weight: 800;
    color: #002b49;
    font-size: 0.82rem;
    margin-bottom: 6px;
    text-align: center;
}
.bar-fill {
    width: 36px;
    border-radius: 6px 6px 0 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: growBar 1s cubic-bezier(0.1, 0.8, 0.2, 1) forwards;
    transform-origin: bottom;
}
@keyframes growBar {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
}
.bar-label {
    margin-top: 10px;
    font-size: 0.68rem;
    font-weight: 700;
    color: #475569;
    text-align: center;
    line-height: 1.1;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ========================================= */
/* MOYENNES                                  */
/* ========================================= */
.averages-box {
    background: #fffbf7;
    border: 1px solid #ffe4d2;
}

.avg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: 10px;
    margin-top: 12px;
}
.avg-item {
    background: #ffffff;
    padding: 12px 14px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    border: 1px solid #f0f2f5;
    border-left: 4px solid #cbd5e1;
    min-width: 0;
    transition: all 0.2s ease;
}
.avg-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}
.cand-name-span {
    font-size: 0.75rem;
    font-weight: 800;
    color: #002b49;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    min-width: 0;
}
.avg-score {
    font-weight: 800;
    font-size: 1rem;
    color: #FF6A00;
    margin-left: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.avg-score i { font-size: 0.78rem; }

/* ========================================= */
/* TABLEAU HISTORIQUE                        */
/* ========================================= */
.history-table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
    border-radius: 12px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.history-table-wrapper::-webkit-scrollbar { height: 6px; }
.history-table-wrapper::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }

.history-table {
    width: 100%;
    min-width: max-content;
    border-collapse: collapse;
    font-size: 0.82rem;
    background: #ffffff;
}
.history-table th, .history-table td {
    padding: 10px 14px;
    text-align: center;
    white-space: nowrap;
    border-bottom: 1px solid #f0f2f5;
}
.history-table th {
    background: #f1f5f9;
    color: #00507D;
    font-weight: 800;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #00507D;
}
.history-table tbody tr { transition: background 0.2s ease; }
.history-table tbody tr:hover { background: #f8fafc; }
.history-table td.score-active {
    background-color: #fff7ee;
    font-weight: 800;
    color: #002b49;
}
.history-table td.score-empty {
    color: #cbd5e1;
}
.history-table td:first-child { font-weight: 600; color: #475569; }
.history-table td strong { color: #002b49; }

/* ========================================= */
/* SIDEBAR : reste sticky en haut (selon styles.css) */
/* ========================================= */
.page-wrapper .sidebar-blocks {
    min-width: 0;
}

/* ========================================= */
/* RESPONSIVE                                */
/* ========================================= */
@media (max-width: 1100px) {
    .sticky-header {
        top: 110px;
    }
}

@media (max-width: 900px) {
    .charts-flex { grid-template-columns: 1fr; }
    .avg-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
}

@media (max-width: 768px) {
    body { font-size: 0.96rem; }

    .sticky-header {
        top: 100px;
        padding: 16px 14px 10px 14px;
        margin: 0 0 18px 0;
        border-radius: 16px;
    }

    .page-wrapper .main-content-area {
        padding: 18px !important;
        border-radius: 16px;
    }

    .election-hero {
        padding: 16px 14px;
        margin-bottom: 12px;
    }
    .election-hero h1 {
        letter-spacing: 0.8px;
        word-break: break-word;
    }

    .latest-poll-banner {
        padding: 12px 12px;
        gap: 10px;
        margin-bottom: 10px;
    }
    .latest-poll-banner .lp-icon { width: 38px; height: 38px; font-size: 1rem; }
    .latest-poll-banner .lp-text { font-size: 0.85rem; }
    .latest-poll-banner .lp-date { font-size: 0.78rem; padding: 6px 10px; }

    .box-container {
        padding: 16px 14px;
        border-radius: 14px;
    }
    .box-title { font-size: 0.85rem; }

    .chart-content { height: 200px; gap: 10px; padding: 14px 6px 0 6px; }
    .cand-col { flex: 0 0 68px; width: 68px; }
    .bar-fill { width: 30px; }
    .bar-value { font-size: 0.78rem; }
    .bar-label { font-size: 0.62rem; }

    .avg-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 165px), 1fr)); gap: 8px; }
    .avg-item { padding: 10px 12px; }
    .cand-name-span { font-size: 0.62rem; }
    .avg-score { font-size: 0.82rem; }

    .history-table { font-size: 0.74rem; }
    .history-table th, .history-table td { padding: 8px 10px; }
    .history-table th { font-size: 0.6rem; }
}

@media (max-width: 480px) {
    body { font-size: 0.9rem; }

    .sticky-header {
        top: 96px;
        padding: 12px 10px 8px 10px;
    }

    .page-wrapper .main-content-area { padding: 14px !important; }

    .election-hero {
        padding: 12px 10px;
    }

    .latest-poll-banner {
        flex-direction: column;
        text-align: center;
        align-items: stretch;
        padding: 12px 10px;
    }
    .latest-poll-banner .lp-icon { margin: 0 auto; }
    .latest-poll-banner .lp-date { align-self: center; }
    .latest-poll-banner .lp-content { text-align: center; }

    .avg-grid { grid-template-columns: 1fr; }
    .cand-name-span { font-size: 0.74rem; }
    .btn-presidentielle-small { width: 100%; max-width: 320px; justify-content: center; }

    .chart-content { height: 180px; }
    .cand-col { flex: 0 0 64px; width: 64px; }
    .bar-fill { width: 26px; }
    .bar-label { font-size: 0.56rem; }
}


/* =====================================================================
   ===   ALIGNEMENT SIDEBAR — pages avec .sticky-header en haut       ===
   =====================================================================
   styles.css applique margin-top: 56px sur .sidebar-blocks pour aligner
   avec le hero sous le titre "À LA UNE" sur index.php.
   Sur ep2027.php, il n'y a pas de section-title : le .sticky-header
   commence directement en haut du main-content. On annule la margin
   pour que la sidebar s'aligne avec le haut du cadre titre.
   ===================================================================== */
.page-wrapper .sidebar-blocks {
    margin-top: 0 !important;
}

/* Sur tablette/mobile, on garde un peu d'écart quand la sidebar passe en dessous */
@media (max-width: 1100px) {
    .page-wrapper .sidebar-blocks {
        margin-top: 24px !important;
    }
}
