
/*
NPS ROBOTICS — Shared Media Standard v1.3
*/

.media-frame {
    position: relative;
    overflow: hidden;
    background: #06131f;
}

/* Hero: Desktop 16:9, Mobile 4:5 */
.media-hero {
    aspect-ratio: 16 / 9;
}

/* Photography card thumbnails: 16:9 */
.media-card-landscape {
    aspect-ratio: 16 / 9;
}

.media-card-landscape > img,
.media-card-landscape img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Poster/artwork: preserve full image */
.media-poster {
    background:
        radial-gradient(
            circle at 50% 50%,
            rgba(44,150,255,.07),
            transparent 45%
        ),
        #030914;
}

.media-poster > img,
.media-poster img {
    width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: contain;
    display: block;
    margin-inline: auto;
}

/* Event detail poster */
.media-poster-detail {
    width: min(920px, 100%);
    margin-inline: auto;
}

.media-poster-detail > img,
.media-poster-detail img {
    width: 100%;
    height: auto;
    max-height: 680px;
    object-fit: contain;
    display: block;
    margin-inline: auto;
}

/* Course / Achievement content cards */
.media-content-card > img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
}

/* Adaptive gallery */
.adaptive-gallery {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-flow: dense;
    gap: 12px;
}

.adaptive-gallery-item {
    grid-column: span 6;
    overflow: hidden;
}

.adaptive-gallery-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.adaptive-gallery-item.is-landscape {
    aspect-ratio: 4 / 3;
}

.adaptive-gallery-item.is-portrait {
    grid-column: span 4;
    aspect-ratio: 3 / 4;
}

.adaptive-gallery-item.is-square {
    grid-column: span 4;
    aspect-ratio: 1 / 1;
}

/* Video */
.media-video-16x9 {
    aspect-ratio: 16 / 9;
}

.media-video-9x16 {
    width: min(420px, 100%);
    aspect-ratio: 9 / 16;
    margin-inline: auto;
}

.media-video-16x9 iframe,
.media-video-9x16 iframe,
.media-video-16x9 video,
.media-video-9x16 video {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

@media (max-width: 640px) {

    .media-poster > img,
    .media-poster img,
    .media-poster-detail > img,
    .media-poster-detail img {
        max-height: none;
    }

    .media-poster-detail {
        width: 100%;
    }

    .adaptive-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 9px;
    }

    .adaptive-gallery-item,
    .adaptive-gallery-item.is-landscape,
    .adaptive-gallery-item.is-portrait,
    .adaptive-gallery-item.is-square {
        grid-column: auto;
    }

    .adaptive-gallery-item.is-landscape {
        grid-column: 1 / -1;
        aspect-ratio: 4 / 3;
    }

    .adaptive-gallery-item.is-portrait {
        aspect-ratio: 3 / 4;
    }

    .adaptive-gallery-item.is-square {
        aspect-ratio: 1 / 1;
    }
}


/* ==========================================================
   Event Polish v1.3.1 gallery count overrides
   ========================================================== */

.adaptive-gallery.gallery-count-1 {
    display: block;
}

.adaptive-gallery.gallery-count-1 .adaptive-gallery-item {
    width: min(680px, 100%);
    margin-inline: auto;
}

.adaptive-gallery.gallery-count-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.adaptive-gallery.gallery-count-2 .adaptive-gallery-item {
    grid-column: auto;
}

@media (max-width: 640px) {

    .adaptive-gallery.gallery-count-2 {
        grid-template-columns: 1fr;
    }
}
