/* ===== Hero ===== */
.gallery-hero {
    background: linear-gradient(135deg, #0f1d45 0%, #1a2a5e 30%, #243674 60%, #2e4a8a 100%);
    position: relative;
    overflow: hidden;
    padding: 80px 20px 64px;
    text-align: center;
}
.gallery-hero-deco {
    position: absolute;
    opacity: 0.07;
    pointer-events: none;
}
.gallery-hero-deco--tr { width: 320px; height: 320px; top: -80px; right: -60px; }
.gallery-hero-deco--bl { width: 240px; height: 240px; bottom: -80px; left: -40px; }
.gallery-hero-title {
    font-size: 2.4rem;
    font-weight: 400;
    color: #fff;
    margin: 0 0 14px;
}
.gallery-hero-subtitle {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.65);
    max-width: 540px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ===== Filter bar ===== */
.gallery-filter-bar {
    background: #fff;
    border-bottom: 1px solid #eaecf4;
    padding: 0 16px;
    display: flex;
    gap: 0;
    justify-content: center;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(36, 54, 116, 0.06);
}
.gallery-filter-btn {
    padding: 16px 22px;
    font-size: 1.0rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    color: #666;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}
.gallery-filter-btn:hover { color: #243674; }
.gallery-filter-btn.active {
    color: #243674;
    font-weight: 700;
    border-bottom-color: #243674;
}

/* ===== Page wrap ===== */
.gallery-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 52px 20px 72px;
}

/* ===== Category section ===== */
.category-section { margin-bottom: 64px; }
.category-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a2a5e;
    margin: 0 0 6px;
    padding-bottom: 14px;
    border-bottom: 2px solid #e8ecf4;
    display: flex;
    align-items: center;
    gap: 12px;
}
.category-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 22px;
    background: linear-gradient(180deg, #243674, #4a6cb3);
    border-radius: 2px;
    flex-shrink: 0;
}
.category-description {
    font-size: 0.93rem;
    color: #888;
    margin: 10px 0 24px;
    line-height: 1.6;
}

/* ===== Grid ===== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* ===== Card ===== */
.gallery-item {
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 14px rgba(36, 54, 116, 0.07);
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    background: #fff;
}
.gallery-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 48px rgba(36, 54, 116, 0.18);
}
.gallery-item-media {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #e4e9f4;
}
.gallery-item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.gallery-item:hover .gallery-item-image { transform: scale(1.06); }

.gallery-item-video-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a2a5e, #243674);
}

/* Overlay — shown on hover for images, always for video */
.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 18, 50, 0.42);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s;
}
.gallery-item:hover .gallery-item-overlay,
.gallery-item--video .gallery-item-overlay { opacity: 1; }
.gallery-item--video .gallery-item-overlay { background: rgba(10, 18, 50, 0.38); }

.overlay-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}
.gallery-item:hover .overlay-icon { transform: scale(1.1); }
.overlay-icon svg { width: 22px; height: 22px; fill: #243674; }
.overlay-icon--play svg { margin-left: 3px; }

/* Card text */
.gallery-item-content { padding: 12px 14px 14px; }
.gallery-item-title {
    font-size: 0.93rem;
    font-weight: 400;
    color: #1a1a2e;
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gallery-item-description {
    font-size: 0.82rem;
    color: #999;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== Empty state ===== */
.gallery-empty {
    text-align: center;
    padding: 100px 0;
    color: #bbb;
    font-size: 1.05rem;
}

/* ===== Lightbox ===== */
.gallery-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5, 10, 30, 0.93);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2000;
    animation: modalFadeIn 0.2s ease;
}
@keyframes modalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.gallery-modal-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px 40px;
    box-sizing: border-box;
}
.gallery-modal-media-wrap {
    max-width: 90vw;
    max-height: 72vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gallery-modal-media {
    max-width: 100%;
    max-height: 72vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}
.gallery-modal-close {
    position: fixed;
    top: 16px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 2010;
    line-height: 1;
}
.gallery-modal-close:hover { background: rgba(255, 255, 255, 0.25); }

.gallery-modal-caption {
    margin-top: 22px;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
}
.gallery-modal-caption-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 5px;
}
.gallery-modal-caption-desc {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
    line-height: 1.5;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .gallery-hero-title { font-size: 1.8rem; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .gallery-modal-inner { padding: 52px 12px 32px; }
    .gallery-filter-btn { padding: 14px 14px; font-size: 0.83rem; }
}
@media (max-width: 480px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .gallery-hero { padding: 60px 16px 48px; }
    .category-title { font-size: 1.05rem; }
}
