/* ═══════════════════════════════════════════════════════════════════════════
   Ópera de Morelia — Galería: Apple-style Masonry + Lightbox
   Filosofía Apple:
   - Cero chrome (sin cards, sin borders, sin backgrounds)
   - Espacio generoso entre elementos
   - Tipografía sans-serif sutil
   - Hover mínimo (scale interno de la imagen, no del contenedor)
   - Foto = contenido principal, todo lo demás se quita del camino
   ═══════════════════════════════════════════════════════════════════════════ */

/* ──────────── MASONRY ──────────── */
/* NOTA: NO usar `gap` shorthand aquí — anularía column-gap del multi-column. */
.gal-grid,
.wp-block-gallery.opm-gallery{
  display: block !important;
  grid-template-columns: none !important;
  column-count: 1 !important;
  column-gap: 20px !important;
  row-gap: 0 !important;
  margin: 28px 0 0;
}
@media (min-width: 640px){
  .gal-grid,
  .wp-block-gallery.opm-gallery{
    column-count: 2 !important;
    column-gap: 24px !important;
  }
}
@media (min-width: 960px){
  .gal-grid,
  .wp-block-gallery.opm-gallery{
    column-count: 3 !important;
    column-gap: 32px !important;
  }
}
@media (min-width: 1280px){
  .gal-grid,
  .wp-block-gallery.opm-gallery{
    column-count: 4 !important;
    column-gap: 40px !important;
  }
}
@media (min-width: 1600px){
  .gal-grid,
  .wp-block-gallery.opm-gallery{
    column-gap: 44px !important;
  }
}

/* Figure: sin chrome — ni borde, ni fondo, ni padding */
.gal-grid > figure,
.wp-block-gallery.opm-gallery .wp-block-image{
  break-inside: avoid;
  page-break-inside: avoid;
  -webkit-column-break-inside: avoid;
  display: block;
  margin: 0 0 32px;
  padding: 0;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0;
  position: relative;
  cursor: zoom-in;
  outline: none;
  overflow: visible;
  transition: none;             /* sin lift del contenedor */
}
@media (min-width: 960px){
  .gal-grid > figure,
  .wp-block-gallery.opm-gallery .wp-block-image{ margin-bottom: 36px; }
}

/* La imagen: aspect ratio natural, radius muy sutil (estilo Apple) */
.gal-grid > figure img,
.gal-grid > figure.wide img,
.wp-block-gallery.opm-gallery img{
  width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
  aspect-ratio: auto !important;
  display: block;
  border-radius: 6px;
  background: #0a0808;
  transition: transform .55s cubic-bezier(.2,.7,.2,1), filter .35s ease;
  will-change: transform;
}

/* Hover: scale sutilísimo de la imagen, NUNCA del contenedor */
.gal-grid > figure:hover img,
.gal-grid > figure:focus-visible img,
.wp-block-gallery.opm-gallery .wp-block-image:hover img,
.wp-block-gallery.opm-gallery .wp-block-image:focus-visible img{
  transform: scale(1.018);
  filter: brightness(1.04);
}

/* Eliminar el badge de zoom (Apple no usa overlays sobre fotos) */
.gal-grid > figure::after,
.gal-grid > figure::before,
.wp-block-gallery.opm-gallery .wp-block-image::after,
.wp-block-gallery.opm-gallery .wp-block-image::before{
  display: none !important;
  content: none !important;
}

/* Captions: Inter, pequeña, muted, sin italics */
.gal-grid figcaption,
.wp-block-gallery.opm-gallery figcaption{
  padding: 14px 2px 0;
  font-size: 12.5px;
  color: rgba(255,255,255,.5);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-style: normal;
  font-weight: 400;
  letter-spacing: -0.005em;
  line-height: 1.5;
  background: transparent;
}

/* Focus visible: anillo sutil tipo Apple */
.gal-grid > figure:focus-visible,
.wp-block-gallery.opm-gallery .wp-block-image:focus-visible{
  outline: 2px solid rgba(255,255,255,.4);
  outline-offset: 4px;
  border-radius: 6px;
}

/* ──────────── LIGHTBOX (Apple-style) ──────────── */
.opm-lb{
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 56px 96px;
  background: rgba(0,0,0,0);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  opacity: 0;
  transition: opacity .35s ease, background-color .35s ease;
}
.opm-lb.is-open{
  display: flex;
  opacity: 1;
  background: rgba(0,0,0,.985);
}

.opm-lb-stage{
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
}
.opm-lb-imgwrap{
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.opm-lb-img{
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 180px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  transition: opacity .35s ease;
}
.opm-lb-cap{
  color: rgba(255,255,255,.62);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 13.5px;
  letter-spacing: -0.005em;
  text-align: center;
  max-width: 680px;
  line-height: 1.55;
  padding: 0 12px;
}
.opm-lb-count{
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.32);
  font-size: 11px;
  letter-spacing: .14em;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-weight: 400;
}
.opm-lb-spinner{
  position: absolute;
  top: 50%; left: 50%;
  width: 28px; height: 28px;
  margin: -14px 0 0 -14px;
  border: 1.5px solid rgba(255,255,255,.12);
  border-top-color: rgba(255,255,255,.55);
  border-radius: 50%;
  animation: opm-lb-spin .9s linear infinite;
  display: none;
}
@keyframes opm-lb-spin { to { transform: rotate(360deg); } }

/* Controles: minimalistas, sin chip background */
.opm-lb-close,
.opm-lb-nav{
  position: absolute;
  background: transparent;
  border: 0;
  color: rgba(255,255,255,.55);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color .2s ease, background .2s ease, transform .2s ease;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}
.opm-lb-close svg,
.opm-lb-nav svg{
  width: 24px;
  height: 24px;
  display: block;
}
.opm-lb-close:hover,
.opm-lb-nav:hover{
  color: rgba(255,255,255,1);
  background: rgba(255,255,255,.06);
}
.opm-lb-close:active,
.opm-lb-nav:active{ transform: scale(.92); }
.opm-lb-close{ top: 20px; right: 24px; }
.opm-lb-prev{ left: 24px;  top: 50%; transform: translateY(-50%); }
.opm-lb-next{ right: 24px; top: 50%; transform: translateY(-50%); }
.opm-lb-prev:active{ transform: translateY(-50%) scale(.92); }
.opm-lb-next:active{ transform: translateY(-50%) scale(.92); }

/* Tablet / Mobile */
@media (max-width: 900px){
  .opm-lb{ padding: 44px 24px; }
}
@media (max-width: 600px){
  .opm-lb{ padding: 56px 12px 64px; }
  .opm-lb-close{
    top: 12px; right: 12px;
    width: 44px; height: 44px;
  }
  .opm-lb-close svg, .opm-lb-nav svg{ width: 20px; height: 20px; }
  .opm-lb-prev{ left: 6px; }
  .opm-lb-next{ right: 6px; }
  .opm-lb-nav{ width: 44px; height: 44px; color: rgba(255,255,255,.4); }
  .opm-lb-img{ max-height: calc(100vh - 160px); border-radius: 6px; }
  .opm-lb-cap{ font-size: 12.5px; }
  .opm-lb-count{ bottom: 12px; font-size: 10.5px; }
}

@media (max-width: 420px){
  .opm-lb-nav{ display: none; }
  /* Solo swipe en móvil chico */
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .opm-lb, .opm-lb-img,
  .gal-grid > figure img,
  .wp-block-gallery.opm-gallery img{
    transition: none !important;
  }
  .opm-lb-spinner{ animation: none; }
  .gal-grid > figure:hover img,
  .wp-block-gallery.opm-gallery .wp-block-image:hover img{
    transform: none;
  }
}

/* ──────────── INTRO COPY arriba de la galería ──────────── */
.gal-intro{
  color: rgba(255,255,255,.58);
  font-size: 15px;
  line-height: 1.6;
  max-width: 720px;
  margin: 8px 0 4px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-weight: 400;
  letter-spacing: -0.01em;
}
