﻿
/* ============================================================
   MEDIA GALLERY
   HUDCO DIGITAL BRAND IDENTITY
============================================================ */

.media-container {
    width: min(100% - 40px, 1260px);
    margin-inline: auto;
}

/* ============================================================
   HERO
============================================================ */

.media-hero {
    position: relative;
    overflow: hidden;
    background: var(--brand-900, #771D1D);
    color: #fff;
}

.media-hero-inner {
    min-height: 230px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.media-hero-content {
    position: relative;
    z-index: 1;
    max-width: 730px;
}

    .media-hero-content h1 {
        margin: 0 0 20px;
        font-size: clamp(30px, 3vw, 40px);
        line-height: 1.2;
        font-weight: 600;
        color: #fff;
    }

    .media-hero-content p {
        margin: 0;
        max-width: 650px;
        color: #fff;
        font-size: 17px;
        line-height: 1.65;
    }

.media-hero-decoration {
    width: 210px;
    height: 210px;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

    .media-hero-decoration::before,
    .media-hero-decoration::after {
        content: "";
        position: absolute;
        border: 1px solid rgba(255,255,255,.12);
        border-radius: 50%;
        pointer-events: none;
    }

    .media-hero-decoration::before {
        inset: -75px;
    }

    .media-hero-decoration::after {
        inset: -155px;
    }

    .media-hero-decoration span {
        font-size: 15px;
        font-weight: 700;
        letter-spacing: 3px;
        text-transform: uppercase;
        text-align: center;
        color: #fff;
    }

/* ============================================================
   GALLERY
============================================================ */

.media-gallery-section {
    padding: 45px 0 75px;
    background: var(--surface-primary, #fff);
}

.media-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px 25px;
}

.media-gallery-card {
    appearance: none;
    display: block;
    width: 100%;
    min-width: 0;
    padding: 0;
    margin: 0;
    border: 1px solid var(--border-light, #C6C6C6);
    border-radius: 13px;
    overflow: hidden;
    background: #fff;
    text-align: left;
    color: var(--text-primary, #150202);
    font: inherit;
    cursor: pointer;
}

    .media-gallery-card:focus-visible {
        outline: 3px solid var(--brand-700, #A72626);
        outline-offset: 4px;
    }

.media-gallery-image {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--surface-secondary, #EBEAEA);
}

    .media-gallery-image img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.media-gallery-heading {
    display: block;
    padding: 15px 17px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text-primary, #150202);
    overflow-wrap: anywhere;
}

.media-gallery-empty {
    text-align: center;
    padding: 70px 15px;
    color: var(--text-secondary, #606060);
}

/* ============================================================
   MODAL
============================================================ */

.media-modal[hidden] {
    display: none !important;
}

.media-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
}

.media-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .92);
}

.media-modal-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(100%, 1250px);
    max-height: calc(100dvh - 44px);
    color: #fff;
}

.media-modal-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 46px;
    gap: 15px;
}

.media-modal-counter {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.media-modal-close {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255,255,255,.45);
    border-radius: 50%;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-size: 29px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-modal-viewer {
    display: flex;
    align-items: center;
    gap: 15px;
    min-height: 0;
    flex: 1;
}

.media-modal-image-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    min-width: 0;
    min-height: 0;
}

    .media-modal-image-wrap img {
        display: block;
        max-width: 100%;
        max-height: calc(100dvh - 180px);
        width: auto;
        height: auto;
        object-fit: contain;
    }

.media-modal-arrow {
    width: 45px;
    height: 45px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,.45);
    border-radius: 50%;
    background: rgba(255,255,255,.08);
    color: #fff;
    font-size: 21px;
    cursor: pointer;
}

    .media-modal-arrow:disabled {
        opacity: .3;
        cursor: default;
    }

    .media-modal-close:focus-visible,
    .media-modal-arrow:focus-visible {
        outline: 3px solid #fff;
        outline-offset: 3px;
    }

.media-modal-caption {
    padding: 20px 45px 5px;
    text-align: center;
    overflow-y: auto;
}

    .media-modal-caption h2 {
        margin: 0;
        color: #fff;
        font-size: 17px;
        font-weight: 500;
        line-height: 1.5;
    }

body.media-modal-open {
    overflow: hidden;
}

/* ============================================================
   RESPONSIVE
============================================================ */

@media (max-width: 991px) {
    .media-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 22px;
    }

    .media-hero-decoration {
        width: 155px;
        height: 155px;
    }

        .media-hero-decoration span {
            font-size: 12px;
            letter-spacing: 2px;
        }
}

@media (max-width: 600px) {
    .media-container {
        width: min(100% - 30px, 1260px);
    }

    .media-hero-inner {
        min-height: 195px;
    }

    .media-hero-content h1 {
        margin-bottom: 12px;
        font-size: 29px;
    }

    .media-hero-content p {
        font-size: 15px;
    }

    .media-hero-decoration {
        display: none;
    }

    .media-gallery-section {
        padding: 25px 0 45px;
    }

    .media-gallery-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .media-gallery-heading {
        padding: 13px 15px;
    }

    .media-modal {
        padding: 12px;
    }

    .media-modal-content {
        max-height: calc(100dvh - 24px);
    }

    .media-modal-viewer {
        gap: 5px;
    }

    .media-modal-arrow {
        width: 32px;
        height: 38px;
        border-radius: 8px;
        font-size: 18px;
    }

    .media-modal-image-wrap img {
        max-height: calc(100dvh - 175px);
    }

    .media-modal-caption {
        padding: 15px 10px 5px;
    }

        .media-modal-caption h2 {
            font-size: 15px;
        }
}



/* ============================================================
   MEDIA GALLERY - IMAGE ZOOM CONTROL
============================================================ */

.media-gallery-image {
    position: relative;
}

/* Zoom icon bottom-right */

.media-gallery-zoom {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: var(--surface-primary, #FFFFFF);
    color: var(--brand-900, #771D1D);
    border: 1px solid var(--border-light, #C6C6C6);
    pointer-events: none;
}

    .media-gallery-zoom svg {
        width: 19px;
        height: 19px;
        flex-shrink: 0;
    }

/* Keyboard accessibility */

.media-gallery-card:focus-visible .media-gallery-zoom {
    outline: 2px solid var(--brand-700, #A72626);
    outline-offset: -3px;
}

/* Mobile */

@media (max-width: 600px) {

    .media-gallery-zoom {
        width: 35px;
        height: 35px;
        right: 10px;
        bottom: 10px;
    }

        .media-gallery-zoom svg {
            width: 18px;
            height: 18px;
        }
}
