/* Component: hero (slider).
 * Tokens via :root variables del style.css global.
 * Migración del Nectar Slider del legacy a Swiper. */

.pf-riojano-hero {
  position: relative;
  width: 100%;
  background: var(--pf-riojano-brand-primary);
  border-top: 4px solid var(--pf-riojano-brand-accent-strong);
  overflow: hidden;
}

.pf-riojano-hero__swiper {
  width: 100%;
  height: 100vh;
  height: 100dvh;
}

.pf-riojano-hero__slide {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
}

/* Imagen de fondo: cubre el slide.
 * Estado por defecto = "zoomed in" (final del Ken Burns inverso). Cuando la slide
 * pasa a swiper-slide-active, la animación la lleva a scale(1.0), creando el
 * efecto de "alejarse" durante la permanencia visible. */
.pf-riojano-hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  z-index: 0;
  transform: scale(1.15);
  transform-origin: center center;
  will-change: transform;
}
.swiper-slide-active .pf-riojano-hero__bg {
  animation: pf-riojano-hero-kenburns 8s ease-out forwards;
}
@keyframes pf-riojano-hero-kenburns {
  from { transform: scale(1.15); }
  to   { transform: scale(1.0); }
}

/* Contenedor del texto: por encima de la imagen de fondo. */
.pf-riojano-hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: var(--pf-riojano-space-6) var(--pf-riojano-space-3);
  gap: var(--pf-riojano-space-3);
}

/* Alineaciones horizontales — derivadas de _nectar_slide_xpos_alignment. */
.pf-riojano-hero__slide--align-x-left  .pf-riojano-hero__inner { align-items: flex-start; text-align: left; }
.pf-riojano-hero__slide--align-x-center .pf-riojano-hero__inner { align-items: center;     text-align: center; }
.pf-riojano-hero__slide--align-x-right  .pf-riojano-hero__inner { align-items: flex-end;   text-align: right; }

/* Alineaciones verticales — derivadas de _nectar_slide_ypos_alignment.
 * El flexbox del slide acomoda el .__inner; aquí usamos margin-top/auto. */
.pf-riojano-hero__slide--align-y-top    { align-items: flex-start; }
.pf-riojano-hero__slide--align-y-middle { align-items: center; }
.pf-riojano-hero__slide--align-y-bottom { align-items: flex-end; }

/* Tipografía del slide. */
.pf-riojano-hero__title {
  font-family: var(--pf-riojano-font-display);
  font-size: var(--pf-riojano-fs-3xl);
  line-height: 1.05;
  letter-spacing: 0.01em;
  margin: 0;
  max-width: 18ch;
}
.pf-riojano-hero__caption {
  font-family: var(--pf-riojano-font-body);
  font-size: var(--pf-riojano-fs-md);
  line-height: 1.4;
  margin: 0;
  max-width: 42ch;
}

.pf-riojano-hero__slide--dark .pf-riojano-hero__title,
.pf-riojano-hero__slide--dark .pf-riojano-hero__caption {
  color: var(--pf-riojano-brand-primary);
}
.pf-riojano-hero__slide--light .pf-riojano-hero__title,
.pf-riojano-hero__slide--light .pf-riojano-hero__caption {
  color: var(--pf-riojano-neutral-cream);
}

/* CTA: usa los tokens de marca. */
.pf-riojano-hero__cta {
  display: inline-block;
  align-self: flex-start;
  background: var(--pf-riojano-brand-accent-strong);
  color: var(--pf-riojano-brand-primary);
  font-family: var(--pf-riojano-font-body);
  font-weight: bold;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  padding: var(--pf-riojano-space-3) var(--pf-riojano-space-5);
  border-radius: var(--pf-riojano-radius-md);
  box-shadow: var(--pf-riojano-shadow-elevated);
  transition:
    background var(--pf-riojano-transition-fast),
    color      var(--pf-riojano-transition-fast),
    transform  var(--pf-riojano-transition-fast);
}
.pf-riojano-hero__cta:hover,
.pf-riojano-hero__cta:focus-visible {
  background: var(--pf-riojano-brand-primary);
  color: var(--pf-riojano-neutral-cream);
  transform: translateY(-1px);
  outline: none;
}

.pf-riojano-hero__slide--align-x-center .pf-riojano-hero__cta { align-self: center; }
.pf-riojano-hero__slide--align-x-right  .pf-riojano-hero__cta { align-self: flex-end; }

/* Entradas diferidas del contenido textual.
 * Estado inicial = invisible y desplazado abajo. La slide activa dispara la
 * animación con delays escalonados (title → caption → cta). */
.pf-riojano-hero__title,
.pf-riojano-hero__caption,
.pf-riojano-hero__cta {
  opacity: 0;
  transform: translateY(24px);
  will-change: opacity, transform;
}
.swiper-slide-active .pf-riojano-hero__title {
  animation: pf-riojano-hero-rise 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) 0.35s forwards;
}
.swiper-slide-active .pf-riojano-hero__caption {
  animation: pf-riojano-hero-rise 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) 0.75s forwards;
}
.swiper-slide-active .pf-riojano-hero__cta {
  animation: pf-riojano-hero-rise 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) 1.15s forwards;
}
@keyframes pf-riojano-hero-rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Paginación (bullets). */
.pf-riojano-hero__pagination.swiper-pagination {
  bottom: var(--pf-riojano-space-4);
  z-index: 3;
}
.pf-riojano-hero__pagination .swiper-pagination-bullet {
  width: 10px;
  height: 10px;
  background: var(--pf-riojano-neutral-cream);
  opacity: 0.55;
  margin: 0 6px !important;
  transition: opacity var(--pf-riojano-transition-fast),
              background var(--pf-riojano-transition-fast);
}
.pf-riojano-hero__pagination .swiper-pagination-bullet-active {
  background: var(--pf-riojano-brand-accent-strong);
  opacity: 1;
}

/* Responsive — móvil. */
@media (max-width: 640px) {
  /* Safe area bajo el header sticky: el chrome se vuelve opaco al
   * scrollear y taparía el texto si estuviese demasiado arriba. Damos
   * 16px de respiración extra sobre la altura del header en mobile. */
  .pf-riojano-hero__slide {
    padding-top: calc(var(--pf-riojano-header-h-mobile, 128px) + var(--pf-riojano-space-3));
  }
  .pf-riojano-hero__title {
    font-size: var(--pf-riojano-fs-2xl);
    max-width: none;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .pf-riojano-hero__caption {
    font-size: var(--pf-riojano-fs-base);
    max-width: none;
    overflow-wrap: anywhere;
  }
}

/* Accesibilidad: respeta preferencia de movimiento reducido del usuario. */
@media (prefers-reduced-motion: reduce) {
  .pf-riojano-hero__bg,
  .swiper-slide-active .pf-riojano-hero__bg {
    animation: none;
    transform: none;
  }
  .pf-riojano-hero__title,
  .pf-riojano-hero__caption,
  .pf-riojano-hero__cta,
  .swiper-slide-active .pf-riojano-hero__title,
  .swiper-slide-active .pf-riojano-hero__caption,
  .swiper-slide-active .pf-riojano-hero__cta {
    opacity: 1;
    transform: none;
    animation: none;
  }
}
