/* ================================================================
   hero-component.css — <reciclanet-hero>
   Componente reutilizable: inicio, servicios, blog, nosotros,
   colabora, contacto. El contenido (fotos, título, botones) se pasa
   como hijos en cada página; el estilo vive aquí, único.

   v3.2 — La foto y el pie de foto son DOS bloques separados.
   Nada se superpone nunca a la foto, en ningún tamaño de pantalla.
   Fondo claro en el pie de foto (solo el footer va oscuro, regla
   del proyecto).
   Reciclanet Web 2026
================================================================ */

reciclanet-hero {
  display: block;
  width: 100%;
  margin-top: var(--navbar-height);
}
@media (min-width: 1024px) {
  reciclanet-hero { margin-top: var(--navbar-height-desktop); }
}

/* ── BLOQUE 1: LA FOTO — nada se pone nunca encima salvo flechas/puntos ── */
.rc-hero__bg {
  position: relative;
  width: 100%;
  height: min(58vh, 520px);
  min-height: 320px;
  overflow: hidden;
  background: #eef1f4;
}

.rc-hero__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.7s ease;
}
.rc-hero__slide.is-active { opacity: 1; z-index: 1; }
.rc-hero__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rc-hero__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  transition: background 0.2s ease;
}
.rc-hero__arrow:hover { background: #fff; }
.rc-hero__arrow:focus-visible { outline: 3px solid #27ae60; outline-offset: 2px; }
.rc-hero__arrow--prev { left: 1.25rem; }
.rc-hero__arrow--next { right: 1.25rem; }
.rc-hero__arrow svg { width: 20px; height: 20px; }

.rc-hero__dots {
  position: absolute;
  bottom: 1.1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 5;
}
.rc-hero__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
  border: none;
  padding: 0;
  cursor: pointer;
}
.rc-hero__dot.is-active { background: #fff; }
.rc-hero__dot:focus-visible { outline: 2px solid #27ae60; outline-offset: 2px; }

/* ── BLOQUE 2: PIE DE FOTO — caja aparte DEBAJO de la foto, nunca encima ── */
.rc-hero__caption {
  position: static;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1.75rem clamp(1.25rem, 4vw, 3rem);
  background: var(--color-bg-alt2, #f0faf4);
  border-top: 3px solid var(--color-primary, #27ae60);
}

.rc-hero__texto {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 680px;
}
.rc-hero__eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--color-primary-dark, #1e8449);
  text-transform: uppercase;
}
.rc-hero__title {
  font-family: var(--font-display, 'Syne', sans-serif);
  font-size: clamp(1.5rem, 3.4vw, 2.4rem);
  font-weight: 800;
  line-height: 1.22;
  color: var(--color-text-primary, #1a1a2a);
  margin: 0;
}
.rc-hero__title em {
  font-style: normal;
  color: var(--color-primary, #27ae60);
}

.rc-hero__actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* El botón "ghost" está pensado para fondo oscuro (borde/texto blanco);
   aquí el fondo es claro, así que lo adaptamos solo dentro del pie de foto
   sin tocar el .btn--ghost original que se usa en páginas con hero oscuro */
.rc-hero__caption .btn--ghost {
  color: var(--color-text-primary, #1a1a2a);
  border-color: var(--color-text-primary, #1a1a2a);
}
.rc-hero__caption .btn--ghost:hover {
  background: rgba(26, 26, 42, 0.06);
}

/* ── MÓVIL — mismo esquema, todo en flujo normal, nada se corta ── */
@media (max-width: 760px) {
  .rc-hero__bg { height: min(46vh, 380px); min-height: 260px; }
  .rc-hero__caption {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem 1.1rem 1.6rem;
  }
  .rc-hero__title { font-size: clamp(1.3rem, 6vw, 1.8rem); }
  .rc-hero__actions { width: 100%; gap: 0.6rem; }
  .rc-hero__actions a { flex: 1; text-align: center; padding-inline: 0.75rem; font-size: 0.85rem; }
  .rc-hero__arrow { width: 38px; height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  .rc-hero__slide { transition: none; }
}
