.home-ad-slot {
    position: relative;
    width: 100%;
    margin: 26px 0;
    overflow: hidden;
    border-radius: 18px;
}

.home-ad-slot__link,
.home-ad-slot picture {
    display: block;
    width: 100%;
}

.home-ad-slot__image {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 18px;
}

.home-ad-slot__label {
    position: absolute;
    top: 10px;
    left: 12px;
    padding: 4px 9px;
    border-radius: 20px;
    background: rgba(15, 23, 42, .72);
    color: #fff;
    font-size: 11px;
    line-height: 1.4;
}

.home-ad-slot.is-available {
    border: 1px dashed rgba(37, 99, 235, .38);
    background:
        linear-gradient(
            135deg,
            rgba(239, 246, 255, .96),
            rgba(248, 250, 252, .98)
        );
}

.home-ad-slot__available {
    position: relative;
    min-height: 150px;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 28px 34px;
}

.home-ad-slot__pulse {
    position: relative;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #2563eb;
}

.home-ad-slot__pulse::after {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid rgba(37, 99, 235, .35);
    animation: steelAdPulse 1.8s ease-out infinite;
}

.home-ad-slot__available-copy {
    flex: 1;
}

.home-ad-slot__eyebrow {
    display: block;
    margin-bottom: 6px;
    color: #2563eb;
    font-size: 13px;
    font-weight: 800;
}

.home-ad-slot__available-copy strong {
    display: block;
    color: #172033;
    font-size: 20px;
    line-height: 1.7;
}

.home-ad-slot__available-copy p {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 14px;
}

.home-ad-slot__cta {
    flex: 0 0 auto;
    padding: 11px 18px;
    border-radius: 10px;
    background: #2563eb;
    color: #fff;
    font-weight: 800;
    text-decoration: none;
    transition:
        transform .2s ease,
        box-shadow .2s ease;
}

.home-ad-slot__cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(37, 99, 235, .22);
}

@keyframes steelAdPulse {
    0% {
        transform: scale(.65);
        opacity: 1;
    }

    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

@media (max-width: 767px) {
    .home-ad-slot {
        margin: 18px 0;
        border-radius: 14px;
    }

    .home-ad-slot__available {
        min-height: 170px;
        flex-direction: column;
        align-items: flex-start;
        gap: 13px;
        padding: 22px;
    }

    .home-ad-slot__available-copy strong {
        font-size: 17px;
    }

    .home-ad-slot__cta {
        width: 100%;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-ad-slot__pulse::after {
        animation: none;
    }
}

/* Enhanced empty advertising slot */
.home-ad-slot.is-available {
    position: relative;
    isolation: isolate;
    border: 1px solid rgba(37, 99, 235, .28);
    background:
        radial-gradient(
            circle at 88% 25%,
            rgba(59, 130, 246, .22),
            transparent 30%
        ),
        radial-gradient(
            circle at 12% 80%,
            rgba(14, 165, 233, .15),
            transparent 28%
        ),
        linear-gradient(
            135deg,
            #eef6ff 0%,
            #f8fbff 42%,
            #e8f2ff 100%
        );
    box-shadow:
        0 12px 32px rgba(30, 64, 175, .08),
        inset 0 1px 0 rgba(255, 255, 255, .9);
}

.home-ad-slot.is-available::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: .32;
    background-image:
        linear-gradient(
            rgba(37, 99, 235, .08) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(37, 99, 235, .08) 1px,
            transparent 1px
        );
    background-size: 32px 32px;
    mask-image:
        linear-gradient(
            90deg,
            transparent,
            #000 35%,
            #000 100%
        );
}

.home-ad-slot.is-available:hover {
    border-color: rgba(37, 99, 235, .5);
    box-shadow:
        0 16px 38px rgba(30, 64, 175, .13),
        inset 0 1px 0 rgba(255, 255, 255, .95);
}

/* === HOME PREMIUM CAROUSEL === */

.home-ad-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 14px;
}

.home-ad-carousel__slide {
    position: relative;
    display: none !important;
    width: 100%;
}

.home-ad-carousel__slide.is-active {
    display: block !important;
    animation: homeAdCarouselFade .45s ease;
}

.home-ad-carousel .home-ad-slot__link {
    display: block;
    width: 100%;
}

.home-ad-carousel .home-ad-slot__image {
    display: block;
    width: 100%;
    height: auto;
}

.home-ad-carousel__arrow {
    position: absolute;
    top: 50%;
    z-index: 20;

    width: 34px;
    height: 34px;

    padding: 0;

    border: 1px solid rgba(255,255,255,.7);
    border-radius: 8px;

    background: rgba(15,23,42,.72);
    color: #fff;

    font-size: 25px;
    line-height: 28px;

    cursor: pointer;

    transform: translateY(-50%);

    backdrop-filter: blur(5px);

    transition:
        background .2s ease,
        transform .2s ease;
}

.home-ad-carousel__arrow:hover {
    background: rgba(15,23,42,.95);

    transform:
        translateY(-50%)
        scale(1.05);
}

.home-ad-carousel__arrow--prev {
    right: 10px;
}

.home-ad-carousel__arrow--next {
    left: 10px;
}

.home-ad-carousel__dots {
    position: absolute;

    right: 50%;
    bottom: 8px;

    z-index: 20;

    display: flex;
    align-items: center;
    gap: 5px;

    transform: translateX(50%);
}

.home-ad-carousel__dot {
    display: block;

    width: 7px;
    height: 7px;

    padding: 0;

    border: 0;
    border-radius: 50%;

    background: rgba(255,255,255,.65);

    cursor: pointer;

    box-shadow:
        0 1px 4px rgba(15,23,42,.35);

    transition:
        width .2s ease,
        background .2s ease,
        border-radius .2s ease;
}

.home-ad-carousel__dot.is-active {
    width: 22px;
    border-radius: 8px;
    background: #fff;
}

@keyframes homeAdCarouselFade {
    from {
        opacity: .15;
    }

    to {
        opacity: 1;
    }
}

@media (max-width: 767px) {

    .home-ad-carousel {
        border-radius: 10px;
    }

    .home-ad-carousel__arrow {
        width: 30px;
        height: 30px;
        font-size: 21px;
    }

    .home-ad-carousel__arrow--prev {
        right: 6px;
    }

    .home-ad-carousel__arrow--next {
        left: 6px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .home-ad-carousel__slide.is-active {
        animation: none;
    }
}



/* === SMALL AD RAIL PLACEHOLDER === */

.showcase-section--with-small-rail {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        225px;
    gap: 18px;
    align-items: start;
}

.showcase-section--with-small-rail
> .section-heading {
    grid-column: 1 / -1;
}

.showcase-section--with-small-rail
> .article-grid {
    grid-column: 1;
    grid-row: 2;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));
}

.showcase-section--with-small-rail
> .article-grid
> .article-card:nth-child(n+4) {
    display: none;
}


/* Rail */

.home-small-ad-rail {
    grid-column: 2;
    grid-row: 2;

    display: flex;
    flex-direction: column;
    gap: 10px;

    min-width: 0;
}


/* Placeholder */

.home-small-ad-placeholder {
    position: relative;
    isolation: isolate;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    width: 100%;
    aspect-ratio: 260 / 150;

    padding: 13px 14px;

    overflow: hidden;

    border:
        1px solid
        rgba(37, 99, 235, .15);

    border-radius: 14px;

    background:
        linear-gradient(
            135deg,
            rgba(255,255,255,.98),
            rgba(239,246,255,.94)
        );

    box-shadow:
        0 8px 24px
        rgba(15,23,42,.055);

    cursor: pointer;

    transition:
        transform .22s ease,
        border-color .22s ease,
        box-shadow .22s ease;
}

.home-small-ad-placeholder::before {
    content: "";

    position: absolute;
    inset: 0;

    z-index: -2;

    background-image:
        linear-gradient(
            rgba(37,99,235,.035) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(37,99,235,.035) 1px,
            transparent 1px
        );

    background-size:
        18px 18px;
}

.home-small-ad-placeholder:hover {
    transform:
        translateY(-2px);

    border-color:
        rgba(37,99,235,.28);

    box-shadow:
        0 12px 30px
        rgba(15,23,42,.09);
}


/* Different subtle backgrounds */

.home-small-ad-placeholder--2 {
    background:
        linear-gradient(
            135deg,
            rgba(255,255,255,.98),
            rgba(240,253,250,.95)
        );
}

.home-small-ad-placeholder--3 {
    background:
        linear-gradient(
            135deg,
            rgba(255,255,255,.98),
            rgba(250,245,255,.95)
        );
}


/* Animated glow */

.home-small-ad-placeholder__glow {
    position: absolute;

    width: 110px;
    height: 110px;

    top: -55px;
    left: -35px;

    z-index: -1;

    border-radius: 50%;

    background:
        rgba(37,99,235,.12);

    filter: blur(18px);

    animation:
        smallAdGlow
        4.5s ease-in-out
        infinite;
}

.home-small-ad-placeholder--2
.home-small-ad-placeholder__glow {
    animation-delay: 1.1s;
}

.home-small-ad-placeholder--3
.home-small-ad-placeholder__glow {
    animation-delay: 2.2s;
}


/* Header */

.home-small-ad-placeholder__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.home-small-ad-placeholder__badge {
    display: inline-flex;
    align-items: center;

    padding: 3px 7px;

    border-radius: 999px;

    background:
        rgba(15,23,42,.78);

    color: #fff;

    font-size: 10px;
    font-weight: 700;
}

.home-small-ad-placeholder__slot {
    color: #94a3b8;
    font-size: 10px;
}


/* Content */

.home-small-ad-placeholder__content {
    display: flex;
    flex-direction: column;
    gap: 2px;

    padding: 5px 0;
}

.home-small-ad-placeholder__eyebrow {
    color: #2563eb;

    font-size: 10px;
    font-weight: 800;
}

.home-small-ad-placeholder__content strong {
    color: #0f172a;

    font-size: 16px;
    line-height: 1.7;
}

.home-small-ad-placeholder__content p {
    margin: 0;

    color: #64748b;

    font-size: 10px;
    line-height: 1.8;
}


/* Footer */

.home-small-ad-placeholder__footer {
    display: flex;
    align-items: center;
    gap: 5px;

    color: #2563eb;

    font-size: 10px;
    font-weight: 800;
}


/* Motion */

@keyframes smallAdGlow {
    0%,
    100% {
        opacity: .45;
        transform: scale(.9);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}


/* Tablet */

@media (max-width: 1050px) {

    .showcase-section--with-small-rail {
        grid-template-columns:
            minmax(0, 1fr)
            200px;
    }

    .showcase-section--with-small-rail
    > .article-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}


/* Mobile */

@media (max-width: 767px) {

    .showcase-section--with-small-rail {
        display: block;
    }

    .showcase-section--with-small-rail
    > .article-grid
    > .article-card:nth-child(n+4) {
        display: block;
    }

    .home-small-ad-rail {
        flex-direction: row;

        gap: 10px;

        margin-top: 16px;
        padding-bottom: 5px;

        overflow-x: auto;

        scroll-snap-type: x mandatory;
    }

    .home-small-ad-placeholder {
        flex:
            0 0
            min(78vw, 280px);

        scroll-snap-align: start;
    }
}

@media (prefers-reduced-motion: reduce) {

    .home-small-ad-placeholder__glow {
        animation: none;
    }
}


/* === SMALL AD RAIL LAYOUT FIX === */

/*
 * Heading remains outside the advertising grid.
 * Only article cards and the small-ad rail share this layout.
 */

.showcase-content-with-small-rail {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        225px;
    gap: 18px;
    align-items: start;
}

.showcase-content-with-small-rail
> .article-grid {
    grid-column: 1;
    grid-row: 1;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));
}

.showcase-content-with-small-rail
> .article-grid
> .article-card:nth-child(n+4) {
    display: none;
}

.showcase-content-with-small-rail
> .home-small-ad-rail {
    grid-column: 2;
    grid-row: 1;
}


@media (max-width: 1050px) {

    .showcase-content-with-small-rail {
        grid-template-columns:
            minmax(0, 1fr)
            200px;
    }

    .showcase-content-with-small-rail
    > .article-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}


@media (max-width: 767px) {

    .showcase-content-with-small-rail {
        display: block;
    }

    .showcase-content-with-small-rail
    > .article-grid
    > .article-card:nth-child(n+4) {
        display: block;
    }

    .showcase-content-with-small-rail
    > .home-small-ad-rail {
        margin-top: 16px;
    }
}


/* === HOME VERTICAL RHYTHM === */

/*
 * Keep the Hero -> Premium Ad spacing unchanged.
 * All primary sections after that use one consistent rhythm.
 */

.page-shell > .section {
    margin-top: 48px;
}


/* Consistent heading-to-content spacing */

.page-shell > .section
> .section-heading {
    margin-bottom: 22px;
}


/*
 * Split headings such as Articles / Videos
 * keep the same vertical rhythm.
 */

.page-shell > .showcase-section
> .section-heading--split {
    margin-bottom: 22px;
}


/* Tablet */

@media (max-width: 920px) {

    .page-shell > .section {
        margin-top: 40px;
    }

    .page-shell > .section
    > .section-heading {
        margin-bottom: 20px;
    }
}


/* Mobile */

@media (max-width: 620px) {

    .page-shell > .section {
        margin-top: 32px;
    }

    .page-shell > .section
    > .section-heading {
        margin-bottom: 18px;
    }
}


/* === HOME SMALL AD STRIP PLACEHOLDER === */

.home-small-ad-strip-section {
    width: min(1180px, 100%);
    margin-inline: auto;
}


/* Header */

.home-small-ad-strip__header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 18px;
}

.home-small-ad-strip__header h2 {
    margin: 4px 0 0;

    color: var(--navy-950);

    font-size: clamp(20px, 2vw, 27px);
    line-height: 1.6;
}

.home-small-ad-strip__label {
    display: inline-flex;
    align-items: center;

    min-height: 30px;

    padding: 0 11px;

    border: 1px solid
        rgba(23, 104, 186, .15);

    border-radius: 999px;

    color: var(--blue-600);

    background: rgba(234, 243, 255, .7);

    font-size: 10px;
    font-weight: 900;
}


/* Grid */

.home-small-ad-strip {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 12px;
}


/* Card */

.home-small-strip-ad {
    position: relative;
    isolation: isolate;

    min-width: 0;

    aspect-ratio: 280 / 150;

    padding: 14px 15px;

    overflow: hidden;

    border: 1px solid
        rgba(23, 104, 186, .16);

    border-radius: 16px;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    background:
        radial-gradient(
            circle at 90% 10%,
            rgba(23, 104, 186, .14),
            transparent 35%
        ),
        linear-gradient(
            135deg,
            #ffffff,
            #f4f8ff
        );

    box-shadow:
        0 10px 26px
        rgba(6, 27, 69, .055);

    transition:
        transform .2s ease,
        box-shadow .2s ease,
        border-color .2s ease;
}

.home-small-strip-ad:hover {
    transform: translateY(-3px);

    border-color:
        rgba(23, 104, 186, .32);

    box-shadow:
        0 15px 34px
        rgba(6, 27, 69, .1);
}


/* Background pattern */

.home-small-strip-ad__pattern {
    position: absolute;
    inset: 0;

    z-index: -1;

    opacity: .32;

    background-image:
        linear-gradient(
            rgba(23,104,186,.055) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(23,104,186,.055) 1px,
            transparent 1px
        );

    background-size: 20px 20px;

    mask-image:
        linear-gradient(
            130deg,
            #000,
            transparent 78%
        );
}


/* Variations */

.home-small-strip-ad--2 {
    background:
        radial-gradient(
            circle at 90% 10%,
            rgba(20, 125, 115, .13),
            transparent 35%
        ),
        linear-gradient(
            135deg,
            #ffffff,
            #f1fbf8
        );
}

.home-small-strip-ad--3 {
    background:
        radial-gradient(
            circle at 90% 10%,
            rgba(237, 115, 19, .13),
            transparent 35%
        ),
        linear-gradient(
            135deg,
            #ffffff,
            #fff8f2
        );
}

.home-small-strip-ad--4 {
    background:
        radial-gradient(
            circle at 90% 10%,
            rgba(86, 56, 166, .13),
            transparent 35%
        ),
        linear-gradient(
            135deg,
            #ffffff,
            #f8f5ff
        );
}


/* Top */

.home-small-strip-ad__top {
    display: flex;
    align-items: center;
    justify-content: space-between;

    color: #8a97aa;

    font-size: 9px;
}

.home-small-strip-ad__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 28px;
    height: 22px;

    padding: 0 7px;

    border-radius: 999px;

    color: #fff;
    background: rgba(6, 27, 69, .78);

    font-size: 8px;
    font-weight: 900;
}


/* Content */

.home-small-strip-ad__content {
    display: grid;
    gap: 3px;
}

.home-small-strip-ad__content strong {
    color: var(--navy-950);

    font-size: 15px;
    line-height: 1.7;
}

.home-small-strip-ad__content span {
    color: var(--muted);

    font-size: 9.5px;
    line-height: 1.8;
}


/* CTA */

.home-small-strip-ad__action {
    display: flex;
    align-items: center;
    gap: 5px;

    color: var(--blue-600);

    font-size: 9px;
    font-weight: 900;
}


/* Tablet */

@media (max-width: 920px) {

    .home-small-ad-strip {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}


/* Mobile */

@media (max-width: 620px) {

    .home-small-ad-strip__header {
        margin-bottom: 14px;
    }

    .home-small-ad-strip {
        display: flex;

        gap: 10px;

        overflow-x: auto;

        padding-bottom: 5px;

        scroll-snap-type: x mandatory;

        scrollbar-width: none;
    }

    .home-small-ad-strip::-webkit-scrollbar {
        display: none;
    }

    .home-small-strip-ad {
        flex:
            0 0
            min(76vw, 270px);

        scroll-snap-align: start;
    }

    .home-small-ad-strip__label {
        display: none;
    }
}


/* === VIDEO SMALL AD RAIL === */

/*
 * Opposite orientation of the article advertising rail:
 * ads on the right, video cards on the left.
 */

.showcase-content-with-small-rail--reverse {
    grid-template-columns:
        225px
        minmax(0, 1fr);
}

.showcase-content-with-small-rail--reverse
> .article-grid {
    grid-column: 2;
    grid-row: 1;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));
}

.showcase-content-with-small-rail--reverse
> .article-grid
> .article-card:nth-child(n+4) {
    display: none;
}

.showcase-content-with-small-rail--reverse
> .home-small-ad-rail {
    grid-column: 1;
    grid-row: 1;
}


/* Tablet */

@media (max-width: 1050px) {

    .showcase-content-with-small-rail--reverse {
        grid-template-columns:
            200px
            minmax(0, 1fr);
    }

    .showcase-content-with-small-rail--reverse
    > .article-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}


/* Mobile */

@media (max-width: 767px) {

    .showcase-content-with-small-rail--reverse {
        display: block;
    }

    .showcase-content-with-small-rail--reverse
    > .article-grid
    > .article-card:nth-child(n+4) {
        display: block;
    }

    .showcase-content-with-small-rail--reverse
    > .home-small-ad-rail {
        margin-top: 16px;
    }
}


/* === EMPTY AD SLOT INTERACTION === */

.home-small-ad-placeholder[data-banner-ad-open],
.home-small-strip-ad[data-banner-ad-open],
.home-ad-slot__available[data-banner-ad-open] {
    cursor: pointer;
}

.home-small-ad-placeholder[data-banner-ad-open]:focus-visible,
.home-small-strip-ad[data-banner-ad-open]:focus-visible,
.home-ad-slot__available[data-banner-ad-open]:focus-visible {
    outline: 3px solid rgba(23, 104, 186, .28);
    outline-offset: 3px;
}

.home-small-strip-ad[data-banner-ad-open] {
    cursor: pointer;
}



/* === REAL SMALL ARTICLE ADS === */

.home-small-ad-card {
    position: relative;

    width: 100%;
    aspect-ratio: 5 / 3;

    overflow: hidden;

    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 14px;

    background: #fff;

    box-shadow:
        0 8px 24px
        rgba(15, 23, 42, .06);

    transition:
        transform .22s ease,
        box-shadow .22s ease;
}

.home-small-ad-card:hover {
    transform: translateY(-2px);

    box-shadow:
        0 12px 30px
        rgba(15, 23, 42, .1);
}

.home-small-ad-card__link,
.home-small-ad-card picture {
    display: block;

    width: 100%;
    height: 100%;
}

.home-small-ad-card__image {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}

.home-small-ad-card__label {
    position: absolute;

    top: 7px;
    left: 7px;

    padding: 3px 7px;

    border-radius: 999px;

    background: rgba(15, 23, 42, .72);
    color: #fff;

    font-size: 8px;
    font-weight: 800;

    pointer-events: none;
}


/*
 * Keep empty and occupied slots
 * visually identical in ratio.
 */

.home-small-ad-placeholder {
    aspect-ratio: 5 / 3;
}



/* === HOME SMALL AD STRIP REAL ADS === */

.home-small-strip-ad--filled {
    padding: 0;
    background: #fff;
}

.home-small-strip-ad__media {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.home-small-strip-ad__media picture,
.home-small-strip-ad__link {
    display: block;
    width: 100%;
    height: 100%;
}

.home-small-strip-ad__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-small-strip-ad__ad-label {
    position: absolute;
    top: 9px;
    right: 9px;
    z-index: 2;

    display: inline-flex;
    align-items: center;

    min-height: 22px;
    padding: 0 8px;

    border-radius: 999px;

    color: #fff;
    background: rgba(6, 27, 69, .82);

    font-size: 8px;
    font-weight: 900;

    pointer-events: none;
}
