/* Movimiento editorial sobrio, sereno e invisible — Horizonte Editorial (Yolanda María Verbauwede) */
:root {
  --ease-editorial: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Barra superior muy fina de progreso de lectura */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--terracotta, #C86D51);
  transform-origin: left center;
  transform: scaleX(0);
  z-index: 120;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    @keyframes horizonScrollProgress {
      from {
        transform: scaleX(0);
      }
      to {
        transform: scaleX(1);
      }
    }

    .scroll-progress {
      animation: horizonScrollProgress linear both;
      animation-timeline: scroll(root block);
      will-change: transform;
    }
  }

  .scroll-progress.is-js-progress {
    will-change: transform;
  }

  /* Opt-in progresivo: entrada suave sin recortes agresivos ni efectos vistosos */
  html.js-motion .reveal-hero,
  html.js-motion .reveal-item {
    opacity: 0;
    transform: translateY(10px);
    transition:
      opacity 0.62s var(--ease-editorial) var(--reveal-delay, 0ms),
      transform 0.62s var(--ease-editorial) var(--reveal-delay, 0ms);
  }

  html.js-motion .reveal-portrait {
    opacity: 0;
    transform: translateY(8px);
    transition:
      opacity 0.72s var(--ease-editorial) var(--reveal-delay, 90ms),
      transform 0.72s var(--ease-editorial) var(--reveal-delay, 90ms);
  }

  html.js-motion .reveal-hero.is-in,
  html.js-motion .reveal-item.is-in,
  html.js-motion .reveal-portrait.is-in {
    opacity: 1;
    transform: none;
  }

  /* Transición cruzada calma al cambiar entre áreas de práctica */
  @keyframes editorialPanelIn {
    from {
      opacity: 0;
      transform: translateY(6px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  .panel-enter {
    animation: editorialPanelIn 0.34s var(--ease-editorial) both;
  }

  /* Hover sutil en fotografías de galería */
  .plate-frame img {
    transition:
      transform 0.65s var(--ease-editorial),
      filter 0.42s var(--ease-editorial);
  }

  .plate-trigger:hover .plate-frame img,
  .plate-trigger:focus-visible .plate-frame img {
    transform: scale(1.02);
  }

  /* Acordeón nativo <details> fluido con interpolate-size */
  details.faq-item::details-content {
    transition:
      block-size 0.32s var(--ease-editorial),
      content-visibility 0.32s allow-discrete,
      display 0.32s allow-discrete;
    transition-behavior: allow-discrete;
  }

  .faq-icon::after {
    transition: transform 0.24s var(--ease-editorial), opacity 0.2s ease;
  }

  /* Entrada y salida nativa del lightbox <dialog> */
  dialog.editorial-lightbox {
    transition:
      opacity 0.24s var(--ease-editorial),
      transform 0.24s var(--ease-editorial),
      overlay 0.24s allow-discrete,
      display 0.24s allow-discrete;
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }

  dialog.editorial-lightbox[open] {
    opacity: 1;
    transform: none;
  }

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

  dialog.editorial-lightbox::backdrop {
    transition:
      background-color 0.24s ease,
      overlay 0.24s allow-discrete,
      display 0.24s allow-discrete;
    background-color: rgba(18, 38, 66, 0);
  }

  dialog.editorial-lightbox[open]::backdrop {
    background-color: rgba(18, 38, 66, 0.82);
  }

  @starting-style {
    dialog.editorial-lightbox[open]::backdrop {
      background-color: rgba(18, 38, 66, 0);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-progress {
    display: none;
  }
}

/* Indicador de sección activa en la barra superior (combina color y línea inferior) */
.nav-menu a.is-current:not(.nav-btn) {
  color: var(--terracotta-ink, #A6472B);
}

.nav-menu a.is-current:not(.nav-btn)::after {
  transform: scaleX(1);
}
