/* Página Nosotros — ICASA (#006837), minimal, confianza */
@import url("icasa-historia-panel.css");

.page-nosotros {
    --icasa-green: #006837;
    --icasa-green-bright: #00a651;
    --icasa-ink: #0f172a;
    --icasa-body: #334155;
    --icasa-muted: #64748b;
    --icasa-line: rgba(0, 104, 55, 0.12);
    --icasa-radius: 1.25rem;
    --icasa-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 12px 40px rgba(15, 45, 74, 0.06);
    --font-display: "Montserrat", "Inter", system-ui, sans-serif;
    --font-body: "Inter", system-ui, sans-serif;
}

/* —— Hero (banner a ancho completo, imagen vía CMS como fondo cover) —— */
.nosotros-hero--banner {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
    overflow: hidden;
    min-height: clamp(22rem, 60vh, 36rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: #0f172a;
}

/* Sin imagen: bloque claro con el mismo impacto vertical */
.nosotros-hero--banner:not(.nosotros-hero--has-bg) {
    background-color: #fff;
}

.nosotros-hero--banner:not(.nosotros-hero--has-bg)::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 100% 0%, rgba(0, 104, 55, 0.06), transparent 55%),
        radial-gradient(ellipse 60% 40% at 0% 100%, rgba(0, 167, 81, 0.05), transparent 50%);
    pointer-events: none;
}

/* Imagen en ::before + scale ligero = un poco menos de “zoom” que cover puro */
.nosotros-hero--has-bg {
    background-image: none;
}

.nosotros-hero--has-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: var(--nosotros-hero-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: scale(0.95);
    transform-origin: center center;
    pointer-events: none;
}

.nosotros-hero__scrim {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(
        105deg,
        rgba(15, 23, 42, 0.88) 0%,
        rgba(15, 23, 42, 0.55) 42%,
        rgba(15, 23, 42, 0.22) 72%,
        rgba(15, 23, 42, 0.08) 100%
    );
}

.nosotros-hero__inner {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: clamp(3.25rem, 8vw, 5.5rem) 0;
}

.nosotros-hero__text {
    position: relative;
    z-index: 1;
    max-width: min(40rem, 100%);
}

.nosotros-hero__kicker {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--icasa-green);
    margin: 0 0 1.25rem;
}

.nosotros-hero--has-bg .nosotros-hero__kicker {
    color: var(--icasa-green-bright);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.nosotros-hero__title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2.15rem, 5vw, 3.25rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
    color: var(--icasa-ink);
    margin: 0 0 1.5rem;
}

.nosotros-hero--has-bg .nosotros-hero__title {
    color: #fff;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}

.nosotros-hero__lead {
    font-family: var(--font-body);
    font-size: clamp(1.05rem, 1.5vw, 1.2rem);
    line-height: 1.7;
    color: var(--icasa-body);
    margin: 0;
    max-width: 36rem;
}

.nosotros-hero--has-bg .nosotros-hero__lead {
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.4);
}

/* Desktop / PC: hero más alto y titular abajo a la izquierda */
@media (min-width: 992px) {
    .nosotros-hero--banner {
        min-height: clamp(32rem, 72vh, 52rem);
        justify-content: flex-end;
    }

    .nosotros-hero__inner {
        flex-shrink: 0;
        padding-top: 1.5rem;
        padding-bottom: clamp(2.75rem, 6vh, 4.5rem);
    }

    .nosotros-hero__text {
        max-width: min(44rem, 100%);
        margin-right: auto;
        margin-left: 0;
    }

    .nosotros-hero__title {
        font-size: clamp(2.65rem, 4.2vw, 3.85rem);
    }
}

/* —— Banda corporativa: misión, visión y valores (#F9FAFB) —— */
.nosotros-corporate-band {
    background: #f9fafb;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}

/* —— Misión / Visión —— */
.nosotros-mv {
    padding: clamp(4rem, 10vw, 6rem) 0 clamp(1.35rem, 2.8vw, 2.15rem);
    background: transparent;
}

@media (min-width: 992px) {
    .nosotros-mv {
        padding-top: clamp(3.25rem, 7vw, 4.75rem);
    }

    .nosotros-mv__grid {
        margin-top: -0.75rem; /* “un poco más arriba” sobre texto + galería */
    }
}

.nosotros-mv__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(1.25rem, 3vw, 1.75rem);
}

@media (min-width: 768px) {
    .nosotros-mv__grid {
        grid-template-columns: 1fr 1fr;
        align-items: stretch;
    }
}

.nosotros-mv__card {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: clamp(2rem, 4.5vw, 2.65rem);
    background: #ffffff;
    border-radius: 1rem;
    border: 1px solid rgba(15, 23, 42, 0.06);
    overflow: hidden;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 4px 24px rgba(15, 23, 42, 0.03);
    transition: box-shadow 0.35s ease, border-color 0.35s ease;
}

.nosotros-mv__card:hover {
    box-shadow:
        0 1px 3px rgba(15, 23, 42, 0.05),
        0 12px 40px rgba(0, 104, 55, 0.07);
    border-color: rgba(0, 104, 55, 0.12);
}

.nosotros-mv__photo {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 0.75rem;
    overflow: hidden;
    background: linear-gradient(145deg, #e2e8f0, #f1f5f9);
    margin-bottom: 1.35rem;
}

.nosotros-mv__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.55s ease;
}

.nosotros-mv__card:hover .nosotros-mv__photo img {
    transform: scale(1.03);
}

/* Iconos Lucide: trazo fino, uniformes */
.nosotros-mv__icon {
    width: 4rem;
    height: 4rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    background: rgba(0, 104, 55, 0.06);
    color: var(--icasa-green);
}

.nosotros-mv__icon svg {
    width: 2.15rem;
    height: 2.15rem;
    stroke: var(--icasa-green);
    stroke-width: 1.35;
}

.nosotros-mv__title-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.15rem;
}

.nosotros-mv__title-accent {
    width: 4px;
    min-height: 2.75rem;
    margin-top: 0.2rem;
    flex-shrink: 0;
    border-radius: 2px;
    background: var(--icasa-green);
    box-shadow: 0 0 0 1px rgba(0, 104, 55, 0.08);
}

.nosotros-mv__card-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.55rem, 2.8vw, 2rem);
    letter-spacing: -0.03em;
    color: var(--icasa-green);
    margin: 0;
    line-height: 1.15;
    flex: 1;
    min-width: 0;
}

.nosotros-mv__card-text {
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.78;
    color: var(--icasa-body);
    font-weight: 400;
    margin: 0;
    flex: 1;
}

/* —— Valores (mismo lenguaje que «¿Por qué elegir nuestro servicio?» en detalle de servicio) —— */
.nosotros-valores {
    padding: clamp(2.25rem, 5vw, 3.5rem) 0 clamp(4rem, 9vw, 6.5rem);
    margin-top: 0;
    border-top: 1px solid rgba(0, 104, 55, 0.08);
    background:
        radial-gradient(circle at 1.5px 1.5px, rgba(0, 104, 55, 0.065) 1.5px, transparent 0)
        0 0 / 26px 26px,
        linear-gradient(180deg, #eff4f1 0%, #fff 55%);
}

.nosotros-valores__head {
    text-align: center;
    max-width: min(36rem, 100%);
    margin: 0 auto clamp(2rem, 5vw, 3rem);
    padding: 0 0.35rem;
}

.nosotros-valores__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.35rem, 2.8vw, 1.75rem);
    letter-spacing: -0.02em;
    color: #004d29;
    margin: 0 0 0.5rem;
    line-height: 1.2;
    text-wrap: balance;
}

.nosotros-valores__title::after {
    content: "";
    display: block;
    width: 2.75rem;
    height: 3px;
    border-radius: 2px;
    margin: 0.6rem auto 0;
    background: linear-gradient(90deg, var(--icasa-green) 0%, rgba(0, 104, 55, 0.2) 100%);
}

.nosotros-valores__subtitle {
    font-family: var(--font-body);
    font-size: clamp(0.98rem, 1.35vw, 1rem);
    color: var(--icasa-muted);
    margin: 0;
    line-height: 1.6;
    font-weight: 400;
    max-width: 34rem;
    margin-left: auto;
    margin-right: auto;
    text-wrap: balance;
}

.nosotros-valores__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(1.35rem, 3.5vw, 1.85rem);
    align-items: stretch;
    counter-reset: nosotros-valor;
    max-width: 56rem;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 576px) {
    .nosotros-valores__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: clamp(1.5rem, 3vw, 2rem);
    }

    .nosotros-valores__grid .nosotros-valor-card:nth-last-child(1):nth-child(odd) {
        grid-column: 1 / -1;
        justify-self: center;
        width: min(100%, 22rem);
    }
}

.nosotros-valor-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: clamp(1.35rem, 3vw, 1.75rem);
    isolation: isolate;
    overflow: hidden;
    counter-increment: nosotros-valor;
    background: linear-gradient(145deg, #007a42 0%, #004d29 100%);
    border: 1px solid rgba(0, 77, 41, 0.65);
    border-radius: 1.25rem;
    box-shadow: 0 14px 40px rgba(0, 40, 22, 0.22);
    -webkit-tap-highlight-color: transparent;
    transition:
        opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
        border-color 0.28s ease,
        box-shadow 0.28s ease,
        background 0.28s ease,
        color 0.28s ease;
}

.nosotros-valor-card::before {
    content: counter(nosotros-valor, decimal-leading-zero);
    position: absolute;
    bottom: -1rem;
    right: 0.45rem;
    font-size: clamp(4.5rem, 12vw, 6.5rem);
    font-weight: 900;
    line-height: 1;
    font-family: var(--font-display);
    letter-spacing: -0.06em;
    color: rgba(255, 255, 255, 0.12);
    pointer-events: none;
    z-index: 0;
    transition: color 0.28s ease;
}

@media (hover: hover) and (pointer: fine) {
    .nosotros-valor-card:hover {
        transition-delay: 0ms;
        background: #fff;
        border-color: rgba(15, 23, 42, 0.1);
        box-shadow:
            0 22px 52px rgba(15, 39, 68, 0.1),
            0 8px 24px rgba(0, 104, 55, 0.08);
        transform: translateY(-7px) scale(1.015);
    }

    .nosotros-valor-card:hover::before {
        color: rgba(0, 104, 55, 0.06);
    }

    .nosotros-valor-card:hover .nosotros-valor-card__icon {
        background: linear-gradient(145deg, #eaf7f0 0%, rgba(234, 247, 240, 0.4) 100%);
        border-color: rgba(0, 104, 55, 0.1);
        color: var(--icasa-green);
    }

    .nosotros-valor-card:hover .nosotros-valor-card__title {
        color: var(--icasa-ink);
    }

    .nosotros-valor-card:hover .nosotros-valor-card__desc {
        color: var(--icasa-muted);
    }
}

.nosotros-valor-card:active {
    transition-delay: 0ms;
    background: #fff;
    border-color: rgba(15, 23, 42, 0.1);
    box-shadow: 0 8px 28px rgba(15, 39, 68, 0.08);
    transform: translateY(-2px) scale(0.985);
}

.nosotros-valor-card:active::before {
    color: rgba(0, 104, 55, 0.06);
}

.nosotros-valor-card:active .nosotros-valor-card__icon {
    background: linear-gradient(145deg, #eaf7f0 0%, rgba(234, 247, 240, 0.4) 100%);
    border-color: rgba(0, 104, 55, 0.1);
    color: var(--icasa-green);
}

.nosotros-valor-card:active .nosotros-valor-card__title {
    color: var(--icasa-ink);
}

.nosotros-valor-card:active .nosotros-valor-card__desc {
    color: var(--icasa-muted);
}

.nosotros-valor-card__icon {
    position: relative;
    z-index: 1;
    width: 3.25rem;
    height: 3.25rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #fff;
    font-size: 1.65rem;
    line-height: 1;
    transition:
        background 0.28s ease,
        border-color 0.28s ease,
        color 0.28s ease,
        transform 0.28s ease;
}

.nosotros-valor-card__icon i {
    display: block;
    line-height: 1;
    color: inherit;
    font-family: "bootstrap-icons" !important;
    font-style: normal;
    font-weight: normal !important;
}

.nosotros-valor-card__title {
    position: relative;
    z-index: 1;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
    color: #fff;
    margin: 0 0 0.5rem;
    line-height: 1.3;
    text-wrap: balance;
    transition: color 0.28s ease;
}

.nosotros-valor-card__desc {
    position: relative;
    z-index: 1;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.88);
    margin: 0;
    font-weight: 400;
    transition: color 0.28s ease;
}

/* —— Móvil / tablets estrechas: hero legible, títulos y módulos sin desbordes —— */
@media (max-width: 767.98px) {
    .nosotros-hero--banner {
        min-height: max(19rem, min(78vh, 34rem));
        min-height: max(19rem, min(78dvh, 34rem));
        box-sizing: border-box;
    }

    /* Con foto: texto abajo centrado; sin velo que tape la imagen */
    .nosotros-hero--banner.nosotros-hero--has-bg {
        justify-content: flex-end;
    }

    /* Fondo foto: sin “marco” por scale; imagen a borde */
    .nosotros-hero--has-bg::before {
        transform: scale(1);
    }

    .nosotros-hero--has-bg .nosotros-hero__scrim {
        background: transparent;
    }

    .nosotros-hero__inner {
        padding-top: clamp(2.25rem, 10vw, 3.25rem);
        padding-bottom: clamp(2.5rem, 9vw, 3.75rem);
        padding-left: calc(var(--bs-gutter-x, 1.5rem) * 0.5 + env(safe-area-inset-left, 0px));
        padding-right: calc(var(--bs-gutter-x, 1.5rem) * 0.5 + env(safe-area-inset-right, 0px));
    }

    .nosotros-hero--banner.nosotros-hero--has-bg .nosotros-hero__inner {
        padding-top: 0.35rem;
        padding-bottom: max(1.65rem, calc(0.9rem + env(safe-area-inset-bottom, 0px)));
    }

    .nosotros-hero__text {
        max-width: 100%;
        min-width: 0;
    }

    .nosotros-hero--has-bg .nosotros-hero__text {
        margin-left: auto;
        margin-right: auto;
        text-align: center;
        max-width: min(34rem, 100%);
    }

    .nosotros-hero__kicker {
        font-size: 0.6875rem;
        letter-spacing: 0.14em;
        line-height: 1.35;
        margin-bottom: 1rem;
        word-break: break-word;
        hyphens: auto;
    }

    .nosotros-hero--has-bg .nosotros-hero__kicker {
        text-shadow:
            0 0 1px rgba(0, 0, 0, 0.95),
            0 1px 3px rgba(0, 0, 0, 0.85),
            0 2px 14px rgba(0, 0, 0, 0.65);
    }

    .nosotros-hero__title {
        font-size: clamp(1.5rem, 7.2vw + 0.35rem, 2.15rem);
        line-height: 1.12;
        letter-spacing: -0.018em;
        margin-bottom: 1.1rem;
        text-wrap: balance;
        overflow-wrap: break-word;
        word-break: break-word;
        hyphens: auto;
    }

    .nosotros-hero--has-bg .nosotros-hero__title {
        text-shadow:
            0 0 1px rgba(0, 0, 0, 1),
            0 1px 2px rgba(0, 0, 0, 0.9),
            0 2px 20px rgba(0, 0, 0, 0.75),
            0 4px 28px rgba(0, 0, 0, 0.45);
    }

    .nosotros-hero__lead {
        font-size: clamp(0.9375rem, 3.8vw + 0.2rem, 1.0625rem);
        line-height: 1.65;
        max-width: 100%;
    }

    .nosotros-hero--has-bg .nosotros-hero__lead {
        margin-left: auto;
        margin-right: auto;
        text-shadow:
            0 0 1px rgba(0, 0, 0, 0.9),
            0 1px 3px rgba(0, 0, 0, 0.75),
            0 2px 12px rgba(0, 0, 0, 0.55);
    }

    .nosotros-mv {
        padding-top: clamp(2.5rem, 8vw, 3.5rem);
        padding-bottom: clamp(0.85rem, 3vw, 1.35rem);
        padding-left: env(safe-area-inset-left, 0);
        padding-right: env(safe-area-inset-right, 0);
    }

    .nosotros-valores {
        padding-top: clamp(0.85rem, 2.5vw, 1.35rem);
        margin-top: 0;
        padding-left: env(safe-area-inset-left, 0);
        padding-right: env(safe-area-inset-right, 0);
    }

    .nosotros-valores__head {
        max-width: 100%;
        margin-bottom: clamp(1.5rem, 4vw, 2.25rem);
        padding: 0 0.125rem;
    }

    .nosotros-valores__title {
        font-size: clamp(1.35rem, 5.5vw + 0.3rem, 1.75rem);
        margin-bottom: 0.55rem;
        line-height: 1.22;
        text-wrap: balance;
        overflow-wrap: break-word;
    }

    .nosotros-valores__title::after {
        width: 2.5rem;
        height: 2px;
        margin-top: 0.55rem;
    }

    .nosotros-valores__subtitle {
        font-size: 1rem;
        line-height: 1.58;
        max-width: 100%;
    }

    .nosotros-mv__card {
        padding: clamp(1.35rem, 4vw, 1.75rem);
    }

    .nosotros-mv__title-row {
        gap: 0.75rem;
        align-items: stretch;
    }

    .nosotros-mv__title-accent {
        min-height: 2.25rem;
        margin-top: 0.15rem;
    }

    .nosotros-mv__card-title {
        font-size: clamp(1.28rem, 4.8vw + 0.35rem, 1.55rem);
        line-height: 1.2;
        letter-spacing: -0.02em;
        text-wrap: balance;
        overflow-wrap: break-word;
    }

    .nosotros-mv__card-text {
        font-size: 1rem;
        line-height: 1.72;
    }

    .nosotros-mv__icon {
        width: 3.25rem;
        height: 3.25rem;
        margin-bottom: 1.15rem;
    }

    .nosotros-mv__icon svg {
        width: 1.85rem;
        height: 1.85rem;
    }

    /* Evita columna mínima 280px que desborda en ~320px */
    .nosotros-valores__grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .nosotros-valor-card {
        padding: 1.25rem 1.15rem 1.35rem;
        min-width: 0;
    }

    .nosotros-valor-card__icon {
        width: 3rem;
        height: 3rem;
        font-size: 1.5rem;
        margin-bottom: 0.85rem;
    }

    .nosotros-valor-card__title {
        font-size: 1rem;
        line-height: 1.32;
        text-wrap: balance;
    }

    .nosotros-valor-card::before {
        font-size: clamp(3.75rem, 18vw, 5rem);
        bottom: -0.65rem;
        right: 0.35rem;
    }
}

/* Pantallas muy estrechas (p. ej. 320px, fold cerrado) */
@media (max-width: 389px) {
    .nosotros-hero__title {
        font-size: clamp(1.35rem, 6.5vw + 0.5rem, 1.65rem);
    }

    .nosotros-hero__kicker {
        letter-spacing: 0.1em;
    }
}

/* —— Scroll reveal —— */
.nosotros-reveal {
    opacity: 0;
    transform: translateY(28px);
    transition:
        opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--reveal-delay, 0ms);
}

.nosotros-reveal.is-inview {
    opacity: 1;
    transform: translateY(0);
}

/* Entrada escalonada en tarjetas de valores */
.nosotros-valor-card.nosotros-reveal {
    transform: translateY(24px);
    transition-property: opacity, transform, border-color, box-shadow, background, color;
    transition-duration: 0.65s, 0.65s, 0.28s, 0.28s, 0.28s, 0.28s;
    transition-timing-function:
        cubic-bezier(0.22, 1, 0.36, 1),
        cubic-bezier(0.22, 1, 0.36, 1),
        ease,
        ease,
        ease,
        ease;
    transition-delay: var(--reveal-delay, 0ms), var(--reveal-delay, 0ms), 0s, 0s, 0s, 0s;
}

.nosotros-valor-card.nosotros-reveal.is-inview {
    transform: translateY(0);
}

@media (hover: hover) and (pointer: fine) {
    .nosotros-valor-card.nosotros-reveal.is-inview:hover {
        transform: translateY(-7px) scale(1.015);
    }
}

@media (prefers-reduced-motion: reduce) {
    .nosotros-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .nosotros-valor-card.nosotros-reveal,
    .nosotros-valor-card.nosotros-reveal.is-inview {
        transform: none;
    }

    .nosotros-valor-card,
    .nosotros-valor-card__icon,
    .nosotros-valor-card__title,
    .nosotros-valor-card__desc,
    .nosotros-valor-card::before {
        transition: none;
    }

    @media (hover: hover) and (pointer: fine) {
        .nosotros-valor-card:hover,
        .nosotros-valor-card.nosotros-reveal.is-inview:hover {
            transform: none;
        }
    }
}
