.experts-module {
    contain: layout style paint;
}

.experts-module .experts-module__header {
    max-width: 800px;
    margin: 0 auto 60px;
    text-align: center;
}

.experts-module .experts-module__heading {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    color: #000;
}

.experts-module .experts-module__description {
    font-size: 18px;
    line-height: 1.6;
    color: #666;
}

.experts-module .experts-module__description p {
    margin: 0;
}

.experts-module .experts-module__masonry {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.experts-module .masonry-item {
    position: relative;
    overflow: hidden;
    will-change: transform, opacity;
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.experts-module .masonry-item.is-visible {
    opacity: 1;
    transform: translateY(0);
    will-change: auto;
}

/* Delay escalonado para cada card */
.experts-module .masonry-item:nth-child(1) {
    transition-delay: 0s;
}

.experts-module .masonry-item:nth-child(2) {
    transition-delay: 0.1s;
}

.experts-module .masonry-item:nth-child(3) {
    transition-delay: 0.2s;
}

.experts-module .masonry-item:nth-child(4) {
    transition-delay: 0.3s;
}

.experts-module .masonry-item:nth-child(5) {
    transition-delay: 0.4s;
}

.experts-module .masonry-item:nth-child(6) {
    transition-delay: 0.5s;
}

.experts-module .masonry-item:nth-child(7) {
    transition-delay: 0.6s;
}

.experts-module .masonry-item:nth-child(8) {
    transition-delay: 0.7s;
}

.experts-module .masonry-item:nth-child(9) {
    transition-delay: 0.8s;
}

.experts-module .masonry-item:nth-child(10) {
    transition-delay: 0.9s;
}

.experts-module .masonry-item--text,
.experts-module .masonry-item--empty {
    background-color: transparent;
    border: none;
    box-shadow: none !important;
    transform: none !important;
}

.experts-module .masonry-item--empty {
    pointer-events: none;
}

.experts-module .people-card {
    position: relative;
    height: 100%;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 16px;
    box-sizing: border-box;
}

.experts-module .people-card::before,
.experts-module .people-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
}

.experts-module .people-card::before {
    background-image: var(--bg-image);
    background-position: var(--bg-pos, center center);
    background-size: cover;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.experts-module .people-card:hover::before {
    transform: scale(1.05);
}

.experts-module .people-card::after {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.1) 40%, rgba(0, 0, 0, 0.6) 100%);
    z-index: 1;
}

.experts-module .people-card__play-icon-wrapper {
    width: 32px;
    height: 32px;
    margin-bottom: 16px;
    transition: transform 0.3s ease;
    z-index: 2;
    display: none;
}

.experts-module .masonry-item.has-video .people-card__play-icon-wrapper {
    display: block;
}

.experts-module .people-card__play-icon-wrapper:hover {
    transform: scale(0.95);
}

.experts-module .people-card__play-icon-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.experts-module .people-card__info {
    position: relative;
    z-index: 2;
    color: #fff;
}

.experts-module .people-card__name {
   
    margin: 0 0 4px 0;
    color: #fff;
     
}

.experts-module .people-card__title {
    font-size: 12px!important;
    margin: 0;
    opacity: 0.9;
    color: #fff;
    line-height: 13px;
    font-weight: normal;
}

.experts-module .text-card {
    display: flex;
    flex-direction: column;
    justify-content: start;
    gap: 20px;
    height: 100%;
}

.experts-module .text-card__text {
    font-size: 20px;
    line-height: 24px;
    color: #666;
    margin: 0;
    max-width: 450px;
    text-wrap: balance;
}

.experts-modal {
    position: fixed;
    z-index: 10000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s linear;
}

.experts-modal.is-active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}

.experts-modal .experts-modal__container {
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease;
    width: 90%;
    max-width: 1100px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

.experts-modal.is-active .experts-modal__container {
    transform: scale(1);
}

.experts-modal__close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

.experts-modal__close:hover {
    opacity: 1;
    transform: scale(1.1);
}

.experts-modal__content {
    width: 100%;
    height: 100%;
}

.video-modal-expert .experts-modal__container {
    background: #000;
    aspect-ratio: 16 / 9;
}

.video-modal-expert.is-vertical .experts-modal__container {
    aspect-ratio: auto;
    max-width: none;
    max-height: 90vh;
    width: auto;
    height: 90vh;
}

.video-modal-expert iframe,
.video-modal-expert video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: contain;
}

.video-modal-expert.is-vertical video {
    position: relative;
    width: auto;
    height: 100%;
    max-width: 90vw;
}

.details-modal-expert .experts-modal__container {
    max-height: 80vh;
    padding: 16px;
    box-sizing: border-box;
    background-image: var(--details-bg-image);
    background-position: var(--details-bg-pos, center center);
    background-size: cover;
    position: relative;
    aspect-ratio: 9 / 12;
}

.details-modal-expert .experts-modal__content {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
}

.details-modal-expert .experts-modal__container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.6) 40%, rgba(0, 0, 0, 0.95) 100%);
    z-index: 1;
}

.details-modal-expert .experts-modal__close {
    color: #fff;
}

.details-modal-expert__info {
    position: relative;
    z-index: 2;
    color: #fff;
    max-width: 80%;
}

.details-modal-expert__name,
.details-modal-expert__title,
.details-modal-expert__intro {
    color: #fff;
}

.details-modal-expert__name {}

.details-modal-expert__title {}

.details-modal-expert__intro {}

.details-modal-expert__intro p {}

.experts-module .masonry-item:nth-child(1) {
    animation-delay: 0.1s;
}

.experts-module .masonry-item:nth-child(2) {
    animation-delay: 0.2s;
}

.experts-module .masonry-item:nth-child(3) {
    animation-delay: 0.3s;
}

.experts-module .masonry-item:nth-child(4) {
    animation-delay: 0.4s;
}

.experts-module .masonry-item:nth-child(5) {
    animation-delay: 0.5s;
}

.experts-module .masonry-item:nth-child(6) {
    animation-delay: 0.6s;
}

.experts-module .masonry-item:nth-child(7) {
    animation-delay: 0.7s;
}

.experts-module .masonry-item:nth-child(8) {
    animation-delay: 0.8s;
}

.experts-module .masonry-item:nth-child(9) {
    animation-delay: 0.9s;
}

.experts-module .masonry-item:nth-child(10) {
    animation-delay: 1.0s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.experts-module .masonry-item::before {
    content: attr(data-item-number);
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: none;
    text-align: center;
    line-height: 30px;
    font-size: 14px;
    font-weight: 700;
    z-index: 100;
}

.experts-module.admin-logged-in .masonry-item:not(.masonry-item--text):not(.masonry-item--empty)::before {
    display: block;
}

@media (min-width: 993px) {
    .experts-module .experts-module__masonry {
        grid-template-columns: repeat(5, 1fr);
        grid-auto-rows: 150px;
    }

    .experts-module .masonry-item--text {
        grid-column: 1 / 3;
        grid-row: 1 / 3;
    }

    .experts-module .masonry-item--empty {
        grid-column: 1 / 2;
        grid-row: 3 / 4;
    }

    .experts-module .expert-1 {
        grid-column: 3 / 5;
        grid-row: 1 / 2;
    }

    .experts-module .expert-2 {
        grid-column: 5 / 6;
        grid-row: 1 / 3;
    }

    .experts-module .expert-3 {
        grid-column: 3 / 4;
        grid-row: 2 / 3;
    }

    .experts-module .expert-4 {
        grid-column: 4 / 5;
        grid-row: 2 / 5;
    }

    .experts-module .expert-5 {
        grid-column: 2 / 3;
        grid-row: 3 / 4;
    }

    .experts-module .expert-6 {
        grid-column: 3 / 4;
        grid-row: 3 / 5;
    }

    .experts-module .expert-7 {
        grid-column: 5 / 6;
        grid-row: 3 / 5;
    }

    .experts-module .expert-8 {
        grid-column: 1 / 3;
        grid-row: 4 / 6;
    }

    .experts-module .expert-9 {
        grid-column: 3 / 5;
        grid-row: 5 / 6;
    }

    .experts-module .expert-10 {
        grid-column: 5 / 6;
        grid-row: 5 / 6;
    }
}

@media (min-width: 769px) and (max-width: 992px) {
    .experts-module .experts-module__masonry {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 190px;
        gap: 12px;
    }

    .experts-module .masonry-item--text {
        grid-column: 1 / 4;
        grid-row: 1 / 2;
    }

    .experts-module .masonry-item--empty {
        display: none;
    }

    .experts-module .expert-1 {
        grid-column: 1 / 2;
        grid-row: 2 / 3;
    }

    .experts-module .expert-2 {
        grid-column: 2 / 3;
        grid-row: 2 / 4;
    }

    .experts-module .expert-3 {
        grid-column: 3 / 4;
        grid-row: 2 / 3;
    }

    .experts-module .expert-4 {
        grid-column: 1 / 2;
        grid-row: 3 / 5;
    }

    .experts-module .expert-5 {
        grid-column: 3 / 4;
        grid-row: 3 / 4;
    }

    .experts-module .expert-6 {
        grid-column: 2 / 3;
        grid-row: 4 / 5;
    }

    .experts-module .expert-7 {
        grid-column: 3 / 4;
        grid-row: 4 / 6;
    }

    .experts-module .expert-8 {
        grid-column: 1 / 3;
        grid-row: 5 / 6;
    }

    .experts-module .expert-9 {
        grid-column: 1 / 2;
        grid-row: 6 / 7;
    }

    .experts-module .expert-10 {
        grid-column: 2 / 4;
        grid-row: 6 / 7;
    }
}

@media (max-width: 768px) {
    .experts-module {
        padding: 0;
    }

    /* Sin padding superior e inferior en móvil */
    .experts-module__header {
        margin-bottom: 40px;
    }

    .experts-module .experts-module__masonry {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 210px;
        gap: 12px;
        grid-template-rows: auto;
    }

    .experts-module .masonry-item--text {
        grid-column: 1 / 3;
        grid-row: 1;
        height: auto;
        min-height: fit-content;
    }

    .experts-module .masonry-item--empty {
        display: none;
    }

    .experts-module .expert-1 {
        grid-column: 1 / 3;
        grid-row: span 1;
    }

    .experts-module .expert-2 {
        grid-column: 1 / 2;
        grid-row: span 2;
    }

    .experts-module .expert-3 {
        grid-column: 2 / 3;
        grid-row: span 1;
    }

    .experts-module .expert-4 {
        grid-column: 2 / 3;
        grid-row: span 1;
    }

    .experts-module .expert-5 {
        grid-column: 1 / 3;
        grid-row: span 1;
    }

    .experts-module .expert-6 {
        grid-column: 1 / 2;
        grid-row: span 1;
    }

    .experts-module .expert-7 {
        grid-column: 2 / 3;
        grid-row: span 2;
    }

    .experts-module .expert-8 {
        grid-column: 1 / 2;
        grid-row: span 1;
    }

    .experts-module .expert-9 {
        grid-column: 1 / 2;
        grid-row: span 1;
    }

    .experts-module .expert-10 {
        grid-column: 2 / 3;
        grid-row: span 1;
    }

    .experts-module .text-card {
        padding: 30px 0px;
        height: auto;
    }

    .experts-module .text-card__text {
        font-size: 16px;
        line-height: 1.5;
    }

    .experts-module .people-card {
         
    }

    .experts-module .people-card__name {
        
    }

    .experts-module .people-card__title {
       
    }

    

    
    .experts-module  .people-card__title {
        font-size: 12px;
        line-height: 16px;
    }

    .details-modal-expert .experts-modal__container {
        flex-direction: column;
        height: 70vh;
        min-height: 70vh;
        max-height: 70vh;
        aspect-ratio: auto;
        overflow-y: auto;
        overflow-x: hidden;

    }

    .details-modal-expert .experts-modal__content {
        height: 100%;
        min-height: 100%;
        justify-content: flex-end;
        align-items: flex-start;
    }

    .details-modal-expert__image {
        width: 100%;
        height: 250px;
    }

    .details-modal-expert__info {
        width: 100%;
        max-width: 100%;
        padding: 0;
   
      
        overflow: visible;
    }

  

    .details-modal-expert__intro p  {
        overflow: visible; text-wrap: balance;
         
        
    }

    .details-modal-expert__intro p:last-child {
        margin-bottom: 0;
    }
}