/*
Theme Name: Guide Expatriation
Theme URI: https://guide-expatriation.fr
Author: KamiLabs
Author URI: https://kami-labs.fr
Description: Thème vitrine pour guides d'expatriation — Variante B Sérénité minimaliste. Fork allégé de kamilabs-theme, sans gamification ni tooltips.
Version: 1.0.0
Tested up to: 6.5
Requires PHP: 8.0
License: Proprietary
Text Domain: guide-expat
*/

/* ============================================================
   VARIABLES CSS — Palette B "Sérénité minimaliste"
   ============================================================ */
:root {
    /* Fonds */
    --ge-bg:               #FAFAF8;
    --ge-bg-card:          #FFFFFF;
    --ge-bg-elevated:      #F9FAFB;

    /* Texte */
    --ge-text:             #1A1A2E;
    --ge-text-muted:       #6B7280;
    --ge-text-light:       #9CA3AF;

    /* Accents */
    --ge-accent:           #059669;
    --ge-accent-hover:     #047857;
    --ge-accent2:          #6366F1;
    --ge-accent2-hover:    #4F46E5;

    /* Brand — couleur identité editoriale (carnet voyage) */
    --ge-brand:            #C2410C;  /* terracotta — brand color */
    --ge-brand-deep:       #9A2D08;  /* terra deep */

    /* Header */
    --ge-header-bg:        #FFFFFF;
    --ge-header-border:    #E5E7EB;
    --ge-header-shadow:    0 1px 0 #F3F4F6;

    /* Sémantique */
    --ge-success:          #059669;
    --ge-warning:          #D97706;
    --ge-danger:           #DC2626;
    --ge-info:             #0EA5E9;

    /* Borders */
    --ge-border:           #E5E7EB;
    --ge-border-light:     #F3F4F6;

    /* Shadows */
    --ge-shadow-sm:        0 1px 2px rgba(0,0,0,.04);
    --ge-shadow:           0 1px 8px rgba(0,0,0,.06);
    --ge-shadow-md:        0 4px 12px rgba(0,0,0,.08);
    --ge-shadow-lg:        0 12px 24px rgba(0,0,0,.10);

    /* Radius */
    --ge-radius-sm:        8px;
    --ge-radius:           20px;
    --ge-radius-pill:      999px;

    /* Transitions */
    --ge-transition-fast:  0.15s ease;
    --ge-transition:       0.25s ease;
    --ge-transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Layout */
    --ge-header-height:    72px;
    --ge-content-max:      1440px;
    --ge-ad-totem-margin:  300px;

    /* ⛔ RÈGLE ABSOLUE — Réserve latérale pour pubs Mediavine
       Les containers principaux doivent respecter ce padding horizontal
       afin de laisser place aux emplacements pub à droite et à gauche.
       Voir CLAUDE.md "Padding latéral réservé pubs". NE JAMAIS RÉDUIRE. */
    --ge-side-pad:         4rem;     /* 64px desktop — réserve pub */
    --ge-side-pad-mobile:  1.5rem;   /* 24px mobile — pubs latérales désactivées */
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    background: var(--ge-bg);
    color: var(--ge-text);
    font-family: Inter, system-ui, -apple-system, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: Manrope, system-ui, sans-serif;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 1rem;
    color: var(--ge-text);
    letter-spacing: -0.01em;
}

h1 { font-size: 2.5rem; line-height: 1.2; }
h2 { font-size: 1.875rem; line-height: 1.3; }
h3 { font-size: 1.375rem; font-weight: 600; line-height: 1.4; }
h4 { font-size: 1.125rem; font-weight: 600; line-height: 1.4; }

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
}

p { margin: 0 0 1rem; }

a {
    color: var(--ge-accent);
    text-decoration: none;
    transition: color var(--ge-transition-fast);
}
a:hover { color: var(--ge-accent-hover); }

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================================================
   LAYOUT STRUCTUREL — IDs immuables (contrat HTML↔CSS↔JS)
   ============================================================ */
#page {
    overflow-x: clip;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#content.site-content {
    display: flex;
    flex: 1 1 auto;
    width: 100%;
    max-width: var(--ge-content-max);
    margin: 0 auto;
    padding: 0 var(--ge-side-pad); /* RÈGLE ABSOLUE — réserve pubs latérales — voir CLAUDE.md */
    gap: 2rem;
}

@media (max-width: 1024px) {
    #content.site-content {
        padding: 0 var(--ge-side-pad-mobile);
    }
}

/* Ad totem margin — desktop uniquement */
@media (min-width: 1025px) {
    #content.site-content {
        margin-left: var(--ge-ad-totem-margin, 0) !important;
    }
}

/* FILET DE SÉCURITÉ WP Rocket Used CSS — reset mobile obligatoire */
@media (max-width: 1024px) {
    html body #content.site-content {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

.container {
    width: 100%;
    max-width: var(--ge-content-max);
    margin: 0 auto;
    padding: 0 var(--ge-side-pad); /* RÈGLE ABSOLUE — réserve pubs latérales — voir CLAUDE.md */
}

@media (max-width: 1024px) {
    .container {
        padding: 0 var(--ge-side-pad-mobile);
    }
}

#primary.content-area {
    flex: 1 1 0%;
    min-width: 0;
    width: 100%;
}

#secondary.widget-area.sidebar {
    flex: 0 0 300px;
    width: 300px;
}

.site-main {
    padding: 2rem 0;
}

/* ============================================================
   .ge-pub-safe — UTILITY CLASS, RÈGLE ABSOLUE
   ============================================================
   À UTILISER OBLIGATOIREMENT pour wrapper tout container racine
   d'une page, section, landing, archive. Garantit la réserve
   latérale 64px desktop / 24px mobile pour les pubs Mediavine.
   Voir CLAUDE.md "Padding latéral réservé pubs Mediavine".
   ============================================================ */
.ge-pub-safe {
    width: 100%;
    max-width: var(--ge-content-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--ge-side-pad);
    padding-right: var(--ge-side-pad);
    box-sizing: border-box;
}

@media (max-width: 1024px) {
    .ge-pub-safe {
        padding-left: var(--ge-side-pad-mobile);
        padding-right: var(--ge-side-pad-mobile);
    }
}

/* ============================================================
   SKIP LINK ACCESSIBILITÉ
   ============================================================ */
.ge-skip-link {
    position: absolute;
    top: -40px;
    left: 1rem;
    background: var(--ge-accent);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: var(--ge-radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    z-index: 9999;
    transition: top var(--ge-transition-fast);
}
.ge-skip-link:focus {
    top: 1rem;
    color: #fff;
}

/* ============================================================
   HEADER
   ============================================================ */
.ge-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--ge-header-bg);
    border-bottom: 1px solid var(--ge-header-border);
    box-shadow: var(--ge-header-shadow);
    backdrop-filter: blur(12px);
    height: var(--ge-header-height);
}

.ge-header-inner {
    max-width: var(--ge-content-max);
    margin: 0 auto;
    padding: 0 var(--ge-side-pad); /* RÈGLE ABSOLUE — réserve pubs latérales — voir CLAUDE.md */
    height: 100%;
    display: flex;
    align-items: center;
    gap: 2rem;
}

@media (max-width: 1024px) {
    .ge-header-inner {
        padding: 0 var(--ge-side-pad-mobile);
    }
}

/* Logo brand — style carnet de voyage (Crimson Pro italic + compass animé) */
.ge-logo {
    font-family: 'Crimson Pro', Georgia, serif;
    font-weight: 600;
    font-style: italic;
    font-size: 1.4rem;
    letter-spacing: -.01em;
    color: var(--ge-text);
    text-decoration: none;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    transition: color var(--ge-transition-fast);
}
.ge-logo::before {
    content: "⛕";
    font-style: normal;
    font-size: 1.55rem;
    line-height: 1;
    color: var(--ge-brand);
    display: inline-block;
    animation: ge-logo-spin 20s linear infinite;
    will-change: transform;
}
@keyframes ge-logo-spin {
    to { transform: rotate(360deg); }
}
.ge-logo:hover { color: var(--ge-brand); }
.ge-logo:hover::before { color: var(--ge-brand-deep); }
.ge-logo-icon {
    width: 28px;
    height: 28px;
    background: var(--ge-brand);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.875rem;
}
/* Si custom logo image active dans WP, masquer le compass (l'image suffit) */
.ge-logo .custom-logo + .ge-logo::before { display: none; }
.ge-logo:has(img)::before { display: none; }

.ge-nav {
    display: flex;
    gap: 1.5rem;
    flex: 1;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ge-nav a {
    color: var(--ge-text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: .01em;
    transition: color var(--ge-transition-fast);
    white-space: nowrap;
}
.ge-nav a:hover,
.ge-nav a:focus {
    color: var(--ge-text);
}

.ge-nav .current-menu-item > a,
.ge-nav .current-menu-ancestor > a {
    color: var(--ge-brand);
    font-family: 'Crimson Pro', Georgia, serif;
    font-weight: 600;
    font-style: italic;
    font-size: 1.05rem;
    letter-spacing: 0;
}

/* Dropdown nav */
.ge-nav .menu-item-has-children {
    position: relative;
}
.ge-nav .sub-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: var(--ge-bg-card);
    border: 1px solid var(--ge-border);
    border-radius: var(--ge-radius-sm);
    box-shadow: var(--ge-shadow-md);
    min-width: 200px;
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
    z-index: 200;
}
.ge-nav .menu-item-has-children:hover .sub-menu,
.ge-nav .menu-item-has-children:focus-within .sub-menu {
    display: block;
}
.ge-nav .sub-menu li a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: var(--ge-text);
}
.ge-nav .sub-menu li a:hover {
    background: var(--ge-bg-elevated);
    color: var(--ge-accent);
}

.ge-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

/* Hamburger mobile */
.ge-hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--ge-text);
}
.ge-hamburger svg {
    display: block;
    width: 24px;
    height: 24px;
}

.ge-mobile-menu {
    display: none;
    position: fixed;
    top: var(--ge-header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--ge-bg-card);
    z-index: 99;
    overflow-y: auto;
    padding: 1.5rem;
}
.ge-mobile-menu.is-open { display: block; }
.ge-mobile-menu .ge-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}
.ge-mobile-menu .ge-nav a {
    display: block;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--ge-border-light);
    font-size: 1.125rem;
    width: 100%;
}
.ge-mobile-menu .sub-menu {
    position: static;
    box-shadow: none;
    border: none;
    padding: 0 0 0 1rem;
    background: transparent;
    display: block;
}

@media (max-width: 1024px) {
    #masthead .ge-nav { display: none; }
    #masthead .ge-hamburger { display: flex; }
}
@media (max-width: 480px) {
    .ge-header-inner { padding: 0 1rem; gap: 1rem; }
}

/* ============================================================
   BREADCRUMBS
   ============================================================ */
.ge-breadcrumbs {
    padding: 0.75rem 0;
    font-size: 0.875rem;
    color: var(--ge-text-muted);
}
.ge-breadcrumbs-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    align-items: center;
}
.ge-breadcrumbs-list li {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.ge-breadcrumbs-list li::after {
    content: '/';
    color: var(--ge-text-light);
    margin-left: 0.25rem;
}
.ge-breadcrumbs-list li:last-child::after { display: none; }
.ge-breadcrumbs-list a {
    color: var(--ge-text-muted);
    text-decoration: none;
}
.ge-breadcrumbs-list a:hover { color: var(--ge-accent); }
.ge-breadcrumbs-list .current { color: var(--ge-text); }

/* ============================================================
   POSTS LOOP — Grille d'articles
   ============================================================ */
.posts-loop {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin: 1.5rem 0;
}

@media (max-width: 900px) {
    .posts-loop { grid-template-columns: 1fr; gap: 1rem; }
}

/* ============================================================
   CARDS ARTICLE
   ============================================================ */
.ge-card {
    background: var(--ge-bg-card);
    border-radius: var(--ge-radius);
    border: 1px solid var(--ge-border-light);
    box-shadow: var(--ge-shadow);
    overflow: hidden;
    transition: transform var(--ge-transition), box-shadow var(--ge-transition), border-color var(--ge-transition);
    display: flex;
    flex-direction: column;
}
.ge-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--ge-shadow-md);
    border-color: var(--ge-border);
}

.ge-card-image {
    aspect-ratio: 16/9;
    object-fit: cover;
    width: 100%;
}
.ge-card-image-link {
    display: block;
    overflow: hidden;
    border-radius: var(--ge-radius) var(--ge-radius) 0 0;
}
.ge-card-image-link img {
    transition: transform 0.4s ease;
}
.ge-card:hover .ge-card-image-link img {
    transform: scale(1.03);
}

.ge-card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.ge-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.ge-card-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ge-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
}
.ge-card-tag:hover { color: var(--ge-accent-hover); }
.ge-card-tag.ge-tag-etape {
    color: var(--ge-accent2);
}

.ge-card-title {
    font-family: Manrope, sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 0.75rem;
    color: var(--ge-text);
}
.ge-card-title a {
    color: inherit;
    text-decoration: none;
}
.ge-card-title a:hover { color: var(--ge-accent); }

.ge-card-excerpt {
    color: var(--ge-text-muted);
    font-size: 0.9375rem;
    line-height: 1.55;
    flex: 1;
    margin-bottom: 1rem;
}

.ge-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: var(--ge-text-light);
    margin-top: auto;
    gap: 0.5rem;
}
.ge-card-meta-date { white-space: nowrap; }
.ge-card-read-time { display: flex; align-items: center; gap: 0.25rem; }

/* Placeholder card (grid fill) */
.ge-card-placeholder {
    background: var(--ge-bg-elevated);
    border: 1px dashed var(--ge-border);
    border-radius: var(--ge-radius);
    opacity: 0.4;
    min-height: 200px;
}

/* ============================================================
   HOME HEADER
   ============================================================ */
.ge-home-header {
    text-align: center;
    padding: 3rem 1.5rem 2rem;
    max-width: 720px;
    margin: 0 auto;
}
.ge-home-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--ge-text);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}
.ge-home-subtitle {
    font-size: 1.125rem;
    color: var(--ge-text-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}
@media (max-width: 768px) {
    .ge-home-header { padding: 2rem 1rem 1.5rem; }
    .ge-home-title { font-size: 1.875rem; }
    .ge-home-subtitle { font-size: 1rem; }
}

/* ============================================================
   FILTRES (Home & Archive)
   ============================================================ */
.ge-filters {
    overflow-x: auto;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
    scrollbar-width: none;
}
.ge-filters::-webkit-scrollbar { display: none; }

.ge-filters-inner {
    display: flex;
    gap: 0.5rem;
    min-width: max-content;
}

.ge-filter-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.4375rem 1rem;
    border-radius: var(--ge-radius-pill);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--ge-border);
    background: var(--ge-bg-card);
    color: var(--ge-text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--ge-transition-fast);
}
.ge-filter-btn:hover {
    border-color: var(--ge-accent);
    color: var(--ge-accent);
}
.ge-filter-btn.active {
    background: var(--ge-accent);
    border-color: var(--ge-accent);
    color: #fff;
    font-weight: 600;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.ge-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 0;
    flex-wrap: wrap;
}
.ge-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    border-radius: var(--ge-radius-sm);
    border: 1px solid var(--ge-border);
    background: var(--ge-bg-card);
    color: var(--ge-text);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--ge-transition-fast);
}
.ge-pagination .page-numbers:hover {
    border-color: var(--ge-accent);
    color: var(--ge-accent);
}
.ge-pagination .page-numbers.current {
    background: var(--ge-accent);
    border-color: var(--ge-accent);
    color: #fff;
    font-weight: 600;
}
.ge-pagination .page-numbers.dots {
    border-color: transparent;
    background: transparent;
    pointer-events: none;
}

/* ============================================================
   ARTICLE SINGLE
   ============================================================ */
.single-post .entry-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--ge-border-light);
}

.single-post .entry-title {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--ge-text);
    margin-bottom: 1rem;
}
@media (max-width: 768px) {
    .single-post .entry-title { font-size: 1.75rem; }
}

.entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--ge-text-muted);
    align-items: center;
}
.entry-meta a { color: var(--ge-text-muted); }
.entry-meta a:hover { color: var(--ge-accent); }

.entry-content {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--ge-text);
}
.entry-content h2 {
    font-size: 1.5rem;
    margin: 2rem 0 0.75rem;
    padding-top: 0.5rem;
    border-top: 2px solid var(--ge-border-light);
}
.entry-content h3 {
    font-size: 1.25rem;
    margin: 1.5rem 0 0.5rem;
}
.entry-content ul, .entry-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}
.entry-content li { margin-bottom: 0.25rem; }
.entry-content blockquote {
    border-left: 4px solid var(--ge-accent);
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background: var(--ge-bg-elevated);
    border-radius: 0 var(--ge-radius-sm) var(--ge-radius-sm) 0;
    color: var(--ge-text-muted);
    font-style: italic;
}
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
    overflow-x: auto;
    display: block;
}
.entry-content table th {
    background: var(--ge-bg-elevated);
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 1rem;
    border: 1px solid var(--ge-border);
    color: var(--ge-text);
}
.entry-content table td {
    padding: 0.625rem 1rem;
    border: 1px solid var(--ge-border-light);
    vertical-align: top;
}
.entry-content table tr:nth-child(even) td {
    background: var(--ge-bg-elevated);
}
.entry-content img {
    border-radius: var(--ge-radius-sm);
    margin: 1rem 0;
    max-width: 100%;
}
.entry-content .wp-caption-text {
    font-size: 0.8125rem;
    color: var(--ge-text-muted);
    text-align: center;
    margin-top: 0.25rem;
}
.entry-content code {
    background: var(--ge-bg-elevated);
    border: 1px solid var(--ge-border);
    padding: 0.1em 0.4em;
    border-radius: 4px;
    font-size: 0.875em;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    color: var(--ge-text);
}
.entry-content pre {
    background: var(--ge-bg-elevated);
    border: 1px solid var(--ge-border);
    border-radius: var(--ge-radius-sm);
    padding: 1rem 1.25rem;
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}
.entry-content pre code {
    background: none;
    border: none;
    padding: 0;
}

/* Featured image */
.single-post .wp-post-image,
.single-post .featured-image img {
    border-radius: var(--ge-radius);
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    margin-bottom: 2rem;
}

/* ============================================================
   AUTHOR BIO CARD
   ============================================================ */
.ge-author-bio-card {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--ge-bg-elevated);
    border: 1px solid var(--ge-border);
    border-radius: var(--ge-radius);
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}
.ge-author-bio-avatar img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.ge-author-bio-content { flex: 1; min-width: 0; }
.ge-author-bio-name {
    font-family: Manrope, sans-serif;
    font-size: 0.9375rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.ge-author-bio-name a { color: var(--ge-accent); }
.ge-author-bio-desc {
    font-size: 0.875rem;
    color: var(--ge-text-muted);
    line-height: 1.5;
}

/* ============================================================
   BOUTONS
   ============================================================ */
.ge-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--ge-radius-pill);
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all var(--ge-transition);
    border: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
}

.ge-btn-primary {
    background: var(--ge-accent);
    color: #fff;
}
.ge-btn-primary:hover {
    background: var(--ge-accent-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5,150,105,.3);
}

.ge-btn-secondary {
    background: var(--ge-bg-card);
    color: var(--ge-text);
    border: 1px solid var(--ge-border);
}
.ge-btn-secondary:hover {
    border-color: var(--ge-accent);
    color: var(--ge-accent);
}

.ge-btn-ghost {
    background: transparent;
    color: var(--ge-text-muted);
}
.ge-btn-ghost:hover { color: var(--ge-accent); }

.ge-btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ============================================================
   BADGES / TAGS
   ============================================================ */
.ge-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: var(--ge-radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}
.ge-badge-pays {
    background: rgba(5,150,105,.1);
    color: var(--ge-accent);
}
.ge-badge-etape {
    background: rgba(99,102,241,.1);
    color: var(--ge-accent2);
}

/* ============================================================
   HUB PAYS (Archive)
   ============================================================ */
.ge-hub-header {
    background: linear-gradient(135deg, var(--ge-accent) 0%, #10b981 100%);
    color: #fff;
    padding: 3rem 1.5rem;
    border-radius: var(--ge-radius);
    margin-bottom: 2rem;
    text-align: center;
}
.ge-hub-header h1 {
    color: #fff;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}
.ge-hub-header p {
    color: rgba(255,255,255,.85);
    font-size: 1rem;
    margin: 0;
}

.ge-archive-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.ge-archive-description {
    color: var(--ge-text-muted);
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* ============================================================
   PAYS CARDS (Homepage)
   ============================================================ */
.ge-pays-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}
@media (max-width: 768px) {
    .ge-pays-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .ge-pays-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
}

.ge-pays-card {
    background: var(--ge-bg-card);
    border: 1px solid var(--ge-border-light);
    border-radius: var(--ge-radius);
    padding: 1.25rem 1rem;
    text-align: center;
    text-decoration: none;
    color: var(--ge-text);
    transition: all var(--ge-transition);
    box-shadow: var(--ge-shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.ge-pays-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--ge-shadow-md);
    border-color: var(--ge-accent);
    color: var(--ge-text);
}
.ge-pays-card-flag { font-size: 2rem; }
.ge-pays-card-name { font-weight: 600; font-size: 0.9375rem; }
.ge-pays-card-count { font-size: 0.75rem; color: var(--ge-text-muted); }

/* ============================================================
   SIDEBAR
   ============================================================ */
.widget-area .widget {
    background: var(--ge-bg-card);
    border: 1px solid var(--ge-border-light);
    border-radius: var(--ge-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--ge-shadow-sm);
}
.widget-area .widget-title {
    font-family: Manrope, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ge-text);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--ge-accent);
    display: inline-block;
}
.widget-area ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.widget-area ul li {
    border-bottom: 1px solid var(--ge-border-light);
    padding: 0.5rem 0;
}
.widget-area ul li:last-child { border-bottom: none; }
.widget-area ul li a {
    color: var(--ge-text-muted);
    font-size: 0.9375rem;
}
.widget-area ul li a:hover { color: var(--ge-accent); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    background: var(--ge-bg-card);
    border-top: 1px solid var(--ge-border);
    margin-top: 3rem;
}

.ge-footer-inner {
    max-width: var(--ge-content-max);
    margin: 0 auto;
    padding: 3rem var(--ge-side-pad) 1.5rem; /* RÈGLE ABSOLUE — réserve pubs latérales */
}

@media (max-width: 1024px) {
    .ge-footer-inner {
        padding: 3rem var(--ge-side-pad-mobile) 1.5rem;
    }
}

.ge-footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 2rem;
}
@media (max-width: 900px) {
    .ge-footer-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
}
@media (max-width: 480px) {
    .ge-footer-grid { grid-template-columns: 1fr; }
}

.ge-footer-brand .ge-footer-logo {
    font-family: Manrope, sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--ge-text);
    text-decoration: none;
    display: block;
    margin-bottom: 0.75rem;
}
.ge-footer-brand p {
    font-size: 0.875rem;
    color: var(--ge-text-muted);
    line-height: 1.6;
}

.ge-footer-col-title {
    font-family: Manrope, sans-serif;
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--ge-text);
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.ge-footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
}
.ge-footer-links li { margin-bottom: 0.5rem; }
.ge-footer-links a {
    font-size: 0.875rem;
    color: var(--ge-text-muted);
    text-decoration: none;
    transition: color var(--ge-transition-fast);
}
.ge-footer-links a:hover { color: var(--ge-accent); }

.ge-footer-bottom {
    border-top: 1px solid var(--ge-border-light);
    padding-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--ge-text-muted);
}
.ge-footer-bottom a { color: var(--ge-text-muted); }
.ge-footer-bottom a:hover { color: var(--ge-accent); }

/* ============================================================
   PAGE 404
   ============================================================ */
.ge-404-wrapper {
    text-align: center;
    padding: 4rem 1.5rem;
    max-width: 500px;
    margin: 0 auto;
}
.ge-404-code {
    font-family: Manrope, sans-serif;
    font-size: 5rem;
    font-weight: 700;
    color: var(--ge-border);
    line-height: 1;
    margin-bottom: 1rem;
}
.ge-404-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}
.ge-404-desc {
    color: var(--ge-text-muted);
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* ============================================================
   AUTHOR PAGE
   ============================================================ */
.ge-author-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem 0;
    border-bottom: 1px solid var(--ge-border-light);
    margin-bottom: 2rem;
}
.ge-author-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--ge-border);
}
.ge-author-info h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}
.ge-author-bio-text {
    color: var(--ge-text-muted);
    font-size: 0.9375rem;
    line-height: 1.5;
    margin: 0;
}

/* ============================================================
   COMMENTAIRES
   ============================================================ */
.ge-comments-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--ge-border-light);
}
.ge-comments-section .comments-title {
    font-family: Manrope, sans-serif;
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.comment-body {
    background: var(--ge-bg-card);
    border: 1px solid var(--ge-border-light);
    border-radius: var(--ge-radius-sm);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}
.comment-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.comment-author { font-weight: 600; font-size: 0.9375rem; }
.comment-metadata { font-size: 0.8125rem; color: var(--ge-text-muted); }
.comment-content { font-size: 0.9375rem; line-height: 1.6; }

/* Reply link */
.comment-reply-link {
    font-size: 0.8125rem;
    color: var(--ge-accent);
    font-weight: 500;
}
.comment-reply-link:hover { color: var(--ge-accent-hover); }

/* Comment form */
#respond {
    background: var(--ge-bg-elevated);
    border: 1px solid var(--ge-border-light);
    border-radius: var(--ge-radius);
    padding: 1.5rem;
    margin-top: 2rem;
}
#respond .comment-reply-title {
    font-family: Manrope, sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
}
#respond label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--ge-text);
}
#respond input[type="text"],
#respond input[type="email"],
#respond input[type="url"],
#respond textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--ge-border);
    border-radius: var(--ge-radius-sm);
    background: var(--ge-bg-card);
    color: var(--ge-text);
    font-size: 0.9375rem;
    font-family: inherit;
    transition: border-color var(--ge-transition-fast);
    margin-bottom: 0.75rem;
}
#respond input:focus,
#respond textarea:focus {
    outline: none;
    border-color: var(--ge-accent);
    box-shadow: 0 0 0 3px rgba(5,150,105,.1);
}
#respond textarea { resize: vertical; min-height: 120px; }
#respond .form-submit { margin-top: 0.5rem; }
#respond .submit {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: var(--ge-accent);
    color: #fff;
    border: none;
    border-radius: var(--ge-radius-pill);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background var(--ge-transition-fast);
}
#respond .submit:hover { background: var(--ge-accent-hover); }

/* ============================================================
   PAGE LINKS (multi-page articles)
   ============================================================ */
.page-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 2rem 0;
    font-size: 0.9375rem;
    color: var(--ge-text-muted);
}
.page-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    border: 1px solid var(--ge-border);
    border-radius: var(--ge-radius-sm);
    background: var(--ge-bg-card);
    color: var(--ge-text);
    font-weight: 500;
}
.page-links a:hover {
    border-color: var(--ge-accent);
    color: var(--ge-accent);
}

/* ============================================================
   MEDIAVINE ADS — IDs conservés verbatim (compat Mediavine beacon)
   ============================================================ */
#kl-ad-totem-left {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 300px;
    z-index: 9998;
}

/* Adhesion bas — cleanup (géré par Mediavine) */
#fixed_container_bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9997;
}

#kl-mv-adhesion-clean #fixed_container_bottom {
    background: transparent;
}

/* UVP Video */
#universalPlayer_wrapper,
#kl-uvp-sidebar-wrapper {
    position: relative;
}

/* Fullscreen iframe ads */
#kl-fs-ad-left {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 9999;
}

/* ============================================================
   RELATED ARTICLES
   ============================================================ */
.ge-related-articles {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--ge-border-light);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.ge-related-articles.is-visible { opacity: 1; }

.ge-related-title {
    font-family: Manrope, sans-serif;
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.ge-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}
@media (max-width: 900px) {
    .ge-related-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
    .ge-related-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   SEARCH
   ============================================================ */
.ge-search-container { position: relative; }
.ge-search-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--ge-bg-card);
    border: 1px solid var(--ge-border);
    border-radius: var(--ge-radius-pill);
    padding: 0 0.75rem;
    gap: 0.5rem;
    transition: border-color var(--ge-transition-fast);
}
.ge-search-input-wrapper:focus-within {
    border-color: var(--ge-accent);
    box-shadow: 0 0 0 3px rgba(5,150,105,.1);
}
.ge-search-icon { color: var(--ge-text-muted); flex-shrink: 0; }
.ge-search-input {
    border: none;
    background: transparent;
    font-size: 0.9375rem;
    color: var(--ge-text);
    padding: 0.5rem 0;
    outline: none;
    font-family: inherit;
    width: 200px;
}
.ge-search-input::placeholder { color: var(--ge-text-light); }
.ge-search-clear {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ge-text-muted);
    font-size: 1.125rem;
    line-height: 1;
    padding: 0;
    display: none;
}
.ge-search-clear.is-visible { display: block; }
.ge-search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--ge-bg-card);
    border: 1px solid var(--ge-border);
    border-radius: var(--ge-radius-sm);
    box-shadow: var(--ge-shadow-md);
    z-index: 50;
    max-height: 320px;
    overflow-y: auto;
    display: none;
}
.ge-search-dropdown.is-open { display: block; }

/* ============================================================
   UTILITAIRES
   ============================================================ */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    height: 1px;
    overflow: hidden;
    position: absolute;
    width: 1px;
    word-wrap: normal;
}
.screen-reader-text:focus {
    background-color: var(--ge-bg-card);
    clip: auto;
    color: var(--ge-text);
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    height: auto;
    left: 5px;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* ============================================================
   RESPONSIF GLOBAL
   ============================================================ */
@media (max-width: 900px) {
    #content.site-content { flex-direction: column; }
    #secondary.widget-area.sidebar { width: 100%; flex: none; }
    .site-main { padding: 1.5rem 0; }
    .ge-footer-grid { padding-bottom: 1rem; }
}

@media (max-width: 480px) {
    #content.site-content { padding: 0 1rem; }
    .container { padding: 0 1rem; }
    .ge-home-header { padding: 1.5rem 0.75rem; }
    .ge-footer-inner { padding: 2rem 1rem 1rem; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
    .ge-header, .site-footer, .ge-related-articles,
    .ge-comments-section, #kl-ad-totem-left,
    #fixed_container_bottom, #kl-fs-ad-left,
    #universalPlayer_wrapper, .ge-pagination {
        display: none !important;
    }
    body {
        background: #fff;
        color: #000;
        font-size: 12pt;
    }
    #content.site-content {
        max-width: 100% !important;
        margin-left: 0 !important;
        padding: 0 !important;
    }
    .entry-content a::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #555;
    }
}
