/* Equipo (empresa.php): grilla móvil 2 columnas + modal de perfil */

@media (max-width: 767.98px) {
    .staff-section-grid.row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: var(--bs-gutter-x, 1rem);
        row-gap: 0.25rem;
        margin-left: 0;
        margin-right: 0;
        justify-content: stretch;
    }

    .staff-section-grid.row > .staff-card-item {
        width: 100% !important;
        max-width: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0;
        padding-right: 0;
    }

    .staff-section-grid .staff-card-item--solo-mobile {
        grid-column: 1 / -1;
        justify-content: center;
    }

    .staff-section-grid .staff-card-item--solo-mobile > .card {
        width: 100%;
        max-width: calc((100% - var(--bs-gutter-x, 1rem)) / 2);
        margin-inline: auto;
    }

    .staff-equipo-section .staff-card-media {
        width: 100%;
        max-width: 100% !important;
        margin-inline: auto;
    }

    .staff-equipo-section .staff-card-figure.rounded-circle {
        width: 100%;
        aspect-ratio: 1 / 1;
        border-radius: 50%;
    }

    .staff-equipo-section .staff-card-figure.rounded-circle .staff-card-photo {
        width: 100%;
        height: 100% !important;
        max-height: none !important;
        aspect-ratio: 1 / 1;
        object-fit: cover;
        object-position: center top;
    }

    .staff-equipo-section .staff-card-media:hover .staff-card-photo,
    .staff-equipo-section .card:hover .staff-card-photo {
        transform: none;
    }

    .staff-section-grid .card-title {
        font-size: clamp(0.72rem, 3.1vw, 0.875rem);
        line-height: 1.3;
    }

    .staff-section-grid .card-text small {
        font-size: clamp(0.65rem, 2.65vw, 0.78rem) !important;
        line-height: 1.35;
        letter-spacing: 0.01em;
    }

    .staff-section-grid .staff-card-item .card {
        margin-bottom: 1.25rem !important;
    }

    .staff-card-item--tap {
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .staff-card-item--tap:focus-visible {
        outline: 2px solid rgba(var(--bs-primary-rgb), 0.65);
        outline-offset: 3px;
        border-radius: 0.35rem;
    }

    .staff-card-item--tap:active .staff-card-photo {
        filter: grayscale(40%);
    }
}

.staff-member-modal__photo-wrap {
    width: min(72vw, 220px);
    margin-inline: auto;
}

.staff-member-modal__photo-wrap .staff-card-figure {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
}

.staff-member-modal__photo {
    width: 100%;
    height: 100%;
    max-height: none;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center top;
    filter: grayscale(100%);
}

.staff-member-modal__name {
    font-size: clamp(0.9rem, 4vw, 1.05rem);
    line-height: 1.35;
}

.staff-member-modal__role {
    font-size: clamp(0.75rem, 3.2vw, 0.875rem);
    line-height: 1.4;
}

.staff-member-modal__linkedin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 2.75rem;
    min-height: 2.75rem;
}

.staff-member-modal__linkedin.is-hidden {
    display: none;
}

/* Modal flotante en body (sin fijar layout de la página) */
#staffMemberModal.staff-member-modal {
    --bs-modal-zindex: 1075;
    --bs-modal-bg: transparent;
    background: transparent;
}

#staffMemberModal.staff-member-modal.show {
    z-index: 1075;
}

body.staff-member-modal-open > .modal-backdrop.show {
    background-color: rgba(2, 8, 18, 0.72);
    opacity: 1;
}

/* Bootstrap pone overflow:hidden en body y en móvil eso salta el scroll al inicio */
body.staff-member-modal-open.modal-open {
    overflow: visible !important;
    padding-right: 0 !important;
    position: static !important;
    top: auto !important;
    width: auto !important;
}

#staffMemberModal .modal-dialog {
    margin: 1.25rem auto;
    max-width: min(92vw, 22rem);
}

#staffMemberModal .modal-content {
    border-radius: 0.75rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.38);
    background-color: var(--bs-body-bg, #fff);
}

@media (min-width: 768px) {
    body.staff-member-modal-open {
        touch-action: auto;
    }

    #staffMemberModal .modal-dialog {
        max-width: 20rem;
    }
}
