/* =========================================================
   GALERÍA CON PESTAÑAS - ESTILOS
========================================================= */

:root {
    --gallery-accent: #0a3d62;   /* azul marino, acorde a la identidad de OPES */
    --gallery-accent-light: #f4f7fa;
    --gallery-radius: 6px;
}

/* --- Pestañas de navegación (estilo sólido cuadrado / corporativo) --- */
.gallery-tabs {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0;
    padding: 0;
    margin: 0 0 45px 0;
    border-bottom: 2px solid #e2e8ee;
}

.gallery-tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 30px;
    border: none;
    background: transparent;
    border-radius: 0;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #5a6b7b;
    cursor: pointer;
    position: relative;
    transition: all 0.25s ease;
}

.gallery-tab-btn i {
    font-size: 16px;
}

.gallery-tab-btn::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 3px;
    background: var(--gallery-accent);
    transform: scaleX(0);
    transition: transform 0.25s ease;
}

.gallery-tab-btn:hover {
    color: var(--gallery-accent);
    background: var(--gallery-accent-light);
}

.gallery-tab-btn.active {
    color: var(--gallery-accent);
    background: var(--gallery-accent-light);
}

.gallery-tab-btn.active::after {
    transform: scaleX(1);
}

/* --- Paneles --- */
.gallery-panel {
    display: none;
}

.gallery-panel.active {
    display: block;
    animation: fadeInPanel 0.4s ease;
}

@keyframes fadeInPanel {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.gallery-empty {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 60px 0;
}

/* --- Grilla estilo masonry (usando CSS grid) --- */
.gallery-masonry {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 160px;
    gap: 14px;
}

.gallery-card {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: var(--gallery-radius);
    grid-row: span 1;
}

/* Cada 5ta imagen ocupa un espacio más grande para dar dinamismo */
.gallery-card-large {
    grid-column: span 2;
    grid-row: span 2;
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.gallery-card:hover img {
    transform: scale(1.1);
}

/* --- Overlay con etiqueta de categoría --- */
.gallery-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0) 55%);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-card:hover .gallery-card-overlay {
    opacity: 1;
}

.gallery-card-tag {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gallery-card-overlay i {
    color: #fff;
    font-size: 18px;
}

/* --- Responsive --- */
@media (max-width: 992px) {
    .gallery-masonry {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .gallery-masonry {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 130px;
    }

    .gallery-tab-btn span {
        display: none; /* solo íconos en mobile para ahorrar espacio */
    }

    .gallery-tab-btn {
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    .gallery-masonry {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 110px;
    }

    .gallery-card-large {
        grid-column: span 2;
        grid-row: span 1;
    }
}