/* ==========================================
   BLOG - CSS dédié
   ========================================== */

/* ── Page header ── */
.blog-header {
    margin-top: 80px;
    padding: 4rem 3rem;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: white;
    text-align: center;
}

.blog-header h1 {
    font-family: 'Crimson Pro', serif;
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.blog-header p {
    font-size: 1.2rem;
    opacity: 0.85;
}

/* ── Section liste ── */
.blog-section {
    padding: 5rem 3rem;
    background: var(--bg-light);
    min-height: 60vh;
}

.blog-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ── Grille 2 colonnes ── */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
    margin-bottom: 3rem;
}

/* ── Tuile article ── */
.blog-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(13, 42, 75, 0.08);
    border: 1px solid #e8eef4;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(13, 42, 75, 0.15);
}

.blog-card-image {
    width: 100%;
    height: 220px;
    background-size: cover;
    background-position: center;
    background-color: #dbe8f4;
    position: relative;
    flex-shrink: 0;
}

/* Placeholder image quand pas de photo */
.blog-card-image-placeholder {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, #0D2A4B 0%, #1a4a7a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.blog-card-image-placeholder .placeholder-icon {
    font-size: 3.5rem;
    opacity: 0.35;
}

.blog-card-category {
    position: absolute;
    top: 14px;
    left: 14px;
    background: var(--accent);
    color: white;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 20px;
}

.blog-card-body {
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blog-card-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.blog-card-meta::before {
    content: '📅';
    font-size: 11px;
}

.blog-card-body h2 {
    font-family: 'Crimson Pro', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.3;
    margin-bottom: 0.9rem;
}

.blog-card-body p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.65;
    flex: 1;
}

.blog-card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 1.2rem;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}

.blog-card-link::after {
    content: '→';
    transition: transform 0.2s;
}

.blog-card:hover .blog-card-link::after {
    transform: translateX(4px);
}

/* ── Pagination ── */
.blog-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem 0 0;
}

.blog-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid #d0dce8;
    background: white;
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.blog-page-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.blog-page-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.blog-page-btn.disabled {
    opacity: 0.3;
    pointer-events: none;
}

.blog-page-btn.prev-next {
    width: auto;
    padding: 0 16px;
    gap: 6px;
    font-size: 13px;
}

/* ── Page article ── */
.article-header {
    margin-top: 80px;
    padding: 5rem 3rem 4rem;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: white;
}

/* Quand une image hero est définie : elle couvre le bandeau, teinte bleue par-dessus */
.article-header--img {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 420px;
    display: flex;
    align-items: flex-end;
    /* Le dégradé rgba est injecté en inline style via PHP */
}

.article-header--img .article-header-inner {
    width: 100%;
    padding-bottom: 0.5rem;
}

.article-header-inner {
    max-width: 860px;
    margin: 0 auto;
}

.article-category {
    display: inline-block;
    background: rgba(91, 184, 255, 0.25);
    color: #5BB8FF;
    border: 1px solid rgba(91, 184, 255, 0.4);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 1.5rem;
}

.article-header h1 {
    font-family: 'Crimson Pro', serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 1.2rem;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 13px;
    opacity: 0.75;
}

/* .article-hero-image — supprimé, image intégrée dans le bandeau */

.article-section {
    padding: 4rem 3rem 6rem;
    background: white;
}

.article-inner {
    max-width: 860px;
    margin: 0 auto;
}

/* Rendu Markdown simplifié */
.article-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #2a3a4a;
    overflow: hidden; /* contient les floats internes */
}

.article-content h2 {
    font-family: 'Crimson Pro', serif;
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--primary);
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e8eef4;
}

.article-content h3 {
    font-family: 'Crimson Pro', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    margin: 2rem 0 0.75rem;
}

.article-content p {
    margin-bottom: 1.2rem;
}

.article-content strong {
    color: var(--primary);
    font-weight: 700;
}

.article-content ul, .article-content ol {
    margin: 0.75rem 0 1.2rem 1.5rem;
}

.article-content li {
    margin-bottom: 0.4rem;
}

.article-content li::marker {
    color: var(--accent);
}

/* Bouton retour */
.article-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 2rem;
    transition: color 0.2s;
}

.article-back:hover { color: white; }
.article-back::before { content: '←'; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .blog-header { padding: 3rem 1.5rem; }
    .blog-header h1 { font-size: 2.2rem; }
    .blog-section { padding: 3rem 1.5rem; }

    .blog-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .blog-card-image,
    .blog-card-image-placeholder { height: 180px; }

    .article-header { padding: 3rem 1.5rem 2.5rem; }
    .article-section { padding: 2.5rem 1.5rem 4rem; }
}

/* ══════════════════════════════════════════
   MÉDIAS DANS L'ARTICLE (shortcodes)
══════════════════════════════════════════ */

/* Image pleine largeur */
.article-img { margin: 1.8rem 0; }
.article-img figure { margin: 0; }
.article-img img { max-width: 100%; border-radius: 10px; display: block; }
.article-img figcaption {
    font-size: 13px; color: #7a9ab0; text-align: center;
    margin-top: 0.5rem; font-style: italic;
}

/* Centrée */
.article-img--center { text-align: center; }
.article-img--center img { display: inline-block; max-width: 70%; }

/* Flottante droite */
.article-img--right { float: right; margin: 0 0 1.2rem 1.8rem; }
.article-img--left  { float: left;  margin: 0 1.8rem 1.2rem 0; }

/* Tailles pour images flottantes */
.article-img--right.article-img--sm,
.article-img--left.article-img--sm  { width: 28%; }
.article-img--right.article-img--md,
.article-img--left.article-img--md  { width: 42%; }
.article-img--right.article-img--lg,
.article-img--left.article-img--lg  { width: 58%; }

/* Vidéo responsive (YouTube / Vimeo) */
.video-wrap {
    position: relative; padding-bottom: 56.25%; height: 0;
    overflow: hidden; border-radius: 12px; margin: 1.8rem 0;
    background: #000;
}
.video-wrap iframe {
    position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}

/* Vidéo locale */
.video-local { margin: 1.8rem 0; }
.video-local video { width: 100%; border-radius: 12px; display: block; }

.video-caption {
    font-size: 13px; color: #7a9ab0; text-align: center;
    margin-top: 0.5rem; font-style: italic;
}

.shortcode-error { color: #e74c3c; font-size: 13px; font-style: italic; }

/* Responsive images flottantes */
@media (max-width: 640px) {
    .article-img--right, .article-img--left {
        float: none; width: 100% !important; margin: 1.2rem 0;
    }
    .article-img--center img { max-width: 100%; }
}

/* ── Comparateur avant/après ─────────────────────────────── */
.cmp-block { margin: 2rem 0; }
.cmp-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: 14px;
    cursor: col-resize;
    user-select: none;
    box-shadow: 0 6px 28px rgba(13,42,75,.13);
    background: #dde8f5;
}
.cmp-before, .cmp-after {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    display: block;
}
.cmp-after { clip-path: inset(0 0 0 50%); }
.cmp-bar {
    position: absolute;
    top: 0; bottom: 0;
    left: 50%;
    width: 3px;
    background: #fff;
    transform: translateX(-50%);
    z-index: 10;
    box-shadow: 0 0 10px rgba(0,0,0,.3);
    pointer-events: none;
}
.cmp-handle {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 40px; height: 40px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 3px 14px rgba(0,0,0,.22);
    display: flex; align-items: center; justify-content: center;
    pointer-events: none; z-index: 11;
}
.cmp-handle svg { width: 20px; height: 20px; stroke: #3B9AE1; }
.cmp-lbl {
    position: absolute;
    bottom: 12px;
    z-index: 5;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(13,42,75,.72);
    color: #a8d4f5;
    border: 1px solid rgba(91,184,255,.3);
    backdrop-filter: blur(5px);
    pointer-events: none;
    white-space: nowrap;
}
.cmp-lbl-b { right: calc(50% + 10px); }
.cmp-lbl-a { left:  calc(50% + 10px); }
.cmp-caption {
    margin-top: .6rem;
    font-size: .82rem;
    color: #7a8fa0;
    text-align: center;
    font-style: italic;
}
@media (max-width: 640px) {
    .cmp-wrap { aspect-ratio: 4/3; border-radius: 10px; }
}
