.eam-media-gallery {
    margin: 16px 0;
    --eam-btn-bg: #ffffff;
    --eam-btn-text: #31567b;
    --eam-btn-border: #c7d9ea;
    --eam-btn-hover-bg: #f3f8ff;
    --eam-btn-hover-text: #0c4b80;
    --eam-btn-hover-border: #9ebbd8;
    --eam-btn-active-bg: #0c4b80;
    --eam-btn-active-text: #ffffff;
    --eam-btn-active-border: #0c4b80;
}

.eam-media-header h3 {
    margin: 0 0 12px;
    color: #0c4b80;
    font-size: 24px;
    font-weight: 700;
}

.eam-media-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 16px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.eam-filter-btn {
    border: 1px solid var(--eam-btn-border);
    background: var(--eam-btn-bg);
    color: var(--eam-btn-text);
    border-radius: 12px;
    padding: 12px 18px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.1px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
}

.eam-filter-btn:hover {
    background: var(--eam-btn-hover-bg);
    color: var(--eam-btn-hover-text);
    border-color: var(--eam-btn-hover-border);
}

.eam-filter-btn.is-active {
    background: var(--eam-btn-active-bg);
    color: var(--eam-btn-active-text);
    border-color: var(--eam-btn-active-border);
    box-shadow: 0 6px 14px rgba(12, 75, 128, 0.28);
}

.eam-media-grid {
    display: grid;
    grid-template-columns: repeat(var(--eam-columns, 3), minmax(0, 1fr));
    gap: 12px;
}

.eam-media-card {
    display: block;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #d9e2ec;
    background: #f8fafc;
    height: 100%;
}

.eam-media-box {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #eef2f7;
    overflow: hidden;
}

.eam-media-image,
.eam-video-embed iframe,
.eam-video-native {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center center;
    border: 0;
    display: block;
}

.eam-video-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 10px;
    color: #0c4b80;
    font-weight: 600;
    word-break: break-word;
    text-decoration: none;
    text-align: center;
}

.eam-hidden,
.eam-hidden-by-limit {
    display: none !important;
}

.eam-loadmore-wrap {
    margin-top: 12px;
    text-align: center;
}

.eam-loadmore-btn {
    border: 1px solid var(--eam-btn-border);
    background: var(--eam-btn-bg);
    color: var(--eam-btn-text);
    border-radius: 12px;
    padding: 12px 18px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.1px;
    cursor: pointer;
    min-width: 140px;
}

.eam-loadmore-btn:hover {
    background: var(--eam-btn-hover-bg);
    color: var(--eam-btn-hover-text);
    border-color: var(--eam-btn-hover-border);
}

.eam-mobile-controls {
    display: none;
}

.eam-mobile-hint {
    display: none;
}

.eam-mobile-nav {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid #c7d9ea;
    background: #fff;
    color: #0c4b80;
    font-size: 22px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.eam-media-empty {
    padding: 14px;
    border: 1px dashed #c0ccda;
    border-radius: 8px;
    color: #64748b;
    background: #f8fafc;
}

.eam-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(3, 8, 14, 0.9);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.eam-lightbox.is-open {
    display: flex;
}

.eam-lightbox-stage {
    margin: 0;
    width: min(92vw, 1200px);
    height: min(84vh, 900px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.eam-lightbox-media-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
}

.eam-lightbox-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.24s ease, opacity 0.2s ease, filter 0.2s ease;
    will-change: transform;
    touch-action: none;
}

.eam-lightbox-image.is-swiping {
    opacity: 0.82;
    filter: saturate(0.88);
}

.eam-lightbox.is-loading .eam-lightbox-image {
    opacity: 0.5;
}

.eam-lightbox-spinner {
    position: absolute;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 3px solid rgba(255, 255, 255, 0.32);
    border-top-color: #ffffff;
    opacity: 0;
    pointer-events: none;
    animation: eamSpin 0.85s linear infinite;
    transition: opacity 0.2s ease;
}

.eam-lightbox.is-loading .eam-lightbox-spinner {
    opacity: 1;
}

.eam-lightbox-counter {
    color: #dbe7f3;
    font-size: 14px;
    font-weight: 600;
}

.eam-lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 44px;
    line-height: 1;
    cursor: pointer;
}

.eam-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: rgba(8, 22, 39, 0.72);
    color: #fff;
    font-size: 34px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
}

.eam-lightbox-prev {
    left: 16px;
}

.eam-lightbox-next {
    right: 16px;
}

.eam-lightbox-zoom {
    position: absolute;
    bottom: 18px;
    right: 20px;
    display: inline-flex;
    gap: 8px;
}

.eam-lightbox-zoom-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.42);
    background: rgba(8, 22, 39, 0.72);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.eam-zoom-reset {
    width: auto;
    min-width: 58px;
    font-size: 13px;
    padding: 0 10px;
}

body.eam-lightbox-open {
    overflow: hidden;
}

@keyframes eamSpin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 1024px) {
    .eam-media-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .eam-mobile-controls {
        display: flex;
        justify-content: center;
        gap: 8px;
        margin: 10px 0 4px;
    }

    .eam-mobile-hint {
        display: block;
        margin: 0 0 10px;
        text-align: center;
        font-size: 12px;
        color: #64748b;
    }

    .eam-media-grid {
        display: flex;
        gap: 10px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        padding-bottom: 4px;
        scrollbar-width: none;
    }
    .eam-media-grid::-webkit-scrollbar { display: none; }

    .eam-item {
        flex: 0 0 82vw;
        scroll-snap-align: start;
    }

    .eam-media-header h3 {
        font-size: 20px;
    }

    .eam-lightbox {
        padding: 12px;
    }

    .eam-lightbox-nav {
        width: 44px;
        height: 44px;
        font-size: 26px;
    }

    .eam-lightbox-zoom {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        bottom: 14px;
    }

    .eam-lightbox-zoom-btn {
        width: 44px;
        height: 44px;
    }
}
