/*
Theme Name: Géopolitique du Numérique
Theme URI: https://geodunumerique.fr/
Author: Géopolitique du Numérique & Gemini
Description: Thème WordPress sur-mesure pour le Think Tank « Géopolitique du Numérique ». Respect strict de la charte graphique officielle (Funnel Display, Bleu Nuit #00084f, Bleu #0030cc, Cyan #48f7ea, Dégradé signature). Intégration modulaire administrable via le Customizer, suppression des dépendances lourdes et compatibilité totale avec les CPT (articles, tribunes, intervenants), ACF, Yoast SEO et Elementor.
Version: 1.0.5
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: geopolnum-theme
*/

/* ==========================================================================
   1. POLICES TYPOGRAPHIQUES (Charte Officielle - Funnel Display 100% Locale)
   ========================================================================== */

@font-face {
    font-family: 'Funnel Display';
    src: url('fonts/FunnelDisplay-300.woff2') format('woff2'),
         url('fonts/FunnelDisplay[wght].ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Funnel Display';
    src: url('fonts/FunnelDisplay-400.woff2') format('woff2'),
         url('fonts/FunnelDisplay[wght].ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Funnel Display';
    src: url('fonts/FunnelDisplay-500.woff2') format('woff2'),
         url('fonts/FunnelDisplay[wght].ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Funnel Display';
    src: url('fonts/FunnelDisplay-600.woff2') format('woff2'),
         url('fonts/FunnelDisplay[wght].ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Funnel Display';
    src: url('fonts/FunnelDisplay-700.woff2') format('woff2'),
         url('fonts/FunnelDisplay[wght].ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Funnel Display';
    src: url('fonts/FunnelDisplay-800.woff2') format('woff2'),
         url('fonts/FunnelDisplay[wght].ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

/* ==========================================================================
   2. VARIABLES CSS & COULEURS DE LA CHARTE
   ========================================================================== */
:root {
    --geo-navy: #00084f;
    --geo-blue: #0030cc;
    --geo-cyan: #48f7ea;
    --geo-dark: #3c3c3b;
    --geo-gray1: #b1b1b1;
    --geo-gray2: #ececec;
    --geo-white: #ffffff;
    --geo-gradient: linear-gradient(135deg, #0030cc 0%, #48f7ea 100%);
    --geo-gradient-radial: radial-gradient(circle at 70% 30%, #48f7ea 0%, #0030cc 70%, #00084f 100%);
    --geo-font: 'Funnel Display', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Base Styles */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

/* Logo officiel */
.custom-logo-wrap img,
img.custom-logo {
    max-height: 50px !important;
    width: auto !important;
    display: block;
    object-fit: contain;
}

body {
    background-color: #ffffff;
    color: var(--geo-dark);
    font-family: var(--geo-font);
    font-weight: 400;
    overflow-x: hidden;
    line-height: 1.6;
    width: 100%;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--geo-font);
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Utilitaires de dégradé */
.bg-geo-gradient {
    background: var(--geo-gradient);
}

.text-geo-gradient {
    background: var(--geo-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.border-geo-gradient {
    border-image: var(--geo-gradient) 1;
}

/* Boutons de la charte */
.btn-geo-primary {
    background: var(--geo-gradient);
    color: #00084f;
    font-weight: 700;
    font-size: 0.875rem;
    padding: 0.75rem 1.75rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(72, 247, 234, 0.25);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-geo-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 247, 234, 0.4);
    filter: brightness(1.05);
}

.btn-geo-secondary {
    background: transparent;
    color: #ffffff;
    border: 1px solid rgba(72, 247, 234, 0.5);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.75rem 1.75rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-geo-secondary:hover {
    border-color: #48f7ea;
    background-color: rgba(72, 247, 234, 0.1);
    color: #48f7ea;
    transform: translateY(-2px);
}

/* ==========================================================================
   Ratio 2:1 Unifié avec Recopie Floue d'Arrière-Plan (Zéro Rognage)
   Compatible 100% WebKit / iOS Safari, Blink, Gecko (Mobile & Desktop)
   ========================================================================== */
.geopol-ratio-2-1-box {
    aspect-ratio: 2 / 1;
    width: 100%;
    position: relative;
    overflow: hidden;
    background-color: #00084f;
    display: block;
}

@supports not (aspect-ratio: 2 / 1) {
    .geopol-ratio-2-1-box {
        height: 0;
        padding-top: 50%;
    }
}

.geopol-ratio-bg {
    position: absolute;
    inset: -25px; /* Débordement pour éviter tout bord net ou transparent lors du flou */
    background-size: cover;
    background-position: center;
    filter: blur(28px) brightness(0.65) saturate(1.25);
    transform: scale(1.18);
    z-index: 1;
    pointer-events: none;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.6s ease;
}

.geopol-ratio-fg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    inset: 0;
    margin: auto;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    z-index: 2;
    filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.45));
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), filter 0.5s ease;
}

/* Animations au survol pour les cartes cliquables */
.group:hover .geopol-ratio-bg {
    transform: scale(1.28);
    filter: blur(22px) brightness(0.75) saturate(1.35);
}

.group:hover .geopol-ratio-fg {
    transform: scale(1.03);
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.55));
}

/* Compatibilité rétroactive */
.aspect-2-1 {
    aspect-ratio: 2 / 1;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.aspect-2-1 img,
img.ratio-2-1 {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

/* ==========================================================================
   Liens et Icône Cliquable PDF (Font Awesome 6 Officiel)
   ========================================================================== */
.geopol-pdf-link {
    display: inline-flex !important;
    align-items: center;
    gap: 0.45rem;
    color: #0030cc !important;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(0, 48, 204, 0.4);
    text-underline-offset: 3px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    vertical-align: middle;
}

.geopol-pdf-link:hover {
    color: #e5252a !important; /* Rouge officiel Adobe/PDF */
    text-decoration-color: #e5252a;
}

.geopol-pdf-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.geopol-pdf-link .geopol-pdf-icon,
.geopol-pdf-link i.fa-file-pdf {
    font-size: 1.2em;
    vertical-align: -0.12em;
    color: #e5252a !important;
    transition: transform 0.25s ease, filter 0.25s ease;
}

.geopol-pdf-link:hover .geopol-pdf-icon,
.geopol-pdf-link:hover i.fa-file-pdf {
    transform: scale(1.22);
    filter: drop-shadow(0 2px 8px rgba(229, 37, 42, 0.45));
}

.geopol-pdf-link-label {
    display: inline;
}

/* ==========================================================================
   Boutons Réseaux Sociaux Officiels (Header & Footer)
   ========================================================================== */
.geopol-social-btn {
    width: 38px;
    height: 38px;
    border-radius: 9999px;
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(72, 247, 234, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
    text-decoration: none !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.geopol-social-btn svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
    transition: transform 0.25s ease;
}

.geopol-social-btn i {
    font-size: 16px;
    transition: transform 0.25s ease;
}

.geopol-social-btn:hover {
    background: linear-gradient(135deg, #0030cc 0%, #48f7ea 100%) !important;
    border-color: #48f7ea !important;
    color: #00084f !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(72, 247, 234, 0.45);
}

.geopol-social-btn:hover svg,
.geopol-social-btn:hover i {
    transform: scale(1.15);
    fill: #00084f;
    color: #00084f;
}

/* Variante footer colonne 3 */
.geopol-social-footer {
    width: 42px;
    height: 42px;
}
.geopol-social-footer svg {
    width: 19px;
    height: 19px;
}
.geopol-social-footer i {
    font-size: 18px;
}

/* Variante sous-barre copyright */
.geopol-social-footer-bar {
    width: 32px;
    height: 32px;
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}
.geopol-social-footer-bar svg {
    width: 14px;
    height: 14px;
}
.geopol-social-footer-bar i {
    font-size: 13px;
}

/* Styles pour le contenu éditorial (WYSIWYG & Gutenberg) */
.editorial-content p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    color: #3c3c3b;
    font-size: 1.1rem;
    font-weight: 400;
}

.editorial-content h2 {
    font-size: 1.85rem;
    font-weight: 700;
    color: #00084f;
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    border-left: 4px solid #48f7ea;
    padding-left: 1rem;
}

.editorial-content h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #0030cc;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.editorial-content a {
    color: #0030cc;
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.2s ease;
}

.editorial-content a:hover {
    color: #48f7ea;
}

.editorial-content ul {
    list-style-type: disc;
    margin-left: 1.75rem;
    margin-bottom: 1.5rem;
    color: #3c3c3b;
}

.editorial-content li {
    margin-bottom: 0.5rem;
}

.editorial-content blockquote {
    border-left: 4px solid #0030cc;
    background-color: #f8fafc;
    padding: 1.5rem 1.75rem;
    border-radius: 0 1rem 1rem 0;
    margin: 2rem 0;
    font-style: italic;
    color: #1c244b;
}

/* Vidéos & Embeds Responsive (YouTube, Dailymotion, Replays de colloques) */
.editorial-content iframe,
.editorial-content embed,
.editorial-content video {
    max-width: 100%;
    border-radius: 1rem;
    margin: 1.5rem 0;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* Ratio 16:9 */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    border-radius: 1rem;
    margin: 2rem 0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.video-container iframe,
.video-container object,
.video-container embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Prise en charge native des embeds YouTube de WordPress (oEmbed / Gutenberg / Classic) */
.editorial-content .wp-block-embed,
.editorial-content .wp-block-embed__wrapper,
.editorial-content .embed-youtube {
    position: relative;
    padding-bottom: 56.25% !important; /* Ratio 16:9 responsive */
    height: 0 !important;
    overflow: hidden;
    max-width: 100%;
    border-radius: 1rem;
    margin: 2rem 0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.editorial-content .wp-block-embed iframe,
.editorial-content .wp-block-embed__wrapper iframe,
.editorial-content .embed-youtube iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    border: 0;
    border-radius: 1rem;
}

/* Boutons et ancres de navigation rapide (Vidéo, Résumé, Intervenants, etc.) */
.editorial-content a[href^="#"] {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 1.15rem;
    border-radius: 9999px;
    background-color: #00084f;
    color: #48f7ea !important;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none !important;
    border: 1px solid rgba(72, 247, 234, 0.4);
    margin: 0.25rem 0.2rem;
    transition: all 0.25s ease;
}

.editorial-content a[href^="#"]:hover {
    background: linear-gradient(135deg, #0030cc 0%, #48f7ea 100%);
    color: #00084f !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(72, 247, 234, 0.35);
}

/* Éléments de mise en page Classic Editor & TinyMCE */
.lead-text,
.editorial-content .lead-text {
    font-size: 1.25rem;
    font-weight: 500;
    color: #00084f;
    line-height: 1.6;
    margin-bottom: 2rem;
    border-bottom: 1px solid #ececec;
    padding-bottom: 1rem;
}

.strategic-callout,
.editorial-content .strategic-callout {
    background: linear-gradient(135deg, rgba(0, 48, 204, 0.06) 0%, rgba(72, 247, 234, 0.08) 100%);
    border: 1px solid rgba(72, 247, 234, 0.6);
    border-radius: 1.25rem;
    padding: 1.75rem;
    margin: 2rem 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.badge-cyan,
.editorial-content .badge-cyan {
    background-color: rgba(72, 247, 234, 0.15);
    color: #00084f;
    border: 1px solid rgba(72, 247, 234, 0.6);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
}

/* Modale légale (Mentions Légales & RGPD) */
.geopol-legal-wysiwyg h2 {
    font-size: 1.25rem;
    color: #00084f;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.geopol-legal-wysiwyg p {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: #4B5563;
}

.geopol-legal-wysiwyg strong {
    font-weight: 600;
    color: #111827;
}

.geopol-legal-wysiwyg ul {
    list-style-type: disc;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
    color: #4B5563;
}

/* ==========================================================================
   Navigation Mobile, Tiroir et Verrouillage Anti-Défilement d'Arrière-Plan
   ========================================================================== */

/* Utilitaires fondamentaux pour garantir le masquage immédiat sans dépendre du CDN Tailwind */
.hidden {
    display: none;
}

#burger-icon.hidden,
#close-icon.hidden {
    display: none !important;
}

/* Réseaux sociaux Header Desktop (visibles uniquement >= 768px) */
.header-social-desktop {
    display: none;
}

@media (min-width: 640px) {
    .sm\:inline {
        display: inline !important;
    }
    .sm\:flex {
        display: flex !important;
    }
    .sm\:block {
        display: block !important;
    }
}

@media (min-width: 768px) {
    .md\:hidden {
        display: none !important;
    }
    .md\:flex,
    .header-social-desktop {
        display: flex !important;
    }
    .md\:block {
        display: block !important;
    }
}

@media (min-width: 1024px) {
    .lg\:hidden {
        display: none !important;
    }
    .lg\:block {
        display: block !important;
    }
    .lg\:flex {
        display: flex !important;
    }
}

@media (min-width: 1280px) {
    .xl\:inline-block,
    .header-tagline {
        display: inline-block !important;
    }
    .xl\:flex {
        display: flex !important;
    }
    .xl\:block {
        display: block !important;
    }
}

/* Tiroir Mobile : STRICTEMENT replié par défaut (zéro FOUC avant JS/Tailwind) */
#mobile-menu-drawer {
    display: none;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

#mobile-menu-drawer.is-open {
    display: block !important;
}

/* Voile d'arrière-plan du menu mobile */
#mobile-menu-backdrop {
    overscroll-behavior: contain;
    touch-action: none;
}

/* Sous-menus mobiles : REPLIÉS PAR DÉFAUT en accordéon fluide */
.mobile-nav .sub-menu {
    display: none;
    padding-left: 0.75rem;
    background-color: rgba(0, 48, 204, 0.2);
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    margin-top: 0.25rem;
    border-left: 2px solid #48f7ea;
}

.mobile-nav .menu-item-has-children.is-expanded > .sub-menu {
    display: block !important;
}

.mobile-nav .sub-menu a {
    font-size: 0.95rem;
    color: #ececec;
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-nav .sub-menu li:last-child {
    border-bottom: none;
}

.mobile-nav .sub-menu a:hover {
    color: #48f7ea;
}

/* Bouton toggle accordéon pour les sous-menus mobiles */
.mobile-submenu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: #48f7ea;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(72, 247, 234, 0.25);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.25s ease;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.mobile-submenu-toggle:hover,
.mobile-submenu-toggle:focus {
    background: rgba(72, 247, 234, 0.2);
    border-color: #48f7ea;
    color: #ffffff;
    outline: none;
}

.mobile-submenu-toggle svg,
.mobile-submenu-toggle i {
    transition: transform 0.25s ease;
}

.mobile-nav .menu-item-has-children.is-expanded > .mobile-item-row .mobile-submenu-toggle svg,
.mobile-nav .menu-item-has-children.is-expanded > .mobile-submenu-toggle svg,
.mobile-nav .menu-item-has-children.is-expanded > .mobile-item-row .mobile-submenu-toggle i,
.mobile-nav .menu-item-has-children.is-expanded > .mobile-submenu-toggle i {
    transform: rotate(180deg);
}

/* Modales Légales : Confinement strict du scroll pour éliminer le scroll arrière */
#geopol-modal-overlay,
#geopol-modal-container,
#geopol-modal-body {
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch;
}

#geopol-modal-overlay {
    touch-action: none;
}

#geopol-modal-body {
    touch-action: pan-y;
}

/* Verrouillage Scroll universel (Desktop & Mobile) sans altération de la position de défilement */
html.geopol-scroll-locked,
body.geopol-scroll-locked {
    overflow: hidden !important;
}
