/**
 * Two campaign heroes (.kr-home-campaigns--duo)
 * template-parts/homepage/hero_campaign.php
 *
 * Only while BOTH campaigns are on (Shop Settings → Esilehe kampaania).
 * Two equal photo banners side by side on desktop, stacked on phones.
 * Each banner: photo on top, fading into the dark ground; eyebrow, title,
 * text and buttons sit on that dark ground (no text over the busy part of
 * the photo). One campaign on = none of these rules apply; the single
 * full-width band in css/home-campaign-hero.css styles it.
 * Own file (new URL) because theme CSS URLs carry no ?ver= cache buster.
 *
 * @package KauplusRattapood
 */

.kr-home-campaigns--duo {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    background: var(--color-white);
}

.kr-home-campaigns--duo .kr-home-campaign {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
}

/* Photo strip: real <img>, cover; the bottom fades into the ground */
.kr-home-campaigns--duo .kr-home-campaign__media {
    position: relative;
    inset: auto;
    z-index: 0;
    width: 100%;
    aspect-ratio: 2 / 1;
    overflow: hidden;
}

.kr-home-campaigns--duo .kr-home-campaign__media::after {
    background: linear-gradient(180deg, rgba(13, 15, 20, 0) 45%, rgba(13, 15, 20, 0.65) 80%, var(--kr-campaign-ground) 100%);
}

/* Fill the strip whatever the photo's own ratio (both strips equal height) */
.kr-home-campaigns--duo .kr-home-campaign__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.kr-home-campaigns--duo .kr-home-campaign--lights .kr-home-campaign__bg {
    object-position: 0% 40%; /* rider + front light */
}

.kr-home-campaigns--duo .kr-home-campaign--winter-tyres .kr-home-campaign__bg {
    object-position: 50% 45%; /* rider on the snowy street */
}

/* Text on the dark ground, overlapping the faded photo bottom */
.kr-home-campaigns--duo .kr-home-campaign__inner {
    position: relative;
    z-index: 1;
    display: block;
    flex: 1 0 auto;
    max-width: none;
    margin-top: -64px;
    padding: 0 clamp(24px, 3vw, 48px) clamp(28px, 3vw, 44px);
}

.kr-home-campaigns--duo .kr-home-campaign__body {
    width: 100%;
    max-width: 560px;
}

.kr-home-campaigns--duo .kr-home-campaign__eyebrow {
    margin-bottom: 10px;
}

.kr-home-campaigns--duo .kr-home-campaign__title {
    margin-bottom: 10px;
    font-size: var(--fs-h2);
}

.kr-home-campaigns--duo .kr-home-campaign__text {
    margin-bottom: 22px;
    font-size: 1.05rem;
}

.kr-home-campaigns--duo .kr-home-campaign .kr-home-campaign__btn {
    padding: 15px 26px;
}

.kr-home-campaigns--duo .kr-home-campaign__note {
    margin-top: 16px;
}

/* Single winter banner (lights campaign over): rider sits mid-photo, so the
   dark gradient starts later than on the lights photo */
.kr-home-campaigns--count-1 .kr-home-campaign--winter-tyres .kr-home-campaign__bg {
    object-position: 50% 48%;
}

.kr-home-campaigns--count-1 .kr-home-campaign--winter-tyres .kr-home-campaign__media::after {
    background:
        linear-gradient(90deg, rgba(13, 15, 20, 0) 32%, rgba(13, 15, 20, 0.6) 52%, rgba(13, 15, 20, 0.88) 72%, rgba(13, 15, 20, 0.92) 100%),
        linear-gradient(180deg, rgba(13, 15, 20, 0.1) 0%, rgba(13, 15, 20, 0.3) 100%);
}

/* Tablet: still side by side, a bit tighter */
@media (max-width: 1024px) {
    .kr-home-campaigns--duo .kr-home-campaign__media {
        aspect-ratio: 16 / 10;
    }

    .kr-home-campaigns--duo .kr-home-campaign .kr-home-campaign__btn {
        padding: 14px 18px;
        font-size: 0.95rem;
    }
}

/* Phone: stacked; each banner = photo strip + text below (same as single) */
@media (max-width: 768px) {
    .kr-home-campaigns--duo {
        grid-template-columns: minmax(0, 1fr);
    }

    .kr-home-campaigns--duo .kr-home-campaign {
        display: block;
    }

    .kr-home-campaigns--duo .kr-home-campaign__media {
        aspect-ratio: 16 / 10;
        max-height: 360px;
    }

    .kr-home-campaigns--duo .kr-home-campaign--lights .kr-home-campaign__bg {
        object-position: 50% 8%; /* keep the rider's helmet in view */
    }

    .kr-home-campaigns--duo .kr-home-campaign--winter-tyres .kr-home-campaign__bg {
        object-position: 50% 50%;
    }

    .kr-home-campaigns--duo .kr-home-campaign__inner {
        margin-top: -48px;
        padding: 0 20px 28px;
    }

    .kr-home-campaigns--duo .kr-home-campaign__text {
        margin-bottom: 18px;
    }

    /* Side by side when both labels fit, otherwise full-width rows (no
       two-line button labels) */
    .kr-home-campaigns--duo .kr-home-campaign__actions {
        flex-wrap: wrap;
    }

    .kr-home-campaigns--duo .kr-home-campaign .kr-home-campaign__btn {
        flex: 1 1 auto;
        padding: 14px 16px;
        font-size: 0.95rem;
        white-space: nowrap;
    }

    .kr-home-campaigns--count-1 .kr-home-campaign--winter-tyres .kr-home-campaign__media::after {
        background: linear-gradient(180deg, rgba(13, 15, 20, 0) 50%, rgba(13, 15, 20, 0.7) 82%, var(--kr-campaign-ground) 100%);
    }

    .kr-home-campaigns--count-1 .kr-home-campaign--winter-tyres .kr-home-campaign__bg {
        object-position: 50% 50%;
    }
}
