/* --- CSS BLOG (listing /blog + article /blog/{slug}) --- */

:root {
    --blog-card-bg: rgba(30, 30, 30, 0.45);
    --blog-card-border: rgba(255, 255, 255, 0.07);
    --blog-accent: #b39ddb;
    --blog-accent-soft: #ffd700;
}

/* === Header listing === */
.blog-listing .blog-header h1 {
    background: linear-gradient(135deg, var(--blog-accent), var(--blog-accent-soft));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* === Cards === */
.blog-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: var(--blog-card-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 14px;
    border: 1px solid var(--blog-card-border);
    overflow: hidden;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.blog-card:hover {
    transform: translateY(-4px);
    border-color: rgba(179, 157, 219, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    color: inherit;
}

.blog-card-cover {
    height: 180px;
    background: linear-gradient(135deg, #2d1b4e, #4a2c6f 50%, #1a0f2e);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 215, 0, 0.55);
    font-size: 3rem;
    border-bottom: 1px solid var(--blog-card-border);
    overflow: hidden;
    position: relative;
}

.blog-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.blog-card:hover .blog-card-cover img {
    transform: scale(1.04);
}

.blog-card-cover-sm {
    height: 130px;
    font-size: 2.2rem;
}

.blog-card-body {
    padding: 18px 20px 22px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-card-date {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 8px;
}

.blog-card-title {
    font-family: 'Cinzel', serif;
    color: #fff;
    margin-bottom: 10px;
    line-height: 1.35;
}

.blog-card-excerpt {
    font-size: 0.92rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.72);
    margin-bottom: 14px;
    flex-grow: 1;
}

.blog-card-cta {
    font-size: 0.85rem;
    color: var(--blog-accent);
    font-weight: 600;
    align-self: flex-start;
}

/* === Pagination === */
.blog-pagination .page-link {
    background: rgba(30, 30, 30, 0.45);
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--blog-card-border);
}

.blog-pagination .page-item.active .page-link {
    background: var(--blog-accent);
    color: #1a0f2e;
    border-color: var(--blog-accent);
}

.blog-pagination .page-link:hover {
    background: rgba(179, 157, 219, 0.2);
    color: #fff;
}

/* === Empty state === */
.blog-empty {
    color: rgba(255, 255, 255, 0.6);
}

/* === Article === */
.blog-article {
    max-width: 760px;
    background-color: rgba(20, 20, 20, 0.4);
    border: 1px solid var(--blog-card-border);
    border-radius: 16px;
    padding: 40px 32px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Bande breadcrumb de la page article : attachée visuellement à la navbar.
   Le séparateur (border-bottom) passe sous le breadcrumb au lieu d'au-dessus
   comme le ferait .seo-breadcrumb par défaut (qui est conçu pour pied de contenu). */
.blog-article-topband {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.25rem 0 0.5rem;
}

.blog-article-topband .seo-breadcrumb {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    margin-bottom: 0;
    opacity: 0.85;
}

/* Hero attachée visuellement à l'article : ratio cinématique 21/9 (~326px sur 760)
   au lieu du natif 1536x1024 qui fait ~500px et pousse trop le contenu. Crop via
   object-fit:cover — le prompt demande un focal-point centré ou en tiers inférieur. */
.blog-article-hero {
    max-width: 760px;
    margin: 0 auto;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    border: 1px solid var(--blog-card-border);
    border-bottom: none;
    aspect-ratio: 21 / 9;
    background: linear-gradient(135deg, #2d1b4e, #4a2c6f 50%, #1a0f2e);
    position: relative;
}

.blog-article-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Fade doux du bas de l'image vers le fond de l'article — masque la couture
   entre hero et article tout en gardant un effet immersif. */
.blog-article-hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 60px;
    background: linear-gradient(to bottom, rgba(20, 20, 20, 0), rgba(20, 20, 20, 0.4));
    pointer-events: none;
}

/* Quand une hero est présente, l'article perd son border-top et ses coins
   supérieurs : il se prolonge visuellement sous l'image. */
.blog-article.has-hero {
    border-top: none;
    border-radius: 0 0 16px 16px;
}

@media (max-width: 576px) {
    .blog-article-hero {
        aspect-ratio: 16 / 9;
    }
}

.blog-article-meta {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

.blog-article-meta .blog-meta-sep {
    color: rgba(255, 255, 255, 0.25);
    margin: 0 0.25rem;
}

.blog-article-meta .blog-article-author {
    color: var(--blog-accent);
    border-bottom: 1px dotted rgba(179, 157, 219, 0.4);
    transition: color 0.2s ease;
}

.blog-article-meta .blog-article-author:hover {
    color: var(--blog-accent-soft);
    border-bottom-color: var(--blog-accent-soft);
}

.blog-article-header h1 {
    background: linear-gradient(135deg, var(--blog-accent), var(--blog-accent-soft));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.blog-article-header .lead {
    font-size: 1.1rem;
    line-height: 1.6;
}

.blog-article-body {
    color: rgba(255, 255, 255, 0.88);
    font-size: 1.05rem;
    line-height: 1.75;
}

.blog-article-body h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.55rem;
    margin: 2.2rem 0 1rem;
    color: #fff;
    border-left: 3px solid var(--blog-accent);
    padding-left: 14px;
}

.blog-article-body h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    margin: 1.8rem 0 0.8rem;
    color: rgba(255, 215, 0, 0.85);
}

.blog-article-body p {
    margin-bottom: 1.1rem;
}

.blog-article-body ul {
    margin: 1rem 0 1.5rem 0.5rem;
    padding-left: 1.2rem;
}

.blog-article-body ul li {
    margin-bottom: 0.55rem;
}

.blog-article-body strong {
    color: #fff;
    font-weight: 700;
}

.blog-article-body a {
    color: var(--blog-accent);
    border-bottom: 1px dotted rgba(179, 157, 219, 0.4);
    transition: all 0.2s ease;
}

.blog-article-body a:hover {
    color: var(--blog-accent-soft);
    border-bottom-color: var(--blog-accent-soft);
}

/* Premier élément du corps : pas de top-margin (le header au-dessus gère l'espace).
   Sélecteurs explicites par tag pour battre la spécificité de .blog-article-body h2. */
.blog-article-body > h2:first-child,
.blog-article-body > h3:first-child,
.blog-article-body > p:first-child,
.blog-article-body > ul:first-child {
    margin-top: 0;
}

.blog-article-footer {
    border-top: 1px solid var(--blog-card-border);
    color: rgba(255, 255, 255, 0.6);
}

.blog-article-footer a {
    color: var(--blog-accent);
}

/* === Bloc « L'essentiel en 30 secondes » (TLDR/GEO) ===
   Affiché en haut de l'article, sous le header. Style "fact panel" :
   fond glass, bordure dorée gauche pour signaler l'importance, padding généreux. */
.blog-article-keyfacts {
    background: rgba(20, 20, 20, 0.55);
    border: 1px solid var(--blog-card-border);
    border-left: 3px solid var(--blog-accent-soft);
    border-radius: 12px;
    padding: 22px 28px;
    margin: 0 0 36px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.blog-article-keyfacts .kf-title {
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--blog-accent-soft);
    margin: 0 0 12px;
}

.blog-article-keyfacts .kf-summary {
    color: rgba(255, 255, 255, 0.92);
    font-size: 1.02rem;
    line-height: 1.6;
    margin: 0 0 18px;
}

.blog-article-keyfacts .kf-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px 24px;
}

.blog-article-keyfacts .kf-list li {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 0;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.blog-article-keyfacts .kf-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 600;
}

.blog-article-keyfacts .kf-value {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.4;
}

/* === Section "Voir aussi" === */
.blog-related h2 {
    font-family: 'Cinzel', serif;
    color: #fff;
}

/* === Aperçu admin (édition article) ===
   Container pleine largeur, scroll interne, pas d'effet visuel particulier.
   Le titre + excerpt sont stylés inline pour éviter tout conflit de spécificité. */
#blogPreviewPane {
    background: rgba(0, 0, 0, 0.25);
    padding: 18px;
    border-radius: 8px;
    max-height: 78vh;
    overflow-y: auto;
}

/* Body du preview : typo plus compacte que le front (sidebar étroite) */
#blogPreviewBody {
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.96rem;
    line-height: 1.65;
}

#blogPreviewBody > *:first-child { margin-top: 0; }

#blogPreviewBody h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.15rem;
    color: #fff;
    border-left: 3px solid var(--blog-accent);
    padding-left: 12px;
    margin: 1.4rem 0 0.7rem;
}

#blogPreviewBody h3 {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    color: rgba(255, 215, 0, 0.85);
    margin: 1.1rem 0 0.5rem;
}

#blogPreviewBody p { margin-bottom: 0.85rem; }

#blogPreviewBody ul {
    margin: 0.6rem 0 1rem 0.5rem;
    padding-left: 1.1rem;
}

#blogPreviewBody ul li { margin-bottom: 0.4rem; }

#blogPreviewBody strong { color: #fff; font-weight: 700; }

#blogPreviewBody a {
    color: var(--blog-accent);
    border-bottom: 1px dotted rgba(179, 157, 219, 0.4);
}

/* Responsive */
@media (max-width: 575px) {
    .blog-article {
        padding: 28px 18px;
    }
    .blog-article-body {
        font-size: 1rem;
    }
    .blog-article-body h2 {
        font-size: 1.3rem;
    }
}
