/* Premium SaaS / Editorial Team Member Redesign */

/* --- Card Styles --- */
.editorial-card {
    position: relative;
    background: transparent;
    height: 480px;
    cursor: pointer;
    perspective: 1500px;
    transform-style: preserve-3d;
}

.ec-inner {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    overflow: hidden;
    background: #00135d;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.4s ease, border-color 0.4s ease;
    transform-style: preserve-3d;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.editorial-card:hover .ec-inner {
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-5px);
}

.ec-status-minimal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 5;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    padding: 6px;
    border-radius: 50%;
}

.ec-status-dot {
    display: block;
    width: 8px;
    height: 8px;
    background: #4caf50;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
}

.ec-image-wrap {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    background: #0d336f;
}

.ec-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center; /* Better for portraits */
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform: scale(1);
    will-change: transform, border-radius;
}

.editorial-card:hover .ec-image {
    transform: scale(1.04);
}

.ec-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(10, 10, 10, 0) 0%,
        rgba(10, 10, 10, 0) 50%,
        rgba(10, 10, 10, 0.6) 75%,
        rgba(10, 10, 10, 0.95) 100%
    );
    z-index: 2;
    transition: background 0.4s ease;
}

.editorial-card:hover .ec-overlay {
    background: linear-gradient(
        to bottom,
        rgba(10, 10, 10, 0) 0%,
        rgba(10, 10, 10, 0) 40%,
        rgba(10, 10, 10, 0.7) 70%,
        rgba(10, 10, 10, 0.98) 100%
    );
}

.ec-content {
    position: relative;
    z-index: 3;
    padding: 2rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
}

.ec-name {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: #ffffff;
    margin: 0 0 0.25rem 0;
    letter-spacing: -0.01em;
}

.ec-role {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    margin: 0 0 1.5rem 0;
}

.ec-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.3s ease;
}

.ec-action-text {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ec-action-arrow {
    font-size: 1.1rem;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.editorial-card:hover .ec-footer {
    color: #ffffff;
}

.editorial-card:hover .ec-action-arrow {
    transform: translateX(4px);
}

/* --- Modal Focus Panel Styles --- */
.ec-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    padding: 2rem;
}

.ec-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.ec-modal {
    background: #ffffff;
    border: 1px solid rgba(0, 19, 93, 0.12);
    border-radius: 28px;
    width: 100%;
    max-width: 900px;
    max-height: 85vh;
    overflow: hidden;
    position: relative;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    box-shadow: 0 40px 80px -20px rgba(0, 19, 93, 0.35);
}

/* Desktop Split Layout */
.ec-modal-split {
    display: flex;
    flex-direction: row;
    height: 100%;
    max-height: 85vh;
}

.ec-modal-left {
    width: 45%;
    position: relative;
    background: #0d336f;
    flex-shrink: 0;
}

.ec-modal-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    /* The image itself might be temporarily hidden during FLIP */
}

.ec-modal-right {
    width: 55%;
    padding: 3rem 2.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Custom Scrollbar for right side */
.ec-modal-right::-webkit-scrollbar { width: 6px; }
.ec-modal-right::-webkit-scrollbar-track { background: transparent; }
.ec-modal-right::-webkit-scrollbar-thumb { background: rgba(0, 19, 93, 0.2); border-radius: 10px; }

.ec-modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 19, 93, 0.06);
    border: 1px solid rgba(0, 19, 93, 0.15);
    color: #444444;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ec-modal-close:hover {
    background: rgba(0, 19, 93, 0.12);
    color: #00135d;
    transform: scale(1.05);
}

/* Right Side Content Styling */
.ec-modal-header {
    margin-bottom: 2rem;
}

.ec-modal-name {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 2.5rem;
    color: #00135d;
    margin: 0 0 0.5rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.ec-modal-role {
    font-size: 1.1rem;
    color: #838383;
    font-weight: 500;
    margin: 0 0 1rem;
}

.ec-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #4caf50;
    font-size: 0.9rem;
    font-weight: 600;
}

.ec-modal-divider {
    height: 1px;
    background: rgba(0, 19, 93, 0.12);
    margin: 2rem 0;
}

.ec-modal-section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #838383;
    margin: 0 0 1rem;
    font-weight: 700;
}

.ec-modal-bio {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #444444;
    margin: 0;
}

.ec-modal-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ec-modal-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #222222;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.ec-modal-btn svg {
    color: #838383;
    transition: color 0.2s ease;
}

.ec-modal-btn:hover {
    color: var(--primary, #285094);
}
.ec-modal-btn:hover svg {
    color: var(--primary, #285094);
}

.ec-modal-bottom-actions {
    margin-top: auto; /* Push to bottom if content is short */
    padding-top: 2rem;
}

.ec-primary-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    background: #285094;
    color: #ffffff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ec-primary-btn:hover {
    background: #0d336f;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(40,80,148,0.35);
}

/* FLIP Transition Layer */
.ec-flip-clone {
    position: fixed;
    z-index: 10000;
    object-fit: cover;
    object-position: top center;
    pointer-events: none;
    /* Will be animated via GSAP */
}

/* Initial state for stagger animation */
.modal-anim-element {
    opacity: 0;
    transform: translateY(15px);
}

@media (max-width: 768px) {
    .ec-modal {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 20px;
    }
    
    .ec-modal-split {
        flex-direction: column;
    }
    
    .ec-modal-left {
        width: 100%;
        height: 350px; /* Large fixed height for mobile */
    }
    
    .ec-modal-right {
        width: 100%;
        padding: 2rem 1.5rem;
    }

    .ec-backdrop {
        padding: 1rem;
    }
}

/* --- Meta chips (experience / location) --- */
.ec-modal-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.9rem; }
.ec-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    border-radius: 99px;
    background: rgba(40, 80, 148, 0.08);
    border: 1px solid rgba(40, 80, 148, 0.2);
    color: #285094;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}
.ec-meta-chip svg { width: 13px; height: 13px; flex-shrink: 0; }

/* --- Expertise chips --- */
.ec-skills { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.ec-skill {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    border-radius: 10px;
    background: #f4f6fb;
    border: 1px solid rgba(13, 51, 111, 0.14);
    color: #0d336f;
    font-size: 0.82rem;
    font-weight: 700;
}


/* the LinkedIn button reads as a real button now */
.ec-modal-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1.4rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #285094, #0d336f);
    color: #ffffff !important;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}
.ec-modal-btn svg { color: #ffffff; fill: #ffffff; }
.ec-modal-btn:hover {
    background: linear-gradient(135deg, #fad02e, #c8a220);
    color: #00135d !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(200, 162, 32, 0.4);
}
.ec-modal-btn:hover svg { color: #00135d; fill: #00135d; }

/* ── THE WAY TO REACH THEM ──────────────────────────────────────────────
   This was a grey sentence saying "please reach us through the official
   channels" - a dead end at the exact moment somebody is interested enough
   to be reading a profile. It is the channel now.

   It is built to the same pattern as the LinkedIn button directly above it,
   because two buttons in a column that disagree about their shape look like
   an accident. Same corner, same height, same full width - the difference
   is the gold, which is what says this is the one to press. */
.ec-modal-contact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    width: 100%;
    margin-top: 1.4rem;
    padding: 1rem 1.6rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    /* Three stops, not two: a highlight across the top edge and a deeper
       band at the bottom is what separates gold from mustard. */
    background: linear-gradient(160deg, #f9d65a 0%, #e8bb33 42%, #c8941a 100%);
    color: #00135d !important;
    font-family: 'Space Grotesk', 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.3px;
    text-decoration: none;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.65),
        inset 0 -1px 0 rgba(120, 86, 10, 0.25),
        0 8px 20px rgba(200, 148, 26, 0.3);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.28s ease,
                background 0.28s ease;
}

.ec-modal-contact svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.ec-modal-contact:hover {
    background: linear-gradient(160deg, #ffe176 0%, #f3c93f 42%, #d9a420 100%);
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(120, 86, 10, 0.25),
        0 14px 30px rgba(200, 148, 26, 0.42);
}

.ec-modal-contact:hover svg { transform: translateX(5px); }

/* Pressed, it sits back down and the lift goes out of the shadow. */
.ec-modal-contact:active {
    transform: translateY(0);
    box-shadow:
        inset 0 2px 5px rgba(120, 86, 10, 0.35),
        0 4px 10px rgba(200, 148, 26, 0.25);
}

.ec-modal-contact:focus-visible {
    outline: 3px solid rgba(0, 19, 93, 0.55);
    outline-offset: 2px;
}

html[dir="rtl"] .ec-modal-contact svg { transform: scaleX(-1); }
html[dir="rtl"] .ec-modal-contact:hover svg { transform: scaleX(-1) translateX(5px); }

/* ── THE CLOSE BUTTON ───────────────────────────────────────────────────
   It was a pale grey circle on a white panel, which on a phone sat over the
   photograph and disappeared entirely. Solid navy, white cross, a ring to
   lift it off whatever is behind it, and a finger-sized target. */
.ec-modal-close {
    background: rgba(0, 19, 93, 0.92);
    border: 2px solid #ffffff;
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(0, 10, 40, 0.35);
}

.ec-modal-close:hover {
    background: #00135d;
    color: #ffffff;
    transform: scale(1.08);
}

/* ── THE CARD ON A PHONE ────────────────────────────────────────────────
   Two columns of a card built at 480px tall gave a narrow strip the height
   of a door: the face was cropped to a sliver and every name wrapped onto
   two lines. One column, and the portrait gets the shape a portrait wants. */
@media (max-width: 768px) {
    .editorial-card { height: 430px; }
    .ec-name { font-size: 1.5rem; }
    .ec-role { font-size: 0.9rem; }
}

@media (max-width: 480px) {
    .editorial-card { height: 400px; }
    .ec-name { font-size: 1.35rem; }
}

/* ── THE PHOTOGRAPH IN THE DIALOG ───────────────────────────────────────
   The picture fills the frame. Shown whole instead, it sat in the middle
   with blurred margins down either side, and a portrait framed in its own
   blur does not read as a company that takes its photographs seriously. */
@media (max-width: 768px) {
    /* The height comes from the viewport, never from the picture. The open
       animation measures this frame the instant the src is set, and a frame
       sized by its image still measures the previous member's photograph. */
    .ec-modal-left {
        height: auto;
        aspect-ratio: 4 / 5;
        max-height: 46vh;
        background: #0d336f;
        overflow: hidden;
    }

    /* Anchored near the top, because what a cover fit has to lose off a
       portrait is the floor, never the face. */
    .ec-modal-avatar {
        height: 100%;
        object-fit: cover;
        object-position: center 25%;
    }
    .ec-modal-close {
        top: 1rem;
        right: 1rem;
        width: 44px;
        height: 44px;
    }

    .ec-modal-right { padding: 1.75rem 1.4rem 2rem; }
    /* the base rule is already full width here */
}

html[dir="rtl"] .ec-modal-close { right: auto; left: 1.5rem; }

@media (max-width: 768px) {
    html[dir="rtl"] .ec-modal-close { left: 1rem; }
}
