/* ==========================================================================
   HOJA DE ESTILOS DEFINITIVA - SECCIÓN GALERÍA MASONRY CON LIGHTBOX
   ========================================================================== */

/* BANNER SUPERIOR DE GALERÍA */
.category-hero-banner {
    width: 100%;
    height: 260px;
    margin-top: 70px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
    padding: 0 20px;
}

.category-banner-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.category-fixed-tag {
    font-family: 'Montserrat', sans-serif;
    color: var(--verde-alimar);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.category-dynamic-main-title {
    font-family: var(--fuente-titulos) !important;
    color: var(--blanco) !important;
    font-size: 48px;
    font-style: italic;
    font-weight: 400;
    text-transform: uppercase;
    margin: 0;
    line-height: 1.1;
}

/* MOSAICO MASONRY */
.alimar-gallery-main-section {
    width: 100%;
    background-color: #f4f6f9;
    padding: 50px 20px 80px 20px;
    box-sizing: border-box;
}

.gallery-inner-container {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
}

.alimar-custom-masonry-render .wp-block-gallery,
.alimar-custom-masonry-render ul.blocks-gallery-grid {
    column-count: 3 !important;
    column-gap: 15px !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

.alimar-custom-masonry-render .wp-block-gallery .wp-block-image,
.alimar-custom-masonry-render ul.blocks-gallery-grid li.blocks-gallery-item {
    display: block !important;
    width: 100% !important;
    margin: 0 0 15px 0 !important;
    break-inside: avoid !important;
}

.alimar-custom-masonry-render .wp-block-gallery .wp-block-image img,
.alimar-custom-masonry-render ul.blocks-gallery-grid li.blocks-gallery-item img {
    width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
    border-radius: 8px !important;
    display: block;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.alimar-custom-masonry-render .wp-block-gallery .wp-block-image img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* --------------------------------------------------------------------------
   ESTILOS EXCLUSIVOS DEL LIGHTBOX EN PANTALLA COMPLETA
   -------------------------------------------------------------------------- */
.alimar-lightbox-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(4, 24, 51, 0.95);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.alimar-lightbox-overlay.lightbox-active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content-box {
    max-width: 85%;
    max-height: 85%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#lightbox-target-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.lightbox-close-btn {
    position: absolute;
    top: 30px; right: 40px;
    color: var(--blanco);
    font-size: 45px;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
    user-select: none;
}
.lightbox-close-btn:hover { color: var(--verde-alimar); }

.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 35px;
    padding: 20px;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s, background-color 0.2s;
    border-radius: 4px;
}
.lightbox-arrow:hover {
    color: var(--blanco);
    background-color: rgba(255, 255, 255, 0.08);
}
.arrow-left { left: 30px; }
.arrow-right { right: 30px; }

/* ADAPTACIÓN RESPONSIVA MÓVIL */
@media (max-width: 991px) {
    .alimar-custom-masonry-render .wp-block-gallery,
    .alimar-custom-masonry-render ul.blocks-gallery-grid { column-count: 2 !important; }
    .lightbox-arrow { font-size: 28px; padding: 15px; }
    .arrow-left { left: 10px; }
    .arrow-right { right: 10px; }
    .lightbox-close-btn { top: 20px; right: 25px; font-size: 38px; }
}

@media (max-width: 600px) {
    .category-hero-banner {
        height: 200px;
        margin-top: 60px;
    }
    .category-dynamic-main-title { font-size: 30px; }
    .alimar-custom-masonry-render .wp-block-gallery,
    .alimar-custom-masonry-render ul.blocks-gallery-grid { column-count: 1 !important; }
}