/**
 * BEYOND — styles du blog uniquement
 * -------------------------------------------------
 * Extrait de style.css pour isoler tout ce qui concerne blog.php /
 * blog-ajax.php (liste, vue article, lecteur YouTube inline). Les
 * variables globales (--blue, --pink, --violet, --text, --text-dim,
 * --hairline, --gradient, --bg, --bg-alt, --ease, --font-body...)
 * restent définies dans :root, dans style.css, et sont réutilisées
 * ici telles quelles — ce fichier ne redéfinit aucune variable, il
 * doit donc être chargé APRÈS style.css.
 *
 * Composants volontairement laissés dans style.css car partagés
 * avec d'autres pages : .page-head (actualités / portfolio / blog),
 * .filter-bar / .filter-btn (portfolio + blog), .btn-lb (bouton rond
 * fixe de base, dont .blog-scroll-top n'est qu'un habillage).
 */

/* ---------------------------------------------------------------
   Blog — une ligne par article : rail de dates, vignette, texte.
   Un filet en dégradé (repris du soulignement des liens) marque la
   ligne survolée ; la vignette reprend la lueur néon déjà utilisée
   sur le portfolio et les boutons, sans réinventer un style de carte.
   --------------------------------------------------------------- */

.blog-list {
    display: flex;
    flex-direction: column;
    transition: opacity .25s var(--ease);
}
.blog-list.is-loading { opacity: .5; pointer-events: none; }

.blog-item {
    position: relative;
    display: grid;
    grid-template-columns: 5rem 1fr;
    gap: 1.75rem;
    padding: 1.9rem 0 1.9rem 1.4rem;
    border-bottom: 1px solid var(--hairline);
    cursor: pointer;
    transition: background-color .3s var(--ease);
}
.blog-item:hover { background-color: rgba(255, 255, 255, .03); }
.blog-item::before {
    content: "";
    position: absolute;
    left: 0; top: .3rem; bottom: .3rem;
    width: 2px;
    background: var(--gradient);
    transform: scaleY(0);
    transform-origin: 50% 50%;
    transition: transform .35s var(--ease);
}
.blog-item:hover::before { transform: scaleY(1); }

.blog-item time {
    padding-top: .15rem;
    font-size: .78rem;
    color: var(--text-dim);
    letter-spacing: .02em;
    font-variant-numeric: tabular-nums;
    transition: color .25s var(--ease);
}
.blog-item:hover time { color: var(--blue); }

.blog-item-body {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    min-width: 0;
}

.blog-item-thumb {
    flex: 0 0 168px;
    width: 168px;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--hairline);
    transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.blog-item:hover .blog-item-thumb {
    border-color: rgba(255, 63, 181, .45);
    box-shadow: 0 0 24px rgba(255, 63, 181, .2);
}

.blog-item-text { flex: 1 1 auto; min-width: 0; }

.blog-item-cat {
    display: inline-block;
    font-size: .72rem;
    color: var(--pink);
    border: 1px solid rgba(255, 63, 181, .35);
    border-radius: 999px;
    padding: .15rem .65rem;
    margin-bottom: .55rem;
    letter-spacing: .02em;
}

/* Une couleur par catégorie (assignée côté PHP via blog-item-cat--N,
   toujours la même pour un même nom de catégorie), en restant dans
   la famille néon du site plutôt qu'un arc-en-ciel générique. */
.blog-item-cat--0 { color: var(--blue);   border-color: rgba(53, 212, 255, .35); }
.blog-item-cat--1 { color: var(--violet); border-color: rgba(122, 77, 255, .35); }
.blog-item-cat--2 { color: var(--pink);   border-color: rgba(255, 63, 181, .35); }
.blog-item-cat--3 { color: #35ffb0;       border-color: rgba(53, 255, 176, .35); }
.blog-item-cat--4 { color: #ffb545;       border-color: rgba(255, 181, 69, .35); }
.blog-item-cat--5 { color: #ff6a6a;       border-color: rgba(255, 106, 106, .35); }

.blog-item h2 {
    font-size: 1.15rem;
    margin: 0 0 .45rem;
}
.blog-item h2 a {
    color: var(--text);
    transition: color .25s var(--ease);
    background-image: var(--gradient);
    background-size: 0% 1px;
    background-repeat: no-repeat;
    background-position: left bottom;
    padding-bottom: 2px;
}
/* Étire la zone cliquable du lien-titre sur toute la carte (relative
   à .blog-item, qui est position:relative), pour que le clic
   n'importe où (image, extrait, date...) ouvre l'article — un seul
   <a> réel dans le DOM, donc pas de lien imbriqué. */
.blog-item h2 a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}
.blog-item:hover h2 a { color: #fff; background-size: 100% 1px; }

.blog-item-text p {
    font-size: .9rem;
    margin: 0;
    max-width: 56ch;
}

.blog-item:nth-child(1) { animation-delay: 0ms; }
.blog-item:nth-child(2) { animation-delay: 60ms; }
.blog-item:nth-child(3) { animation-delay: 120ms; }
.blog-item:nth-child(4) { animation-delay: 180ms; }
.blog-item:nth-child(5) { animation-delay: 240ms; }

.blog-empty { color: var(--text-dim); font-size: .9rem; padding: 1.5rem 0; }

.blog-load-more-wrap { display: flex; justify-content: center; margin-top: 2.5rem; }
.blog-load-more {
    font-family: var(--font-body);
    font-size: .85rem;
    color: var(--text);
    background: transparent;
    border: 1px solid var(--hairline);
    border-radius: 999px;
    padding: .75rem 1.8rem;
    cursor: pointer;
    transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.blog-load-more:hover:not(:disabled) { border-color: var(--pink); box-shadow: 0 0 18px rgba(255, 63, 181, .3); }
.blog-load-more:disabled { opacity: .5; cursor: default; }

@media (max-width: 760px) {
    .blog-item { grid-template-columns: 1fr; gap: .9rem; padding-left: 1rem; }
    .blog-item-body { flex-direction: column; gap: 1rem; }
    .blog-item-thumb { width: 100%; flex-basis: auto; aspect-ratio: 16 / 9; }
}

/* =================================================================
   Blog — vue "article complet" (inline, remplace la liste, AJAX)
   ================================================================= */
.blog-item-title-link { cursor: pointer; }

.blog-article-view[hidden] { display: none; }
.blog-article-view { max-width: 1000px; margin: 0 auto; }

.blog-back {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-family: var(--font-body);
    font-size: .82rem;
    color: var(--text-dim);
    background: transparent;
    border: 1px solid var(--hairline);
    border-radius: 999px;
    padding: .55rem 1.2rem;
    margin-bottom: 2rem;
    cursor: pointer;
    transition: color .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.blog-back:hover { color: var(--text); border-color: var(--blue); box-shadow: 0 0 16px rgba(53, 212, 255, .25); }

/* .btn-lb (bouton rond fixe : position, taille, fond, bordure) reste
   dans style.css — .blog-scroll-top n'ajoute que son placement et
   son animation d'apparition. */
.blog-scroll-top {
    bottom: 28px;
    right: 24px;
    font-size: 1.2rem;
    line-height: 1;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .25s var(--ease), visibility .25s var(--ease), transform .25s var(--ease),
        border-color .25s var(--ease), box-shadow .25s var(--ease), color .25s var(--ease);
}
.blog-scroll-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }

@media (max-width: 760px) {
    .blog-scroll-top { bottom: 16px; right: 16px; }
}

.blog-article-head { margin-bottom: 1.5rem; }
.blog-article-head h2 { font-size: 1.7rem; margin: .5rem 0 0; }
.blog-article-head time { display: block; font-size: .8rem; color: var(--text-dim); margin-top: .35rem; }

.blog-article-body { color: var(--text); }
.blog-article-body p { color: var(--text); max-width: 68ch; margin: 0 auto 1.1em; }
.blog-article-body ul, .blog-article-body ol { max-width: 68ch; margin: 0 auto 1.1em; padding-left: 1.4em; }
.blog-article-body img {
    display: block;
    max-width: min(68ch, 100%);
    height: auto;
    border-radius: 6px;
    border: 1px solid var(--hairline);
    margin: 1.2em auto;
}
.blog-article-body figure {
    max-width: min(68ch, 100%);
    margin: 1.4em auto;
}
.blog-article-body figure img { margin: 0 auto; }

/* Le flux RSS enveloppe parfois l'embed YouTube dans une <figure>
   (héritée du HTML d'origine) : on ne veut pas que la vidéo hérite
   de la largeur "colonne de texte" (68ch) prévue pour les images. */
.blog-article-body figure:has(.blog-yt) {
    max-width: 100%;
}
.blog-article-body figcaption {
    margin-top: .6em;
    font-size: .82rem;
    color: var(--text-dim);
    text-align: center;
}
.blog-article-body h2, .blog-article-body h3, .blog-article-body h4 { margin-top: 1.4em; max-width: 68ch; margin-left: auto; margin-right: auto; }
.blog-article-body a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.blog-article-body blockquote {
    max-width: 68ch;
    margin: 1.4em auto;
    padding: .2rem 1.2rem;
    border-left: 2px solid var(--pink);
    color: var(--text-dim);
}
.blog-article-body pre {
    overflow-x: auto;
    padding: 1rem;
    background: var(--bg-alt);
    border-radius: 6px;
    border: 1px solid var(--hairline);
}
.blog-article-body table { width: 100%; border-collapse: collapse; margin: 1.2em 0; }
.blog-article-body th, .blog-article-body td { border: 1px solid var(--hairline); padding: .5em .75em; text-align: left; }

.blog-article-source { margin-top: 2rem; font-size: .85rem; }
.blog-article-source a { color: var(--pink); }

/* Lecteur YouTube personnalisé — façade cliquable (miniature + bouton
   play néon), l'iframe n'est chargée qu'au clic (voir data-yt-play). */
.blog-yt {
    position: relative;
    width: 100%;
    max-width: 1000px;
    aspect-ratio: 16 / 9;
    margin: 1.4em auto;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--hairline);
    background: var(--bg-alt);
}
.blog-yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.blog-yt-facade {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}
.blog-article-body .blog-yt-thumb {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    display: block;
    margin: 0;
    border: 0;
    border-radius: 0;
    filter: brightness(.75);
    transition: filter .25s var(--ease), transform .4s var(--ease);
}
.blog-yt-facade:hover .blog-yt-thumb { filter: brightness(.55); transform: scale(1.03); }

.blog-yt-play {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 68px; height: 68px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(var(--bg), var(--bg)) padding-box, var(--gradient) border-box;
    border: 1px solid transparent;
    box-shadow: 0 0 24px rgba(255, 63, 181, .35);
    transition: box-shadow .25s var(--ease), transform .25s var(--ease);
}
.blog-yt-play svg { width: 24px; height: 24px; fill: var(--text); }
.blog-yt-facade:hover .blog-yt-play {
    box-shadow: 0 0 34px rgba(255, 63, 181, .55);
    transform: translate(-50%, -50%) scale(1.06);
}

@media (max-width: 760px) {
    .blog-yt-play { width: 52px; height: 52px; }
    .blog-yt-play svg { width: 20px; height: 20px; }
}
