/* ============================================================
   EGA Ambassador Shortcode — style.css
   ============================================================ */

/* ── Wrapper ─────────────────────────────────────────────── */
.ega-amb-wrapper {
    display: flex;
    flex-direction: column;
    gap: 32px;
    width: 100%;
}

/* ── Row (Desktop: equal 3-col grid) ────────────────────── */
.ega-amb-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    align-items: start;
}

/* ── All 3 columns share identical media-wrap sizing ─────── */
/* aspect-ratio 2/3  =  400 : 600                           */
.ega-amb-img-wrap,
.ega-amb-clip-wrap {
    display: block;
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 32px;
    background: #111;
}

/* Images fill the wrap — NO hover zoom/scale ─────────────── */
.ega-amb-img-wrap img,
.ega-amb-clip-wrap img:not(.ega-amb-play-img) {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: none;
    transform: none;
}

/* button reset for clip-wrap ─────────────────────────────── */
.ega-amb-clip-wrap {
    cursor: pointer;
    padding: 0;
    border: none;
    outline: none;
}

/* ── Play button overlay ─────────────────────────────────── */
.ega-amb-play-btn {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* PNG icon — fixed 72px, NO hover/focus change ───────────── */
.ega-amb-play-img {
    width: 72px !important;
    height: 72px !important;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.45));
    transform: none !important;
    transition: none !important;
}

/* ── Popup Modal ─────────────────────────────────────────── */
.ega-amb-popup {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ega-amb-popup[hidden] {
    display: none !important;
}

.ega-amb-popup__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    cursor: pointer;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.ega-amb-popup__container {
    position: relative;
    z-index: 1;
    width: min(380px, 92vw);
    animation: egaAmbFadeIn 0.22s ease both;
}

@keyframes egaAmbFadeIn {
    from { opacity: 0; transform: scale(0.94) translateY(10px); }
    to   { opacity: 1; transform: scale(1)    translateY(0);    }
}

/* Close button — solid black ─────────────────────────────── */
.ega-amb-popup__close {
    position: absolute;
    top: -44px;
    right: -4px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000!important;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s;
}

.ega-amb-popup__close:hover {
    background: #222;
}

.ega-amb-popup__close svg {
    width: 16px;
    height: 16px;
}

.ega-amb-popup__player {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.ega-amb-popup__player::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255,255,255,0.15);
    border-top-color: #fff;
    border-radius: 50%;
    animation: egaAmbSpin 0.7s linear infinite;
}

.ega-amb-popup__player.is-loaded::before {
    display: none;
}

@keyframes egaAmbSpin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.ega-amb-popup__player iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* ── Empty state ─────────────────────────────────────────── */
.ega-amb-empty {
    color: #888;
    font-style: italic;
}


/* ============================================================
   RESPONSIVE — Mobile Carousel with Dots
   ============================================================ */

@media (max-width: 600px) {
    .ega-amb-wrapper {
        gap: 28px;
    }

    .ega-amb-row {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 12px;
        padding-bottom: 4px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .ega-amb-row::-webkit-scrollbar {
        display: none;
    }

    .ega-amb-col {
        flex: 0 0 68vw;
        max-width: 260px;
        scroll-snap-align: start;
    }

    .ega-amb-play-img {
        width: 52px !important;
        height: 52px !important;
    }

    .ega-amb-popup__close {
        top: -40px;
        right: 0;
    }
}

/* Dots — shown on mobile only ─────────────────────────────── */
.ega-amb-dots {
    display: none;
}

@media (max-width: 600px) {
    .ega-amb-dots {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
        margin-top: 10px;
    }

    .ega-amb-dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: #ccc;
        border: none;
        padding: 0;
        cursor: pointer;
        transition: background 0.2s, transform 0.2s;
        flex-shrink: 0;
    }

    .ega-amb-dot.is-active {
        background: #EC6F03;
        transform: scale(1.25);
    }
}