/* =========================
   TEAM (Quiénes somos) — clean
========================= */

.team {
    padding: var(--page-top-space) 0 5rem;
}

.team .container {
    max-width: none;
    width: 90%;
}

/* top: izquierda (eyebrow + titulo) / derecha (lead) */
.team__top {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 3rem;
    align-items: start;
    margin-bottom: 2.2rem;
}

.team__eyebrow {
    margin: 0 0 .55rem;
    font-family: var(--font-body);
    font-size: .85rem;
    letter-spacing: .10em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, .65);
}

/* título grande */
.team__title {
    margin: 0;
    font-family: var(--font-body);
    font-weight: 800;
    font-size: clamp(2.4rem, 3.8vw, 3.25rem);
    line-height: 1.05;
    color: rgba(0, 0, 0, .80);
}

/* párrafo derecha alineado a la altura del título */
.team__lead {
    margin: 0;
    /* importante */
    padding-top: 2rem;
    /* ajusta la altura para que empiece “a la altura del título” */
    color: rgba(0, 0, 0, .65);
    line-height: 1.3;
    font-size: 18px;
    text-align: justify;
    max-width: 100ch;
}

/* grid cards */
.team__grid {
    margin-top: 65px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8rem;
}

/* card SIN bordes, SIN radius */
.team-card {
    text-decoration: none;
    color: inherit;
    display: block;
}

.team-card__photo {
    width: 100%;
    /* aspect-ratio: 3 / 4; */
    /* rectangular vertical */
    background: rgba(0, 0, 0, .03);
    overflow: hidden;
    /* por si usas cover */
}

/* ✅ elige UNA de estas dos (te dejo ambas) */

/* Opción A: estilo editorial (recorta un poco, queda pro) */
.team-card__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(1);
    transition: filter .25s ease, transform .25s ease;
}

.team-card:hover .team-card__photo img {
    filter: grayscale(.2);
    transform: scale(1.02);
}

/* Nombre debajo */
.team-card__name {
    margin-top: .75rem;
    font-family: var(--font-body);
    font-weight: 800;
    font-size: 1.05rem;
    color: rgba(0, 0, 0, .92);
}

/* responsive */
@media (max-width: 920px) {
    .team__top {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .team__lead {
        padding-top: 0;
    }

    .team__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 520px) {
    .team__grid {
        grid-template-columns: 1fr;
    }
}

.team-card__photo {
    position: relative;
    overflow: hidden;
    container-type: inline-size;
}

/* Imagen normal */
.team-card__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(1);
    transition: filter .25s ease, transform .25s ease;
    will-change: filter, transform;
}

/* Overlay (oculto) */
.team-card__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 1.5rem;

    background:
        linear-gradient(to top, rgba(10, 10, 20, 0.72) 0%, rgba(10, 10, 20, 0.28) 45%, rgba(10, 10, 20, 0.08) 100%);
    opacity: 0;
    transition: opacity .3s ease;
}

/* rol moderno y limpio */
.team-card__roleOverlay {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: clamp(1rem, 1.25vw, 1.2rem);
    line-height: 1.1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #f4f6ff;
    max-width: 12ch;
}

/* hover */
.team-card:hover .team-card__photo img,
.team-card:focus-visible .team-card__photo img {
    transform: scale(1.03);
    filter: grayscale(.15) blur(3px);
}

.team-card:hover .team-card__overlay,
.team-card:focus-visible .team-card__overlay {
    opacity: 1;
}

.team-card__name {
    margin-top: 0.9rem;
    font-family: var(--font-title);
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--identity);
}

/* botón ver rol */
.team-card__toggle {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
}

/* oculto en ordenador */
@media (min-width: 921px) {
    .team-card__toggle {
        display: none;
    }
}

/* estado abierto */
.team-card.is-open .team-card__overlay {
    opacity: 1;
}

.team-card.is-open .team-card__photo img {
    transform: scale(1.03);
    filter: grayscale(.15) blur(3px);
}

/* responsive */
@media (max-width: 920px) {
    .team__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

@media (max-width: 520px) {
    .team__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .team-card__name {
        margin-top: .6rem;
        font-size: .9rem;
        line-height: 1.15;
    }

    .team-card__toggle {
        width: 32px;
        height: 32px;
        font-size: 16px;
        bottom: 8px;
        right: 8px;
    }

    .team-card__overlay {
        padding: .9rem;
    }

    .team-card__roleOverlay {
        font-size: .72rem;
        max-width: 10ch;
        line-height: 1.05;
    }
}

/* =========================
   PROFILE DOCUMENT STYLE
========================= */

.profile-page {
    min-height: 100vh;
    padding-top: calc(var(--header-h) + 2.5rem);
    padding-bottom: 4rem;
}

.profile-doc__inner {
    width: 90%;
    max-width: 1800px;
    margin: 0 auto;
}

/* nombre */
.profile-doc__name {
    margin: 0 0 0rem;
    font-family: var(--font-title);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(3rem, 5vw, 5rem);
    line-height: 1;
    color: #1b1d63;
}

/* ---------- FOTO + CONTACTO ---------- */

.profile-doc__top {
    display: grid;
    grid-template-columns: 850px 320px 330px;
    align-items: end;
    column-gap: 4rem;
    margin-bottom: 1.4rem;
}

.profile-doc__photo {
    grid-column: 2;
    width: 330px;
}

.profile-doc__photo img {
    width: 100%;
    display: block;
}

.profile-doc__miniContact {
    grid-column: 3;
    justify-self: start;
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    font-size: .82rem;
    line-height: 1.35;
}

.profile-doc__miniContact a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.profile-doc__left {
    align-self: start;
    padding-top: 20px;
}

/* línea */

.profile-doc__divider {
    border-top: 2px solid var(--identity);
    margin-bottom: 1.4rem;
}

/* ---------- CONTENIDO ---------- */

.profile-doc__bottom {
    display: grid;
    grid-template-columns: 420px 320px 330px;
    column-gap: 1rem;
}

/* izquierda */

.profile-doc__role {
    font-family: Georgia, "Times New Roman", serif;
    text-transform: uppercase;
    font-weight: 400;
    font-size: 1.5rem;
    color: var(--muted);
    margin-bottom: 1rem;

    /* evita salto de línea */
    white-space: nowrap;
}

.profile-doc__studies {
    padding-left: 2rem;
    max-width: 530px;
}

.profile-doc__studies li {
    font-family: var(--font-body);
    font-style: italic;
    font-size: .92rem;
    line-height: 1.35;
    margin-bottom: .4rem;
}

.profile-doc__studies p {
    font-family: var(--font-body);
    font-style: italic;
    font-size: .92rem;
    margin-top: 0px;
    margin-bottom: .9rem;
    margin-left: 15px;
}

/* textos */

.profile-doc__text {
    width: 330px;
}

.profile-doc__text p {
    font-family: var(--font-body);
    font-size: .92rem;
    line-height: 1.35;
    margin-bottom: 1rem;
    text-align: justify;


}

/* =========================
   PROFILE DOCUMENT — responsive
========================= */

@media (max-width: 920px) {
    .profile-page {
        padding-top: calc(var(--header-h) + 1.5rem);
        padding-bottom: 3rem;
    }

    .profile-doc__inner {
        width: min(92%, 720px);
    }

    .profile-doc__name {
        font-size: clamp(2.2rem, 8vw, 4rem);
        line-height: .98;
        margin-bottom: 1rem;
    }

    .profile-doc__top {
        grid-template-columns: 1fr;
        row-gap: 1.25rem;
        column-gap: 0;
        margin-bottom: 1.2rem;
    }

    .profile-doc__photo {
        grid-column: auto;
        width: min(100%, 340px);
    }

    .profile-doc__miniContact {
        grid-column: auto;
        justify-self: start;
        font-size: .9rem;
    }

    .profile-doc__divider {
        margin-bottom: 1.2rem;
    }

    .profile-doc__bottom {
        grid-template-columns: 1fr;
        row-gap: 1.5rem;
        column-gap: 0;
    }

    .profile-doc__role {
        font-size: 1.8rem;
        margin-bottom: 1.1rem;
        white-space: normal;
    }

    .profile-doc__studies {
        padding-left: 1.2rem;
        max-width: none;
    }

    .profile-doc__studies li {
        font-size: .9rem;
        line-height: 1.45;
        margin-bottom: .45rem;
    }

    .profile-doc__text {
        width: 100%;
        max-width: none;
    }

    .profile-doc__text p {
        font-size: .95rem;
        line-height: 1.55;
        margin-bottom: 1rem;
        text-align: left;
    }
}

@media (max-width: 520px) {
    .profile-page {
        padding-top: calc(var(--header-h) + 1rem);
        padding-bottom: 2.5rem;
    }

    .profile-doc__inner {
        width: 90%;
    }

    .profile-doc__name {
        font-size: 2rem;
        line-height: 1;
        margin-bottom: .9rem;
    }

    .profile-doc__top {
        row-gap: 1rem;
        margin-bottom: 1rem;
    }

    .profile-doc__photo {
        width: 100%;
        max-width: 280px;
    }

    .profile-doc__miniContact {
        font-size: .82rem;
        line-height: 1.45;
    }

    .profile-doc__role {
        font-size: 1.45rem;
        margin-bottom: .9rem;
    }

    .profile-doc__studies {
        padding-left: 1rem;
    }

    .profile-doc__studies li {
        font-size: .82rem;
        line-height: 1.4;
    }

    .profile-doc__text p {
        font-size: .88rem;
        line-height: 1.5;
    }
}

/* =========================
   TEAM UNITED — OVERLAY SCROLL REVEAL
========================= */

.team {
    position: relative;
    z-index: 1;
    overflow: visible;
}

/* El contenido anterior se va hacia arriba */
.team__top,
.team__grid {
    transition:
        opacity 1s ease,
        transform 1s ease,
        filter 1s ease;
}

.team.is-leaving .team__top,
.team.is-leaving .team__grid {
    opacity: 0;
    transform: translateY(-120px);
    filter: blur(12px);
    pointer-events: none;
}

/* =========================
   FOTO GRUPAL
========================= */

.team-united {
    position: relative;
    z-index: 5;

    margin-top: -550px;
    height: 90vh;
    overflow: hidden;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform: translateY(140px) scale(.98);
    filter: blur(14px);

    transition:
        opacity 1s ease,
        transform 1s ease,
        filter 1s ease,
        visibility 0s linear 1s;
}

.team-united.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 50;

    transform: translateY(0) scale(1);
    filter: blur(0);

    transition:
        opacity 1s ease,
        transform 1s ease,
        filter 1s ease,
        visibility 0s;
}

.team-united img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;

    transform: scale(1.08);
    transition: transform 1.5s ease;
}

.team-united.is-visible img {
    transform: scale(1);
}

/* Overlay oscuro encima de la imagen */
.team-united__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;

    background:
        linear-gradient(to top,
            rgba(0, 0, 0, .78),
            rgba(0, 0, 0, .32),
            rgba(0, 0, 0, .08));
}

/* Texto sobre la foto */
.team-united__content {
    position: absolute;
    left: 5rem;
    bottom: 5rem;
    z-index: 2;

    max-width: 700px;
    color: white;

    opacity: 0;
    transform: translateY(45px);

    transition:
        opacity .9s ease .25s,
        transform .9s ease .25s;
}

.team-united.is-visible .team-united__content {
    opacity: 1;
    transform: translateY(0);
}

.team-united__content h2 {
    margin: 0 0 1rem;

    font-family: var(--font-title);
    font-size: clamp(2.5rem, 5vw, 5rem);
    line-height: .95;
}

.team-united__content p {
    margin: 0;

    max-width: 52ch;

    font-size: 1rem;
    line-height: 1.6;
}

/* =========================
   BLOQUEAR CLICKS EN CARDS
========================= */

.team.is-leaving .team__grid,
.team.is-leaving .team-card,
.team.is-leaving .team-card__link {
    pointer-events: none !important;
}

/* =========================
   MOBILE — ESTÁTICO + FOTO COMPLETA + TEXTO ENCIMA
========================= */

@media (max-width: 768px) {

    .team {
        overflow: visible;
    }

    .team__top,
    .team__grid,
    .team.is-leaving .team__top,
    .team.is-leaving .team__grid {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
        pointer-events: auto !important;
    }

    .team-card,
    .team-card__link {
        pointer-events: auto !important;
    }

    .team-united,
    .team-united.is-visible {
        position: relative !important;
        z-index: 1 !important;

        margin-top: 4rem !important;
        height: auto !important;
        min-height: auto !important;

        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        filter: none !important;

        pointer-events: auto !important;
        overflow: hidden !important;
    }

    .team-united img,
    .team-united.is-visible img {
        width: 100% !important;
        height: auto !important;

        object-fit: contain !important;
        display: block;

        transform: none !important;
    }

    .team-united__overlay {
        display: block !important;
        position: absolute;
        inset: 0;
        z-index: 1;

        background:
            linear-gradient(to top,
                rgba(0, 0, 0, .82),
                rgba(0, 0, 0, .32),
                rgba(0, 0, 0, .04));
    }

    .team-united__content,
    .team-united.is-visible .team-united__content {
        position: absolute !important;

        left: 1.4rem !important;
        right: 1.4rem !important;
        bottom: 1.4rem !important;

        z-index: 2;

        max-width: none;

        color: white !important;

        opacity: 1 !important;
        transform: none !important;
    }

    .team-united__content h2 {
        margin-bottom: .6rem;

        font-size: clamp(1.7rem, 8vw, 2.4rem);
        line-height: .95;

        color: white !important;
    }

    .team-united__content p {
        max-width: 100%;

        font-size: .88rem;
        line-height: 1.45;

        color: rgba(255, 255, 255, .9) !important;
    }
}


/* =========================================================
   RESPONSIVE FINAL — QUIÉNES SOMOS + PERFILES
   Pegar al final de quienes-somos.css
========================================================= */

/* =========================
   1440px / Desktop medio
========================= */

@media (max-width: 1440px) {
    .team .container {
        width: 92%;
    }

    .team__grid {
        gap: 4rem;
    }

    .team__lead {
        font-size: 17px;
    }

    .profile-doc__inner {
        width: 92%;
        max-width: 1400px;
    }

    .profile-doc__top {
        grid-template-columns: minmax(420px, 1fr) 300px 280px;
        column-gap: 2.5rem;
    }

    .profile-doc__photo {
        width: 300px;
    }

    .profile-doc__bottom {
        grid-template-columns: minmax(360px, 1fr) 300px 280px;
        column-gap: 2.5rem;
    }

    .profile-doc__text {
        width: 100%;
    }
}

/* =========================
   1200px / Portátil pequeño
========================= */

@media (max-width: 1200px) {
    .team {
        padding-top: 5rem;
    }

    .team__top {
        gap: 2.2rem;
    }

    .team__grid {
        gap: 2.5rem;
    }

    .profile-doc__name {
        font-size: clamp(3rem, 5vw, 4.4rem);
    }

    .profile-doc__top {
        grid-template-columns: minmax(340px, 1fr) 270px 240px;
        column-gap: 2rem;
    }

    .profile-doc__photo {
        width: 270px;
    }

    .profile-doc__bottom {
        grid-template-columns: minmax(320px, 1fr) 270px 240px;
        column-gap: 2rem;
    }

    .profile-doc__role {
        font-size: 1.35rem;
    }

    .profile-doc__studies {
        max-width: 440px;
    }
}

/* =========================
   1024px / Tablet horizontal
========================= */

@media (max-width: 1024px) {
    .team {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }

    .team__top {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    .team__lead {
        padding-top: 0;
        max-width: 78ch;
        text-align: left;
        line-height: 1.55;
        font-size: 1rem;
    }

    .team__grid {
        margin-top: 3rem;
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .profile-page {
        padding-top: calc(var(--header-h) + 2rem);
    }

    .profile-doc__inner {
        width: min(92%, 860px);
    }

    .profile-doc__top {
        grid-template-columns: 1fr 280px;
        column-gap: 2rem;
        row-gap: 1.5rem;
        align-items: start;
    }

    .profile-doc__left {
        grid-column: 1;
        grid-row: 1;
    }

    .profile-doc__photo {
        grid-column: 2;
        grid-row: 1;
        width: 280px;
    }

    .profile-doc__miniContact {
        grid-column: 2;
        grid-row: 2;
        justify-self: start;
    }

    .profile-doc__bottom {
        grid-template-columns: 1fr 1fr;
        column-gap: 2rem;
    }

    .profile-doc__text {
        width: 100%;
    }

    .profile-doc__text p {
        line-height: 1.5;
    }

    .team-united {
        margin-top: -360px;
        height: 78vh;
    }
}

/* =========================
   920px / Tablet vertical
========================= */

@media (max-width: 920px) {
    .team .container {
        width: 92%;
    }

    .team__title {
        font-size: clamp(2.2rem, 7vw, 3rem);
    }

    .team__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .team-card__roleOverlay {
        font-size: clamp(.85rem, 2vw, 1rem);
    }

    .profile-doc__inner {
        width: min(92%, 720px);
    }

    .profile-doc__top {
        grid-template-columns: 1fr;
        row-gap: 1.25rem;
    }

    .profile-doc__left,
    .profile-doc__photo,
    .profile-doc__miniContact {
        grid-column: auto;
        grid-row: auto;
    }

    .profile-doc__photo {
        width: min(100%, 340px);
    }

    .profile-doc__bottom {
        grid-template-columns: 1fr;
        row-gap: 1.4rem;
    }

    .profile-doc__role {
        white-space: normal;
    }
}

/* =========================
   768px / Móvil grande
========================= */

@media (max-width: 768px) {
    .team {
        padding-top: 3.5rem;
        padding-bottom: 3.5rem;
    }

    .team__eyebrow {
        font-size: .76rem;
    }

    .team__title {
        font-size: clamp(2rem, 8vw, 2.8rem);
    }

    .team__lead {
        font-size: .95rem;
        line-height: 1.55;
    }

    .team__grid {
        margin-top: 2.4rem;
        gap: 1.4rem;
    }

    .team-card__name {
        font-size: 1rem;
    }

    .profile-page {
        padding-top: calc(var(--header-h) + 1.5rem);
        padding-bottom: 3rem;
    }

    .profile-doc__name {
        font-size: clamp(2.4rem, 9vw, 3.5rem);
        margin-bottom: 1rem;
    }

    .profile-doc__photo {
        width: min(100%, 320px);
    }

    .profile-doc__role {
        font-size: 1.45rem;
    }

    .profile-doc__studies {
        padding-left: 1.2rem;
        max-width: none;
    }

    .profile-doc__text p {
        font-size: .94rem;
        line-height: 1.55;
        text-align: left;
    }

    .team-united__content {
        left: 1.4rem !important;
        right: 1.4rem !important;
        bottom: 1.4rem !important;
    }
}

/* =========================
   640px / Móvil normal
========================= */

@media (max-width: 640px) {
    .team {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }

    .team .container {
        width: 100%;
        padding: 0 1.2rem;
    }

    .team__top {
        margin-bottom: 1.6rem;
    }

    .team__eyebrow {
        font-size: .7rem;
        letter-spacing: .08em;
    }

    .team__title {
        font-size: clamp(1.85rem, 9vw, 2.45rem);
    }

    .team__lead {
        font-size: .9rem;
        line-height: 1.5;
    }

    .team__grid {
        margin-top: 2rem;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .team-card__name {
        margin-top: .65rem;
        font-size: .9rem;
        line-height: 1.15;
    }

    .team-card__overlay {
        padding: .9rem;
    }

    .team-card__roleOverlay {
        font-size: .72rem;
        max-width: 11ch;
    }

    .profile-doc__inner {
        width: 100%;
        padding: 0 1.2rem;
    }

    .profile-doc__name {
        font-size: clamp(2rem, 10vw, 2.8rem);
    }

    .profile-doc__photo {
        max-width: 290px;
    }

    .profile-doc__miniContact {
        font-size: .82rem;
        line-height: 1.45;
        word-break: break-word;
    }

    .profile-doc__role {
        font-size: 1.25rem;
        line-height: 1.1;
    }

    .profile-doc__studies {
        padding-left: 1rem;
    }

    .profile-doc__studies li,
    .profile-doc__studies p {
        font-size: .84rem;
        line-height: 1.4;
    }

    .profile-doc__text p {
        font-size: .88rem;
        line-height: 1.5;
    }

    .team-united {
        margin-top: 3rem !important;
    }

    .team-united__content h2 {
        font-size: clamp(1.6rem, 8vw, 2.2rem);
    }

    .team-united__content p {
        font-size: .84rem;
    }
}

/* =========================
   480px / Móvil pequeño
========================= */

@media (max-width: 480px) {
    .team .container {
        padding: 0 1rem;
    }

    .team__title {
        font-size: 2rem;
    }

    .team__grid {
        gap: .85rem;
    }

    .team-card__name {
        font-size: .82rem;
    }

    .team-card__toggle {
        width: 30px;
        height: 30px;
        font-size: 15px;
    }

    .team-card__roleOverlay {
        font-size: .66rem;
    }

    .profile-doc__inner {
        padding: 0 1rem;
    }

    .profile-doc__name {
        font-size: 2rem;
    }

    .profile-doc__photo {
        max-width: 260px;
    }

    .profile-doc__role {
        font-size: 1.1rem;
    }

    .profile-doc__studies li,
    .profile-doc__studies p {
        font-size: .8rem;
    }

    .profile-doc__text p {
        font-size: .84rem;
    }

    .team-united__content {
        left: 1rem !important;
        right: 1rem !important;
        bottom: 1rem !important;
    }
}

/* =========================
   380px / Móvil muy estrecho
========================= */

@media (max-width: 380px) {
    .team__grid {
        grid-template-columns: 1fr;
        gap: 1.3rem;
    }

    .team-card__name {
        font-size: .95rem;
    }

    .team-card__roleOverlay {
        font-size: .8rem;
    }

    .profile-doc__name {
        font-size: 1.75rem;
    }

    .profile-doc__photo {
        max-width: 230px;
    }

    .profile-doc__miniContact {
        font-size: .78rem;
    }

    .profile-doc__role {
        font-size: 1rem;
    }

    .profile-doc__text p {
        font-size: .8rem;
    }

    .team-united__content h2 {
        font-size: 1.55rem;
    }

    .team-united__content p {
        font-size: .78rem;
    }
}