/* ============================================
   THE TEAM PAGE — team-style.css
   Upload to: wp-content/themes/hello-elementor-child/
   ============================================ */

/* ── Fade-in animation (matches insights-style.css) ── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0);     }
}

/* Hero background stays instant */
.tpage-hero { animation: none !important; opacity: 1 !important; }

/* Hero text fades in with a stagger */
.tpage-label { animation: fadeIn 0.6s ease-out 0.05s forwards; opacity: 0; }
.tpage-title { animation: fadeIn 0.6s ease-out 0.15s forwards; opacity: 0; }
.tpage-count { animation: fadeIn 0.6s ease-out 0.25s forwards; opacity: 0; }

/* Everything below the hero fades in */
.tpage-body { animation: fadeIn 0.6s ease-out forwards; }


/* ══════════════════════════════════════════════
   PAGE WRAPPER
══════════════════════════════════════════════ */
.tpage-wrap {
    background: #f5f5f5;
    color: #0a1f44;
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    width: 100%;
}

.tpage-wrap * {
    box-sizing: border-box;
}


/* ══════════════════════════════════════════════
   HERO  (mirrors ipage-hero exactly)
══════════════════════════════════════════════ */
.tpage-hero {
    background-image: url(https://perluxi.com/wp-content/uploads/2025/04/herobg.png);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-bottom: 1px solid #e0e0e0;
    padding: 128px 60px 48px;
    position: relative;
    overflow: hidden;
    text-align: center;
    min-height: 400px;
}

.tpage-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.6) 0%,
        rgba(0, 0, 0, 0.0) 100%
    );
    pointer-events: none;
    z-index: 0;
}

.tpage-label {
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #ffffff;
    margin-bottom: 12px;
    display: block;
    position: relative;
    z-index: 1;
}

.tpage-title {
    font-family: 'Poppins', sans-serif !important;
    font-size: clamp(48px, 7vw, 88px) !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    text-transform: uppercase !important;
    letter-spacing: -1px !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    margin: 0 0 16px !important;
    padding: 0 !important;
    background: none !important;
    text-shadow: none !important;
    position: relative;
    z-index: 1;
}

.tpage-count {
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #dddddd;
    letter-spacing: 0.03em;
    position: relative;
    z-index: 1;
}

.tpage-count span {
    color: #ffffff;
    font-weight: 600;
}


/* ══════════════════════════════════════════════
   BODY  (mirrors ipage-body exactly)
══════════════════════════════════════════════ */
.tpage-body {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 60px 80px;
}


/* ══════════════════════════════════════════════
   TEAM GRID
══════════════════════════════════════════════ */
.tpage-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}


/* ══════════════════════════════════════════════
   TEAM CARD
══════════════════════════════════════════════ */
.tpage-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
}

.tpage-card:hover {
    box-shadow: 0 8px 32px rgba(15, 103, 207, 0.1);
    transform: translateY(-2px);
    border-color: #c8d8f8;
}

/* ── Card photo ── */
.tpage-card-photo {
    position: relative;
    overflow: hidden;
    aspect-ratio: 3 / 3.5;
    background: #eef3fb;
    flex-shrink: 0;
}

.tpage-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    transition: transform 0.35s ease;
}

.tpage-card:hover .tpage-card-photo img {
    transform: scale(1.04);
}

/* Placeholder when no Featured Image is set — shows first initial */
.tpage-photo-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e8f0fe 0%, #c8d8f8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tpage-photo-placeholder span {
    font-family: 'Poppins', sans-serif;
    font-size: 48px;
    font-weight: 800;
    color: #0F67CF;
    opacity: 0.35;
    line-height: 1;
}

/* LinkedIn badge — appears on hover in the photo corner */
.tpage-linkedin-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: #0F67CF;
    color: #ffffff;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s, transform 0.2s;
    z-index: 2;
}

.tpage-card:hover .tpage-linkedin-badge {
    opacity: 1;
    transform: translateY(0);
}

/* ── Card info ── */
.tpage-card-info {
    padding: 18px 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.tpage-card-name {
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #0a1f44;
    line-height: 1.3;
}

.tpage-card-position {
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #0F67CF;
    line-height: 1.3;
}

/* View Profile — styled as a clean text link, same as "Read Article →" on Insights.
   Uses a <span role="button"> so Elementor/theme button CSS never touches it. */
.tpage-wrap .tpage-card-info .tpage-read-btn {
    /* Hard reset — override anything inherited */
    all: unset !important;
    /* Re-apply exactly what we want */
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    cursor: pointer !important;
    font-family: 'Poppins', sans-serif !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    letter-spacing: 0.03em !important;
    color: #0F67CF !important;
    text-decoration: none !important;
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 12px 0 0 !important;
    box-shadow: none !important;
    line-height: 1 !important;
    width: auto !important;
    transition: color 0.15s !important;
    /* Stop the theme applying button min-height / min-width */
    min-height: 0 !important;
    min-width: 0 !important;
}

.tpage-wrap .tpage-card-info .tpage-read-btn::after {
    content: '→';
    display: inline-block !important;
    font-size: 14px !important;
    transition: transform 0.15s !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
}

.tpage-wrap .tpage-card-info .tpage-read-btn:hover {
    color: #0a52a8 !important;
    text-decoration: none !important;
    background: none !important;
}

.tpage-wrap .tpage-card-info .tpage-read-btn:hover::after {
    transform: translateX(4px) !important;
}

.tpage-wrap .tpage-card-info .tpage-read-btn:focus-visible {
    outline: 2px solid #0F67CF !important;
    outline-offset: 2px !important;
    border-radius: 2px !important;
}


/* ══════════════════════════════════════════════
   MODAL OVERLAY
   ─────────────────────────────────────────────
   The modal is position:fixed so it always covers
   the full viewport regardless of the page body's
   max-width container.

   Backdrop: no dark fill — just a very light blur
   so the cards appear to float freely over the page
   rather than being imprisoned in a dimmed rectangle.
══════════════════════════════════════════════ */
.tpage-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    /* The backdrop blur is applied here so it covers
       the true viewport, not a child element         */
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    transition: backdrop-filter 0.25s ease;
}

.tpage-modal[hidden] {
    display: none;
}

.tpage-modal--open {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* Backdrop: almost-transparent tint — just enough to
   separate the modal from the page, no heavy dim     */
.tpage-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 31, 68, 0.18);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.tpage-modal--open .tpage-modal-backdrop {
    opacity: 1;
}

/* ── Modal box ── */
.tpage-modal-box {
    position: relative;
    z-index: 1;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    box-shadow:
        0 24px 64px rgba(10, 31, 68, 0.18),
        0  4px 16px rgba(10, 31, 68, 0.08);
    width: 100%;
    max-width: 860px;
    max-height: 88vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px) scale(0.97);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.tpage-modal--open .tpage-modal-box {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ── Close button: bare floating X — no background, no border, no shape ── */
.tpage-wrap .tpage-modal-close {
    all: unset !important;
    cursor: pointer !important;
    position: absolute !important;
    top: 16px !important;
    right: 18px !important;
    z-index: 10 !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: #aaaaaa !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: color 0.15s !important;
    line-height: 1 !important;
}

.tpage-wrap .tpage-modal-close:hover {
    color: #0a1f44 !important;
    background: none !important;
}

.tpage-wrap .tpage-modal-close:focus-visible {
    outline: 2px solid #0F67CF !important;
    outline-offset: 4px !important;
    border-radius: 2px !important;
}

/* ── Inner: flex row so photo stays pinned while text scrolls ── */
.tpage-modal-inner {
    display: flex;
    flex-direction: row;
    /* Fill the box height but never exceed it */
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ── Photo column — fixed width, fills the full modal height ── */
.tpage-modal-photo {
    position: relative;
    flex: 0 0 280px;
    width: 280px;
    /* Stretches to whatever height the box is — photo never moves */
    align-self: stretch;
    overflow: hidden;
    background: #eef3fb;
}

.tpage-modal-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

.tpage-modal-photo-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e8f0fe 0%, #c8d8f8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tpage-modal-photo-placeholder span {
    font-family: 'Poppins', sans-serif;
    font-size: 80px;
    font-weight: 800;
    color: #0F67CF;
    opacity: 0.25;
    line-height: 1;
}

/* LinkedIn — small badge pinned to bottom-left of photo */
.tpage-modal-linkedin {
    position: absolute;
    bottom: 16px;
    left: 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #ffffff;
    background: rgba(15, 103, 207, 0.9);
    padding: 7px 12px;
    border-radius: 4px;
    text-decoration: none;
    backdrop-filter: blur(4px);
    transition: background 0.15s;
    z-index: 2;
}

.tpage-modal-linkedin:hover {
    background: #0F67CF;
    text-decoration: none;
    color: #ffffff;
}

/* ── Content column — takes remaining width, scrolls independently ── */
.tpage-modal-content {
    flex: 1;
    min-width: 0;
    padding: 40px 40px 40px;
    /* Only this column scrolls — photo stays pinned */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Name */
.tpage-modal-name {
    font-family: 'Poppins', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #0a1f44;
    line-height: 1.2;
    margin: 0 0 6px;
    padding-right: 36px; /* clear the close button */
}

/* Position badge */
.tpage-modal-position {
    display: inline-block;
    font-family: 'Poppins', sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #0F67CF;
    background: rgba(15, 103, 207, 0.07);
    border-left: 2px solid #0F67CF;
    padding: 4px 10px;
    border-radius: 0 3px 3px 0;
    margin: 0 0 28px;
}

/* Divider line between header and bio */
.tpage-modal-divider {
    height: 1px;
    background: #eeeeee;
    margin: 0 0 24px;
}

/* Bio paragraphs */
.tpage-modal-bio {
    flex: 1;
}

.tpage-modal-bio p {
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    line-height: 1.85;
    color: #4a5568;
    margin: 0 0 16px;
}

.tpage-modal-bio p:last-child {
    margin-bottom: 0;
}

.tpage-modal-bio ul,
.tpage-modal-bio ol {
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    color: #4a5568;
    line-height: 1.85;
    padding-left: 20px;
    margin: 0 0 16px;
}

.tpage-modal-bio strong { color: #0a1f44; font-weight: 600; }
.tpage-modal-bio em     { font-style: italic; }


/* ══════════════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════════════ */
.tpage-empty {
    text-align: center;
    padding: 80px 20px;
}

.tpage-empty p {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: #666666;
}


/* ══════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .tpage-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .tpage-hero {
        padding: 80px 24px 40px;
    }

    .tpage-body {
        padding: 28px 24px 60px;
    }

    .tpage-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Modal stacks vertically on mobile */
    .tpage-modal {
        padding: 12px;
        align-items: flex-end;
    }

    .tpage-modal-box {
        max-height: 92vh;
        border-radius: 12px 12px 8px 8px;
    }

    /* Stack photo above content */
    .tpage-modal-inner {
        flex-direction: column;
        overflow-y: auto;
    }

    .tpage-modal-photo {
        flex: 0 0 auto;
        width: 100%;
        height: 220px;
        align-self: auto;
    }

    .tpage-modal-content {
        flex: 1;
        padding: 24px 24px 32px;
        overflow-y: visible;
    }

    .tpage-modal-name {
        font-size: 20px !important;
        padding-right: 36px;
    }
}

@media (max-width: 480px) {
    .tpage-grid {
        grid-template-columns: 1fr;
    }
}