/* Contenedores */


.wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 1rem;
}

.cm-title {
    padding-top: 50px;
    padding-bottom: 50px;
    text-align: center;
    margin: 0 0 1.5rem;
}

/* HERO */
.cm-hero {
    padding-top: 50px;

    position: relative;

    /* full-bleed sin pasarse por el 100vw */
    left: 49.5%;
    margin-left: -50vw;
    margin-right: -50vw;
    width: 100vw;
    /* fallback */
    width: 100dvw;
    /* ✅ no cuenta la barra vertical */

    min-height: calc(100svh - 60px);
    overflow: hidden;

    background-image: var(--hero);
    background-size: cover;
    background-position: center;
    display: grid;
    align-items: center;
    --hero-mask: 0.3;

    /* máscara negra sutil + imagen */
    background-image:
        linear-gradient(rgba(0, 0, 0, var(--hero-mask)), rgba(0, 0, 0, var(--hero-mask))),
        var(--hero);
    background-size: cover;
    background-position: center;
}




.cm-hero__overlay {
    position: relative;
    z-index: 1;
    width: min(1180px, 92vw);
    margin: 0 auto;
    padding-block: clamp(1rem, 2vw, 2rem);

    /* 2 columnas: logo (izq) + texto (der) */
    display: grid;
    grid-template-columns: minmax(260px, 420px) 1fr;
    gap: clamp(16px, 3vw, 48px);
    align-items: center;
}

.cm-hero__logo {
    width: clamp(180px, 24vw, 320px);
    margin-bottom: 1rem;
}

.cm-hero__texto {
    font-family: 'Montserrat', sans-serif;
    font-weight: 100;
    color: #fff;
    font-size: clamp(1rem, 1.15vw, 1.15rem);
    line-height: 1.55;
    max-width: 560px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .85);
    padding-left: 118px;
    text-align: justify !important;
}

/* MIEMBROS */
.cm-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}



.m-card {
    background: transparent;
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;

    transition: transform .18s ease, box-shadow .18s ease;
}

.m-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .12);
}

.m-card__thumb {
    aspect-ratio: 1/1;
    overflow: hidden;
}

.m-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(100%) contrast(105%) brightness(120%);
}

.m-card__name {
    font-family: 'Montserrat', sans-serif;
    margin: .6rem .8rem 1rem;
    font-weight: 400;
}

/* RESIDENCIA */
.cm-residencia__texto {
    font-family: 'Montserrat', sans-serif;
    max-width: 760px;
    margin: 0 auto;
}

.cm-residencia__cta {
    text-align: center;
    margin-top: 1.25rem;
}

/* ====== Modal (reutiliza estilo de Agenda) ====== */
/* ===== MODAL robusto en móvil ===== */

/* contenedor */
.modal {
    position: fixed;
    inset: 0;
    display: none;
}

.modal.is-open {
    display: block;
    z-index: 1000000;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .55);
}

/* diálogo centrado y con altura limitada a viewport real */
.modal-dialog {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: calc(env(safe-area-inset-top) + 12px);
    bottom: calc(env(safe-area-inset-bottom) + 12px);

    width: min(860px, 92vw);
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px);

    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
    color: #3a3a3a;
    display: flex;
    flex-direction: column;
}

/* si quieres mantener tu fondo gris */
.modal-dialog--yellow {
    background: #f1f2f2;
}

.modal-close {
    color: #ffb600;
    position: absolute;
    right: 21px;
    top: 21px;
    z-index: 3;
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 37px;
    line-height: 1;
}

/* cuerpo en columna: permite scroll interno */
.modal-body {
    padding: 0;
    /* quitamos padding aquí */
    display: flex;
    flex-direction: column;
    min-height: 0;
    /* clave para scroll interno */
}

/* imagen de cabecera: limita la altura, recorta con cover */
.modal-hero {
    margin: 0;
    overflow: hidden;
}

.modal-hero img {
    width: 100%;
    height: min(45vh, 560px);
    object-fit: cover;
    object-position: 50% 20%;
    display: block;
}

/* contenido con padding propio y scroll interno */
.modal-content {
    padding: 1rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    min-height: 0;
}

/* el texto scrollea, no el diálogo */
.modal-scroll {
    flex: 1;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;

    /* mantengo tu estilo de scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #ffb600 #000;
    scrollbar-gutter: stable;
}

.modal-scroll::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.modal-scroll::-webkit-scrollbar-track {
    background: #000;
    border-radius: 10px;
}

.modal-scroll::-webkit-scrollbar-thumb {
    background: #ffb600;
    border-radius: 10px;
    border: 2px solid #000;
}

.modal-scroll::-webkit-scrollbar-thumb:hover {
    background: #ffd46b;
}

/* acciones/íconos */
.modal-actions {
    display: flex;
    gap: 16px;
    margin-top: .25rem;
}

.modal-actions .icon-link {
    font-size: 28px;
    color: #ffb600;
    text-decoration: none;
    transition: transform .2s ease, color .2s ease;
}

.modal-actions .icon-link:hover {
    color: #643f99;
    transform: scale(1.2);
}

/* BLOQUEO DE SCROLL DEL FONDO al abrir modal */
html.no-scroll,
body.no-scroll {
    overflow: hidden;
    height: 100%;
    touch-action: none;
}

/* Ajustes en pantallas pequeñas */
@media (max-width:760px) {
    .modal-dialog {
        width: 94vw;
        border-width: 5px;
    }

    .modal-hero img {
        height: 40vh;
        object-position: 50% 15%;
    }
}


/* Card hover overlay */
.m-card {
    position: relative;
}

.m-card__thumb {
    position: relative;
    overflow: hidden;
}

/* Atenuar y leve zoom en hover */
.m-card__thumb img {
    transition: filter .25s ease, transform .25s ease;
}

.m-card:hover .m-card__thumb img {
    filter: brightness(0.55) saturate(0.95);
    transform: scale(1.02);
}

/* Capa overlay */
.m-card__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding: 14px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, .55) 100%);
    opacity: 0;
    transition: opacity .25s ease;
}

.m-card:hover .m-card__overlay {
    opacity: 1;
}

/* Contenido del overlay */
.m-card__overlay-content {
    width: 100%;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Descripción con scroll si es larga */
.m-card__overlay-desc {
    font-family: 'Montserrat', sans-serif;
    font-size: .95rem;
    line-height: 1.45;
    max-height: 6.5em;
    /* ~4-5 líneas */
    overflow: auto;
}

/* Íconos sobre la imagen */
.m-card__overlay-links {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    align-items: center;
}

.m-card__overlay-links .icon-link {
    font-size: 22px;
    color: #ffb600;
    text-decoration: none;
    transition: transform .2s ease, color .2s ease;
}

.m-card__overlay-links .icon-link:hover {
    transform: scale(1.12);
    color: #ffd46b;
}

/* Accesibilidad: también al enfocar con teclado */
.m-card:focus-within .m-card__overlay {
    opacity: 1;
}


/* ===== Scrollbar amarillo sobre negro ===== */
/* Card overlay (texto con scroll) */
.m-card__overlay-desc {
    scrollbar-width: thin;
    /* Firefox */
    scrollbar-color: #ffb600 #000;
    /* thumb | track */
    scrollbar-gutter: stable;
    /* evita saltos de layout */
}

/* Modal (si quieres igual estilo en la descripción) */
.modal-scroll {
    scrollbar-width: thin;
    scrollbar-color: #ffb600 #000;
    scrollbar-gutter: stable;
}

/* WebKit (Chrome, Edge, Safari) */
.m-card__overlay-desc::-webkit-scrollbar,
.modal-scroll::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.m-card__overlay-desc::-webkit-scrollbar-track,
.modal-scroll::-webkit-scrollbar-track {
    background: #000;
    /* pista negra */
    border-radius: 10px;
}

.m-card__overlay-desc::-webkit-scrollbar-thumb,
.modal-scroll::-webkit-scrollbar-thumb {
    background: #ffb600;
    /* thumb amarillo */
    border-radius: 10px;
    border: 2px solid #000;
    /* separa del track */
}

.m-card__overlay-desc::-webkit-scrollbar-thumb:hover,
.modal-scroll::-webkit-scrollbar-thumb:hover {
    background: #ffd46b;
    /* hover más claro */
}

.m-card__overlay-desc::-webkit-scrollbar-corner,
.modal-scroll::-webkit-scrollbar-corner {
    background: #000;
}



/* Opcional: en móvil reduce un poco la imagen para más espacio al texto */
@media (max-width: 760px) {
    .modal-hero img {
        height: 42vh;
        object-position: 50% 15%;
    }

    .modal-scroll {
        max-height: 32vh;
    }
}



/* Botones (usa los globales si ya los tienes) */
.btn {
    display: inline-block;
    padding: .85rem 1.8rem;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: .25s;
    cursor: pointer;
}

.btn-morado {
    font-family: 'Montserrat', sans-serif;
    background: #5f2c8c;
    color: #fff;
}

.btn-morado:hover {
    background: #4a1f6d;
    transform: translateY(-2px);
}

.btn-amarillo {
    background: #000;
    color: #fff;
}

/* en fondo amarillo, prueba morado si prefieres */
/*movil*/



@media (max-width: 760px) {
    .modal-dialog {
        inset: 6% 50% auto 50%;
    }

    .modal-grid {
        grid-template-columns: 1fr;
    }

    .cm-hero__overlay {
        grid-template-columns: 1fr;
        /* una sola columna */
        row-gap: 12px;
    }

    .cm-hero__logo {
        order: 1;
        justify-self: start;
        padding-top: 4rem;
    }

    .cm-hero__texto {
        order: 2;
        max-width: 90%;
    }

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

    .modal-links .icon-chip {
        width: 52px;
        height: 52px;
    }

    .modal-links .favicon {
        width: 26px;
        height: 26px;
    }
}