﻿/* =========================================================
   CMD MEDIA INTERACTIONS / GALLERY
========================================================= */

:root {
    --cmd-accent: #c91616;
    --cmd-accent-text: #fff;
    --cmd-line: rgba(0, 0, 0, 0.12);
    --cmd-control-color: #4c4c4c;
    --cmd-control-bg: #fff;
    --cmd-card-shadow: rgba(0, 0, 0, 0.06);
    --cmd-focus: #1269a8;
    --cmd-video-bg: radial-gradient( circle at 30% 30%, #f9f9f9, #6c6c6c 60%, #f9f9f9 );
}

.container-cmd {
    width: 90%;
    margin-inline: auto;
}

.photo-gallery-section,
.photo-video-gallery {
    padding-block: 18px;
}

/* =========================================================
   SECTION HEADER
========================================================= */

.section-header {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0 0 1rem;
    gap: 1rem;
}

    .section-header .line {
        flex: 1 1 auto;
        height: 1px;
        background: var(--cmd-line);
    }

    .section-header .pill {
        display: inline-block;
        padding: 0.55rem 1.8rem;
        color: var(--cmd-accent-text);
        font-size: 1rem;
        font-weight: 600;
        background: var(--cmd-accent);
        border-radius: 999px;
        box-shadow: 0 4px 12px var(--cmd-card-shadow);
    }

/* =========================================================
   SWIPER / PHOTO GALLERY
========================================================= */

.swiper {
    position: relative;
    overflow: hidden;
    padding-bottom: 40px;
}

.swiper-slide {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    overflow: hidden;
}

    .swiper-slide img {
        z-index: 1;
        display: block;
        width: 100%;
        height: auto;
        padding: 0.75rem;
        box-sizing: border-box;
        object-fit: cover;
        border-radius: 5px;
        cursor: zoom-in;
        transition: transform 0.35s ease, filter 0.35s ease;
    }

.gallery-card {
    overflow: hidden;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 6px 18px var(--cmd-card-shadow);
}

    .gallery-card .card-body {
        position: relative;
        min-height: 450px;
        padding: 1rem;
    }

.photo-slide {
    display: block;
    width: 100%;
    height: 320px;
    overflow: hidden;
    object-fit: cover;
    border-radius: 4px;
}

.photo-item {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.photo-tile {
    overflow: hidden;
    background: var(--cmd-video-bg);
    border: 5px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    cursor: pointer;
}

.photo-caption {
    padding: 8px;
    color: #444;
    font-size: 0.9rem;
    text-align: center;
}

/* =========================================================
   GALLERY NAVIGATION
========================================================= */

.gallery-nav-btn {
    position: absolute;
    z-index: 12;
    top: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: #fff;
    background: var(--cmd-accent);
    border: 0;
    border-radius: 50%;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transform: translateY(-50%);
}

    .gallery-nav-btn.nav-prev {
        left: 10px;
    }

    .gallery-nav-btn.nav-next {
        right: 10px;
    }

.hudco-controls {
    position: absolute;
    z-index: 30;
    bottom: 12px;
    left: 50%;
    display: flex;
    align-items: center;
    padding: 6px 10px;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 28px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
    transform: translateX(-50%);
}

.hudco-ctrl {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 8px 10px;
    color: var(--cmd-control-color);
    font-size: 1rem;
    background: var(--cmd-control-bg);
    border-radius: 999px;
    cursor: pointer;
}

    .hudco-ctrl:focus-visible {
        outline: 2px solid rgba(201, 21, 21, 0.35);
        outline-offset: 2px;
    }

.hudco-indicators {
    z-index: 10;
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
    gap: 0.5rem;
}

    .hudco-indicators button {
        width: 10px;
        height: 10px;
        padding: 0;
        background: rgba(0, 0, 0, 0.12);
        border: 0;
        border-radius: 50%;
        cursor: pointer;
    }

        .hudco-indicators button[aria-selected="true"] {
            background: var(--cmd-accent);
            box-shadow: 0 4px 10px rgba(201, 21, 21, 0.18);
        }

/* =========================================================
   LIGHTBOX
========================================================= */

.lightbox {
    position: fixed;
    z-index: 9999;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
}

    .lightbox img {
        max-width: 90%;
        max-height: 90%;
    }

/* =========================================================
   LEGACY HTML VIDEO CARD
   Keep only if another page still uses a native <video> tag.
========================================================= */

.video-card {
    padding: 1.5%;
}

    .video-card video {
        display: block;
        width: 100%;
        height: 350px;
        background: #000;
        border-radius: 4px;
    }

.video-desc {
    padding: 2%;
    text-align: center;
    background: #f3f3f3;
    border-radius: 5px;
}

/* =========================================================
   YOUTUBE GALLERY
========================================================= */

.cmd-gallery-container {
    padding: 1% 0;
    border-radius: 10px;
    /*box-shadow: 0 6px 18px rgba(15, 23, 42, 0.6);*/
}

/* Main player and custom poster */
.main-video-wrapper {
    position: relative;
    width: 75%;
    margin-inline: auto;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 16px;
}

    .main-video-wrapper iframe {
        position: absolute;
        z-index: 1;
        inset: 0;
        display: block;
        width: 100%;
        height: 100%;
        border: 0;
    }

.main-video-poster {
    position: absolute;
    z-index: 2;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    overflow: hidden;
    background: #111;
    border: 0;
    cursor: pointer;
}

    .main-video-poster img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }

    .main-video-poster.is-hidden {
        display: none;
    }

.main-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    width: 78px;
    height: 56px;
    color: #fff;
    background: #f00;
    border-radius: 15px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    place-items: center;
    transform: translate(-50%, -50%);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

    .main-play-button i {
        margin-left: 4px;
        font-size: 23px;
    }

.main-video-poster:hover .main-play-button {
    background: #d90000;
    transform: translate(-50%, -50%) scale(1.08);
}

.main-video-poster:focus-visible {
    outline: 4px solid var(--cmd-focus);
    outline-offset: -4px;
}

/* Video cards */
.video-card-tile {
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
    color: inherit;
    text-align: left;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

    .video-card-tile:hover,
    .video-card-tile:focus-visible {
        border-color: var(--cmd-focus);
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
        transform: translateY(-4px);
    }

    .video-card-tile:focus-visible {
        outline: 3px solid rgba(18, 105, 168, 0.35);
        outline-offset: 3px;
    }

    .video-card-tile.active {
        border-color: var(--cmd-focus);
        box-shadow: 0 0 0 3px rgba(18, 105, 168, 0.18);
    }

.video-thumb {
    position: relative;
    display: block;
    width: 100%;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background-color: #e9ecef;
    background-image: var(--cmd-video-bg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}

    /* Compatibility for gallery markup that still uses .play-icon. */
    .video-thumb .play-icon {
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        font-size: 3rem;
        background: rgba(0, 0, 0, 0.35);
        transition: background-color 0.3s ease;
    }

    .video-thumb:hover .play-icon {
        background: rgba(0, 0, 0, 0.5);
    }

.youtube-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    width: 64px;
    height: 46px;
    color: #fff;
    background: #f00;
    border-radius: 12px;
    place-items: center;
    transform: translate(-50%, -50%);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

    .youtube-play-button i {
        margin-left: 3px;
        font-size: 19px;
    }

.video-card-tile:hover .youtube-play-button {
    background: #d90000;
    transform: translate(-50%, -50%) scale(1.08);
}

.video-caption {
    display: block;
    padding: 15px 17px;
    color: #222;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    text-align: left;
}

.video-unavailable-message {
    display: grid;
    min-height: 240px;
    padding: 30px;
    color: #555;
    text-align: center;
    background: #f5f6f7;
    border-radius: 16px;
    place-items: center;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 991.98px) {
    .gallery-card .card-body {
        min-height: 320px;
    }

    .photo-slide {
        height: 260px;
    }

    .video-card video {
        height: auto;
        max-height: 260px;
    }
}

@media (max-width: 575.98px) {
    .container-cmd {
        width: 94%;
    }

    .gallery-card .card-body {
        min-height: 280px;
        padding: 0.75rem;
    }

    .photo-slide {
        height: 200px;
    }

    .video-card video {
        max-height: 200px;
    }

    .gallery-nav-btn {
        width: 36px;
        height: 36px;
    }

        .gallery-nav-btn.nav-prev {
            left: 8px;
        }

        .gallery-nav-btn.nav-next {
            right: 8px;
        }

    .hudco-controls {
        bottom: 10px;
        padding: 6px;
    }

    .main-video-wrapper {
        border-radius: 10px;
    }

    .main-play-button {
        width: 62px;
        height: 46px;
        border-radius: 12px;
    }

        .main-play-button i {
            font-size: 19px;
        }

    .youtube-play-button {
        width: 54px;
        height: 40px;
        border-radius: 10px;
    }

    .video-caption {
        padding: 12px 14px;
        font-size: 0.94rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .swiper-slide img,
    .video-card-tile,
    .main-play-button,
    .youtube-play-button {
        transition: none;
    }
}
