/* =============================================
   GALERÍA ESFERA 3D — OVERLAY
   ============================================= */

/* --- SECCIÓN TRIGGER --- */
.galeria-cta-wrapper {
    text-align: center;
    margin-top: 3rem;
}

/* --- OVERLAY FULLSCREEN --- */
.galeria-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease, background 0.5s ease, backdrop-filter 0.5s ease;
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
}

.galeria-overlay:active {
    cursor: grabbing;
}

.galeria-overlay.active {
    opacity: 1;
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* --- BOTÓN CERRAR --- */
.galeria-close {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 10001;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
    backdrop-filter: blur(10px);
}

.galeria-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* --- ESCENA 3D --- */
.galeria-overlay .scene {
    perspective: 1200px;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.galeria-overlay .sphere {
    position: relative;
    width: 1px;
    height: 1px;
    transform-style: preserve-3d;
}

/* --- CADA IMAGEN --- */
.sphere-item {
    position: absolute;
    border-radius: 10px;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transition: box-shadow 0.3s ease, filter 0.3s ease;
    will-change: transform, opacity;
}

.sphere-item.landscape {
    width: var(--land-w);
    height: var(--land-h);
}

.sphere-item.portrait {
    width: var(--port-w);
    height: var(--port-h);
}

.sphere-item.square {
    width: var(--sq-size);
    height: var(--sq-size);
}

.sphere-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    border-radius: 10px;
}

.sphere-item::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

.sphere-item.near {
    box-shadow: 0 8px 40px rgba(200, 169, 106, 0.25);
    filter: brightness(1.1);
}

.sphere-item.far {
    filter: brightness(0.35) saturate(0.4);
}

/* --- TEXTO CENTRO --- */
.sphere-center-text {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    z-index: 500;
    color: rgba(255, 255, 255, 0.7);
    font-family: var(--font-heading, 'Playfair Display', serif);
}

.sphere-center-text h2 {
    font-size: clamp(1.5rem, 4vw, 3rem);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 2px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
    color: rgba(255, 255, 255, 0.7);
}

/* --- FONDO GLOW --- */
.bg-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(200, 169, 106, 0.05) 0%, transparent 70%);
    pointer-events: none;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
}

/* --- HINT --- */
.galeria-overlay .hint {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;

    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    font-family: var(--font-body);
    letter-spacing: 1.5px;
    text-transform: uppercase;

    padding: 0.6rem 1.6rem;
    border-radius: 50px;

    pointer-events: none;
    transition: opacity 1s ease;
}

.galeria-overlay .hint.hidden {
    opacity: 0;
}

/* --- REGISTRO DE PROPIEDADES --- */
@property --sphere-radius {
    syntax: '<number>';
    inherits: true;
    initial-value: 500;
}
@property --img-size {
    syntax: '<number>';
    inherits: true;
    initial-value: 240;
}
@property --land-w {
    syntax: '<length>';
    inherits: true;
    initial-value: 240px;
}
@property --land-h {
    syntax: '<length>';
    inherits: true;
    initial-value: 165px;
}
@property --port-w {
    syntax: '<length>';
    inherits: true;
    initial-value: 155px;
}
@property --port-h {
    syntax: '<length>';
    inherits: true;
    initial-value: 220px;
}
@property --sq-size {
    syntax: '<length>';
    inherits: true;
    initial-value: 180px;
}


/* --- BOTÓN TÍTULO GALERÍA --- */
.galeria-heading-wrapper {
    text-align: center;
    margin-bottom: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.btn-galeria-heading {
    font-family: var(--font-heading, 'Playfair Display', serif);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 600;
    color: var(--text-dark, #1a2535);
    background: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1.2rem;
    border-radius: 100px;
    position: relative;
    transition: color 0.3s ease, background 0.3s ease;
    outline: none;
}

.btn-galeria-heading::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 100px;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.btn-galeria-heading:hover {
    color: var(--primary, #7a5c3b);
    background: rgba(122, 92, 59, 0.06);
}

.btn-galeria-heading:hover::after {
    border-color: rgba(122, 92, 59, 0.2);
}

.btn-galeria-heading:active {
    background: rgba(122, 92, 59, 0.1);
}

.btn-galeria-heading-icon {
    font-size: 1rem;
    opacity: 0.4;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.btn-galeria-heading:hover .btn-galeria-heading-icon {
    opacity: 1;
    transform: rotate(30deg);
}

.galeria-heading-sub {
    font-size: 0.95rem;
    color: #999;
    font-style: italic;
    margin: 0;
}


/* --- PROPORCIONES FIJAS (no tocar) ---
     landscape : 1 × img-size  /  0.6875 × img-size
     portrait  : 0.646 × img-size  /  0.917 × img-size
     square    : 0.75 × img-size
   --- */
:root {
    --land-w:  calc(var(--img-size) * 1px);
    --land-h:  calc(var(--img-size) * 0.6875px);
    --port-w:  calc(var(--img-size) * 0.646px);
    --port-h:  calc(var(--img-size) * 0.917px);
    --sq-size: calc(var(--img-size) * 0.75px);
}

/* ================================
   AJUSTE POR BREAKPOINT
   Solo modifica estos 2 valores:
     --sphere-radius : tamaño de la esfera
     --img-size      : tamaño de las imágenes
   ================================ */

:root {
    --sphere-radius: 500;
    --img-size: 240;
}


/*TABLET*/
@media (max-width: 768px) {
    :root {
        --sphere-radius: 320;
        --img-size: 260;
    }
}

/*MOVIL*/
@media (max-width: 480px) {
    :root {
        --sphere-radius: 260;
        --img-size: 200;
    }
}

/*ESCRITORIO*/
@media (min-width: 1400px) {
    :root {
        --sphere-radius: 380;
        --img-size: 300;
    }
}