/* =====================================================
   Mansa À la Une — v5.12.0 Style Éditorial
   ===================================================== */

:root {
    --alune-ink:        #0d0d0d;
    --alune-paper:      #ffffff;
    --alune-off:        #f3f2ef;
    --alune-line:       #0d0d0d;
    --alune-line-light: #e2dfd8;
    --alune-grey:       #6f6f6a;
    --alune-f:          'Helvetica Neue', Arial, sans-serif;
}

/* ─── Reset héritage thème ─────────────────────────── */
/* box-sizing universel */
.alune-clean *,
.alune-clean *::before,
.alune-clean *::after {
    box-sizing: border-box;
}

/* Neutralise les borders injectés par le thème
   SAUF sur .alune-side-card qui a ses propres séparateurs */
.alune-clean article,
.alune-clean span,
.alune-clean h2,
.alune-clean h3,
.alune-clean p {
    border-top: none !important;
    border-bottom: none !important;
}

/* Reset sur les <a> et <div> sans cibler les side-cards */
.alune-clean a:not(.alune-side-card),
.alune-clean div:not(.alune-side-stack) {
    border-top: none !important;
}

/* ─── Section wrapper ─── */
.alune-clean {
    width: 100%;
    margin: 48px 0;
    padding: 0;
}

.alune-wrap {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0;   /* pas de padding interne — le thème gère les marges */
}

/* ─── Titre & description ─── */
.alune-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--alune-grey);
    font-weight: 700;
    margin: 0 0 10px;
    padding: 0;
}

.alune-description {
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--alune-grey);
    margin: 0 0 24px;
}

/* ─── Grille principale : feature (2fr) + side-stack (1fr) ─── */
.alune-a-la-une {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin-top: 24px;
    margin-bottom: 40px;
    width: 100%;
    align-items: start;
}

/* ─── FEATURE PRINCIPALE ─── */
.alune-feature {
    display: block;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.alune-feature-fig {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: transparent;
    margin-bottom: 12px;
}

.alune-feature-fig img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    max-width: 100% !important;
}

.alune-feature-title {
    font-family: var(--alune-f);
    font-size: 23px;
    line-height: 1.22;
    font-weight: 700;
    color: var(--alune-ink);
    margin: 6px 0 8px;
}

.alune-feature-excerpt {
    font-family: var(--alune-f);
    font-size: 14.5px;
    line-height: 1.5;
    color: #333;
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ─── Tags & Dates (communs) ─── */
.alune-tag {
    font-family: var(--alune-f);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--alune-grey);
    font-weight: 600;
    display: block;
    margin-bottom: 1px;
    margin-top: 0;
}

.alune-date {
    font-family: var(--alune-f);
    font-size: 12px;
    color: var(--alune-grey);
    display: block;
    border-top: none !important;
    padding-top: 0 !important;
    margin-top: 2px !important;
}

/* Styles pour les événements / agenda */
.alune-event-meta {
    display: flex !important;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px 0;
}

.alune-event-date,
.alune-event-loc {
    display: inline-flex;
    align-items: center;
    gap: 3.5px;
    line-height: 1.3;
}

.alune-event-meta .alune-icon {
    display: inline-block;
    color: var(--alune-grey);
    flex-shrink: 0;
    vertical-align: middle;
}

/* ─── SIDE STACK (articles secondaires) ─── */
.alune-side-stack {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
    align-self: start; /* remonte la stack en haut de la feature */
}

.alune-side-card {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.18s ease;
    min-width: 0;
    overflow: hidden;
    /* Séparateur + espacement compact comme le mockup */
    padding-top: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--alune-line-light);
}

/* Première carte : pas de padding-top */
.alune-side-card:first-child {
    padding-top: 0;
}

/* Dernière carte : pas de séparateur en bas */
.alune-side-card:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.alune-side-card:hover {
    opacity: 0.8;
}

.alune-side-fig {
    width: 140px;
    flex: 0 0 140px;
    overflow: hidden;
    background: transparent;
    position: relative;
}

.alune-side-fig img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    max-width: 100% !important;
}

.alune-side-body {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
    min-width: 0;
    /* tag, titre et date collent en haut, au niveau de l’image */
    align-self: flex-start;
    justify-content: flex-start;
}

.alune-side-title {
    font-family: var(--alune-f);
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--alune-ink);
    margin: 0 0 1px;   /* espace minimal avant la date */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ─── Badge icône lien externe ─── */
.alune-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    padding: 6px;
    z-index: 10;
    line-height: 0;
    background-color: rgba(255, 255, 255, 0.92);
    display: block;
}

/* ─── GRILLE TERTIAIRES ─── */
.alune-tertiary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px 20px;
    padding: 0;        /* pas de padding-top superflu */
    margin-top: 0;
    align-items: start; /* alignement naturel, pas de hauteur forcée */
}

/* Carte tertiaire */
.alune-card-ter {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: transparent;
    border: none;
    overflow: hidden;
    transition: opacity 0.18s ease;
}

.alune-card-ter:hover {
    opacity: 0.88;
}

.alune-ter-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    /* pas de height: 100% — flux naturel */
}

.alune-ter-fig {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: transparent;
    margin-bottom: 8px;   /* espacement compact image → texte */
}

.alune-ter-fig img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    max-width: 100% !important;
}

/* Lien externe : afficher l’image dans son ratio d’origine sans déformer ni rogner */
.alune-external-fig {
    aspect-ratio: auto !important;
}

.alune-external-fig img {
    height: auto !important;
    object-fit: unset !important;
}

.alune-ter-body {
    padding: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0;
}

.alune-ter-title {
    font-family: var(--alune-f);
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.28;
    color: var(--alune-ink);
    margin: 2px 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.alune-ter-link:hover .alune-ter-title {
    text-decoration: underline;
}

.alune-ter-excerpt {
    font-family: var(--alune-f);
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--alune-grey);
    margin: 0 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Date tertiaire : flux naturel, pas de décalage forcé */
.alune-ter-body .alune-date {
    margin-top: 6px !important;
    padding-top: 0 !important;
}

/* ─── Placeholder ─── */
.alune-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: #f5f5f5;
    border: 2px dashed #ccc;
    color: #999;
    font-size: 16px;
}

/* ─── Gutenberg Alignments ─── */
.alignwide .alune-wrap  { max-width: 100%; }
.alignfull .alune-wrap  { max-width: 100%; }

/* ─────────────────────────────────────────────────── */
/* RESPONSIVE                                          */
/* ─────────────────────────────────────────────────── */

/* Tablette : 1024px */
@media (max-width: 1024px) {
    .alune-wrap {
        padding: 0 24px; /* Marge de sécurité sur tablette */
    }

    .alune-a-la-une {
        gap: 28px;
    }

    .alune-feature-title {
        font-size: 21px;
    }

    .alune-tertiary {
        gap: 20px 16px;
    }
}

/* Mobile large : 820px — bascule en colonne */
@media (max-width: 820px) {
    .alune-wrap {
        padding: 0 18px; /* Marge de sécurité sur mobile large */
    }

    .alune-clean {
        margin: 32px auto;
    }

    .alune-a-la-une {
        grid-template-columns: 1fr;
        gap: 28px;
        margin-top: 16px;
        margin-bottom: 28px;
    }

    .alune-feature-title {
        font-size: 20px;
    }

    /* Side-fig : un peu plus large sur tablette */
    .alune-side-fig {
        width: 110px;
        flex: 0 0 110px;
    }

    /* Tertiaires : 2 colonnes */
    .alune-tertiary {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px 14px;
    }
}

/* Mobile : 520px */
@media (max-width: 520px) {
    .alune-wrap {
        padding: 0 14px; /* Marge de sécurité sur petit écran mobile */
    }

    .alune-feature-title {
        font-size: 19px;
    }

    /* Side-stack : image légèrement réduite sur petit écran */
    .alune-side-fig {
        width: 90px;
        flex: 0 0 90px;
    }

    /* Tertiaires : 1 colonne */
    .alune-tertiary {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}
