/* ── IW Blog Posts Grid ──────────────────────────── */

.iw-bpg-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

/* ── Rows: alternating 60/40 and 40/60 ──────────── */

.iw-bpg-row {
    display: grid;
    gap: 20px;
}

.iw-bpg-row--60-40 {
    grid-template-columns: 3fr 2fr;
}

.iw-bpg-row--40-60 {
    grid-template-columns: 2fr 3fr;
}

/* ── Card ────────────────────────────────────────── */

.iw-bpg-card {
    position: relative;
    background: #111214;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.25s ease, transform 0.2s ease;
    min-height: 220px;
}

.iw-bpg-card:not(.iw-bpg-card--glow-chase):hover {
    border-color: rgba(255, 255, 255, 0.25) !important;
}

.iw-bpg-card:hover {
    transform: translateY(-2px);
}

/* ── Inner layout: text left, image right ────────── */

.iw-bpg-card__inner {
    display: flex;
    flex-direction: row;
    height: 100%;
    min-height: 220px;
    position: relative;
    z-index: 1;
}

.iw-bpg-card__inner--has-visual .iw-bpg-card__body {
    flex: 1 1 60%;
    min-width: 55%;
}

/* ── Body (text side) ────────────────────────────── */

.iw-bpg-card__body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: center;
}

.iw-bpg-card__cat {
    display: inline-block;
    align-self: flex-start;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
    line-height: 1;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(50, 50, 55, 0.85);
}

.iw-bpg-card__title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    color: #e8e8ea;
    margin: 0 0 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Meta (author & date) — below title, above excerpt ── */

.iw-bpg-card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif;
}


.iw-bpg-card__author {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
}

.iw-bpg-card__sep {
    color: rgba(255, 255, 255, 0.2);
}

.iw-bpg-card__date {
    color: rgba(255, 255, 255, 0.35);
}

/* ── Excerpt ─────────────────────────────────────── */

.iw-bpg-card__excerpt {
    font-size: 14px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.45);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.iw-bpg-card--narrow .iw-bpg-card__excerpt {
    -webkit-line-clamp: 2;
}

/* ── Visual (right side) ─────────────────────────── */

.iw-bpg-card__visual {
    flex: 0 0 40%;
    max-width: 40%;
    position: relative;
    overflow: hidden;
}

.iw-bpg-card--narrow .iw-bpg-card__visual {
    flex: 0 0 35%;
    max-width: 35%;
}

/* Option 1: Fill */
.iw-bpg-card__visual--fill {
    background-size: cover;
    background-position: center;
}

/* Option 2: Radial fade from bottom-right corner */
.iw-bpg-card__visual--radial {
    background-size: 300%;
    background-position: 40% 20px;
    -webkit-mask-image: radial-gradient(ellipse at bottom right, rgba(0,0,0,1) 20%, rgba(0,0,0,0) 70%);
    mask-image: radial-gradient(ellipse at bottom right, rgba(0,0,0,1) 20%, rgba(0,0,0,0) 70%);
}

/* Option: Alt feature image (scales in place, crops overflow) */
.iw-bpg-card__visual--alt .iw-bpg-card__alt-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transform-origin: center center;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.iw-bpg-card:hover .iw-bpg-card__alt-img {
    opacity: 1;
}

/* Option 3: Custom icon */
.iw-bpg-card__visual--icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.iw-bpg-card--narrow .iw-bpg-card__visual--icon {
    padding-left: 0;
}

.iw-bpg-card__icon {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.iw-bpg-card--wide .iw-bpg-card__icon {
    max-width: 70%;
    max-height: 70%;
}

.iw-bpg-card:hover .iw-bpg-card__icon {
    opacity: 1;
}

/* ── Glow Chase Effect ───────────────────────────── */

.iw-bpg-card--glow-chase {
    overflow: visible;
}

.iw-bpg-card--glow-chase .iw-bpg-card__inner {
    overflow: hidden;
    border-radius: inherit;
}

.iw-bpg-card--glow-chase .iw-bpg-card__gradient {
    border-radius: inherit;
    overflow: hidden;
}

.iw-bpg-glow {
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    padding: 2px;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 1s ease;
    --glow-angle: 315deg;
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    mask-composite: exclude;
}

.iw-bpg-glow--active {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* ── Editor-only post ID badge ───────────────────── */

.iw-bpg-card__pid {
    position: absolute;
    bottom: 8px;
    left: 10px;
    font-size: 11px;
    font-family: monospace;
    color: rgba(255, 255, 255, 0.25);
    pointer-events: none;
    line-height: 1;
    z-index: 2;
}

/* ── Hide visual on narrow cards (desktop only) ──── */

.iw-bpg-card__inner--hide-visual-desktop .iw-bpg-card__visual {
    display: none;
}

.iw-bpg-card__inner--hide-visual-desktop {
    /* Remove has-visual text constraint when image is hidden */
}

.iw-bpg-card__inner--hide-visual-desktop .iw-bpg-card__body {
    flex: 1 1 100%;
    min-width: 100%;
}

/* ── Responsive ──────────────────────────────────── */

@media (max-width: 768px) {
    .iw-bpg-row,
    .iw-bpg-row--60-40,
    .iw-bpg-row--40-60 {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .iw-bpg-wrapper {
        gap: 16px;
    }

    .iw-bpg-card__inner {
        flex-direction: column-reverse;
        min-height: auto;
    }

    .iw-bpg-card__visual {
        flex: none;
        max-width: 100%;
        height: 140px;
    }

    .iw-bpg-card__inner--hide-visual-desktop .iw-bpg-card__visual {
        display: block;
    }

    .iw-bpg-card__inner--hide-visual-desktop .iw-bpg-card__body {
        flex: 1;
        min-width: 0;
    }

    .iw-bpg-card__visual--icon {
        height: 100px;
        padding-left: 24px;
    }

    .iw-bpg-card__title {
        font-size: 15px;
    }

    .iw-bpg-card__body {
        padding: 16px 18px 20px;
    }
}
