/* ============================================================================
   FOTOGRAFÍA · PORTAFOLIO EDITORIAL (LAB, 2026-10-09)
   Seis capítulos, una sesión real cada uno. Retícula de celdas cuadradas para
   componer con escalas distintas: una foto protagonista y apoyos asimétricos que
   se superponen. Cada foto se expone (se abre como un obturador) al entrar en
   cuadro, y la luz de la página toma el tono de la sesión que se está viendo.
   Toda foto abre el visor a pantalla completa, sin recorte.
   ========================================================================== */

[data-rh-ft="escena"] .fg-sec {
  --fg-tone: #3a2a20;
  position: relative; padding: clamp(80px, 10vw, 140px) 0 clamp(80px, 10vw, 140px);
  background: #06090d; color: #f4f7fa;
}
[data-rh-ft="escena"] .fg-ambient {
  position: sticky; top: 0; height: 100vh; margin-bottom: -100vh; pointer-events: none; z-index: 0;
  background-color: var(--fg-tone); opacity: 0.26; transition: background-color 0.9s ease;
  -webkit-mask-image: radial-gradient(75% 60% at 50% 45%, #000, transparent 75%);
  mask-image: radial-gradient(75% 60% at 50% 45%, #000, transparent 75%);
}
[data-rh-ft="escena"] .fg-intro { position: relative; z-index: 1; width: min(1240px, 100% - 64px); margin: 0 auto; }
[data-rh-ft="escena"] .fg-intro .rh-h2 { max-width: 18em; }
[data-rh-ft="escena"] .fg-intro__lead { max-width: 40em; margin-top: 18px; font-size: 17px; line-height: 1.6; color: rgba(244, 247, 250, 0.74); }

/* --- Capítulo ---------------------------------------------------------------- */
[data-rh-ft="escena"] .ch { position: relative; z-index: 1; margin-top: clamp(90px, 11vw, 170px); }
[data-rh-ft="escena"] .ch__grid {
  --gap: 16px; --gw: min(1240px, 100vw - 64px);
  width: var(--gw); margin: 0 auto;
  display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: calc((var(--gw) - 11 * var(--gap)) / 12); gap: var(--gap);
}
[data-rh-ft="escena"] .ch__head { align-self: end; padding-bottom: 6px; }
[data-rh-ft="escena"] .ch__n { margin: 0; font-size: clamp(44px, 5vw, 76px); font-weight: 800; line-height: 1; letter-spacing: -0.03em; color: color-mix(in srgb, var(--tone) 55%, #fff); }
[data-rh-ft="escena"] .ch__t { margin: 10px 0 0; font-size: clamp(24px, 2.4vw, 36px); font-weight: 700; line-height: 1.1; letter-spacing: -0.01em; color: #fff; }
[data-rh-ft="escena"] .ch__u { margin: 10px 0 0; font-size: 16px; line-height: 1.45; color: rgba(244, 247, 250, 0.78); max-width: 22em; }
[data-rh-ft="escena"] .ch__c { margin: 12px 0 0; font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(244, 247, 250, 0.5); }

/* --- Foto -------------------------------------------------------------------- */
[data-rh-ft="escena"] .fg { margin: 0; position: relative; min-width: 0; }
[data-rh-ft="escena"] .fg--lead { z-index: 2; }
[data-rh-ft="escena"] .fg__btn {
  display: block; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 2px; overflow: hidden;
  background: #0b0f14; cursor: zoom-in; box-shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.9);
}
[data-rh-ft="escena"] .fg__btn img { display: block; width: 100%; height: 100%; object-fit: cover; }
[data-rh-ft="escena"] .fg__btn:focus-visible { outline: 2px solid #f26a1b; outline-offset: 4px; }
[data-rh-ft="escena"] .fg__btn::after { /* el borde de luz indica que se puede ampliar */
  content: ""; position: absolute; inset: 0; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(243, 234, 216, 0); transition: box-shadow 0.25s ease; pointer-events: none;
}
[data-rh-ft="escena"] .fg__btn:hover::after { box-shadow: inset 0 0 0 1px rgba(243, 234, 216, 0.55); }

/* exposición al entrar en cuadro: el obturador se abre (una sola vez) */
[data-rh-ft="escena"] .fg-sec.fg-ready .fg { clip-path: inset(9% 9% 9% 9%); }
[data-rh-ft="escena"] .fg-sec.fg-ready .fg img { transform: scale(1.12); }
[data-rh-ft="escena"] .fg-sec.fg-ready .fg.is-in { clip-path: inset(0 0 0 0); transition: clip-path 1.1s cubic-bezier(0.16, 0.84, 0.24, 1); }
[data-rh-ft="escena"] .fg-sec.fg-ready .fg.is-in img { transform: scale(1); transition: transform 1.5s cubic-bezier(0.16, 0.84, 0.24, 1); }

/* --- Composiciones (escritorio): columna / filas en celdas cuadradas ----------- */
@media (min-width: 900px) {
  /* 01 Gastronomía: el plato domina; la cenital se monta encima */
  .ch--1 .ch__head { grid-column: 1 / span 4; grid-row: 1 / span 3; }
  .ch--1 .fg:nth-of-type(1) { grid-column: 5 / span 8; grid-row: 1 / span 5; }
  .ch--1 .fg:nth-of-type(2) { grid-column: 2 / span 5; grid-row: 5 / span 3; z-index: 3; }
  /* 02 Retrato: un rostro grande y una secuencia escalonada */
  .ch--2 .ch__head { grid-column: 9 / span 4; grid-row: 1 / span 2; }
  .ch--2 .fg:nth-of-type(1) { grid-column: 1 / span 5; grid-row: 1 / span 7; }
  .ch--2 .fg:nth-of-type(2) { grid-column: 6 / span 3; grid-row: 2 / span 4; }
  .ch--2 .fg:nth-of-type(3) { grid-column: 9 / span 3; grid-row: 3 / span 4; }
  .ch--2 .fg:nth-of-type(4) { grid-column: 6 / span 3; grid-row: 6 / span 4; }
  .ch--2 .fg:nth-of-type(5) { grid-column: 10 / span 3; grid-row: 7 / span 4; }
  /* 03 Editorial: la protagonista al centro, flanqueada a distintas alturas */
  .ch--3 .ch__head { grid-column: 1 / span 4; grid-row: 1 / span 2; }
  .ch--3 .fg:nth-of-type(1) { grid-column: 5 / span 4; grid-row: 1 / span 6; }
  .ch--3 .fg:nth-of-type(2) { grid-column: 1 / span 3; grid-row: 3 / span 4; }
  .ch--3 .fg:nth-of-type(3) { grid-column: 10 / span 3; grid-row: 2 / span 4; }
  .ch--3 .fg:nth-of-type(4) { grid-column: 9 / span 4; grid-row: 6 / span 3; }
  .ch--3 .fg:nth-of-type(5) { grid-column: 3 / span 3; grid-row: 7 / span 4; }
  /* 04 Producto: la textura manda; el contexto de tienda abre */
  .ch--4 .ch__head { grid-column: 9 / span 4; grid-row: 1 / span 2; }
  .ch--4 .fg:nth-of-type(1) { grid-column: 8 / span 5; grid-row: 3 / span 7; }
  .ch--4 .fg:nth-of-type(2) { grid-column: 1 / span 7; grid-row: 1 / span 5; }
  .ch--4 .fg:nth-of-type(3) { grid-column: 1 / span 3; grid-row: 6 / span 4; }
  .ch--4 .fg:nth-of-type(4) { grid-column: 4 / span 3; grid-row: 7 / span 4; }
  .ch--4 .fg:nth-of-type(5) { grid-column: 8 / span 4; grid-row: 10 / span 3; }
  /* 05 Oficios: el retrato de trabajo en alto, el taller en ancho */
  .ch--5 .ch__head { grid-column: 1 / span 4; grid-row: 1 / span 2; }
  .ch--5 .fg:nth-of-type(1) { grid-column: 8 / span 5; grid-row: 1 / span 7; }
  .ch--5 .fg:nth-of-type(2) { grid-column: 1 / span 7; grid-row: 3 / span 5; }
  .ch--5 .fg:nth-of-type(3) { grid-column: 3 / span 5; grid-row: 8 / span 3; }
  .ch--5 .fg:nth-of-type(4) { grid-column: 9 / span 4; grid-row: 8 / span 3; }
  /* 06 Eventos: el montaje completo y el momento en escena */
  .ch--6 .ch__head { grid-column: 9 / span 4; grid-row: 1 / span 2; }
  .ch--6 .fg:nth-of-type(1) { grid-column: 1 / span 8; grid-row: 1 / span 5; }
  .ch--6 .fg:nth-of-type(2) { grid-column: 9 / span 4; grid-row: 3 / span 6; }
  .ch--6 .fg:nth-of-type(3) { grid-column: 2 / span 3; grid-row: 6 / span 4; }
  .ch--6 .fg:nth-of-type(4) { grid-column: 5 / span 4; grid-row: 7 / span 3; }
}

/* --- Móvil / tablet: protagonista y horizontales a lo ancho; verticales en pares -- */
@media (max-width: 899px) {
  [data-rh-ft="escena"] .fg-intro { width: calc(100% - 40px); }
  [data-rh-ft="escena"] .ch { margin-top: 72px; }
  [data-rh-ft="escena"] .ch__grid { --gap: 10px; width: calc(100% - 32px); grid-template-columns: 1fr 1fr; grid-auto-rows: auto; align-items: start; }
  [data-rh-ft="escena"] .ch__head { grid-column: 1 / -1; padding: 0 4px 8px; }
  [data-rh-ft="escena"] .fg { aspect-ratio: var(--ar); }
  [data-rh-ft="escena"] .fg--lead, [data-rh-ft="escena"] .fg--land { grid-column: 1 / -1; }
  [data-rh-ft="escena"] .fg--lead.fg--port { margin: 0 12%; }
  /* vertical sin pareja: a lo ancho y recortada en horizontal, más baja que la protagonista (el visor la muestra completa) */
  [data-rh-ft="escena"] .fg--solo { grid-column: 1 / -1; aspect-ratio: 16 / 10; }
  [data-rh-ft="escena"] .fg--solo img { object-position: 50% 30%; }
  [data-rh-ft="escena"] .ch__n { font-size: 40px; }
}

/* --- Visor a pantalla completa ---------------------------------------------- */
[data-rh-ft="escena"] .fg-viewer {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(4, 6, 9, 0.97); color: #f4f7fa; overflow: hidden;
}
[data-rh-ft="escena"] .fg-viewer::backdrop { background: rgba(4, 6, 9, 0.6); }
[data-rh-ft="escena"] .fg-viewer[open] { animation: fg-in 0.3s ease both; }
@keyframes fg-in { from { opacity: 0; } to { opacity: 1; } }
[data-rh-ft="escena"] .fg-viewer__fig { position: absolute; inset: 24px 88px 84px; margin: 0; display: flex; align-items: center; justify-content: center; }
[data-rh-ft="escena"] .fg-viewer__img { max-width: 100%; max-height: 100%; object-fit: contain; opacity: 1; transform: none; transition: opacity 0.35s ease, transform 0.5s cubic-bezier(0.16, 0.84, 0.24, 1); }
[data-rh-ft="escena"] .fg-viewer__img.is-loading { opacity: 0; transform: scale(0.985); }
[data-rh-ft="escena"] .fg-viewer__cap { position: fixed; left: 24px; right: 24px; bottom: 22px; display: flex; gap: 14px; align-items: baseline; font-size: 14px; }
[data-rh-ft="escena"] .fg-viewer__cap b { font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #f2a56b; white-space: nowrap; }
[data-rh-ft="escena"] .fg-viewer__cap span { color: rgba(244, 247, 250, 0.82); flex: 1; min-width: 0; }
[data-rh-ft="escena"] .fg-viewer__cap i { font-style: normal; font-variant-numeric: tabular-nums; color: rgba(244, 247, 250, 0.55); white-space: nowrap; }
[data-rh-ft="escena"] .fg-viewer__btn, [data-rh-ft="escena"] .fg-viewer__close {
  position: fixed; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(243, 234, 216, 0.28);
  background: rgba(4, 6, 9, 0.6); color: #fff; font-size: 22px; line-height: 1; cursor: pointer;
}
[data-rh-ft="escena"] .fg-viewer__btn:hover, [data-rh-ft="escena"] .fg-viewer__close:hover { border-color: #f26a1b; }
[data-rh-ft="escena"] .fg-viewer__btn:focus-visible, [data-rh-ft="escena"] .fg-viewer__close:focus-visible { outline: 2px solid #f26a1b; outline-offset: 3px; }
[data-rh-ft="escena"] .fg-viewer__btn--prev { left: 20px; top: 50%; margin-top: -24px; }
[data-rh-ft="escena"] .fg-viewer__btn--next { right: 20px; top: 50%; margin-top: -24px; }
[data-rh-ft="escena"] .fg-viewer__close { right: 20px; top: 16px; font-size: 28px; }
@media (max-width: 720px) {
  [data-rh-ft="escena"] .fg-viewer__fig { inset: 64px 8px 170px; }
  [data-rh-ft="escena"] .fg-viewer__btn--prev, [data-rh-ft="escena"] .fg-viewer__btn--next { top: auto; bottom: 104px; margin: 0; }
  [data-rh-ft="escena"] .fg-viewer__btn--prev { left: calc(50% - 60px); }
  [data-rh-ft="escena"] .fg-viewer__btn--next { right: calc(50% - 60px); }
  [data-rh-ft="escena"] .fg-viewer__cap { flex-wrap: wrap; row-gap: 4px; bottom: 14px; font-size: 13px; }
  [data-rh-ft="escena"] .fg-viewer__cap span { order: 3; flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  [data-rh-ft="escena"] .fg-ambient, [data-rh-ft="escena"] .fg-viewer__img, [data-rh-ft="escena"] .fg-viewer[open] { transition: none; animation: none; }
}
