/* ==========================================================================
   PAGE HERO — componente reutilizable
   Hero institucional para páginas internas (Servicios, Nosotros, Productos,
   Sostenibilidad, Exportación, Noticias, Contacto, Recetas...).
   Distinto del hero del Home (ver hero.css): sin swiper, altura menor,
   contenido siempre alineado abajo-izquierda en cualquier breakpoint.
   Mobile First. Consume exclusivamente variables definidas en :root.
   ========================================================================== */

.page-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    width: 100%;
    min-height: 22rem;
    overflow: hidden;
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

/* Degradé único de arriba a abajo: nunca cae a 0 (siempre hay contraste
   mínimo sobre la imagen), más oscuro arriba (legibilidad del header
   superpuesto) y abajo (legibilidad del contenido). Evita el hueco
   transparente que dejaban dos gradientes independientes solapados. */
.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to bottom,
            rgba(24, 40, 19, 0.65) 0%,
            rgba(24, 40, 19, 0.35) 30%,
            rgba(24, 40, 19, 0.45) 55%,
            rgba(24, 40, 19, 0.8) 100%);
}

.page-hero__picture {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.page-hero__media {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.page-hero > .container {
    position: relative;
    z-index: 2;
    width: 100%;
    padding-block: var(--space-8) var(--space-7);
}

.page-hero__content {
    max-width: 34rem;
    /* Compensa la altura del header superpuesto (misma escala que hero.css)
       para que el eyebrow nunca quede oculto detrás de él. */
    padding-top: clamp(5rem, 20vw, 7rem);
}

.page-hero__eyebrow {
    display: inline-block;
    font-size: var(--font-size-sm);
    font-weight: var(--font-semibold);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-primary-100);
    margin-bottom: var(--space-4);
}

.page-hero__title {
    color: var(--color-white);
    font-size: var(--font-size-4xl);
    font-weight: var(--font-extrabold);
    line-height: var(--line-height-tight);
    text-wrap: balance;
    margin-bottom: var(--space-4);
}

.page-hero__description {
    color: var(--color-white);
    font-size: var(--font-size-lg);
    line-height: var(--line-height-relaxed);
}

/* CTA opcional: por defecto no se renderiza (props `ctaText`/`ctaHref` nulos),
   así que las páginas que no lo usan (Servicios, Nosotros, Sostenibilidad)
   no sufren ningún cambio visual. */
.page-hero__cta {
    margin-top: var(--space-6);
}

.page-hero__cta-icon {
    width: 1.125em;
    height: 1.125em;
}

/* ==========================================================================
   Desktop (>= 62rem): más altura y más aire, mismo alineado abajo-izquierda.
   ========================================================================== */
@media (min-width: 62rem) {
    .page-hero {
        min-height: 28rem;
    }

    .page-hero > .container {
        padding-block: var(--space-10) var(--space-9);
    }

    .page-hero__content {
        max-width: 40rem;
        padding-top: clamp(6rem, 12vw, 9rem);
    }
}

/* ==========================================================================
   Variante carrusel — se activa sola cuando la sección tiene más de un banner
   activo (ver components/page-hero.blade.php). El degradé se mueve del
   <section> a cada slide: el transform que Swiper aplica a .swiper-slide crea
   un contexto de apilado propio y el ::before del section quedaría por encima
   del texto.
   ========================================================================== */

.page-hero--swiper {
    display: block;
}

.page-hero--swiper::before {
    content: none;
}

.page-hero__swiper {
    width: 100%;
}

.page-hero--swiper .swiper-slide {
    position: relative;
    display: flex;
    align-items: flex-end;
    width: 100%;
    min-height: 22rem;
    overflow: hidden;
}

.page-hero--swiper .swiper-slide::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to bottom,
            rgba(24, 40, 19, 0.65) 0%,
            rgba(24, 40, 19, 0.35) 30%,
            rgba(24, 40, 19, 0.45) 55%,
            rgba(24, 40, 19, 0.8) 100%);
}

.page-hero--swiper .swiper-slide > .container {
    position: relative;
    z-index: 2;
    width: 100%;
    padding-block: var(--space-8) var(--space-7);
}

/* Bullets: misma escala y comportamiento que los del hero del Home. */
.page-hero .swiper-pagination-bullet {
    width: 0.5rem;
    height: 0.5rem;
    background-color: var(--color-white);
    opacity: 0.5;
    border-radius: var(--radius-full);
    transition: opacity var(--transition-fast), width var(--transition-fast);
}

.page-hero .swiper-pagination-bullet-active {
    opacity: 1;
    width: 1.5rem;
}

@media (min-width: 62rem) {
    .page-hero--swiper .swiper-slide {
        min-height: 28rem;
    }

    .page-hero--swiper .swiper-slide > .container {
        padding-block: var(--space-10) var(--space-9);
    }
}
