/* Galería fotográfica aislada: mejora con profundidad y alternativa HTML. */
.work-gallery{position:relative;isolation:isolate;background:#f3f3f1;color:#0a0a0a;margin-top:2rem}
.wg-stage{padding:3.5rem max(1.25rem,5vw) 3rem}
.wg-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;position:relative;z-index:3}
.wg-head h2{font-size:clamp(2.75rem,5.2vw,5rem);font-weight:500;line-height:1;letter-spacing:-.045em}
.wg-head h2 em{font-family:"Instrument Serif",Georgia,serif;font-weight:400}
.wg-mode{min-height:46px;font-size:.875rem}
.wg-mode[hidden]{display:none}
.wg-scene{position:relative;margin-top:2rem}
.wg-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1.25rem;list-style:none;padding:0;margin:0}
.wg-item{min-width:0;list-style:none}
.wg-card{display:block;position:relative;width:100%;height:100%;aspect-ratio:4/5;padding:.4rem;background:#fff;box-shadow:0 12px 30px #0000000a;text-decoration:none}
.wg-card img{display:block;width:100%;height:100%;object-fit:cover;background:#e2e2df}
.wg-card:focus-visible{outline:3px solid #0a0a0a;outline-offset:6px}
.wg-card::after{content:"";position:absolute;inset:.4rem;pointer-events:none;box-shadow:inset 0 0 0 1px #00000008}
.wg-foot{display:flex;justify-content:space-between;align-items:center;gap:1rem;margin-top:1.5rem;position:relative;z-index:3}
.wg-note{font-size:.875rem;color:#62625f;line-height:1.5}
.wg-navigation{display:none;align-items:center;gap:.75rem;margin-left:auto}
.wg-count{font-variant-numeric:tabular-nums;min-width:3.5rem;text-align:center;font-size:.875rem}
.wg-step{display:inline-flex;align-items:center;justify-content:center;width:48px;height:48px;flex:none;border:1px solid #b7b7b4;border-radius:50%;background:transparent;color:#0a0a0a;cursor:pointer;transition:background-color .2s,color .2s}
.wg-step:hover{background:#0a0a0a;color:white;border-color:#0a0a0a}
.wg-step:focus-visible{outline:2px solid currentColor;outline-offset:4px}
.wg-step .icon{width:20px;height:20px}
.wg-prev .icon{transform:rotate(180deg)}
.wg-hint{display:none;font-size:.875rem;color:#62625f;margin-left:auto}
.wg-live{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.work-gallery.is-curved{height:240svh}
.is-curved .wg-stage{position:sticky;top:0;height:100svh;display:flex;flex-direction:column;overflow:hidden;padding-top:clamp(1.5rem,5vh,3.5rem);padding-bottom:max(1.5rem,env(safe-area-inset-bottom));}
.is-curved .wg-scene{flex:1;min-height:0;perspective:1400px;perspective-origin:50% 48%;touch-action:pan-y pinch-zoom;cursor:grab;margin-top:1rem;margin-inline:calc(-1 * max(1.25rem,5vw));}
.is-curved .wg-scene.is-dragging{cursor:grabbing}
.is-curved .wg-list{position:absolute;inset:0;display:block;transform-style:preserve-3d;pointer-events:none}
.is-curved .wg-item{position:absolute;left:50%;top:50%;width:var(--wg-card-width,20rem);aspect-ratio:4/5;transform-style:preserve-3d;will-change:transform,opacity}
.is-curved .wg-card{aspect-ratio:auto;backface-visibility:hidden;user-select:none;-webkit-user-drag:none;box-shadow:0 18px 35px #00000016}
.is-curved .wg-card img{pointer-events:none;-webkit-user-drag:none;user-select:none}
.is-curved .wg-foot{margin-top:.75rem}
.is-curved .wg-navigation{display:flex}
.is-curved .wg-hint{display:block}
.wg-viewer{position:fixed;inset:0;width:100%;height:100%;max-width:none;max-height:none;border:0;padding:0;margin:0;background:#101010;color:#fff;overflow:auto;overscroll-behavior:contain}
.wg-viewer::backdrop{background:#101010f5}
.wg-viewer[open]{display:flex;flex-direction:column}
.wg-viewer-top{display:flex;justify-content:space-between;align-items:center;gap:1rem;padding:1rem 1.5rem;flex:none}
.wg-viewer-title{font-size:.875rem;font-weight:400;color:#d2d2d2}
.wg-viewer-close{width:48px;height:48px;display:flex;align-items:center;justify-content:center;border:1px solid #666;border-radius:50%;color:white;background:none;cursor:pointer}
.wg-viewer-close .icon{width:20px;height:20px}
.wg-viewer-photo{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;padding:0 1.5rem}
.wg-viewer-photo img{display:block;object-fit:contain;width:100%;height:100%;max-height:calc(100svh - 11rem)}
.wg-viewer-bottom{flex:none;display:flex;justify-content:center;align-items:center;gap:1rem;padding:1rem 1.25rem max(1rem,env(safe-area-inset-bottom))}
.wg-viewer .wg-step{border-color:#666;color:white}
.wg-viewer .wg-step:hover{color:#0a0a0a;background:white}
.wg-viewer :focus-visible{outline:2px solid white;outline-offset:4px}
html.wg-viewer-open{overflow:hidden}
@media(max-width:639px){
  .wg-stage{padding:2.5rem 1.25rem 2rem}
  .wg-head h2{font-size:clamp(2.2rem,10vw,3.25rem)}
  .wg-mode{padding:.75rem 1rem;font-size:.875rem;letter-spacing:0}
  .wg-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem}
  .wg-card{padding:.25rem}
  .wg-card::after{inset:.25rem}
  .wg-foot{align-items:flex-start}
  .wg-note{max-width:10rem}
  .wg-step{width:46px;height:46px}
  .wg-navigation{gap:.35rem}
  .work-gallery.is-curved{height:230svh}
  .is-curved .wg-stage{padding:1.5rem 1.25rem max(1.25rem,env(safe-area-inset-bottom))}
  .is-curved .wg-head{align-items:center}
  .is-curved .wg-foot{align-items:center;flex-wrap:wrap;row-gap:.75rem}
  .is-curved .wg-hint{display:none}
  .wg-viewer-top{padding:.75rem 1rem}
  .wg-viewer-photo{padding:0 .5rem}
}
@media(max-height:500px) and (min-width:640px){
  .is-curved .wg-stage{padding-block:1rem}
  .is-curved .wg-head h2{font-size:2.2rem}
  .is-curved .wg-mode{min-height:44px;padding-block:.6rem}
  .is-curved .wg-scene{margin-top:.5rem}
  .is-curved .wg-foot{margin-top:.25rem}
}
@media(prefers-reduced-motion:reduce){.wg-step{transition:none}}
