/* The three ready-made popup designs: Poster, Split and Bright card.
   Markup is in partials/popup-design.blade.php; this file is only loaded
   on pages that show one (see partials/site-popups.blade.php), on top of
   site-popups.css. Colours still come from that file's theme variables. */
.ap-popup__dialog--design { max-width: none; }

.ap-d__title {
    margin: 16px 0 10px;
    font-family: 'Josefin Sans', sans-serif;
    font-size: clamp(34px, 4.6vw, 58px);
    line-height: .98;
    font-weight: 700;
    color: var(--ap-title);
}
.ap-d__accent { color: var(--ap-accent); }
.ap-d__sub {
    margin: 0 0 22px;
    max-width: 62ch;
    font-size: 17px;
    line-height: 1.55;
    opacity: .95;
}
.ap-popup__dialog--design .ap-popup__badge { margin-bottom: 0; }
.ap-popup__dialog--design .ap-popup__checklist { margin-bottom: 22px; }
.ap-popup__dialog--design .ap-popup__checklist li { font-size: 16px; }
.ap-popup__dialog--design .ap-popup__countdown { margin-bottom: 4px; }
.ap-popup__dialog--design .ap-popup__countdown-label { text-align: left; }
.ap-popup__dialog--design .ap-popup__buttons { margin-top: 22px; }

.ap-focus--left { object-position: 18% center; }
.ap-focus--center { object-position: center; }
.ap-focus--right { object-position: 82% center; }

/* ---- Poster: the picture/video fills the whole popup ---------------------- */
.ap-popup__dialog--poster {
    max-width: 1000px;
    aspect-ratio: 16 / 9.4;
    background: #02121c;
    color: #fff;
    border-radius: 28px;
}
.ap-poster__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ap-poster__bg--video { container-type: size; overflow: hidden; background: transparent; }
/* The video fades in only once it is really playing (see watchPlaying in
   site-popups.js), so the cover picture — or the dark backdrop — shows until then. */
.ap-poster__bg--video iframe,
.ap-poster__bg--video video { opacity: 0; transition: opacity .7s ease; }
.ap-poster__bg--video.is-playing iframe,
.ap-poster__bg--video.is-playing video { opacity: 1; }
.ap-poster__bg video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* An embedded video scaled up until it covers the popup, like object-fit: cover.
   The extra 20% pushes YouTube's title strip and logo past the edges. */
.ap-poster__bg iframe {
    position: absolute;
    left: 50%;
    top: 50%;
    width: calc(max(100cqw, 177.78cqh) * 1.2);
    height: calc(max(100cqh, 56.25cqw) * 1.2);
    transform: translate(-50%, -50%);
    border: 0;
    pointer-events: none;
}
.ap-poster__shade {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(0, 0, 0, .45) 0, rgba(0, 0, 0, 0) 28%, rgba(2, 18, 28, .55) 52%, rgba(2, 18, 28, .94) 100%);
}
.ap-poster__scroll {
    position: relative;
    z-index: 2;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 26px 44px 38px;
    /* The video's "tap to unmute" sits underneath — let clicks reach it. */
    pointer-events: none;
}
.ap-poster__scroll > * { pointer-events: auto; }
/* Just a logo and a tag — not clickable, so the unmute chip beside the X stays reachable. */
.ap-poster__scroll > .ap-poster__top { pointer-events: none; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-right: 56px; }
.ap-poster__logo { height: 44px; width: auto; background: #fff; border-radius: 10px; padding: 5px 10px; }
.ap-poster__body { margin-top: auto; padding-top: 24px; }
.ap-d__title--poster {
    margin: 0 0 12px;
    font-size: clamp(40px, 7vw, 76px);
    color: #fff;
    text-shadow: 0 6px 30px rgba(0, 0, 0, .5);
}
.ap-d__title--poster .ap-d__accent {
    background: linear-gradient(90deg, color-mix(in srgb, var(--ap-accent) 62%, #fff), var(--ap-accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.ap-popup__dialog--poster .ap-d__sub { font-size: 19px; max-width: 620px; color: #fff; }
.ap-poster__bar { display: flex; gap: 22px 28px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.ap-poster__timer { flex: 1 1 340px; max-width: 430px; }
.ap-popup__dialog--poster .ap-popup__countdown-label { color: var(--ap-accent); text-align: left; }
.ap-popup__dialog--poster .ap-popup__countdown-boxes > div {
    background: rgba(255, 255, 255, .14);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.ap-popup__dialog--poster .ap-popup__countdown-boxes b { color: #fff; }
.ap-popup__dialog--poster .ap-popup__countdown-ended { color: #fff; }
.ap-popup__dialog--poster .ap-popup__buttons { margin-top: 0; }
.ap-popup__dialog--poster .ap-btn { padding: 20px 36px; }
.ap-popup__dialog--poster .ap-btn--secondary { color: #fff !important; border-color: rgba(255, 255, 255, .75); }
/* The unmute chip goes top-right (beside the X) so it never sits under the text. */
.ap-popup__dialog--poster .ap-popup__unmute { left: auto; right: 68px; top: 20px; bottom: auto; }

/* ---- Split: picture/video on the left, details on the right --------------- */
.ap-popup__dialog--split {
    max-width: 1120px;
    display: grid;
    grid-template-columns: 1.12fr 1fr;
    grid-template-rows: minmax(0, 1fr);
    background: var(--ap-bg);
    border-radius: 26px;
}
.ap-split__media {
    position: relative;
    min-height: 420px;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.ap-split__media .ap-popup__video { box-shadow: none; border-radius: 0; }
.ap-split__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ap-split__shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(0, 0, 0, .04) 45%, rgba(0, 20, 30, .85)); }
.ap-split__caption { position: absolute; left: 26px; bottom: 26px; right: 26px; z-index: 2; color: #fff; }
.ap-split__caption small { display: block; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; opacity: .88; }
.ap-split__caption strong { font-family: 'Josefin Sans', sans-serif; font-size: 28px; font-weight: 700; line-height: 1.15; }
.ap-split__panel .ap-d__title { font-size: clamp(30px, 3.6vw, 48px); margin-top: 14px; }
.ap-split__panel .ap-d__sub { margin-bottom: 16px; font-size: 16px; }
.ap-split__panel .ap-popup__checklist { gap: 9px; margin-bottom: 16px; }
.ap-split__panel .ap-popup__buttons { margin-top: 18px; }
.ap-split__panel {
    padding: 40px 40px 32px;
    background:
        radial-gradient(520px 320px at 100% 0, var(--ap-glow-a), transparent 70%),
        var(--ap-bg);
}
.ap-split__panel .ap-popup__countdown-label { margin-top: 4px; }

/* ---- Bright card: white card, picture on top ------------------------------ */
.ap-popup__dialog--card {
    max-width: 900px;
    background: #fff;
    color: #3d4852;
    border-radius: 26px;
    --ap-fg: #3d4852;
    --ap-title: #004d65;
    --ap-box-bg: rgba(255, 255, 255, .12);
    --ap-box-fg: #fff;
    --ap-box-shadow: none;
}
.ap-card__scroll { padding: 0; }
.ap-card__hero { position: relative; height: 290px; background: #0b1c26; }
.ap-card__hero > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ap-card__hero::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, .4));
}
.ap-card__hero--video { height: auto; background: #000; }
.ap-card__hero--video::after { display: none; }
.ap-card__hero--video .ap-popup__video { border-radius: 0; box-shadow: none; }
.ap-card__ribbon {
    position: absolute;
    left: 0;
    top: 28px;
    z-index: 2;
    padding: 11px 26px 11px 24px;
    border-radius: 0 999px 999px 0;
    background: var(--ap-btn-bg);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    box-shadow: 0 8px 20px rgba(252, 99, 4, .45);
}
.ap-card__chip {
    position: absolute;
    right: 22px;
    bottom: -26px;
    z-index: 3;
    max-width: 60%;
    padding: 14px 22px;
    border-radius: 18px;
    background: #fff;
    text-align: center;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .22);
}
.ap-card__chip small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #7a8791; }
.ap-card__chip b { font-family: 'Josefin Sans', sans-serif; font-size: 26px; line-height: 1.15; color: #004d65; }
.ap-card__in { padding: 34px 40px 36px; }
.ap-d__title--card { margin: 0 0 8px; font-size: clamp(32px, 4.2vw, 46px); }
.ap-popup__dialog--card .ap-d__accent { color: #fc6304; }
.ap-popup__dialog--card .ap-d__sub { max-width: 600px; }
.ap-card__cols { display: grid; gap: 22px; align-items: center; }
.ap-popup__dialog--card .ap-popup__checklist { margin-bottom: 0; }
.ap-popup__dialog--card .ap-popup__checklist li { color: #263238; }
.ap-popup__dialog--card .ap-popup__checklist li::before { background: #e8f3f6; box-shadow: none; }
.ap-popup__dialog--card .ap-popup__checklist li::after { border-color: #004d65; }
.ap-card__timer {
    padding: 20px 18px 18px;
    border-radius: 20px;
    background: linear-gradient(160deg, #00303f, #004d65);
    color: #fff;
}
.ap-card__timer .ap-popup__countdown-label { text-align: center; color: #ffa45c; }
.ap-card__timer .ap-popup__countdown-ended { color: #fff; }
.ap-popup__dialog--card .ap-btn--light { background: #e8f3f6; }
.ap-popup__dialog--card .ap-btn--secondary { color: #004d65 !important; }

@media (min-width: 760px) {
    .ap-card__cols--two { grid-template-columns: 1.1fr 1fr; gap: 28px; }
}

/* ---- Designs on phones ------------------------------------------------------ */
@media (max-width: 759px) {
    .ap-popup__dialog--poster { aspect-ratio: auto; height: calc(100dvh - 20px); border-radius: 22px; }
    .ap-poster__scroll { padding: 18px 20px 22px; }
    .ap-poster__top { margin-right: 52px; }
    .ap-poster__logo { height: 36px; }
    .ap-poster__body { padding-top: 24px; }
    .ap-popup__dialog--poster .ap-d__sub { font-size: 16px; }
    .ap-poster__timer { flex-basis: 100%; max-width: none; }
    .ap-popup__dialog--poster .ap-popup__countdown-boxes b { font-size: 26px; }
    .ap-popup__dialog--poster .ap-btn { padding: 17px 22px; }
    .ap-popup__dialog--poster .ap-popup__unmute { right: 60px; top: 14px; }

    .ap-popup__dialog--split { display: block; overflow-y: auto; border-radius: 22px; }
    .ap-split__media { min-height: 230px; }
    .ap-split__panel { padding: 26px 20px 24px; overflow: visible; }
    .ap-split__caption strong { font-size: 22px; }

    .ap-card__hero { height: 190px; }
    .ap-card__hero--video { height: auto; }
    .ap-card__in { padding: 30px 20px 22px; }
    .ap-card__chip { right: 14px; padding: 10px 16px; }
    .ap-card__chip b { font-size: 21px; }
}
