/* ============================================================
   css/gallery.css
   Página de galería: hero, sidebar de álbumes, grid masonry-like.
   ============================================================ */

/* ══════════════════════════════════════════
   HERO
   ══════════════════════════════════════════ */
.gallery-hero {
    background: linear-gradient(135deg, var(--color-ocean-deep), var(--color-ocean-mid));
    padding: 80px var(--space-xl) 60px;
    position: relative;
    overflow: hidden;
}
.gallery-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(46, 196, 212, 0.1) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}
.gallery-hero__inner {
    max-width: var(--max-width-md);
    margin-inline: auto;
    position: relative;
    z-index: 1;
}
.gallery-hero .section-tag { color: var(--color-turquoise); }
.gallery-hero__title {
    font-family: var(--font-display);
    font-size: clamp(40px, 6vw, 72px);
    font-weight: 300;
    color: var(--color-white);
    line-height: 1.05;
    margin: 12px 0 16px;
}
.gallery-hero__title em {
    font-style: italic;
    color: var(--color-turquoise);
}
.gallery-hero__sub {
    font-size: var(--text-base);
    color: rgba(255, 255, 255, 0.6);
    font-weight: 300;
    max-width: 520px;
}

/* ══════════════════════════════════════════
   LAYOUT PRINCIPAL
   ══════════════════════════════════════════ */
.gallery-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 70vh;
    max-width: var(--max-width);
    margin-inline: auto;
    padding: var(--space-xl);
    gap: var(--space-xl);
    align-items: start;
}

/* ══════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════ */
.gallery-sidebar {
    position: sticky;
    top: calc(var(--lang-bar-height) + var(--nav-height) + 24px);
}

/* Toggle mobile (oculto en desktop) */
.gallery-sidebar__toggle { display: none; }

.gallery-sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gallery-sidebar__tab {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 400;
    color: var(--color-text-mid);
    text-align: left;
    transition: all var(--transition-fast);
    width: 100%;
}
.gallery-sidebar__tab:hover {
    background: rgba(14, 77, 110, 0.06);
    color: var(--color-ocean-deep);
    border-color: rgba(14, 77, 110, 0.1);
}
.gallery-sidebar__tab.is-active {
    background: var(--color-ocean-deep);
    color: var(--color-white);
    border-color: var(--color-ocean-deep);
}
.gallery-sidebar__tab-name { flex: 1; }
.gallery-sidebar__tab-count {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}
.gallery-sidebar__tab:not(.is-active) .gallery-sidebar__tab-count {
    background: rgba(14, 77, 110, 0.08);
    color: var(--color-text-mid);
}

/* ══════════════════════════════════════════
   CONTENIDO
   ══════════════════════════════════════════ */
.gallery-content { min-width: 0; }

/* Panel de álbum */
.gallery-panel {
    display: none;
    animation: panel-in 0.4s ease;
}
.gallery-panel.is-active { display: block; }

@keyframes panel-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.gallery-panel__header {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(14, 77, 110, 0.1);
}
.gallery-panel__title {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 300;
    color: var(--color-ocean-deep);
    line-height: 1;
}
.gallery-panel__count {
    font-size: var(--text-sm);
    color: var(--color-text-mid);
    font-weight: 300;
}

/* ── Grid de fotos ── */
.gallery-grid {
    columns: 3;
    column-gap: 12px;
}
.gallery-grid__item {
    display: block;
    break-inside: avoid;
    margin-bottom: 12px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    cursor: zoom-in;
}
.gallery-grid__img {
    width: 100%;
    display: block;
    transition: transform var(--transition-slow);
}
.gallery-grid__item:hover .gallery-grid__img {
    transform: scale(1.04);
}

/* Overlay hover */
.gallery-grid__overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 42, 61, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
    opacity: 0;
    transition: opacity var(--transition-normal);
}
.gallery-grid__item:hover .gallery-grid__overlay { opacity: 1; }

/* Estado vacío */
.gallery-panel__empty {
    text-align: center;
    padding: var(--space-xl) 0;
    color: var(--color-text-mid);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.gallery-panel__empty span { font-size: 48px; opacity: 0.3; }
.gallery-panel__empty p {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 20px;
}

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */
@media (max-width: 960px) {
    .gallery-layout {
        grid-template-columns: 1fr;
        padding: 32px 24px;
        gap: 0;
    }

    .gallery-sidebar {
        position: static;
        margin-bottom: 24px;
    }

    /* Toggle visible en mobile */
    .gallery-sidebar__toggle {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        background: var(--color-ocean-deep);
        color: var(--color-white);
        border: none;
        border-radius: var(--radius-sm);
        padding: 14px 18px;
        font-family: var(--font-body);
        font-size: var(--text-base);
        font-weight: 500;
        cursor: pointer;
    }
    .gallery-sidebar__toggle span:first-of-type { flex: 1; text-align: left; }
    .gallery-sidebar__chevron {
        transition: transform var(--transition-normal);
        flex-shrink: 0;
    }
    .gallery-sidebar.is-open .gallery-sidebar__chevron {
        transform: rotate(180deg);
    }

    /* Nav colapsado en mobile */
    .gallery-sidebar__nav {
        display: none;
        background: var(--color-white);
        border: 1px solid rgba(14, 77, 110, 0.1);
        border-top: none;
        border-radius: 0 0 var(--radius-sm) var(--radius-sm);
        padding: 8px;
    }
    .gallery-sidebar.is-open .gallery-sidebar__nav {
        display: flex;
    }

    .gallery-grid { columns: 2; }
}

@media (max-width: 480px) {
    .gallery-hero { padding: 60px 24px 40px; }
    .gallery-grid { columns: 2; column-gap: 8px; }
    .gallery-grid__item { margin-bottom: 8px; }
}

/* ============================================================
   Lightbox — añadir al final de gallery.css o en su propio archivo.
   ============================================================ */

.lb-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.lb-overlay.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 18, 28, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
}

/* Imagen */
.lb-img-wrap {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 90vh;
}
.lb-img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    display: block;
    border-radius: var(--radius-sm);
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
    transition: opacity 0.25s ease;
}
.lb-img.is-loading { opacity: 0; }

/* Caption */
.lb-caption {
    margin-top: 14px;
    color: rgba(255, 255, 255, 0.65);
    font-size: var(--text-sm);
    font-family: var(--font-display);
    font-style: italic;
    text-align: center;
    max-width: 600px;
}

/* Contador */
.lb-counter {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    letter-spacing: 1.5px;
    z-index: 2;
}

/* Cerrar */
.lb-close {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-fast);
}
.lb-close:hover { background: rgba(255, 255, 255, 0.18); }

/* Flechas */
.lb-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.lb-arrow:hover {
    background: var(--color-turquoise);
    border-color: var(--color-turquoise);
    color: var(--color-ocean-deep);
}
.lb-arrow--prev { left: 20px; }
.lb-arrow--next { right: 20px; }

@media (max-width: 600px) {
    .lb-arrow { display: none; }
    .lb-img   { max-height: 75vh; }
}


