/* ==================================================
   LE BLOG — liste, carte d'article, article

   Un hero turquoise, une barre de filtres, une grille
   de trois, et pour l'article une colonne latérale
   collante. Reprise de la maquette.
================================================== */

/* --------------------------------------------------
   HERO DU BLOG ET DE L'ARTICLE
-------------------------------------------------- */

/* Ces deux hero ouvrent leur page : ils doivent donc absorber le
   débordement du logo, comme le fait le hero de la maquette. La variable
   vient de header.css, où les paliers de taille du logo sont définis. */
.blog-hero,
.article-hero {
    padding-top: calc(var(--v-logo-debord) + 24px);
    background: var(--v-fond-hero);
    color: var(--v-blanc);
}

.blog-hero .v-titre,
.article-hero .v-titre,
.blog-hero .v-chapo {
    color: var(--v-blanc);
}

.blog-hero .v-eyebrow { color: var(--v-jaune-500); }

.blog-hero__texte,
.article-hero__texte {
    max-width: 720px;
}

.blog-hero .v-chapo { margin-top: 12px; }

/* Le visuel de l'article se pose à droite du titre, et déborde vers le
   bas comme dans la maquette. */
.article-hero > .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 48px;
}

.article-hero__visuel {
    flex: 0 0 380px;
    max-width: 380px;
    border-radius: var(--v-radius-lg);
    overflow: hidden;
}

.article-hero__visuel img {
    display: block;
    width: 100%;
    height: auto;
}

/* align-self : la pastille est dans un conteneur flex en colonne, où
   « stretch » l'étirerait sur toute la largeur de la carte. */
.article-hero__cat,
.v-carte-article__cat {
    display: inline-block;
    align-self: flex-start;
    margin-bottom: 12px;
    padding: 4px 11px;
    border-radius: var(--v-radius-pill);
    background: var(--cat, var(--v-violet-500));
    font-family: var(--v-font-corps);
    font-size: 0.5625rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cat-texte, var(--v-blanc));
    text-decoration: none;
}

.article-hero__meta,
.v-carte-article__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 0;
    font-family: var(--v-font-corps);
    font-size: 0.75rem;
}

.article-hero__meta { color: var(--v-blanc); }

.article-hero__avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

/* --------------------------------------------------
   FILTRES
-------------------------------------------------- */

.blog-filtres {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 32px;
    padding: 12px 16px;
    background: var(--v-fond-carte);
    border: 1px solid var(--v-bordure);
    border-radius: var(--v-radius-lg);
}

.blog-recherche {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 240px;
    min-width: 0;
}

.blog-recherche i { color: var(--v-gris-400); }

.blog-recherche input[type="search"] {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    background: transparent;
    font-family: var(--v-font-corps);
    font-size: 0.8125rem;
    color: var(--v-texte-corps);
}

.blog-recherche input:focus { outline: none; }

.blog-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.blog-chip {
    display: inline-block;
    padding: 7px 15px;
    border-radius: var(--v-radius-pill);
    background: var(--v-fond-page);
    font-family: var(--v-font-corps);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--v-texte-corps);
    text-decoration: none;
}

.blog-chip.est-actif,
.blog-chip:hover {
    background: var(--v-violet-700);
    color: var(--v-blanc);
}

.blog-compte {
    margin: 28px 0 14px;
    font-family: var(--v-font-corps);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--v-texte-meta);
}

/* --------------------------------------------------
   GRILLE ET CARTES
-------------------------------------------------- */

.blog-grille {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.v-carte-article {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--v-fond-carte);
    border: 1px solid var(--v-bordure);
    border-radius: var(--v-radius-lg);
}

/* Le format du visuel est tenu par un rembourrage en pourcentage, et non
   par aspect-ratio : le ratio du parent et le « height: 100% » de l'image
   dépendent alors l'un de l'autre, et le navigateur tranche en donnant à
   la boîte une hauteur qui n'a rien à voir — 1500 px pour 265 attendus,
   mesuré sur la liste. Le rembourrage, lui, ne dépend que de la largeur. */
.v-carte-article__visuel {
    display: block;
    position: relative;
    padding-top: 62.5%; /* 16 / 10 */
    overflow: hidden;
    background: var(--v-turquoise-100);
}

.v-carte-article__visuel img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.v-carte-article__corps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px;
}

.v-carte-article__titre {
    margin: 0;
    font-family: var(--v-font-titre);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--v-texte-titre);
}

.v-carte-article__titre a { color: inherit; text-decoration: none; }
.v-carte-article__titre a:hover { text-decoration: underline; }

.v-carte-article__chapo {
    margin: 0;
    font-family: var(--v-font-corps);
    font-size: 0.8125rem;
    line-height: 1.55;
    color: var(--v-texte-meta);
}

.v-carte-article__meta {
    margin-top: auto;
    padding-top: 10px;
    color: var(--v-texte-meta);
}

.v-carte-article__auteur { color: var(--v-action-cta); font-weight: 600; }

.v-carte-article__lire a {
    font-family: var(--v-font-corps);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--v-action-cta);
    text-decoration: none;
}

/* La carte « à la une » passe en deux colonnes : visuel à gauche. */
.v-carte-article--une {
    flex-direction: row;
    margin-bottom: 8px;
}

/* En « à la une », le visuel n'a plus de format imposé : il occupe la
   hauteur de la carte, que le texte détermine. */
.v-carte-article--une .v-carte-article__visuel {
    flex: 0 0 46%;
    padding-top: 0;
    align-self: stretch;
    min-height: 260px;
}

.v-carte-article--une .v-carte-article__corps {
    flex: 1 1 auto;
    justify-content: center;
    padding: 28px;
}

.v-carte-article--une .v-carte-article__titre { font-size: 1.375rem; }

/* --------------------------------------------------
   PAGINATION
-------------------------------------------------- */

.blog-liste .page-numbers {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 36px 0 0;
    padding: 0;
}

.blog-liste .page-numbers a,
.blog-liste .page-numbers span {
    display: inline-block;
    min-width: 36px;
    padding: 8px 12px;
    border: 1px solid var(--v-bordure);
    border-radius: var(--v-radius-pill);
    font-family: var(--v-font-corps);
    font-size: 0.8125rem;
    color: var(--v-texte-corps);
    text-align: center;
    text-decoration: none;
}

.blog-liste .page-numbers .current {
    background: var(--v-violet-700);
    border-color: var(--v-violet-700);
    color: var(--v-blanc);
}

.blog-vide {
    font-family: var(--v-font-corps);
    color: var(--v-texte-meta);
}

/* --------------------------------------------------
   CORPS DE L'ARTICLE
-------------------------------------------------- */

.article-corps__grille {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 48px;
    align-items: start;
}

/* Un article composé au builder rend des blocs entiers — section, fond,
   conteneur. Dans la colonne d'un article ils sont déjà dans le conteneur
   de la page : on neutralise le second, sinon la largeur se réduit une
   fois de trop et les marges s'additionnent. */
.article-corps__texte > .v-bloc {
    padding-left: 0;
    padding-right: 0;
}

.article-corps__texte > .v-bloc:first-child { padding-top: 0; }
.article-corps__texte > .v-bloc:last-child { padding-bottom: 0; }

.article-corps__texte .v-bloc > .container {
    width: 100%;
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}

/* Le texte repris de l'ancien site n'a aucune classe : c'est le
   conteneur qui doit le mettre en forme, balise par balise. */
.v-prose {
    font-family: var(--v-font-corps);
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--v-texte-corps);
}

.v-prose > *:first-child { margin-top: 0; }

.v-prose h2 {
    margin: 36px 0 12px;
    font-family: var(--v-font-titre);
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--v-texte-titre);
}

.v-prose h3 {
    margin: 28px 0 10px;
    font-family: var(--v-font-titre);
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--v-texte-titre);
}

.v-prose p { margin: 0 0 16px; }

/* Les boutons sont exclus : `.v-prose a` est plus spécifique que la
   classe `.v-bouton--primaire`, et lui volait sa couleur de texte — on
   obtenait de l'orange sur du violet. Un bouton porte déjà la sienne. */
.v-prose a:not([class*="v-bouton"]) { color: var(--v-action-cta); }

.v-prose ul,
.v-prose ol { margin: 0 0 16px; padding-left: 22px; }

.v-prose li { margin-bottom: 6px; }

.v-prose blockquote {
    margin: 24px 0;
    padding: 18px 22px;
    background: var(--v-turquoise-100);
    border-radius: var(--v-radius-md);
    font-style: italic;
}

.v-prose blockquote p:last-child { margin-bottom: 0; }

/* Les images des articles repris ont perdu leurs dimensions figées et
   leur habillage au nettoyage : elles se posent toutes de la même façon,
   ce qui est le but — une mise en page qui ne dépend plus de ce que
   l'ancien éditeur avait mis dans chaque article. */
.v-prose img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 20px 0;
    border-radius: var(--v-radius-md);
}

/* Le bouton qui remplace les formulaires de l'ancien site. */
.v-prose__cta {
    margin: 24px 0;
    text-align: center;
}

.v-prose table {
    width: 100%;
    margin-bottom: 16px;
    border-collapse: collapse;
}

.v-prose th,
.v-prose td {
    padding: 8px 10px;
    border: 1px solid var(--v-bordure);
    text-align: left;
}

/* --------------------------------------------------
   COLONNE LATÉRALE
-------------------------------------------------- */

.article-corps__colonne {
    position: sticky;
    top: 110px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.article-encart {
    padding: 16px 18px;
    background: var(--v-fond-carte);
    border: 1px solid var(--v-bordure);
    border-radius: var(--v-radius-lg);
    font-family: var(--v-font-corps);
    font-size: 0.8125rem;
}

.article-encart .v-eyebrow { margin-bottom: 8px; }

.article-sommaire ol {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.article-sommaire a {
    color: var(--v-texte-corps);
    text-decoration: none;
}

.article-sommaire a:hover { text-decoration: underline; }

.article-auteur__ligne {
    display: flex;
    align-items: center;
    gap: 12px;
}

.article-auteur__ligne img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.article-auteur__nom {
    margin: 0;
    font-weight: 600;
    color: var(--v-texte-titre);
}

.article-auteur__fonction,
.article-formation__accroche {
    margin: 2px 0 0;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--v-texte-meta);
}

.article-auteur__lien {
    margin: 10px 0 0;
}

.article-auteur__lien a {
    font-weight: 600;
    color: var(--v-action-cta);
    text-decoration: none;
}

.article-partage ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Le bouton « Copier le lien » se présente comme les deux autres : c'est
   la même rangée, la même action pour le lecteur. */
.article-partage a,
.article-partage__copie {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--v-bordure);
    border-radius: var(--v-radius-pill);
    font-family: var(--v-font-corps);
    font-size: 0.75rem;
    color: var(--v-texte-corps);
    text-decoration: none;
    cursor: pointer;
}

.article-partage a:hover,
.article-partage__copie:hover {
    background: var(--v-violet-700);
    border-color: var(--v-violet-700);
    color: var(--v-blanc);
}

/* Confirmation de la copie, en turquoise comme tout ce qui est acquis. */
.article-partage__copie.est-copie {
    background: var(--v-succes-fond);
    border-color: var(--v-turquoise-500);
    color: var(--v-succes-texte);
}

.article-formation {
    background: var(--v-turquoise-100);
    border-color: var(--v-turquoise-500);
}

.article-formation__titre {
    margin: 0 0 6px;
    font-family: var(--v-font-titre);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--v-texte-titre);
}

.article-formation .v-bouton { margin-top: 12px; }

.article-lies { background: var(--v-fond-page); }

/* --------------------------------------------------
   ADAPTATIONS
-------------------------------------------------- */

@media (max-width: 1199px) {
    .article-corps__grille { grid-template-columns: minmax(0, 1fr); gap: 32px; }

    /* Sans deuxième colonne, la colonne collante n'a plus lieu d'être. */
    .article-corps__colonne { position: static; }
}

@media (max-width: 991px) {
    .blog-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .article-hero > .container { flex-direction: column; align-items: flex-start; }
    .article-hero__visuel { flex: 1 1 auto; max-width: 100%; width: 100%; }
}

@media (max-width: 767px) {
    .blog-grille { grid-template-columns: minmax(0, 1fr); }

    .v-carte-article--une { flex-direction: column; }
    .v-carte-article--une .v-carte-article__visuel { flex: 1 1 auto; padding-top: 62.5%; min-height: 0; }
    .v-carte-article--une .v-carte-article__corps { padding: 18px; }
}
