/* ENHEBRADOS · 4 fotografías siempre parejas, cuadrados y pase automático */
.gallery-section .gallery{
 display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;
 gap:16px!important;align-items:start;min-height:180px;
}
.gallery-section .gallery > button:first-child{grid-column:auto;grid-row:auto;}
.gallery-section .gallery > button{
 min-width:0;position:relative;transition:opacity .35s ease,transform .35s ease;
 transform-origin:center center;cursor:zoom-in;
}
.gallery-section .gallery > button[hidden]{display:none!important}
.gallery-section .gallery > button img{
 display:block;width:100%!important;height:auto!important;aspect-ratio:1/1!important;
 object-fit:cover!important;border-radius:17px!important;
 box-shadow:0 14px 35px #3b302628!important;
 transition:transform .75s ease,filter .7s ease!important;
}
.gallery-section .gallery > button span{display:block;margin-top:10px;font-size:clamp(.76rem,1.15vw,1rem)}
.gallery-section .gallery > button:hover img,
.gallery-section .gallery > button:focus-visible img{
 transform:scale(1.045) translateY(-3px)!important;filter:saturate(1.14) brightness(1.05);
}
.gallery-section .gallery.is-changing > button:not([hidden]){
 opacity:0;transform:translateY(20px) scale(.95)
}
.gallery-section .gallery > button.gallery-arrive{
 animation:gallery-entrance .84s cubic-bezier(.18,.68,.2,1) both;
 animation-delay:calc(var(--gallery-item-index,0) * .13s);
}
@keyframes gallery-entrance {
 0%{opacity:0;filter:blur(4px);transform:translateY(25px) scale(.92)}
 100%{opacity:1;filter:blur(0);transform:translateY(0) scale(1)}
}
.gallery-motion-toolbar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;
 gap:15px;padding:12px 16px;margin:0 0 18px;border-radius:17px;
 background:color-mix(in srgb,var(--brand,#806c58) 9%,white);border:1px solid #ad9b862f;
}
.gallery-motion-label{font-size:.85rem;letter-spacing:.02em;opacity:.88}
.gallery-motion-actions{display:flex;gap:8px;align-items:center}
.gallery-motion-actions button{font:inherit;min-width:41px;min-height:41px;border-radius:50%;
 border:1px solid #ac9a85a8;background:#fff;box-shadow:0 3px 8px #0000000b;
 color:var(--brand,#654b43);cursor:pointer;display:grid;place-items:center;font-size:1.15rem;
 transition:transform .2s,background .2s;
}
.gallery-motion-actions button:hover{background:#fbecd8;transform:translateY(-2px)}
.gallery-motion-actions button:focus-visible{outline:3px solid var(--brand,#634d49);outline-offset:2px}
.gallery-motion-status{font-size:.79rem;min-width:50px;text-align:center}
/* El resto de las fotos sigue disponible en la galería ampliada con flechas. */
.gallery-section .hero-art img,.hero-art img,.story-art img{animation:enhebrados-portrait 13s ease-in-out infinite alternate}
@keyframes enhebrados-portrait{from{filter:saturate(1);transform:scale(1.01)}to{filter:saturate(1.07);transform:scale(1.055)}}
@media(max-width:780px){
 .gallery-section .gallery{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:13px!important}
 .gallery-motion-toolbar{padding:10px;gap:8px}.gallery-motion-label{font-size:.75rem}
 .gallery-motion-actions button{min-width:39px;min-height:39px}
}
@media(prefers-reduced-motion:reduce){
 .gallery-section .gallery > button.gallery-arrive,.hero-art img,.story-art img{animation:none!important}
 .gallery-section .gallery > button{transition:none!important}
 .gallery-section .gallery > button img{transition:none!important}
}

/* Galería estable: cuatro casillas, sin desplazamientos bruscos cuando cambia una foto. */
.gallery-section .gallery.is-staggered{grid-template-areas:"a b c d";grid-auto-flow:row;gap:16px;align-items:stretch;}
.gallery-section .gallery.is-staggered > button {position:relative;align-self:start;opacity:1;transform:none;}
.gallery-section .gallery.is-staggered > button.gallery-cross-out {animation:gallery-soft-out 1.15s ease-in-out forwards!important;pointer-events:none;}
.gallery-section .gallery.is-staggered > button.gallery-cross-in {animation:gallery-soft-in 1.15s ease-in-out forwards!important;}
@keyframes gallery-soft-out {0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.975)}}
@keyframes gallery-soft-in {0%{opacity:0;transform:scale(1.035)}100%{opacity:1;transform:scale(1)}}
@media(max-width:780px){.gallery-section .gallery.is-staggered {grid-template-areas:"a b" "c d";gap:13px}}
@media(prefers-reduced-motion:reduce){.gallery-section .gallery.is-staggered > button.gallery-cross-in,.gallery-section .gallery.is-staggered > button.gallery-cross-out{animation:none!important}}
