/**
 * Blog Home V5 - Osmova
 * Design magazine avec sections par pôle et animations cinétiques
 *
 * Couleurs définies dynamiquement via CSS custom properties depuis PHP
 * --pole-1: Dev (bleu), --pole-2: Design (jaune), --pole-3: Marketing (vert)
 */

/* ─── VARIABLES ─── */
.osmova-blog-home {
    --bh-dark: #111010;
    --bh-mid: #6b6b6b;
    --bh-border: #e4e4e0;
    --bh-bg: #ffffff;
    --bh-white: #ffffff;
    --bh-radius: 12px;
    width: 100%;
    overflow-x: hidden;
}

/* ─── FILTER BAR ─── */
.bh-filter-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 16px 20px;
    background: var(--bh-white);
    border-bottom: 1px solid var(--bh-border);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(14px);
    background: rgba(255, 255, 255, 0.96);
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.bh-filter-btn {
    font-size: 12px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 100px;
    border: none;
    background: none;
    color: var(--bh-mid);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.bh-filter-btn:hover {
    background: var(--bh-bg);
    color: var(--bh-dark);
}

.bh-filter-btn.active {
    background: var(--bh-dark);
    color: #fff;
}

.bh-filter-btn.active-pole {
    color: #fff;
    background: var(--btn-active-bg);
}

.bh-filter-pip {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.bh-filter-live {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #6b6b6b;
    flex-shrink: 0;
    white-space: nowrap;
}

/* ─── MASTHEAD CINÉTIQUE ─── */
.bh-masthead {
    background: var(--bh-dark);
    margin-top: 2vh;
    padding: 52px 40px 44px;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid #222;
    border-radius: 12px;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

/* Grain texture overlay */
.bh-masthead::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    opacity: 0.04;
    pointer-events: none;
}

.bh-masthead-inner {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
}

.bh-mast-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 32px;
}

.bh-mast-kicker {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.25);
}

.bh-mast-date {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.2);
}

/* Kinetic title */
.bh-mast-headline {
    font-size: clamp(48px, 8vw, 96px);
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: -0.05em;
    color: #fff;
    margin-bottom: 0;
}

.bh-mast-headline .bh-static {
    display: block;
}

.bh-mast-headline .bh-cycle-wrap {
    display: block;
    height: 1.05em;
    overflow: hidden;
    position: relative;
}

.bh-cycle-word {
    display: block;
    position: absolute;
    left: 0;
    bottom: 0;
    transform: translateY(110%);
    transition: transform 0s;
    font-style: italic;
    font-weight: 800;
    will-change: transform;
}

.bh-cycle-word.enter {
    transform: translateY(0);
    transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.bh-cycle-word.exit {
    transform: translateY(-110%);
    transition: transform 0.55s cubic-bezier(0.7, 0, 0.84, 0);
}

.bh-mast-bottom {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-top: 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding-top: 24px;
}

.bh-mast-desc {
    font-size: 14px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.35);
    max-width: 380px;
}

.bh-mast-desc strong {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

/* 3-pole pills */
.bh-mast-poles {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.bh-pole-pill {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 7px 14px;
    border-radius: 100px;
    border: 1.5px solid;
}

/* Background blurred shapes */
.bh-mast-bg-shape {
    position: absolute;
    z-index: 0;
    pointer-events: none;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.12;
}

.bh-shape-1 {
    width: 400px;
    height: 400px;
    top: -100px;
    right: 5%;
}

.bh-shape-2 {
    width: 300px;
    height: 300px;
    bottom: -80px;
    right: 30%;
}

.bh-shape-3 {
    width: 250px;
    height: 250px;
    top: -60px;
    right: 45%;
}

/* ─── PAGE BODY ─── */
.bh-page-body {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 40px 80px;
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
}

/* ─── HERO CARD ─── */
.bh-hero-card {
    background: var(--bh-dark);
    border-radius: var(--bh-radius);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 20px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.04);
    text-decoration: none;
    color: inherit;
}

.bh-hero-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.bh-hero-card:hover .bh-hc-img img {
    transform: scale(1.06);
}

.bh-hc-body {
    padding: 36px 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.bh-hc-pole {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.bh-hc-pole .bh-pip {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.bh-hc-title {
    font-size: clamp(18px, 2vw, 28px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.04em;
    color: #fff;
    margin-bottom: 14px;
}

.bh-hc-excerpt {
    font-size: 13px;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 28px;
}

.bh-hc-footer {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bh-hc-meta {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.65);
}

.bh-hc-btn {
    margin-left: auto;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s;
    display: inline-block;
}

.bh-hc-btn:hover {
    opacity: 0.8;
}

.bh-hc-img {
    overflow: hidden;
    position: relative;
}

.bh-hc-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.bh-hc-img-num {
    position: absolute;
    bottom: -10px;
    right: 6px;
    font-size: 130px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.06em;
    font-style: italic;
    color: rgba(255, 255, 255, 0.07);
    pointer-events: none;
}

/* ─── SECTION HEADER ─── */
.bh-sec-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 0 2px;
}

.bh-sec-pip {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.bh-sec-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.bh-sec-line {
    flex: 1;
    height: 1px;
    background: var(--bh-border);
}

.bh-sec-more {
    font-size: 11px;
    font-weight: 600;
    color: var(--bh-mid);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s;
}

.bh-sec-more:hover {
    color: var(--bh-dark);
}

/* ─── ARTICLE CARDS ─── */
.bh-cards-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.bh-cards-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.bh-acard {
    background: var(--bh-white);
    border-radius: var(--bh-radius);
    padding: 20px;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid transparent;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.bh-acard:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.09);
    border-color: var(--bh-border);
}

.bh-acard:hover .bh-acard-link {
    opacity: 1;
}

.bh-acard:hover .bh-aimg img {
    transform: scale(1.05);
}

.bh-aimg {
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
    aspect-ratio: 16/9;
    background: var(--bh-bg);
    flex-shrink: 0;
}

.bh-aimg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

/* Placeholder for posts without images */
.bh-aimg-placeholder {
    border-radius: 8px;
    margin-bottom: 16px;
    aspect-ratio: 16/9;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.04em;
    opacity: 0.12;
    color: #fff;
}

.bh-acard-pole {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.bh-acard-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.bh-acard-title {
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.025em;
    margin-bottom: 8px;
    flex: 1;
    color: var(--bh-dark);
}

.bh-acard-excerpt {
    font-size: 11.5px;
    color: var(--bh-mid);
    line-height: 1.65;
    margin-bottom: 14px;
}

.bh-acard-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--bh-border);
    margin-top: auto;
}

.bh-acard-meta {
    font-size: 10px;
    color: #767676;
}

.bh-acard-link {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.2s;
}

/* ─── ROW LIST ─── */
.bh-row-list {
    background: var(--bh-white);
    border-radius: var(--bh-radius);
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid var(--bh-border);
}

.bh-art-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--bh-border);
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    color: inherit;
}

.bh-art-row:last-child {
    border-bottom: none;
}

.bh-art-row:hover {
    background: #fafaf8;
}

.bh-art-row:hover .bh-ar-arr {
    color: var(--bh-dark);
    transform: translateX(4px);
}

.bh-ar-n {
    font-size: 10px;
    font-weight: 700;
    color: #d0d0cc;
    width: 16px;
    flex-shrink: 0;
}

.bh-ar-pip {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.bh-ar-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.015em;
    flex: 1;
    line-height: 1.3;
}

.bh-ar-meta {
    font-size: 10px;
    color: var(--bh-mid);
    flex-shrink: 0;
    white-space: nowrap;
}

.bh-ar-arr {
    font-size: 16px;
    color: var(--bh-border);
    transition: color 0.2s, transform 0.2s;
    flex-shrink: 0;
}

/* ─── SECTION BLOCK ─── */
.bh-section-block {
    margin-bottom: 32px;
}

.bh-section-block.bh-hidden {
    display: none;
}

/* ─── SIDEBAR ─── */
.bh-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bh-side-card {
    background: var(--bh-white);
    border-radius: var(--bh-radius);
    overflow: hidden;
    border: 1px solid var(--bh-border);
}

.bh-side-inner {
    padding: 20px;
}

.bh-side-label {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--bh-mid);
    margin-bottom: 14px;
}

/* Trending */
.bh-trend-item {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--bh-border);
    cursor: pointer;
    transition: opacity 0.15s;
    text-decoration: none;
    color: inherit;
}

.bh-trend-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.bh-trend-item:hover {
    opacity: 0.55;
}

.bh-trend-n {
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.06em;
    flex-shrink: 0;
    width: 26px;
}

.bh-trend-t {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

/* Tags */
.bh-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 20px;
}

.bh-tag {
    font-size: 11px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 100px;
    border: 1.5px solid var(--bh-border);
    color: var(--bh-mid);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.bh-tag:hover {
    border-color: var(--bh-dark);
    color: var(--bh-dark);
}

.bh-tag-pole {
    background: rgba(var(--tag-pole-rgb), 0.05);
    border-color: rgba(var(--tag-pole-rgb), 0.3);
    color: var(--tag-pole-color);
}

.bh-tag-pole:hover {
    border-color: var(--tag-pole-color);
    color: var(--tag-pole-color);
}

/* Actu card (dark) */
.bh-actu-card {
    background: var(--bh-dark);
    border-radius: var(--bh-radius);
    padding: 20px;
}

.bh-actu-item {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: opacity 0.15s;
    text-decoration: none;
    display: block;
}

.bh-actu-item:last-child {
    border-bottom: none;
}

.bh-actu-item:hover {
    opacity: 0.55;
}

.bh-actu-t {
    font-size: 12px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.35;
}

.bh-actu-d {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.2);
    margin-top: 3px;
}

/* Sidebar Recent */
.bh-side-art {
    padding: 13px 0;
    border-bottom: 1px solid var(--bh-border);
    cursor: pointer;
    transition: opacity 0.18s;
    text-decoration: none;
    display: block;
    color: inherit;
}

.bh-side-art:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.bh-side-art:hover {
    opacity: 0.55;
}

.bh-sa-pole {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.bh-sa-title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.015em;
    color: var(--bh-dark);
}

.bh-sa-meta {
    font-size: 10px;
    color: #aaa;
    margin-top: 4px;
}

/* ─── REVEAL ANIMATION ─── */
.bh-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.bh-reveal.bh-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─── LIVE DOT ─── */
@keyframes bhPulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

.bh-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #e53535;
    animation: bhPulse 2s ease infinite;
    display: inline-block;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 1100px) {
    .bh-page-body {
        grid-template-columns: 1fr;
        padding: 24px 24px 60px;
    }

    .bh-hero-card {
        grid-template-columns: 1fr;
    }

    .bh-hc-img {
        display: none;
    }

    .bh-cards-3 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 700px) {
    .bh-masthead {
        padding: 32px 20px;
        margin-left: 16px;
        margin-right: 16px;
    }

    .bh-mast-headline .bh-cycle-wrap {
        height: 2.15em;
    }

    .bh-mast-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .bh-mast-poles {
        flex-wrap: wrap;
    }

    .bh-page-body {
        padding: 20px 16px 60px;
    }

    .bh-cards-2,
    .bh-cards-3 {
        grid-template-columns: 1fr;
    }

    .bh-hc-body {
        padding: 24px 20px;
    }

    .bh-filter-bar {
        overflow-x: auto;
        justify-content: flex-start;
        gap: 2px;
        padding: 12px 16px;
        -webkit-overflow-scrolling: touch;
    }

    .bh-art-row {
        padding: 12px 14px;
        gap: 10px;
    }

    .bh-ar-meta {
        display: none;
    }

    .bh-mast-kicker,
    .bh-mast-date {
        font-size: 9px;
    }
}
