/* ---- Article Banner Mosaic ---- */
.ab-outer {
    position: relative;
    height: 420px;
    width: 100%;
    background: #0f0f0f;
    overflow: hidden;
}

/* Featured item: absolutely pinned left, does NOT scroll */
.ab-featured {
    position: absolute;
    top: 0;
    left: 0;
    width: 450px;
    height: 100%;
    z-index: 2;
    overflow: hidden;
    border-right: 1px solid rgba(255, 255, 255, 0.10);
}

/* Scrollable track: starts right after the featured item */
.ab-track {
    position: absolute;
    top: 0;
    left: 450px;
    /* must match .ab-featured width */
    right: 0;
    height: 100%;
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.ab-track::-webkit-scrollbar {
    display: none;
}

/* Each column: 2 items stacked.
   Width = (viewport_right - 420px) / 2.4  so exactly 2 full cols + ~40% peek visible.
   On a typical 1280px screen: (1280-420)/2.4 = 358px ≈ show 2.4 cols = 1 featured + 4 items + hint of next 2 */
.ab-col {
    flex: 0 0 300px;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.10);
}

.ab-col:last-child {
    border-right: none;
}

.ab-cell {
    flex: 0 0 50%;
    height: 50%;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.ab-cell:last-child {
    border-bottom: none;
}

/* Images */
.ab-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.7s ease;
}

.ab-featured:hover .ab-img,
.ab-cell:hover .ab-img {
    transform: scale(1.06);
}

/* Gradients */
.ab-grad-feat {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.25) 50%, transparent 80%);
    z-index: 1;
}

.ab-grad-cell {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.10) 60%, transparent 100%);
    z-index: 1;
}

/* Bookmark circle */
.ab-bm {
    position: absolute;
    z-index: 4;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(15, 15, 15, 0.50);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: background 0.2s, color 0.2s;
    cursor: pointer;
    pointer-events: none;
}

.ab-featured .ab-bm {
    width: 34px;
    height: 34px;
    top: 14px;
    right: 14px;
}

.ab-bm svg {
    width: 13px;
    height: 13px;
    fill: currentColor;
}

.ab-featured .ab-bm svg {
    width: 15px;
    height: 15px;
}

.ab-featured:hover .ab-bm,
.ab-cell:hover .ab-bm {
    background: #fff;
    color: #d01;
}

/* Featured text overlay */
.ab-feat-text {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 22px 20px;
    z-index: 3;
}

.ab-badge {
    display: inline-block;
    padding: 3px 10px;
    background: linear-gradient(135deg, #9d174d 0%, #ea580c 50%, #f59e0b 100%);
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 10px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.ab-feat-title {
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ab-feat-meta {
    color: rgba(255, 255, 255, 0.50);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 7px;
}

.ab-feat-meta .mdot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    display: inline-block;
}

/* Cell text overlay */
.ab-cell-text {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 13px;
    z-index: 3;
}

.ab-cell-title {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Full-cover link */
.ab-link {
    position: absolute;
    inset: 0;
    z-index: 5;
}

/* Mobile: show featured + 1 column visible, rest scroll */
@media (max-width: 767px) {
    .ab-outer {
        height: 240px;
    }

    .ab-featured {
        width: 230px;
    }

    .ab-track {
        left: 230px;
    }

    .ab-col {
        flex: 0 0 160px;
    }

    .ab-feat-title {
        font-size: 14px;
    }
}

/* Large desktop: slightly wider columns so still 2 full + partial */
@media (min-width: 1280px) {
    .ab-featured {
        width: 480px;
    }

    .ab-track {
        left: 480px;
    }

    .ab-col {
        flex: 0 0 330px;
    }
}

/* Dynamic Sections */
.dynamic-grid {
    display: grid;
    grid-template-columns: repeat(var(--grid-mobile, 1), minmax(0, 1fr));
    gap: 0.8rem;
}

@media (min-width: 768px) {
    .dynamic-grid {
        grid-template-columns: repeat(var(--grid-tablet, 2), minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .dynamic-grid {
        grid-template-columns: repeat(var(--grid-desktop, 4), minmax(0, 1fr));
    }
}
