/* =========================================
   PÁGINA DE GALERÍA
   ========================================= */

.gallery-page {
    max-width: 480px !important;
    padding-bottom: 0;
}

/* =========================================
   HEADER
   ========================================= */
.gallery-header {
    background: var(--fondo-card);
    padding: 48px 24px 16px;
    text-align: center;
    border-bottom: 1px solid var(--dorado-claro);
}

.gallery-subtitle {
    font-family: 'Josefin Sans', serif;
    font-size: 15px;
    font-style: italic;
    color: var(--texto-secundario);
    letter-spacing: 2px;
    margin-top: 4px;
    padding-bottom: 20px;
}

/* =========================================
   CONTADOR
   ========================================= */
.gallery-counter {
    text-align: center;
    padding: 16px;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--dorado);
    background: var(--fondo-suave);
    border-top: 1px solid var(--dorado-claro);
    border-bottom: 1px solid var(--dorado-claro);
    margin-top: 8px;
}

.gallery-counter span {
    font-family: 'Josefin Sans', serif;
    font-size: 22px;
    font-style: italic;
    color: var(--texto-principal);
    margin-right: 4px;
}

/* =========================================
   GRID GALERÍA GRANDE
   ========================================= */
.gallery-section {
    padding: 16px;
}

.gallery-grid-full {
    column-count: 2;
    column-gap: 10px;
    padding: 0;
}

.gallery-item-full {
    break-inside: avoid;
    margin-bottom: 10px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--dorado-muy-claro);
    background: var(--fondo-suave);
    animation: fadeIn 0.4s ease;
}

.gallery-item-full img,
.gallery-item-full video {
    width: 100%;
    height: auto; /* esto es clave para el efecto masonry */
    display: block;
    transition: transform 0.3s ease;
}

.gallery-item-full:hover img,
.gallery-item-full video {
    transform: scale(1.03);
}

/* Overlay con icono al hacer hover */
.gallery-item-full::after {
    content: '🔍';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 28px;
    transition: transform 0.2s ease;
    pointer-events: none;
}

.gallery-item-full:hover::after {
    transform: translate(-50%, -50%) scale(1);
}

/* =========================================
   LOADING Y VACÍO
   ========================================= */
.gallery-loading {
    grid-column: span 2;
    text-align: center;
    padding: 48px 0;
    font-size: 14px;
    font-style: italic;
    color: var(--dorado);
    animation: fadeIn 0.5s ease;
}

.gallery-empty {
    column-span: all;
    width: 100%;
    font-size: 13px;
    color: var(--texto-muted);
    font-style: italic;
    text-align: center;
    padding: 48px 16px;
    border: 1px dashed var(--dorado-claro);
    border-radius: 4px;
    line-height: 1.8;
}

/* =========================================
   MODAL PREVIEW
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    animation: fadeIn 0.3s ease;
    padding: 16px;
}

.modal-overlay img,
.modal-overlay video {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: fixed;
    top: 20px; right: 20px;
    color: white;
    font-size: 28px;
    cursor: pointer;
    background: rgba(255,255,255,0.1);
    border: none;
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal-close:hover {
    background: rgba(255,255,255,0.2);
}

/* =========================================
   BOTÓN VOLVER
   ========================================= */
.btn-back {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 20px 28px 16px;
    padding: 14px;
    border-radius: 2px;
    font-family: 'Josefin Sans', sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    text-align: center;
    color: var(--dorado);
    border: 1px solid var(--dorado-claro);
    background: var(--fondo-suave);
    cursor: pointer;
    transition: all 0.25s ease;
    border-radius: 8px;
}

.btn-back:hover {
    border-color: var(--dorado);
    background: var(--dorado-muy-claro);
}
/* =========================================
   PÉTALOS Y DESTELLOS ANIMADOS
   ========================================= */
.petal {
    position: fixed;
    top: -20px;
    pointer-events: none;
    z-index: 999;
    animation: caerPetalo linear infinite;
    opacity: 0;
}

.petal.rosa {
    font-size: 14px;
}

.petal.dorado {
    width: 6px;
    height: 6px;
    background: var(--dorado);
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(197, 168, 128, 0.8);
}

@keyframes caerPetalo {
    0% {
        opacity: 0;
        transform: translateY(0) rotate(0deg) scale(0.8);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) rotate(360deg) scale(1.1);
    }
}