.pw-prof-grid{display:grid;grid-template-columns:repeat(4,272px);gap:24px;justify-content:center;justify-items:start}

@media (max-width:1200px){
    .pw-prof-grid{grid-template-columns:repeat(3,272px)}
}
@media (max-width:980px){
    .pw-prof-grid{grid-template-columns:repeat(2,272px)}
}
@media (max-width:600px){
    .pw-prof-grid{grid-template-columns:1fr}
}
.pw-prof-card{width:272px;height:387px;border-radius:12px;overflow:hidden;cursor:pointer;box-shadow:0 10px 20px rgba(211,210,216,0.6);background:#fff;position:relative}
.pw-prof-thumb{width:100%;height:100%;background-size:cover;background-position:center;position:relative;transition:transform .5s ease, background-position .5s ease}
.pw-prof-card{transition:transform .18s ease, box-shadow .18s ease;will-change:transform}
.pw-prof-thumb.no-image{background:#f4f4f6;display:flex;align-items:bottom;justify-content:center}

/* overlay that contains gradient + row with name and icon */
.pw-card-overlay{position:absolute;left:0;right:0;bottom:0;padding:20px;border-bottom-left-radius:12px;border-bottom-right-radius:12px;height:46%;display:flex;align-items:flex-end}
.pw-card-overlay::before{content:'';position:absolute;left:0;right:0;bottom:0;top:0;
    background: linear-gradient(to top, rgba(19,55,69,1) 0%, rgba(19,55,69,0.6) 60%, rgba(19,55,69,0) 100%);
    border-bottom-left-radius:12px;border-bottom-right-radius:12px;pointer-events:none}
.pw-card-row{position:relative;display:flex;align-items:flex-end;justify-content:space-between;width:100%;z-index:2}
.pw-prof-name{font-family:Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;font-size:32px;line-height:40px;font-weight:500;color:#F0E6A0;margin:0}
.pw-card-icon{width:44px;height:44px;background:#ffffff00;border-radius:50%;padding:0px;display:inline-block;object-fit:contain}

/* hover effects for cards: subtle lift + image zoom + overlay stronger */
.pw-prof-card:hover, .pw-prof-card:focus-within{transform:translateY(-8px) scale(1.02);box-shadow:0 26px 40px rgba(16,24,40,0.12)}
.pw-prof-card:focus-within{outline:2px solid rgba(14,180,241,0.08);outline-offset:6px}
.pw-prof-card:hover .pw-prof-thumb, .pw-prof-card:focus-within .pw-prof-thumb{transform:scale(1.06);background-position:center}
.pw-prof-card:hover .pw-card-overlay::before, .pw-prof-card:focus-within .pw-card-overlay::before{background: linear-gradient(to top, rgba(19,55,69,1) 0%, rgba(19,55,69,0.72) 60%, rgba(19,55,69,0) 100%)}
.pw-prof-card:hover .pw-prof-name, .pw-prof-card:focus-within .pw-prof-name{transform:translateY(-4px);transition:transform .18s ease}


.pw-prof-popup{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;visibility:hidden;opacity:0;transition:opacity .18s ease, visibility .18s;z-index:9999}
.pw-prof-popup{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;visibility:hidden;opacity:0;transition:opacity .18s ease, visibility .18s;z-index:9999}
.pw-prof-popup.is-open{visibility:visible;opacity:1}
.pw-prof-popup-inner{width:min(980px,96%);background:#fff;border-radius:14px;box-shadow:0 30px 60px rgba(2,6,23,0.2);overflow:hidden;height: 80%;}
.pw-prof-popup-body{display:flex;height:100%}
.pw-popup-close{position:absolute;right:18px;top:16px;background: #fff !important;border:1px solid #E2E8F0;border-radius:16px !important;width:40px;height:40px;cursor:pointer;box-shadow:0 10px 15px -8px rgba(0,0,0,0.2);display:flex;align-items:center;justify-content:center;color: #000 !important;font-size:20px;font-weight: 400 !important;}
.pw-popup-left{flex:0 0 45%;position:relative;min-height:230px}
.pw-popup-photo{height: 100%;width: 100%;position: absolute;background-size: cover;background-position: center;}
.pw-popup-left-overlay{position:absolute;left:0;right:0;top:0;bottom:0;display:block}
/* gradient overlay bottom->top */
.pw-popup-left-overlay::before{content:'';position:absolute;left:0;right:0;bottom:0;top:0;background:linear-gradient(to top, rgba(51,65,85,0.898) 0%, rgba(51,65,85,0.5) 50%, rgba(0,0,0,0) 100%);border-radius:8px}
.pw-popup-name{position:relative;z-index:2;font-family:Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;font-weight:400 !important;font-size:32px;line-height:48px;color:#FFFFFF;margin:0;position:absolute;left:28px;bottom:108px;right:74px}
.pw-popup-subtitle{position:absolute;left:28px;bottom:78px;right:74px;z-index:2;font-family:Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;font-weight:400;font-size:18px;line-height:24px;color:rgba(255,255,255,0.92);display:none}
.pw-popup-tags{position:absolute;left:28px;bottom:36px;right:74px;z-index:2;display:flex;flex-wrap:wrap;gap:10px}
.pw-popup-tags:empty{display:none}
.pw-popup-tag{display:inline-flex;align-items:center;padding:8px 14px;border-radius:999px;background:rgba(255,255,255,0.16);border:1px solid rgba(255,255,255,0.22);color:#FFFFFF;font-family:Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;font-weight:500;font-size:14px;line-height:18px;backdrop-filter:saturate(140%) blur(2px)}
/* linkedin icon bottom-right inside left */
.pw-popup-linkedin-icon{position:absolute;right:18px;bottom:18px;z-index:3;border-radius:16px;background:#fff;border:1px solid #E2E8F0;box-shadow:0 10px 15px -8px rgba(0,0,0,0.2);width:44px;height:44px;display:flex;align-items:center;justify-content:center}
.pw-popup-linkedin-icon img{width:22px;height:22px}
.pw-popup-right{flex:1;padding:0em 1em 0em 1em}
.pw-popup-name--desktop{display:none}
.pw-popup-lists{display:flex;gap:20px}
.pw-popup-lists h4{margin:0 0 8px 0;display:flex;align-items:center;gap:10px;font-family:Inter;font-weight:500;font-size:20px;line-height:30px;color:#334155}
.pw-popup-lists h4 img{width:28px;height:28px}
.pw-popup-lists ul{margin:0;padding:0;list-style:none}
.pw-popup-lists ul li{display:flex;gap:12px;align-items:flex-start;padding:8px 0;color:#64748B;font-size: 14px;}
.pw-popup-education ul li::before{content:'';width:2px;background:rgba(14,180,241,0.5);display:block;flex:0 0 2px;height: -webkit-fill-available;}
.pw-popup-experience ul li::before{content:'';width:2px;background:rgba(251,191,36,0.5);display:block;flex:0 0 2px;height: -webkit-fill-available;}
.pw-popup-lists ul li > *{flex:1}
.pw-popup-lists ul li p{margin:0;color:#64748B;font-family:Inter;font-weight:400;font-size:14px;line-height:23px}
.pw-popup-education, .pw-popup-experience{flex:1;padding-top:1.5em;padding-bottom:2em;padding-left:1em;padding-right:1em}

/* Desktop popup layout: cover photo on top, lists below */
@media (min-width:701px){
    .pw-prof-popup-body{flex-direction:column}
    .pw-popup-left{flex:0 0 auto;width:100%;min-height:0;height:230px}
    .pw-popup-right{flex:1 1 auto;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch}
}

/* subtle hover and focus effects for close and linkedin buttons */
.pw-popup-close, .pw-popup-linkedin-icon{
    transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}
.pw-popup-close:hover, .pw-popup-close:focus, .pw-popup-close:focus-visible{
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 16px 22px -10px rgba(0,0,0,0.22);
    background-color: #ffffff;
}
.pw-popup-linkedin-icon:hover, .pw-popup-linkedin-icon:focus, .pw-popup-linkedin-icon:focus-visible{
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 16px 22px -10px rgba(0,0,0,0.22);
    background-color: #fbfdff;
}
.pw-popup-close:focus-visible, .pw-popup-linkedin-icon:focus-visible{outline:2px solid rgba(14,180,241,0.18);outline-offset:3px}

/* If a section's list is empty, hide that section so the other takes full width (CSS-only via :has)
   Note: :has has modern browser support (Chrome/Edge/Safari). If older support required, use JS fallback. */
.pw-popup-education:has(ul:empty),
.pw-popup-experience:has(ul:empty) {
    display: none;
}

/* Ensure non-empty sections fill available space */
.pw-popup-education:has(ul:not(:empty)),
.pw-popup-experience:has(ul:not(:empty)){
    display: block; /* make sure visible */
    flex: 1 1 100%;
}

@media(max-width:700px){
    .pw-prof-popup-body{flex-direction:column}
    .pw-popup-left{flex:0 0 auto}
    .pw-popup-right{flex:1 1 auto;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;padding-bottom:max(16px, env(safe-area-inset-bottom))}
}

/* Mobile carousel mode ("swiper"-like) when there is more than one professor */
@media (max-width: 600px) {
    .pw-prof-grid.pw-prof-grid--carousel{
        display: flex;
        grid-template-columns: none;
        justify-content: flex-start;
        gap: 16px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0 16px 8px;
        /*scroll-snap-type: x mandatory;*/
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        /* IMPORTANT: don't restrict touch gestures; otherwise horizontal swipe can be blocked */
        touch-action: auto;
    }

    .pw-prof-grid.pw-prof-grid--carousel::-webkit-scrollbar{display:none}
    .pw-prof-grid.pw-prof-grid--carousel{scrollbar-width:none}

    .pw-prof-grid.pw-prof-grid--carousel .pw-prof-card{
        flex: 0 0 auto;
        width: min(272px, calc(100vw - 72px));
        scroll-snap-align: start;
    }

    /* Mobile shadow style */
    .pw-prof-card{
        box-shadow: 0px 5px 7px -5px rgb(56 56 56 / 86%);
    }

    .pw-prof-carousel-dots{
        display: flex;
        justify-content: center;
        gap: 8px;
        margin-top: 12px;
    }

    .pw-prof-carousel-dot{
        width: 8px;
        height: 8px;
        border-radius: 999px;
        border: 0;
        padding: 0;
        background: rgba(2,6,23,0.18);
        cursor: pointer;
    }

    .pw-prof-carousel-dot.is-active{
        background: rgba(2,6,23,0.55);
    }
}