/**
 * Panel verde «texto + carrusel» (Nosotros — Nuestra historia, Servicios — En detalle).
 * Mismas clases .nosotros-historia* en ambas páginas.
 */

.nosotros-historia {
    padding: clamp(3.5rem, 8vw, 5.5rem) 0;
    background: #fafbfc;
    border-top: 1px solid rgba(0, 104, 55, 0.12);
}

.nosotros-historia__shell {
    position: relative;
    overflow: hidden;
    background: linear-gradient(148deg, #042818 0%, #0a4d2e 42%, #006837 100%);
    border-radius: clamp(1.35rem, 2.8vw, 1.85rem);
    padding: clamp(1.65rem, 4.5vw, 2.85rem);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.14),
        0 22px 55px rgba(0, 32, 18, 0.38);
}

.nosotros-historia__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(1.75rem, 4vw, 2.75rem);
    align-items: center;
}

.nosotros-historia__grid--solo-texto {
    grid-template-columns: 1fr;
}

@media (min-width: 992px) {
    .nosotros-historia__grid--solo-texto {
        max-width: 44rem;
    }
}

@media (min-width: 992px) {
    .nosotros-historia__grid:not(.nosotros-historia__grid--solo-texto) {
        grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
        gap: clamp(2rem, 4vw, 3.25rem);
        align-items: stretch;
    }

    .nosotros-historia__card {
        max-width: 42rem;
        min-width: 0;
    }

    .nosotros-historia__media {
        min-width: 0;
        align-self: stretch;
        width: 100%;
        max-width: 100%;
        height: 100%;
        min-height: clamp(14rem, 22vw, 20rem);
        aspect-ratio: 16 / 10;
        position: relative;
        top: auto;
        display: flex;
        flex-direction: column;
    }
}

.nosotros-historia__card {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
    transition: none;
}

.nosotros-historia__card:hover {
    transform: none;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.nosotros-historia__kicker {
    font-family: var(--font-display, "Montserrat", "Inter", system-ui, sans-serif);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.78);
    margin: 0 0 0.85rem;
}

.nosotros-historia__title {
    font-family: var(--font-display, "Montserrat", "Inter", system-ui, sans-serif);
    font-weight: 800;
    font-size: clamp(1.65rem, 3vw, 2.25rem);
    letter-spacing: -0.02em;
    color: #fff;
    margin: 0 0 1.15rem;
    line-height: 1.2;
    text-shadow: 0 1px 18px rgba(0, 0, 0, 0.18);
}

.nosotros-historia__lead {
    font-family: var(--font-body, "Inter", system-ui, sans-serif);
    font-size: 1.125rem;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.92);
    margin: 0 0 1.15rem;
    font-weight: 500;
}

.nosotros-historia__body {
    font-family: var(--font-body, "Inter", system-ui, sans-serif);
    font-size: 1.02rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
}

.nosotros-historia__body p {
    margin-bottom: 1rem;
}

.nosotros-historia__body p:last-child {
    margin-bottom: 0;
}

.nosotros-historia__body a {
    color: #fff;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.nosotros-historia__body a:hover {
    color: rgba(255, 255, 255, 0.88);
}

.nosotros-historia__body strong {
    color: #fff;
}

.nosotros-historia__body h2,
.nosotros-historia__body h3,
.nosotros-historia__body h4 {
    color: #fff;
    font-family: var(--font-display, "Montserrat", "Inter", system-ui, sans-serif);
    margin-top: 1.15rem;
    margin-bottom: 0.65rem;
}

.nosotros-historia__body ul,
.nosotros-historia__body ol {
    margin-bottom: 1rem;
    padding-left: 1.25rem;
}

.nosotros-historia__media {
    position: relative;
    isolation: isolate;
    border-radius: clamp(1rem, 2vw, 1.35rem);
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.14);
    aspect-ratio: 16 / 11;
    min-height: clamp(16rem, 52vw, 22rem);
    width: 100%;
    max-width: 100%;
    background: rgba(0, 0, 0, 0.2);
}

.nosotros-historia__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nosotros-historia-carousel {
    position: relative;
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.nosotros-historia-carousel .carousel-inner {
    height: 100%;
}

.nosotros-historia-carousel .carousel-item {
    height: 100%;
}

.nosotros-historia-carousel .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}

.nosotros-historia-carousel .carousel-control-prev,
.nosotros-historia-carousel .carousel-control-next {
    width: 14%;
    opacity: 0.95;
}

.nosotros-historia-carousel .carousel-control-prev-icon,
.nosotros-historia-carousel .carousel-control-next-icon {
    filter: invert(1) drop-shadow(0 1px 6px rgba(0, 0, 0, 0.45));
    opacity: 0.92;
}

@media (max-width: 991.98px) {
    .nosotros-historia__grid {
        gap: clamp(1.5rem, 4.5vw, 2.25rem);
    }

    .nosotros-historia__media {
        --nosotros-historia-media-bleed: clamp(0.65rem, 3.25vw, 1.15rem);
        width: calc(100% + 2 * var(--nosotros-historia-media-bleed));
        margin-inline: calc(-1 * var(--nosotros-historia-media-bleed));
        aspect-ratio: 4 / 3;
        min-height: clamp(18rem, 85vw, 32rem);
    }

    .nosotros-historia__placeholder {
        min-height: clamp(18rem, 85vw, 32rem);
    }
}

.nosotros-historia__placeholder {
    width: 100%;
    height: 100%;
    min-height: clamp(16rem, 52vw, 22rem);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.22);
    font-size: 5rem;
    background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 767.98px) {
    .nosotros-historia {
        padding-left: env(safe-area-inset-left, 0);
        padding-right: env(safe-area-inset-right, 0);
    }

    .nosotros-historia__shell {
        padding: clamp(1.25rem, 4.5vw, 1.75rem);
        border-radius: clamp(1.1rem, 3.5vw, 1.45rem);
    }

    .nosotros-historia__kicker {
        font-size: 0.65rem;
        letter-spacing: 0.12em;
    }

    .nosotros-historia__title {
        font-size: clamp(1.35rem, 5.5vw + 0.25rem, 1.75rem);
        line-height: 1.18;
        text-wrap: balance;
        overflow-wrap: break-word;
    }

    .nosotros-historia__lead {
        font-size: 1rem;
    }

    .nosotros-historia__body {
        font-size: 0.98rem;
    }

    .nosotros-historia__media {
        --nosotros-historia-media-bleed: clamp(0.85rem, 4vw, 1.35rem);
        min-height: clamp(20rem, 88vw, 34rem);
    }

    .nosotros-historia__placeholder {
        min-height: clamp(20rem, 88vw, 34rem);
    }

    .nosotros-historia-carousel .carousel-control-prev,
    .nosotros-historia-carousel .carousel-control-next {
        width: 12%;
        min-width: 2.5rem;
    }

    /* Servicio detalle (móvil): evitar desborde lateral y centrar carrusel */
    body.page-servicio-detalle .nosotros-historia__media {
        --nosotros-historia-media-bleed: clamp(0.3rem, 1.6vw, 0.55rem);
        width: calc(100% + 2 * var(--nosotros-historia-media-bleed));
        max-width: none;
        margin-inline: calc(-1 * var(--nosotros-historia-media-bleed));
        min-height: clamp(17rem, 78vw, 24rem);
    }

    body.page-servicio-detalle .nosotros-historia__placeholder {
        min-height: clamp(17rem, 78vw, 24rem);
    }
}

/* Rich text del admin dentro del panel verde */
.nosotros-historia__body.service-detail-content,
.nosotros-historia__body.service-detail-content p,
.nosotros-historia__body.service-detail-content li,
.nosotros-historia__body.service-detail-content span {
    color: rgba(255, 255, 255, 0.9) !important;
}

.nosotros-historia__body.service-detail-content h2,
.nosotros-historia__body.service-detail-content h3,
.nosotros-historia__body.service-detail-content h4,
.nosotros-historia__body.service-detail-content strong {
    color: #fff !important;
}

.nosotros-historia__body.service-detail-content a {
    color: #fff !important;
}

.nosotros-historia__body.service-detail-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.65rem;
    margin: 0.75rem 0;
    display: block;
}
