:root {
    --somch-dh-ink: #10151c;
    --somch-dh-muted: #626c79;
    --somch-dh-line: #dce1e7;
    --somch-dh-paper: #ffffff;
    --somch-dh-red: #d7192d;
    --somch-dh-green: #11833b;
    --somch-dh-gold: #b18d38;
}

/* Accessibilité (WCAG 2.1 AA) : la page d'accueil affiche déjà son propre H1
   éditorial ; on masque le titre de page générique du thème pour éviter un
   H1 dupliqué dans la structure du document. */
.somch-dh-active .page-header {
    display: none;
}

/* Le contenu statique de la page d'accueil affiche déjà un titre de section
   ("Dernières publications") juste au-dessus de ce bloc dynamique. On masque
   visuellement l'en-tête interne du bloc (redondant à l'écran) tout en le
   gardant accessible aux lecteurs d'écran et comme cible d'aria-labelledby. */
.somch-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.somch-dynamic-home {
    width: 100%;
    margin-top: 24px;
    color: var(--somch-dh-ink);
}

.somch-dynamic-home *,
.somch-dynamic-home *::before,
.somch-dynamic-home *::after {
    box-sizing: border-box;
}

.somch-dynamic-home a {
    text-decoration: none;
}

.home.somch-dynamic-home-active .somch-section--dynamic-home > .somch-section__bar,
.home.somch-dynamic-home-active .somch-section--dynamic-home > .somch-section__intro {
    display: none !important;
}

/* Optional compact version of the existing editorial introduction. */
.home.somch-dh-compact-intro .somch-hero {
    padding: 38px 44px !important;
}

.home.somch-dh-compact-intro .somch-hero h1 {
    margin-bottom: 16px !important;
    font-size: clamp(38px, 4vw, 48px) !important;
    line-height: 1.06 !important;
}

.home.somch-dh-compact-intro .somch-hero__main > p:not(:first-child) {
    font-size: 17px !important;
    line-height: 1.55 !important;
}

.home.somch-dh-compact-intro .somch-hero__brief {
    padding: 24px !important;
}

/* Ancre de navigation rapide : une seule ligne de liens vers les rubriques
   de l'accueil, pour éviter d'avoir à tout faire défiler pour atteindre
   Histoire ou Sélection de la rédaction sur une page longue. */
#somch-dh-actualites,
.somch-dynamic-home__topic {
    scroll-margin-top: 90px;
}

.somch-dynamic-home__quicknav {
    margin-bottom: 20px;
}

.somch-dynamic-home__quicknav ul {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    list-style: none;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.somch-dynamic-home__quicknav li {
    flex: 0 0 auto;
}

.somch-dynamic-home__quicknav a {
    display: block;
    padding: 8px 16px;
    color: var(--somch-dh-ink);
    border: 1px solid var(--somch-dh-line);
    border-radius: 999px;
    background: var(--somch-dh-paper);
    font-size: 12.5px;
    font-weight: 750;
    white-space: nowrap;
    transition: border-color .16s ease, color .16s ease, background-color .16s ease;
}

.somch-dynamic-home__quicknav a:hover,
.somch-dynamic-home__quicknav a:focus-visible {
    color: #fff;
    border-color: var(--somch-dh-red);
    background: var(--somch-dh-red);
}

@media (max-width: 640px) {
    .somch-dynamic-home__quicknav {
        margin-bottom: 16px;
    }

    .somch-dynamic-home__quicknav a {
        padding: 7px 14px;
        font-size: 12px;
    }
}

.somch-dynamic-home__lead-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(330px, .75fr);
    gap: 18px;
}

.somch-dynamic-home__featured,
.somch-dynamic-home__latest,
.somch-dynamic-home__story {
    overflow: hidden;
    border: 1px solid var(--somch-dh-line);
    border-radius: 7px;
    background: var(--somch-dh-paper);
    box-shadow: 0 10px 30px rgba(16, 21, 28, .07);
}

.somch-dynamic-home__featured > a {
    display: grid;
    min-height: 560px;
    color: #fff;
    grid-template-rows: minmax(250px, 1fr) auto;
}

.somch-dynamic-home__featured-media {
    position: relative;
    min-height: 290px;
    overflow: hidden;
    background: linear-gradient(135deg, #10151c, #762329 64%, #11833b);
}

.somch-dynamic-home__featured-media::after {
    position: absolute;
    inset: auto 0 0;
    height: 40%;
    background: linear-gradient(180deg, transparent, rgba(16, 21, 28, .48));
    content: "";
}

.somch-dynamic-home__featured-media img {
    width: 100%;
    height: 100%;
    min-height: 290px;
    object-fit: cover;
    transition: transform .35s ease;
}

.somch-dynamic-home__featured:hover img {
    transform: scale(1.025);
}

.somch-dynamic-home__featured-media > span {
    position: absolute;
    right: 34px;
    bottom: 28px;
    color: rgba(255, 255, 255, .18);
    font-size: clamp(26px, 4vw, 58px);
    font-weight: 900;
    letter-spacing: .03em;
}

.somch-dynamic-home__featured-body {
    padding: 34px 38px 36px;
    background: var(--somch-dh-ink);
}

.somch-dynamic-home__eyebrow {
    display: block;
    color: var(--somch-dh-red);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .07em;
    line-height: 1.3;
    text-transform: uppercase;
}

.somch-dynamic-home__featured .somch-dynamic-home__eyebrow {
    color: #ff9ba4;
}

body.home.somch-media-design-v3 .somch-dynamic-home__featured h2,
.somch-dynamic-home__featured h2 {
    max-width: 760px;
    margin: 13px 0 15px;
    color: #fff;
    font-size: clamp(31px, 3.3vw, 48px);
    line-height: 1.06;
    letter-spacing: 0;
}

.somch-dynamic-home__featured p {
    max-width: 720px;
    margin: 0;
    color: #cdd3db;
    font-size: 16px;
    line-height: 1.62;
}

.somch-dynamic-home__featured-body > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, .14);
}

.somch-dynamic-home__featured time,
.somch-dynamic-home__featured strong {
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.somch-dynamic-home__latest {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 27px 28px;
}

.somch-dynamic-home__latest header {
    margin-bottom: 7px;
}

body.home.somch-media-design-v3 .somch-dynamic-home__latest h2,
.somch-dynamic-home__latest h2 {
    margin: 7px 0 0;
    font-size: 25px;
    line-height: 1.15;
}

.somch-dynamic-home__compact {
    border-bottom: 1px solid var(--somch-dh-line);
}

.somch-dynamic-home__compact > a {
    display: block;
    padding: 17px 0;
    color: var(--somch-dh-ink);
}

.somch-dynamic-home__compact span {
    color: var(--somch-dh-red);
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
}

.somch-dynamic-home__compact h3 {
    margin: 5px 0 7px;
    color: var(--somch-dh-ink);
    font-size: 18px;
    line-height: 1.2;
    transition: color .18s ease;
}

.somch-dynamic-home__compact a:hover h3 {
    color: var(--somch-dh-red);
}

.somch-dynamic-home__compact time,
.somch-dynamic-home__story time {
    color: var(--somch-dh-muted);
    font-size: 11px;
    font-weight: 700;
}

.somch-dynamic-home__all {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 20px;
    color: var(--somch-dh-red);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.somch-dynamic-home__topic {
    margin-top: 46px;
    padding-top: 32px;
    border-top: 1px solid var(--somch-dh-line);
}

.somch-dynamic-home__topic > header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 22px;
}

body.home.somch-media-design-v3 .somch-dynamic-home__topic > header h2,
.somch-dynamic-home__topic > header h2 {
    margin: 7px 0 0;
    font-size: clamp(28px, 3vw, 39px);
    line-height: 1.08;
}

.somch-dynamic-home__topic > header > a {
    flex: 0 0 auto;
    color: var(--somch-dh-red);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.somch-dynamic-home__topic-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 17px;
}

.somch-dynamic-home__story {
    position: relative;
    min-width: 0;
    background-color: var(--somch-dh-paper) !important;
    background-image: none !important;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.somch-dynamic-home__story:hover {
    transform: translateY(-3px);
    border-color: rgba(215, 25, 45, .38);
    box-shadow: 0 18px 42px rgba(16, 21, 28, .12);
}

.somch-dynamic-home__story > a {
    display: grid;
    height: 100%;
    color: var(--somch-dh-ink);
    background-color: var(--somch-dh-paper) !important;
    background-image: none !important;
    grid-template-rows: 190px 1fr;
}

.somch-dynamic-home__story-media {
    position: relative;
    display: flex;
    align-items: end;
    min-height: 190px;
    overflow: hidden;
    padding: 20px;
    background: linear-gradient(135deg, #161c24, #762329 64%, #11833b);
}

.somch-dynamic-home__story-media img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: cover;
    transition: transform .3s ease;
}

.somch-dynamic-home__story:hover .somch-dynamic-home__story-media img {
    transform: scale(1.03);
}

.somch-dynamic-home__story-media > span {
    color: rgba(255, 255, 255, .78);
    font-size: 13px;
    font-weight: 850;
    text-transform: uppercase;
}

.somch-dynamic-home__story-body {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    padding: 23px 24px 25px;
    color: var(--somch-dh-ink) !important;
    background-color: var(--somch-dh-paper) !important;
    background-image: none !important;
}

/*
 * Some legacy visual modules inject an inline background on generic article
 * cards. Keep the editorial copy in its own opaque panel even when those
 * modules are still active.
 */
body.home .somch-dynamic-home .somch-dynamic-home__story,
body.home .somch-dynamic-home .somch-dynamic-home__story > a,
body.home .somch-dynamic-home .somch-dynamic-home__story-body {
    background-image: none !important;
    background-position: initial !important;
    background-repeat: no-repeat !important;
    background-size: auto !important;
}

.somch-dynamic-home__story-body > span {
    color: var(--somch-dh-red);
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
}

body.home.somch-media-design-v3 .somch-dynamic-home__story h3,
.somch-dynamic-home__story h3 {
    margin: 8px 0 11px;
    color: var(--somch-dh-ink);
    font-size: 22px;
    line-height: 1.16;
}

.somch-dynamic-home__story p {
    margin: 0 0 19px;
    color: var(--somch-dh-muted);
    font-size: 14.5px;
    line-height: 1.55;
}

.somch-dynamic-home__story time {
    margin-top: auto;
}

.somch-dynamic-home__topic--editorial {
    padding: 32px;
    border: 0;
    border-radius: 8px;
    background: #10151c;
}

.somch-dynamic-home__topic--editorial h2,
.somch-dynamic-home__topic--editorial > header > a {
    color: #fff;
}

.somch-dynamic-home__topic--editorial .somch-dynamic-home__eyebrow {
    color: #ff9ba4;
}

@media (max-width: 980px) {
    .somch-dynamic-home__lead-grid {
        grid-template-columns: 1fr;
    }

    .somch-dynamic-home__featured > a {
        min-height: 0;
    }

    .somch-dynamic-home__latest {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0 24px;
    }

    .somch-dynamic-home__latest header,
    .somch-dynamic-home__all {
        grid-column: 1 / -1;
    }

    .somch-dynamic-home__topic-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .somch-dynamic-home__story:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .home.somch-dh-compact-intro .somch-hero {
        padding: 26px 20px !important;
    }

    .home.somch-dh-compact-intro .somch-hero h1 {
        font-size: 36px !important;
    }

    .somch-dynamic-home {
        margin-top: 18px;
    }

    .somch-dynamic-home__featured > a {
        grid-template-rows: 220px auto;
    }

    .somch-dynamic-home__featured-media,
    .somch-dynamic-home__featured-media img {
        min-height: 220px;
    }

    .somch-dynamic-home__featured-body {
        padding: 25px 23px 27px;
    }

    .somch-dynamic-home__featured h2 {
        font-size: 31px;
    }

    .somch-dynamic-home__featured p {
        font-size: 15px;
    }

    .somch-dynamic-home__latest {
        display: block;
        padding: 24px 22px;
    }

    .somch-dynamic-home__topic {
        margin-top: 38px;
        padding-top: 28px;
    }

    .somch-dynamic-home__topic > header {
        display: block;
    }

    .somch-dynamic-home__topic > header > a {
        display: inline-block;
        margin-top: 14px;
    }

    .somch-dynamic-home__topic-grid {
        grid-template-columns: 1fr;
    }

    .somch-dynamic-home__story:last-child {
        grid-column: auto;
    }

    .somch-dynamic-home__story > a {
        grid-template-rows: 180px 1fr;
    }

    .somch-dynamic-home__topic--editorial {
        padding: 26px 18px;
    }
}

/* Fusion des deux blocs Diaspora statiques ("Suisse & Europe" +
   "Informations communautaires importantes") en un seul bloc de 8 cartes,
   déplacées en JS (public.js) dans la grille du premier bloc. Rendues en
   petites pastilles compactes (même esprit que l'ancre de navigation
   rapide) plutôt qu'en grandes cartes-photo, pour limiter la place prise
   sur l'accueil. */
.somch-mini-grid--merged {
    display: flex !important;
    flex-wrap: wrap !important;
    grid-template-columns: none !important;
    gap: 8px !important;
}

.somch-mini-grid--merged .somch-clickable-card {
    position: relative;
    flex: 0 0 auto !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 9px 16px !important;
    border: 1px solid var(--somch-dh-line) !important;
    border-radius: 999px !important;
    background-color: var(--somch-dh-paper) !important;
    box-shadow: none !important;
    transition: border-color .16s ease, background-color .16s ease;
}

.somch-mini-grid--merged .somch-clickable-card:hover,
.somch-mini-grid--merged .somch-clickable-card:focus-within {
    border-color: var(--somch-dh-red) !important;
    background-color: var(--somch-dh-red) !important;
}

.somch-mini-grid--merged .somch-clickable-card h3 {
    margin: 0 !important;
    color: var(--somch-dh-ink);
    font-size: 13px !important;
    font-weight: 750 !important;
    line-height: 1.3 !important;
}

.somch-mini-grid--merged .somch-clickable-card:hover h3,
.somch-mini-grid--merged .somch-clickable-card:focus-within h3 {
    color: #fff;
}

.somch-mini-grid--merged .somch-clickable-card p {
    display: none !important;
}

/* Le bloc statique "Reconnaissance internationale / Le suivi diplomatique
   de 2026" (en haut de l'accueil) fait doublon avec la rubrique
   dynamique "Reconnaissance internationale" plus bas sur la même page.
   On masque uniquement le bloc statique ; la rubrique dynamique et la
   catégorie elle-même restent inchangées. */
.home .somch-recognition {
    display: none !important;
}

/* v1.10.0 : le bloc statique en deux colonnes "Économie & investissement"
   (Corridors, commerce et opportunités) / "Berbera & Mer Rouge" (Port,
   logistique et sécurité maritime) faisait triple doublon sur la page
   d'accueil : ces deux mêmes rubriques apparaissent déjà dans la rangée de
   pastilles colorées juste au-dessus, ET dans le menu principal (Économie,
   avec Berbera en sous-rubrique). Masqué comme le bloc Reconnaissance
   ci-dessus — le contenu reste dans la page, seul l'affichage est coupé. */
.home .somch-section.somch-two-col {
    display: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .somch-dynamic-home *,
    .somch-dynamic-home *::before,
    .somch-dynamic-home *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
