/* ============================================================
   JUAN PABLO ARROYO — PSICÓLOGO Y DIVULGADOR
   Hoja de estilos principal
   Versión 1.0 — 07.2026
   ============================================================ */

/* ----------------------------------------------------------
   FUENTES AUTOALOJADAS (WOFF2) — Playfair Display + Manrope
   Subconjunto latin (cubre español). Sin llamadas a Google.
   ---------------------------------------------------------- */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/manrope-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('../fonts/playfair-display-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Playfair Display';
  font-style: italic;
  font-weight: 400 500;
  font-display: swap;
  src: url('../fonts/playfair-display-italic-latin.woff2') format('woff2');
}

/* ----------------------------------------------------------
   CSS CUSTOM PROPERTIES (Paleta oficial)
   ----------------------------------------------------------
   NOTA PARA QA: El brief escrito indica Olive Mist #A39A48,
   pero la imagen oficial de paleta del cliente dice #A39A64.
   Se usa #A39A64 (la imagen oficial manda).
   ---------------------------------------------------------- */
:root {
  /* ── Colores principales ── */
  --cream: #F5EDE4;           /* fondo base, NUNCA blanco puro */
  --ink: #3D2E2E;             /* texto principal, NUNCA negro puro */
  --olive-mist: #A39A64;      /* SUPERFICIE/ACENTO: bordes, separadores, fondos, puntos, iconos */
  --olive-text: #736C44;      /* TEXTO oliva AA: cursivas, ARROYO, etiquetas (4,58:1 sobre cream, 5,22:1 sobre warm-white) */
  --arcilla-premium: #B87963; /* líneas finas, separadores, foco accesible */
  --arcilla-action: #A0522D;  /* variante oscura para textos hover sobre crema (contraste AA) */
  --sand: #D8B894;            /* panel fotográfico hero, fondos secundarios */
  --warm-white: #FFFDF9;      /* texto de botones e iconos sobre Olive Mist */
  --ink-muted: #746765;       /* texto atenuado AA sobre cream (4,68:1) — estados "no disponible" */
  --cream-muted: #BEB4AD;     /* texto atenuado AA sobre ink (6,34:1) — pie */

  /* ── Variante funcional para contraste (si fuera necesaria) ── */
  --olive-action: #7D7638;

  /* ── Tipografías ── */
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-functional: 'Manrope', 'Helvetica Neue', Arial, sans-serif;

  /* ── Tamaños fluidos (clamp) ── */
  --fs-section-title: clamp(58px, 7.2vw, 112px);
  --fs-hero-title: clamp(50px, 4.8vw, 78px);
  --fs-brand-name: clamp(52px, 4.7vw, 76px);
  --fs-body: clamp(19px, 1.6vw, 28px);
  --fs-editorial: clamp(23px, 2.1vw, 36px);
  --fs-credentials: clamp(14px, 1.3vw, 21px);
  --fs-button: clamp(17px, 1.7vw, 28px);

  /* ── Espaciado ── */
  --section-padding: clamp(54px, 5.5vw, 84px);
  --inline-padding: clamp(22px, 6vw, 108px);
}

/* ----------------------------------------------------------
   RESET & BASE
   ---------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-functional);
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  font: inherit;
  border: none;
  background: none;
}

/* ----------------------------------------------------------
   TIPOGRAFÍA
   ---------------------------------------------------------- */
h1, h2, h3, h4 {
  font-weight: 400;
}

/* ── Titulares de sección (h2) ── */
.section-title {
  font-family: var(--font-display);
  font-size: var(--fs-section-title);
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--ink);
  margin-bottom: clamp(16px, 2vw, 28px);
}

.section-title em {
  font-style: italic;
  color: var(--olive-text);
}

/* ── Párrafos ── */
p {
  max-width: 1080px;
}

/* ----------------------------------------------------------
   LAYOUT: CONTENEDORES
   ---------------------------------------------------------- */
.site-container {
  width: min(100%, 1680px);
  margin-inline: auto;
}

.section-inner {
  width: 100%;
  max-width: 1480px;
  margin-inline: auto;
  padding-inline: var(--inline-padding);
}

/* ── Secciones ── */
.site-section {
  padding-block: var(--section-padding);
}

/* ----------------------------------------------------------
   LÍNEAS EDITORIALES (Arcilla Premium)
   ---------------------------------------------------------- */
.section-divider {
  width: clamp(76px, 7vw, 120px);
  height: 3px;
  border-radius: 999px;
  background: var(--arcilla-premium);
  margin-bottom: clamp(28px, 3vw, 56px);
}

.section-divider--long {
  width: 92%;
  height: 2px;
  border-radius: 0;
  margin: 0 0 clamp(20px, 2.5vw, 26px);
}

/* ----------------------------------------------------------
   BOTONES PRINCIPALES (.cta-primary)
   ---------------------------------------------------------- */
.cta-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 3vw, 46px);

  min-height: 76px;
  padding: 20px 34px;

  border: 0;
  border-radius: 10px;

  /* Verde oliva de marca en su variante funcional oscura: garantiza
     contraste AA con el texto blanco (el #A39A64 claro solo alcanza 2,85:1) */
  background: var(--olive-action);
  color: var(--warm-white);

  font-family: var(--font-functional);
  font-weight: 500;
  font-size: var(--fs-button);
  text-decoration: none;
  text-align: left;

  cursor: pointer;

  transition:
    transform 180ms cubic-bezier(.22, 1, .36, 1),
    background-color 180ms cubic-bezier(.22, 1, .36, 1),
    box-shadow 180ms cubic-bezier(.22, 1, .36, 1);
}

.cta-primary:hover {
  transform: translateY(-2px);
  background-color: #726B33;
  box-shadow: 0 10px 26px rgba(61, 46, 46, 0.13);
}

/* El icono de reproducción mantiene el blanco cálido sobre el verde oliva */
.cta-primary:hover .icon-play,
.cta-primary:focus-visible .icon-play {
  background: transparent;
  border-color: var(--warm-white);
}

.cta-primary:focus-visible {
  outline: 3px solid rgba(125, 118, 56, 0.9);
  outline-offset: 5px;
}


/* ── Botón ancho centrado en su contenedor ── */
.cta-wrapper {
  display: flex;
  justify-content: flex-start;
  margin-top: clamp(32px, 4vw, 56px);
}

/* ----------------------------------------------------------
   ICONOS SVG INLINE
   ---------------------------------------------------------- */
.icon-play {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  background: transparent;
  border: 2px solid var(--warm-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 220ms ease, border-color 220ms ease;
}

.icon-play svg {
  width: 40%;
  height: 40%;
  fill: var(--warm-white);
}

.icon-arrow {
  flex-shrink: 0;
  width: clamp(26px, 2.5vw, 36px);
  height: clamp(26px, 2.5vw, 36px);
  background: var(--olive-mist);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-arrow svg {
  width: 40%;
  height: 40%;
  fill: var(--warm-white);
}

.icon-whatsapp {
  flex-shrink: 0;
  width: clamp(28px, 2.8vw, 40px);
  height: clamp(28px, 2.8vw, 40px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-whatsapp svg {
  width: 100%;
  height: 100%;
  fill: var(--warm-white);
}

/* ----------------------------------------------------------
   HEADER & NAVEGACIÓN
   ---------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding-block: clamp(14px, 2vw, 24px);
  transition:
    background-color 300ms ease,
    box-shadow 300ms ease,
    padding-block 300ms ease;
}

/* ── Header al hacer scroll: barra oscura premium ── */
.site-header--scrolled {
  background-color: rgba(51, 46, 41, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(20, 16, 14, 0.18);
  border-bottom: 1px solid rgba(245, 237, 228, 0.12);
  padding-block: clamp(8px, 1.2vw, 14px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1480px;
  margin-inline: auto;
  padding-inline: var(--inline-padding);
}

/* ── Logo ── */
.header-logo {
  display: inline-flex;
  align-items: center;
  gap: clamp(10px, 1.2vw, 16px);
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
}

.header-logo-symbol {
  width: clamp(34px, 3vw, 46px);
  height: clamp(34px, 3vw, 46px);
  flex: none;
  color: var(--ink);
}

.header-logo-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.header-logo-name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(17px, 1.5vw, 22px);
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
  transition: color 300ms ease;
}

.header-logo-name .header-logo-last {
  color: var(--olive-text);
  letter-spacing: 0.06em;
}

.header-logo-sub {
  font-family: var(--font-functional);
  font-weight: 500;
  font-size: clamp(9px, 0.75vw, 11px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.62;
  white-space: nowrap;
  transition: color 300ms ease, opacity 300ms ease;
}

/* ── Textos claros sobre la barra oscura al hacer scroll ── */
.site-header--scrolled .header-logo,
.site-header--scrolled .header-logo-name {
  color: var(--warm-white);
}

.site-header--scrolled .header-logo-sub {
  color: var(--warm-white);
  opacity: 0.7;
}

.site-header--scrolled .header-nav a {
  color: var(--warm-white);
}

.site-header--scrolled .header-nav a:hover,
.site-header--scrolled .header-nav a:focus-visible {
  color: var(--sand);
}

.site-header--scrolled .header-hamburger span {
  background: var(--warm-white);
}

/* ── Con el menú móvil abierto: header transparente y textos oscuros ── */
.site-header--scrolled:has(.header-hamburger--open) {
  background-color: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
  border-bottom-color: transparent;
}

.site-header--scrolled:has(.header-hamburger--open) .header-logo,
.site-header--scrolled:has(.header-hamburger--open) .header-logo-name,
.site-header--scrolled:has(.header-hamburger--open) .header-logo-sub {
  color: var(--ink);
}

.site-header--scrolled:has(.header-hamburger--open) .header-logo-sub {
  opacity: 0.62;
}

.site-header--scrolled:has(.header-hamburger--open) .header-hamburger span {
  background: var(--ink);
}

/* ── Navegación escritorio ── */
.header-nav {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 36px);
}

.header-nav a {
  font-family: var(--font-functional);
  font-weight: 500;
  font-size: clamp(15px, 1.2vw, 18px);
  color: var(--ink);
  transition: color 180ms ease;
  position: relative;
}

.header-nav a:hover,
.header-nav a:focus-visible {
  color: var(--arcilla-action);
}

.header-nav a:focus-visible {
  outline: 3px solid rgba(184, 121, 99, 0.7);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ── Hamburguesa (móvil) ── */
.header-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
  background: none;
  border: none;
  z-index: 1001;
}

.header-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  border-radius: 999px;
  transition:
    transform 250ms ease,
    opacity 250ms ease,
    background-color 300ms ease;
}

.header-hamburger--open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.header-hamburger--open span:nth-child(2) {
  opacity: 0;
}

.header-hamburger--open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Menú móvil ── */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--cream);
  z-index: 999;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: var(--inline-padding);
  gap: clamp(18px, 4vh, 32px);
}

.mobile-nav--open {
  display: flex;
}

.mobile-nav a {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 5vw, 42px);
  color: var(--ink);
  line-height: 1.1;
}

.mobile-nav a:hover,
.mobile-nav a:focus-visible {
  color: var(--arcilla-action);
}

/* ----------------------------------------------------------
   SECCIÓN 1 — HERO (#inicio)
   ---------------------------------------------------------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  padding-top: clamp(96px, 10vw, 140px);
  padding-bottom: clamp(48px, 6vw, 80px);
}

.hero .section-inner {
  display: flex;
  align-items: stretch;
  flex: 1;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 58%) minmax(0, 42%);
  gap: clamp(40px, 4vw, 56px);
  align-items: stretch;
  flex: 1;
}

/* ── Columna izquierda: texto ── */
.hero-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  padding-right: clamp(34px, 5vw, 76px);
}

.hero-brand {
  font-family: var(--font-display);
  font-size: var(--fs-brand-name);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin-bottom: clamp(16px, 2vw, 22px);
  white-space: nowrap;
}

.hero-brand .brand-first {
  font-style: italic;
  color: var(--ink);
  font-weight: 400;
}

.hero-brand .brand-last {
  font-style: italic;
  font-weight: 400;
  text-transform: uppercase;
  color: var(--olive-text);
}

.hero-credentials {
  font-family: var(--font-functional);
  font-weight: 400;
  font-size: var(--fs-credentials);
  line-height: 1.55;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  max-width: 1080px;
  margin-bottom: clamp(40px, 5vw, 64px);
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-hero-title);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--ink);
  max-width: 1080px;
  margin-bottom: clamp(32px, 4vw, 46px);
}

.hero-title em {
  display: block;
  font-style: italic;
  color: var(--olive-text);
}

.hero-rhythm {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(27px, 2.2vw, 37px);
  line-height: 1.18;
  color: var(--ink);
  margin-bottom: clamp(32px, 4vw, 48px);
}

.hero-rhythm span {
  display: block;
}

.hero-emotional {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(20px, 1.75vw, 28px);
  line-height: 1.45;
  color: var(--ink);
  max-width: 1080px;
}

.hero-emotional em {
  font-style: italic;
  color: var(--olive-text);
}

/* ── Botón del hero: anclado abajo, dimensiones editoriales ── */
.hero .cta-wrapper {
  margin-top: auto;
  padding-top: clamp(40px, 5vw, 64px);
}

.hero .cta-primary {
  width: min(100%, 610px);
  min-height: 76px;
  padding: 0 28px;
  gap: 18px;
  justify-content: flex-start;
  font-size: 18px;
  border-radius: 8px;
}

/* ── Columna derecha: panel fotográfico ── */
.hero-visual {
  width: 100%;
  display: flex;
  margin-top: 24px;
}

.hero-photo {
  width: 100%;
  flex: 1;
  background-color: var(--sand);
  border-radius: 0;
  position: relative;
  overflow: hidden;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* Velo cálido sutil para integrar la foto con la paleta arena */
.hero-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(216, 184, 148, 0.16), rgba(61, 46, 46, 0.05));
  pointer-events: none;
}

/* ----------------------------------------------------------
   SECCIÓN 2 — PARA TI (#para-ti)
   ---------------------------------------------------------- */
.para-ti-intro {
  font-family: var(--font-functional);
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink);
  margin-bottom: clamp(8px, 1.5vw, 16px);
}

.para-ti-intro em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--olive-text);
}

.para-ti-content {
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 2vw, 28px);
}

.para-ti-content p {
  font-family: var(--font-functional);
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink);
}

.para-ti-content p strong {
  font-family: var(--font-functional);
  font-weight: 700;
}

.para-ti-content p em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--olive-text);
}

/* ----------------------------------------------------------
   SECCIÓN 3 — TEMAS (#temas)
   ---------------------------------------------------------- */
#temas .section-title {
  font-size: clamp(52px, 5.3vw, 88px);
  letter-spacing: -0.035em;
}

.temas-subtitle {
  font-family: var(--font-functional);
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink);
  margin-bottom: clamp(8px, 1.5vw, 16px);
}

.temas-subtitle strong {
  font-weight: 700;
}

.temas-subtitle em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--olive-text);
}

.temas-cta-text {
  font-family: var(--font-functional);
  font-weight: 700;
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink);
  margin-bottom: clamp(28px, 3.5vw, 48px);
}

/* ── Cuadrícula de tarjetas ── */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 1.3vw, 20px);
}

/* ── Tarjeta de tema (enlace clicable) ── */
.topic-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 24px;
  background: rgba(255, 253, 249, 0.22);
  border: 1px solid rgba(163, 154, 100, 0.78);
  border-radius: 10px;
  min-height: 96px;
  text-decoration: none;
  transition:
    transform 200ms cubic-bezier(.22, 1, .36, 1),
    border-color 200ms ease,
    background-color 200ms ease,
    box-shadow 200ms ease;
}

.topic-card:hover {
  transform: translateY(-3px);
  border-color: var(--arcilla-premium);
  background-color: rgba(184, 121, 99, 0.08);
  box-shadow: 0 10px 24px rgba(61, 46, 46, 0.08);
}

/* Al pulsar (táctil y ratón): el cuadrante se queda en arcilla */
.topic-card:active {
  border-color: var(--arcilla-premium);
  background-color: rgba(184, 121, 99, 0.12);
  transform: translateY(-1px);
}

a.topic-card:focus-visible {
  outline: 3px solid rgba(184, 121, 99, 0.7);
  outline-offset: 4px;
}

/* El icono es un elemento gráfico que transmite información (WCAG 1.4.11 exige
   3:1 con el fondo adyacente). Sobre `--olive-mist` el glifo `--warm-white`
   daba 2,81:1; con `--olive-action` sube a 4,57:1 sin tocar el token de
   superficie ni la estructura de la tarjeta. En hover se usa la variante oscura
   de arcilla (5,53:1) para que el estado activo siga oscureciendo, no aclarando. */
.topic-card__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  background: var(--olive-action);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color 200ms ease,
    transform 200ms cubic-bezier(.22, 1, .36, 1);
}

.topic-card:hover .topic-card__icon {
  background: var(--arcilla-action);
  transform: scale(1.06);
}

.topic-card__icon svg {
  width: 38%;
  height: 38%;
  fill: var(--warm-white);
}

.topic-card__text {
  font-family: var(--font-functional);
  font-weight: 500;
  font-size: clamp(16px, 1.15vw, 20px);
  line-height: 1.3;
  color: var(--ink);
}


/* ----------------------------------------------------------
   SECCIÓN 4 — SOBRE MÍ (#sobre-mi)
   ---------------------------------------------------------- */
.sobre-mi-content {
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 2vw, 28px);
}

.sobre-mi-content p {
  font-family: var(--font-functional);
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink);
}

.sobre-mi-content p strong {
  font-family: var(--font-functional);
  font-weight: 700;
}

.sobre-mi-content p em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--olive-text);
}

/* ── Pregunta editorial ── */
.sobre-mi-question {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: var(--fs-editorial);
  line-height: 1.5;
  color: var(--ink);
  max-width: 1350px;
}

.sobre-mi-question em {
  font-style: italic;
  color: var(--olive-text);
}

/* ----------------------------------------------------------
   SECCIÓN 4b — GALERÍA «SOBRE MÍ»
   Contenido dinámico materializado al publicar desde la tabla
   `media` (kind = 'gallery'). Todas las clases de este bloque
   las emite `generateGalleryGrid()`; si se renombra una aquí
   hay que renombrarla allí (CHANGELOG-QA 2026-09-06).
   ---------------------------------------------------------- */

/* Ritmo vertical: la galería respira como el resto de la sección. El margen
   superior separa del texto; no hay margen inferior porque lo aporta el
   `padding-block` de `.site-section`. */
.sobre-mi-gallery {
  margin-top: clamp(34px, 4vw, 60px);
}

/* El atributo `hidden` es una regla del user-agent con especificidad mínima:
   cualquier `display` propio la anularía en silencio (CHANGELOG-QA 2026-11-14,
   `.admin-cms-bar__dirty[hidden]`). Se declara explícitamente para que el
   estado vacío que aplica `js/main.js` sea real. */
.sobre-mi-gallery[hidden] {
  display: none;
}

/* Estado vacío SIN JavaScript: si el generador no ha emitido ningún
   `.gallery__item`, la galería entera no se pinta. No hay hueco, no hay
   contenedor colapsado y el visitante no ve ningún mensaje que parezca un
   error: la sección simplemente no tiene galería todavía.
   `:has()` es compatible con los navegadores del sitio (2023+); el `hidden`
   del JS queda como respaldo para el resto. */
.sobre-mi-gallery:not(:has(.gallery__item)) {
  display: none;
}

.sobre-mi-gallery__title {
  font-family: var(--font-display);
  font-size: var(--fs-editorial);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  /* Texto en `--ink` (14,2:1 sobre cream). Prohibido `--olive-mist` como color
     de texto: 2,46:1 (V-01, CHANGELOG-QA 2026-11-14). */
  color: var(--ink);
  margin-bottom: clamp(16px, 2vw, 24px);
}

/* ── Cuadrícula ──
   Mobile-first: 1 columna; 2 a partir de 560 px; 3 desde 900 px. */
.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(12px, 1.6vw, 20px);
}

/* ── Miniatura ──
   El disparador es un `<button>` real: foco, teclado (Enter/Espacio) y nombre
   accesible gratis, sin `role="button"` ni manejadores sintéticos. */
.gallery__trigger {
  display: block;
  width: 100%;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--sand);
  /* Solo `transform` y `box-shadow`: nada de `top`/`width`, que provocan
     reflow en cada frame. */
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 220ms ease;
}

.gallery__trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(61, 46, 46, 0.14);
}

.gallery__trigger:active {
  transform: translateY(0);
}

/* Foco visible: anillo con `--arcilla-action` (5,53:1 sobre cream), nunca
   `outline: none` sin sustituto. */
.gallery__trigger:focus-visible {
  outline: 3px solid var(--arcilla-action);
  outline-offset: 3px;
}

/* Proporción reservada: 0 CLS. La imagen se recorta con `object-fit`, pero el
   contenedor SIEMPRE mide lo mismo aunque la imagen tarde o no cargue. */
.gallery__media {
  display: block;
  aspect-ratio: 4 / 3;
  width: 100%;
  overflow: hidden;
}

.gallery__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Micro-zoom en hover: transform puro, sin reflow. `will-change` no se usa a
     propósito: la cuadrícula puede tener muchas fotos y no queremos reservar
     una capa por cada una. */
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery__trigger:hover .gallery__img,
.gallery__trigger:focus-visible .gallery__img {
  transform: scale(1.04);
}

/* La descripción va FUERA del contenedor con `aspect-ratio`, así puede refluir
   al 200 % de zoom sin recortarse (CHANGELOG-QA 2026-11-14, `.video-embed--pending`).
   Color `--ink-muted` (4,68:1 sobre cream), nunca `opacity` sobre `--ink`. */
.gallery__caption {
  font-family: var(--font-functional);
  font-size: var(--fs-credentials);
  line-height: 1.45;
  color: var(--ink-muted);
  margin-top: 10px;
  max-width: none;
}

@media (min-width: 560px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ----------------------------------------------------------
   VISOR DE LA GALERÍA (<dialog> nativo)
   `showModal()` aporta trampa de foco, cierre con Escape e inercia
   del fondo gratis y sin dependencias (CSP `script-src 'self'`).
   ---------------------------------------------------------- */
.gallery-dialog {
  /* `max-*` con `dvh` para no desbordar en móviles con barra de URL. */
  width: min(1100px, calc(100vw - 2 * clamp(12px, 3vw, 40px)));
  max-width: none;
  max-height: calc(100dvh - 2 * clamp(12px, 3vw, 40px));
  padding: clamp(14px, 2vw, 24px);
  border: 1px solid rgba(184, 121, 99, 0.28);
  border-radius: 16px;
  background: var(--warm-white);
  color: var(--ink);
  overflow: auto;
  /* Apertura: solo opacity/transform. Sin animación, el diálogo aparecería
     de golpe; con ella, el cambio es sutil y nunca bloquea la interacción. */
  transition: opacity 180ms ease, transform 180ms ease;
}

/* `::backdrop` acepta animación, pero el fondo del sitio ya es cálido: se usa
   un velo oscuro semitransparente con desenfoque ligero. */
.gallery-dialog::backdrop {
  background: rgba(61, 46, 46, 0.72);
  backdrop-filter: blur(2px);
}

@supports (animation-timeline: none) {
  /* El estado de entrada solo se define donde `@starting-style` existe; en el
     resto de navegadores el diálogo aparece ya visible (nunca invisible). */
  .gallery-dialog[open] {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  @starting-style {
    .gallery-dialog[open] {
      opacity: 0;
      transform: translateY(8px) scale(0.985);
    }
  }
}

.gallery-dialog__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

/* Contador: `aria-live="polite"` lo anuncia al cambiar de foto sin mover el
   foco. En `--ink` (14,2:1 sobre warm-white). */
.gallery-dialog__counter {
  font-family: var(--font-functional);
  font-size: var(--fs-credentials);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  max-width: none;
}

.gallery-dialog__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Mínimo táctil WCAG 2.5.8: 44×44 CSS px.
     Se declara 46 y no 44 porque el navegador redondea la caja a píxeles
     enteros con el zoom del sistema: medido a 390 px de viewport, 44 daba
     43×43 reales. Con 46 el mínimo medido es 45, siempre ≥ 44. */
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 50%;
  color: var(--ink);
  background: rgba(184, 121, 99, 0.12);
  transition: background-color 160ms ease, color 160ms ease;
}

.gallery-dialog__close svg {
  width: 20px;
  height: 20px;
}

.gallery-dialog__close:hover {
  background: var(--arcilla-action);
  color: var(--warm-white);
}

.gallery-dialog__close:focus-visible,
.gallery-dialog__prev:focus-visible,
.gallery-dialog__next:focus-visible {
  outline: 3px solid var(--arcilla-action);
  outline-offset: 3px;
}

.gallery-dialog__figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* La imagen se limita por alto para que el diálogo nunca desborde el viewport
   y los botones de navegación sigan siempre alcanzables. */
.gallery-dialog__img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(62dvh, 620px);
  object-fit: contain;
  border-radius: 8px;
  background: var(--cream);
}

.gallery-dialog__caption {
  font-family: var(--font-functional);
  font-size: var(--fs-credentials);
  line-height: 1.5;
  color: var(--ink-muted);
  text-align: center;
  max-width: 72ch;
}

/* `<figcaption>` vacío no debe dejar un hueco: el JS lo deja sin texto cuando
   la foto no tiene descripción, y la regla `:empty` colapsa el espacio. */
.gallery-dialog__caption:empty {
  display: none;
}

.gallery-dialog__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: clamp(12px, 2vw, 20px);
}

.gallery-dialog__prev,
.gallery-dialog__next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  /* 46 px de alto declarado para garantizar ≥ 44 px MEDIDOS (2.5.8): con 44
     declarados el navegador reportaba 43 por redondeo subpíxel. */
  min-height: 46px;
  min-width: 46px;
  padding: 10px 16px;
  border: 1px solid rgba(184, 121, 99, 0.4);
  border-radius: 999px;
  font-family: var(--font-functional);
  font-size: var(--fs-credentials);
  color: var(--ink);
  background: transparent;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.gallery-dialog__prev svg,
.gallery-dialog__next svg {
  width: 18px;
  height: 18px;
}

.gallery-dialog__prev:hover,
.gallery-dialog__next:hover {
  background: var(--olive-action);
  border-color: var(--olive-action);
  color: var(--warm-white);
}

/* Mensaje de "no hay acciones" para el caso de una sola foto: no se ocultan
   los botones (desaparecería el layout), se marcan inertes. */
.gallery-dialog__prev[disabled],
.gallery-dialog__next[disabled] {
  opacity: 1;
  color: var(--ink-muted);
  border-color: rgba(116, 103, 101, 0.35);
  cursor: default;
}

/* En móvil la etiqueta de texto de los botones estorba: el nombre accesible
   sigue existiendo (`aria-label` en el botón), así que se oculta visualmente. */
@media (max-width: 559px) {
  .gallery-dialog__nav-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .gallery-dialog__prev,
  .gallery-dialog__next {
    padding: 10px 14px;
  }
}

/* ----------------------------------------------------------
   SECCIÓN 5 — MI ENFOQUE (#enfoque)
   Manifiesto editorial compacto: tarjeta ligera en lugar de
   sección gigante vacía.
   ---------------------------------------------------------- */
#enfoque {
  padding-block: clamp(40px, 4.5vw, 64px);
}

.enfoque-text {
  font-family: var(--font-functional);
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink);
  max-width: 980px;
  padding: clamp(24px, 3vw, 40px) clamp(26px, 3.4vw, 46px);
  background: rgba(255, 253, 249, 0.65);
  border: 1px solid rgba(184, 121, 99, 0.26);
  border-left: 3px solid var(--arcilla-premium);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(61, 46, 46, 0.05);
}

#videos .cta-primary {
  width: 100%;
}

#temas .cta-wrapper {
  justify-content: center;
  margin-top: 30px;
}

#temas .cta-primary {
  width: min(100%, 1120px);
  min-height: 96px;
  padding: 20px 38px;
  gap: 28px;
  justify-content: center;
  text-align: center;
  background-color: var(--olive-action);
  border-radius: 9px;
  font-size: clamp(20px, 1.75vw, 28px);
}

#temas .cta-primary:hover {
  background-color: #726B33;
}

#temas .cta-primary .icon-play {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-width: 3px;
}

#contacto .cta-primary {
  min-width: min(100%, 560px);
  justify-content: flex-start;
}

.enfoque-text em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--olive-text);
}

/* ----------------------------------------------------------
   SECCIÓN 6 — VÍDEOS (#videos)
   ---------------------------------------------------------- */
.videos-text {
  font-family: var(--font-functional);
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink);
  margin-bottom: clamp(28px, 4vw, 52px);
}

.videos-text strong {
  font-weight: 700;
}

.videos-text em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--olive-text);
}

/* ── Grupo de enlaces sociales ── */
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(14px, 2vw, 24px);
  margin-top: clamp(18px, 2.5vw, 32px);
}

.social-link {
  font-family: var(--font-functional);
  font-weight: 500;
  font-size: var(--fs-credentials);
  color: var(--ink);
  padding: 10px 20px;
  border: 1px solid var(--olive-mist);
  border-radius: 8px;
  transition:
    color 180ms ease,
    background-color 180ms ease;
}

.social-link:hover,
.social-link:focus-visible {
  color: var(--warm-white);
  background-color: var(--arcilla-action);
  border-color: var(--arcilla-action);
}

.social-link:focus-visible {
  outline: 3px solid rgba(184, 121, 99, 0.7);
  outline-offset: 3px;
}

/* ── Enlace social deshabilitado (cuenta aún no confirmada) ──
   No es un enlace navegable: mantiene el aspecto atenuado pero sin cursor
   de enlace. El atenuado se hace con COLOR ya mezclado sobre el fondo real
   (no con `opacity`), para poder garantizar el contraste AA: `opacity`
   mezclaba contra el fondo y bajaba a 3,13:1 sobre crema. */
.social-disabled,
.footer-social a.social-disabled {
  cursor: default;
  opacity: 1;
  color: var(--ink-muted);
  pointer-events: none;
}

/* En el pie el fondo es `--ink`: el atenuado debe ser claro, no oscuro. */
.footer-social a.social-disabled {
  color: var(--cream-muted);
}

/* ----------------------------------------------------------
   SECCIÓN 7 — CONTACTO (#contacto)
   ---------------------------------------------------------- */
.contacto-text {
  font-family: var(--font-functional);
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink);
  margin-bottom: clamp(14px, 2vw, 22px);
}

.contacto-text strong {
  font-weight: 700;
}

.contacto-text em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--olive-text);
}

/* ----------------------------------------------------------
   FOOTER
   ---------------------------------------------------------- */
.site-footer {
  background-color: var(--ink);
  color: var(--cream);
  padding-block: clamp(56px, 6vw, 88px);
}

.footer-inner {
  width: 100%;
  max-width: 1480px;
  margin-inline: auto;
  padding-inline: var(--inline-padding);
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 2vw, 28px);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: clamp(12px, 1.4vw, 18px);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(24px, 2.5vw, 36px);
  color: var(--cream);
}

.footer-brand-symbol {
  width: clamp(30px, 2.6vw, 40px);
  height: clamp(30px, 2.6vw, 40px);
  flex: none;
  color: var(--cream);
}

.footer-credentials {
  font-family: var(--font-functional);
  font-weight: 400;
  font-size: var(--fs-credentials);
  line-height: 1.55;
  color: var(--cream);
  opacity: 0.7;
}

.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(14px, 2vw, 24px);
}

.footer-social a {
  font-family: var(--font-functional);
  font-weight: 500;
  font-size: var(--fs-credentials);
  color: var(--cream);
  opacity: 0.7;
  transition: opacity 180ms ease;
}

.footer-social a:hover,
.footer-social a:focus-visible {
  opacity: 1;
  color: var(--sand);
}

.footer-disclaimer {
  font-family: var(--font-functional);
  font-weight: 400;
  font-size: clamp(13px, 0.9vw, 16px);
  line-height: 1.55;
  color: var(--cream);
  opacity: 0.5;
  max-width: 720px;
  margin-top: clamp(8px, 1.5vw, 16px);
}

/* ----------------------------------------------------------
   ANIMACIONES DE APARICIÓN SUAVE
   ---------------------------------------------------------- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 600ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.animate-on-scroll--visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Revelado individual (fade-up) para elementos sueltos ── */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 560ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 560ms cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal--visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Stagger: retardo escalonado por índice ── */
.reveal--stagger-1 { transition-delay: 60ms; }
.reveal--stagger-2 { transition-delay: 120ms; }
.reveal--stagger-3 { transition-delay: 180ms; }
.reveal--stagger-4 { transition-delay: 240ms; }
.reveal--stagger-5 { transition-delay: 300ms; }
.reveal--stagger-6 { transition-delay: 360ms; }
.reveal--stagger-7 { transition-delay: 420ms; }
.reveal--stagger-8 { transition-delay: 480ms; }
.reveal--stagger-9 { transition-delay: 540ms; }

/* ── Revelado del subrayado Arcilla (firma editorial) ──
   La clase .section-divider--animate la añade el JS; sin JS
   las líneas se muestran siempre (accesible y robusto). */
.section-divider--animate {
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.section-divider--animate.section-divider--visible {
  transform: scaleX(1);
}

/* ----------------------------------------------------------
   RESPETO A PREFERENCIAS DE MOVIMIENTO REDUCIDO
   ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  /* ── Galería (T08): movimiento CERO, no "casi cero" ──
     La regla universal de arriba deja transiciones de 0,01 ms: suficiente para
     el resto del sitio, pero aquí se anulan por completo y se retiran los
     desplazamientos, para que la media query sea verificable midiendo
     `getComputedStyle(...).transitionDuration === '0s'` y que el hover no mueva
     ni un píxel. Nada se mueve solo en ningún caso (no hay autoplay). */
  .gallery__trigger,
  .gallery__img,
  .gallery-dialog,
  .gallery-dialog__close,
  .gallery-dialog__prev,
  .gallery-dialog__next {
    transition: none !important;
    animation: none !important;
  }

  .gallery__trigger:hover,
  .gallery__trigger:active,
  .gallery__trigger:focus-visible {
    transform: none;
  }

  .gallery__trigger:hover .gallery__img,
  .gallery__trigger:focus-visible .gallery__img {
    transform: none;
  }

  .gallery-dialog[open],
  .gallery-dialog::backdrop {
    opacity: 1;
    transform: none;
    animation: none !important;
  }
}

/* ----------------------------------------------------------
   RESPONSIVE — TABLET (768px – 1199px)
   ---------------------------------------------------------- */
@media (max-width: 1199px) {
  .topics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-grid {
    grid-template-columns: minmax(0, 62%) minmax(0, 38%);
    gap: clamp(32px, 4vw, 48px);
  }

  .hero-content {
    padding-right: clamp(24px, 3vw, 40px);
  }
}

@media (max-width: 900px) {
  .header-nav {
    display: none;
  }

  .header-hamburger {
    display: flex;
  }
}

/* ----------------------------------------------------------
   RESPONSIVE — MÓVIL (< 768px)
   ---------------------------------------------------------- */
@media (max-width: 767px) {
  .section-inner {
    padding-inline: 22px;
  }

  .section-divider {
    width: 72px;
  }

  .section-divider--long {
    width: 92%;
  }

  /* ── Header ── */
  .header-nav {
    display: none;
  }

  .header-hamburger {
    display: flex;
  }

  /* ── Hero ── */
  .hero {
    min-height: auto;
    padding-top: clamp(100px, 14vw, 140px);
    padding-bottom: clamp(40px, 6vw, 64px);
  }

  .hero .section-inner {
    display: block;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: clamp(32px, 6vw, 56px);
  }

  .hero-visual {
    order: 2;
    margin-top: 0;
  }

  .hero-content {
    order: 1;
    gap: 0;
  }

  .hero-photo {
    aspect-ratio: auto;
    min-height: 420px;
  }

  .hero .cta-wrapper {
    margin-top: clamp(40px, 6vw, 56px);
    padding-top: 0;
  }

  /* ── Temas ── */
  .topics-grid {
    grid-template-columns: 1fr;
  }

  .topic-card {
    min-height: 88px;
    padding: 16px 18px;
    gap: 16px;
  }

  .topic-card__icon {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  #temas .cta-primary {
    min-height: 82px;
    padding: 18px 20px;
    gap: 18px;
  }

  #temas .cta-primary .icon-play {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
  }

  /* ── Botones ── */
  .cta-primary {
    width: 100%;
    justify-content: flex-start;
    padding: 17px 20px;
    gap: 16px;
  }

  .cta-wrapper {
    justify-content: stretch;
  }

  .section-title {
    font-size: clamp(48px, 15vw, 64px);
    letter-spacing: -0.045em;
  }

  .hero-brand {
    font-size: clamp(44px, 13vw, 58px);
    white-space: normal;
  }

  #enfoque {
    padding-block: clamp(32px, 8vw, 48px);
  }

  /* ── Footer ── */
  .footer-inner {
    padding-inline: 22px;
  }

  .footer-social {
    flex-direction: column;
    gap: 12px;
  }
}

/* ----------------------------------------------------------
   RESPONSIVE — ESCRITORIO GRANDE (> 1200px)
   ---------------------------------------------------------- */
@media (min-width: 1200px) {
  .hero-photo {
    border-radius: 0;
  }
}

/* ----------------------------------------------------------
   UTILIDADES DE ACCESIBILIDAD
   ---------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
