/* Blog OBR Partner — vitrine premium */

.blog-premium {
    /* Aligné sur la charte du site (thèmes :root + body[data-theme]) */
    --blog-accent: var(--primary-color);
    --blog-accent-soft: var(--primary-light);
    --blog-ink: #0f172a;
    --blog-muted: #64748b;
    --blog-surface: rgba(255, 255, 255, 0.78);
    --blog-glass: rgba(255, 255, 255, 0.55);
    --blog-radius: 20px;
    --blog-shadow: 0 24px 48px rgba(15, 23, 42, 0.08);
    --blog-font-display: "Playfair Display", Georgia, serif;
    --blog-font-body: "Inter", system-ui, sans-serif;
}

/* --- Hero : fond sobre par défaut ; image optionnelle (blog.bg_image_url) --- */
.blog-hero {
    position: relative;
    min-height: clamp(280px, 42vw, 420px);
    display: flex;
    align-items: flex-end;
    padding: 0 0 4rem;
    overflow: hidden;
}

.blog-hero__bg {
    position: absolute;
    inset: 0;
    /* Dégradé fondu dans les couleurs de marque (lisible avec texte clair) */
    background: linear-gradient(
        135deg,
        var(--primary-dark) 0%,
        var(--primary-color) 48%,
        var(--primary-dark) 100%
    );
    z-index: 0;
}

@supports (color: color-mix(in srgb, red, blue)) {
    .blog-hero__bg {
        background: linear-gradient(
            135deg,
            color-mix(in srgb, var(--primary-dark) 82%, #070b12) 0%,
            color-mix(in srgb, var(--primary-color) 55%, #0f172a) 48%,
            color-mix(in srgb, var(--primary-dark) 88%, #020617) 100%
        );
    }
}

.blog-hero__bg.has-photo {
    background-size: cover;
    background-position: center;
}

.blog-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.18) 0%, rgba(15, 23, 42, 0.72) 100%);
    z-index: 1;
}

/* Sans photo : léger voile bas (même logique que le hero principal : texte en bas) */
.blog-hero__overlay--minimal {
    background: linear-gradient(0deg, rgba(15, 23, 42, 0.42) 0%, transparent 58%);
}

.blog-hero .container {
    position: relative;
    z-index: 2;
}

.blog-hero__kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: var(--blog-font-body);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.95);
    margin-bottom: 0.85rem;
}

.blog-hero__kicker::before {
    content: "";
    width: 28px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--primary-light), rgba(248, 250, 252, 0.55));
}

.blog-hero h1 {
    font-family: var(--blog-font-display);
    font-size: clamp(2.1rem, 4.5vw, 3.25rem);
    font-weight: 700;
    line-height: 1.12;
    color: #f8fafc;
    letter-spacing: -0.02em;
    max-width: 18ch;
    margin: 0 0 1rem;
    text-shadow: 0 2px 28px rgba(0, 0, 0, 0.25);
}

.blog-hero__lead {
    font-family: var(--blog-font-body);
    font-size: clamp(1rem, 1.35vw, 1.12rem);
    line-height: 1.65;
    color: rgba(226, 232, 240, 0.92);
    max-width: 38rem;
    margin: 0;
}

/* --- Barre recherche & filtres --- */
.blog-toolbar {
    margin-top: -2.5rem;
    position: relative;
    z-index: 3;
    padding-bottom: 2.5rem;
}

.blog-toolbar__inner {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .blog-toolbar__inner {
        grid-template-columns: 1fr auto;
        align-items: center;
    }
}

.blog-search {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 1rem;
    border-radius: 14px;
    background: var(--blog-surface);
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: var(--blog-shadow);
    backdrop-filter: blur(14px);
}

.blog-search svg {
    flex-shrink: 0;
    opacity: 0.45;
}

.blog-search input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: var(--blog-font-body);
    font-size: 0.95rem;
    color: var(--blog-ink);
    outline: none;
}

.blog-search input::placeholder {
    color: #94a3b8;
}

.blog-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: flex-start;
}

.blog-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(255, 255, 255, 0.9);
    color: #334155;
    transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.blog-pill:hover {
    transform: translateY(-1px);
    border-color: rgba(59, 130, 246, 0.45);
    color: var(--blog-accent);
}

.blog-pill.is-active {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.2);
}

/* --- Grille articles --- */
.blog-section {
    padding: 0 0 5rem;
    background: linear-gradient(180deg, #f1f5f9 0%, #f8fafc 35%, #ffffff 100%);
}

.blog-featured {
    margin-bottom: 3rem;
}

.blog-featured__title {
    font-family: var(--blog-font-display);
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--blog-ink);
    margin: 0 0 1.25rem;
    letter-spacing: -0.02em;
}

.blog-grid {
    display: grid;
    gap: 1.75rem;
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1100px) {
    .blog-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.blog-grid--featured {
    grid-template-columns: 1fr;
}

@media (min-width: 900px) {
    .blog-grid--featured {
        grid-template-columns: repeat(3, 1fr);
    }
}

.blog-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--blog-radius);
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 4px 6px rgba(15, 23, 42, 0.04), 0 18px 36px rgba(15, 23, 42, 0.06);
    text-decoration: none;
    color: inherit;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(30, 64, 175, 0.12), 0 24px 48px rgba(15, 23, 42, 0.08);
}

.blog-card__media {
    position: relative;
    aspect-ratio: 16 / 10;
    background:
        linear-gradient(135deg, #e0e7ff 0%, #dbeafe 50%, #eff6ff 100%);
}

.blog-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-card__media--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--blog-font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: rgba(30, 64, 175, 0.15);
}

.blog-card__body {
    padding: 1.25rem 1.35rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.65rem;
}

.blog-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--blog-muted);
}

.blog-card__meta .dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #cbd5e1;
}

.blog-card__cat {
    color: var(--blog-accent);
}

.blog-card h2 {
    font-family: var(--blog-font-display);
    font-size: 1.22rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    color: var(--blog-ink);
    letter-spacing: -0.02em;
}

.blog-card__excerpt {
    font-size: 0.9rem;
    line-height: 1.55;
    color: #475569;
    margin: 0;
    flex: 1;
}

.blog-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.35rem;
    padding-top: 0.85rem;
    border-top: 1px solid #f1f5f9;
}

.blog-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.blog-card__tag {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
    background: #f1f5f9;
    color: #475569;
}

.blog-read-more {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--blog-accent);
    white-space: nowrap;
}

/* Pagination */
.blog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.blog-pagination a,
.blog-pagination span {
    min-width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
}

.blog-pagination a {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #334155;
}

.blog-pagination a:hover {
    border-color: #93c5fd;
    color: var(--blog-accent);
}

.blog-pagination .current {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    color: #fff;
    border: none;
}

.blog-empty {
    text-align: center;
    padding: 4rem 1.5rem;
    border-radius: var(--blog-radius);
    background: #fff;
    border: 1px dashed #cbd5e1;
    color: #64748b;
}

/* --- Article --- */
.blog-article-wrap {
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 45%);
    padding-bottom: 5rem;
}

.blog-article-hero {
    padding: 2.5rem 0 2rem;
}

.blog-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 1.25rem;
}

.blog-breadcrumb a {
    color: var(--blog-accent);
    text-decoration: none;
}

.blog-breadcrumb a:hover {
    text-decoration: underline;
}

.blog-article-hero h1 {
    font-family: var(--blog-font-display);
    font-size: clamp(1.85rem, 4vw, 2.85rem);
    font-weight: 700;
    line-height: 1.15;
    color: var(--blog-ink);
    letter-spacing: -0.025em;
    margin: 0 0 1rem;
    max-width: min(38rem, 100%);
}

.blog-article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    font-size: 0.88rem;
    color: #64748b;
    font-weight: 500;
}

.blog-article-meta a {
    color: var(--blog-accent);
    text-decoration: none;
    font-weight: 600;
}

.blog-article-cover {
    border-radius: calc(var(--blog-radius) + 4px);
    overflow: hidden;
    margin: 0 0 2.5rem;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(226, 232, 240, 0.9);
}

.blog-article-cover img {
    width: 100%;
    display: block;
    max-height: min(520px, 70vh);
    object-fit: cover;
}

.blog-article-layout {
    display: grid;
    gap: 2.5rem;
    /* minmax(0,1fr) évite que le contenu (SVG, flex…) impose une largeur min énorme */
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
}

@media (min-width: 1024px) {
    .blog-article-layout {
        grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
    }
}

.blog-article-content {
    min-width: 0;
    max-width: 100%;
    background: #fff;
    border-radius: var(--blog-radius);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    border: 1px solid #e8eef7;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.04);
}

/* Typographie contenu éditorial */
.blog-prose {
    font-family: var(--blog-font-body);
    font-size: 1.05rem;
    line-height: 1.75;
    color: #334155;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* SVG / médias collés depuis l’éditeur : ne pas dépasser la colonne */
.blog-prose svg {
    max-width: 100%;
    height: auto;
    display: inline-block;
    vertical-align: middle;
}

.blog-prose video,
.blog-prose iframe {
    max-width: 100%;
}

.blog-prose > *:first-child {
    margin-top: 0;
}

.blog-prose h2,
.blog-prose h3,
.blog-prose h4 {
    font-family: var(--blog-font-display);
    color: var(--blog-ink);
    margin: 2rem 0 0.75rem;
    line-height: 1.25;
}

.blog-prose h2 { font-size: 1.65rem; }
.blog-prose h3 { font-size: 1.35rem; }
.blog-prose h4 { font-size: 1.15rem; }

.blog-prose p {
    margin: 0 0 1.1rem;
}

.blog-prose ul,
.blog-prose ol {
    margin: 0 0 1.1rem 1.25rem;
    padding: 0;
}

.blog-prose li {
    margin-bottom: 0.35rem;
}

.blog-prose blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--blog-accent-soft);
    background: linear-gradient(90deg, #eff6ff, transparent);
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: #475569;
}

.blog-prose .blog-source-attribution {
    margin-top: 2.25rem;
    padding: 1rem 1.15rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f1f5f9;
    font-size: 0.95rem;
    color: #475569;
}

.blog-prose .blog-source-attribution p {
    margin: 0;
}

.blog-prose .blog-source-attribution a {
    font-weight: 600;
}

.blog-prose a {
    color: var(--blog-accent);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.blog-prose img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 1.25rem 0;
}

.blog-prose pre {
    overflow: auto;
    padding: 1rem;
    border-radius: 12px;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 0.88rem;
}

.blog-prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
    font-size: 0.92rem;
}

.blog-prose th,
.blog-prose td {
    border: 1px solid #e2e8f0;
    padding: 0.5rem 0.65rem;
}

.blog-prose th {
    background: #f8fafc;
    font-weight: 700;
}

.blog-aside {
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.blog-aside-card {
    border-radius: 16px;
    padding: 1.25rem;
    background: #fff;
    border: 1px solid #e8eef7;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.blog-aside-card h3 {
    font-family: var(--blog-font-display);
    font-size: 1.05rem;
    margin: 0 0 0.85rem;
    color: var(--blog-ink);
}

.blog-aside-card .tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.blog-aside-card .tag-list a {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.28rem 0.55rem;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    text-decoration: none;
}

.blog-aside-card .tag-list a:hover {
    background: #dbeafe;
    color: var(--blog-accent);
}

.blog-share-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.blog-share-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.blog-share-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0;
    border-radius: 12px;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #334155;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.15s ease;
    box-sizing: border-box;
}

.blog-premium .blog-aside .blog-share-btn svg {
    flex-shrink: 0;
    width: 1.35rem;
    height: 1.35rem;
    max-width: 1.35rem;
    max-height: 1.35rem;
    display: block;
}

.blog-share-btn:hover {
    transform: translateY(-1px);
}

.blog-share-btn--linkedin:hover {
    background: #e8f1fc;
    border-color: #0a66c2;
    color: #0a66c2;
}

.blog-share-btn--whatsapp:hover {
    background: #e8f8ef;
    border-color: #25d366;
    color: #128c4b;
}

.blog-share-btn--facebook:hover {
    background: #eef4ff;
    border-color: #1877f2;
    color: #1877f2;
}

.blog-share-btn--copy {
    cursor: pointer;
    font-family: inherit;
}

.blog-share-btn--copy:hover {
    background: #eef2ff;
    border-color: #a5b4fc;
    color: #3730a3;
}

.blog-share-btn--copy.is-done {
    background: #ecfdf5;
    border-color: #6ee7b7;
    color: #047857;
}

.blog-404 {
    text-align: center;
    padding: 5rem 1rem;
}

.blog-404 h1 {
    font-family: var(--blog-font-display);
    font-size: 2rem;
    color: var(--blog-ink);
}
