/* ============================================================
   english-speaking-countries.css — CORPS de la page « Liste des pays anglophones ».
   Le HERO vient de ling-article.css (classes .ling-article-hero--split),
   chargé juste avant : on ne redéfinit ici que le reste de la page.
   Tout est préfixé .countries- pour ne rien impacter d'autre.
   ============================================================ */

.countries {
    --countries-max: 1100px;
    --countries-ink: #0f172a;
    --countries-muted: #64748b;
    --countries-line: #e6e8ee;
    --countries-soft: #f6f8fc;
    --countries-accent: var(--color-primary, #3b82f6);
}

/* ---- Bandeau de chiffres clés ---- */
.countries-stats {
    max-width: var(--countries-max);
    margin: 3.5rem auto 0;
    padding: 0 var(--padding-x, 1.25rem);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}
.countries-stat {
    background: var(--countries-soft);
    border: 1px solid var(--countries-line);
    border-radius: 14px;
    padding: 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.countries-stat-n {
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--countries-accent);
    font-variant-numeric: tabular-nums;
}
.countries-stat-l { font-size: 0.9rem; color: var(--countries-muted); line-height: 1.35; }
@media (max-width: 860px) { .countries-stats { grid-template-columns: repeat(2, 1fr); } }

/* ---- Recherche + filtres ---- */
.countries-tools {
    max-width: var(--countries-max);
    margin: 2.5rem auto 0;
    padding: 0 var(--padding-x, 1.25rem);
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}
.countries-search input {
    width: 100%;
    height: 46px;
    padding: 0 1rem;
    font: inherit;
    color: var(--countries-ink);
    background: #fff;
    border: 1px solid var(--countries-line);
    border-radius: 999px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.countries-search input:focus {
    border-color: var(--countries-accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.countries-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.countries-chip {
    font: inherit;
    font-size: 0.9rem;
    line-height: 1;
    padding: 9px 15px;
    border-radius: 999px;
    border: 1px solid var(--countries-line);
    background: #fff;
    color: #334155;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.countries-chip:hover { background: var(--countries-soft); }
.countries-chip.is-on {
    background: var(--countries-accent);
    border-color: var(--countries-accent);
    color: #fff;
    font-weight: 500;
}
.countries-filters--statut .countries-chip { font-size: 0.86rem; }
.countries-count { font-size: 0.88rem; color: var(--countries-muted); margin: 0; }

/* ---- Tableau des pays ---- */
.countries-tablewrap {
    max-width: var(--countries-max);
    margin: 1.25rem auto 0;
    padding: 0 var(--padding-x, 1.25rem);
}
.countries-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border: 1px solid var(--countries-line);
    border-radius: 14px;
    overflow: hidden;
    font-size: 0.94rem;
}
.countries-table thead th {
    background: var(--countries-soft);
    border-bottom: 1px solid var(--countries-line);
    padding: 0;
    text-align: left;
}
.countries-sort {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    font: inherit;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--countries-ink);
    background: none;
    border: 0;
    padding: 0.85rem 1rem;
    cursor: pointer;
    text-align: left;
}
.countries-sort:hover { color: var(--countries-accent); }
.countries-arrow {
    width: 0; height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 5px solid currentColor;
    opacity: 0;
    transition: opacity 0.15s, transform 0.15s;
}
.countries-sort.is-asc  .countries-arrow { opacity: 0.75; }
.countries-sort.is-desc .countries-arrow { opacity: 0.75; transform: rotate(180deg); }
.countries-table tbody th,
.countries-table tbody td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--countries-line);
    color: #334155;
    text-align: left;
    font-weight: 400;
    vertical-align: top;
}
.countries-table tbody th { font-weight: 600; color: var(--countries-ink); }
.countries-table tbody tr:last-child th,
.countries-table tbody tr:last-child td { border-bottom: 0; }
.countries-table tbody tr:nth-child(even) th,
.countries-table tbody tr:nth-child(even) td { background: #fafbfd; }
.countries-table tbody tr:hover th,
.countries-table tbody tr:hover td { background: #f2f6fd; }

/* Badge de statut Commonwealth */
.countries-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    line-height: 1.35;
    white-space: nowrap;
}
.countries-badge--commonwealth { background: #e8f2ff; color: #1d4ed8; }
.countries-badge--pays         { background: #f1f5f9; color: #475569; }
.countries-badge--territoire   { background: #fff5e6; color: #b45309; white-space: normal; }

.countries-empty { text-align: center; color: var(--countries-muted); padding: 2rem 0 0; }

/* Mobile : le tableau devient des cartes (libellés via data-label) */
@media (max-width: 800px) {
    .countries-table, .countries-table tbody, .countries-table tr, .countries-table th, .countries-table td { display: block; }
    .countries-table thead { display: none; }
    .countries-table { border: 0; background: none; }
    .countries-table tbody tr {
        background: #fff;
        border: 1px solid var(--countries-line);
        border-radius: 14px;
        margin-bottom: 0.85rem;
        padding: 0.35rem 0;
        overflow: hidden;
    }
    .countries-table tbody th,
    .countries-table tbody td,
    .countries-table tbody tr:nth-child(even) th,
    .countries-table tbody tr:nth-child(even) td { background: none; border-bottom: 0; padding: 0.4rem 1rem; }
    .countries-table tbody th { font-size: 1.02rem; padding-top: 0.7rem; }
    .countries-table tbody td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.7rem;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--countries-muted);
        margin-bottom: 2px;
    }
}

/* ---- Sections explicatives ---- */
.countries-prose {
    max-width: 820px;
    margin: 4rem auto 5rem;
    padding: 0 var(--padding-x, 1.25rem);
}
.countries-prose > section + section {
    margin-top: 3.5rem;
    padding-top: 3.5rem;
    border-top: 1px solid var(--countries-line);
}
.countries-prose h2 {
    font-size: clamp(1.35rem, 1.1rem + 1vw, 1.7rem);
    line-height: 1.3;
    margin: 0 0 1.2rem;
    padding-left: 0.9rem;
    border-left: 4px solid var(--countries-accent);
    color: var(--color-dark, #1f2937);
}
.countries-prose p,
.countries-prose li { font-size: 1.02rem; line-height: 1.8; color: #334155; }
.countries-prose > section > * + * { margin-top: 1.2rem; }
.countries-prose a {
    color: var(--countries-accent);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}
.countries-prose a:hover { color: var(--color-primary-dark, #2563eb); }
