/* =========================================================
   TEAM PAGE
   Arch-photo cards  +  split-layout profile modal
   Brand: blue #1d43fe · green #5ac559 · navy #0b1633
   Font:  Kantumruy Pro (Khmer-friendly: generous line-height,
          no uppercase / letter-spacing on labels)
========================================================= */

:root {
    --mm-primary: #1d43fe;
    --mm-secondary: #5ac559;
    --mm-dark: #0b1633;
    --mm-gray: #667085;
    --mm-border: #eef1f6;
    --mm-bg-soft: #f7f8fc;
    --mm-tint: #eef2ff;
    --mm-tint-green: #e8f7e8;
    --mm-green-ink: #2b8a3e;
    --mm-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --mm-font:
        "Kantumruy Pro", system-ui, -apple-system, "Segoe UI", sans-serif;

    /* Arch shape: round top, softly rounded bottom.
       (Photo ratio is 1 : 1.15, so 43.5% vertical = a true semicircle.) */
    --mm-arch: 50% 50% 18px 18px / 43.5% 43.5% 18px 18px;
}

/* =========================================================
   SECTION
========================================================= */

.testimonial__area {
    position: relative;
    padding: 90px 0;
    overflow: hidden;
    background: var(--mm-bg-soft);
}

.testimonial__area .container {
    position: relative;
    z-index: 2;
}

.section__title .sub-title-a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px 6px 12px;
    border-radius: 50px;
    background: var(--mm-tint);
    color: var(--mm-primary);
    font: 600 13px/1.6 var(--mm-font);
    margin-bottom: 14px;
}

.section__title .sub-title-a::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--mm-secondary);
}

.section__title .title-a {
    margin: 0;
    color: var(--mm-dark);
    font-family: var(--mm-font);
    font-size: clamp(26px, 3.2vw, 40px);
    font-weight: 800;
    line-height: 1.4;
}

.section__content p {
    margin: 0;
    color: #5b6475;
    line-height: 1.9;
}

.testimonial__shape-wrap {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0.06;
    pointer-events: none;
}

.big-shape {
    opacity: 0.08;
}

/* =========================================================
   TEAM CARD
========================================================= */

.team-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 12px 12px 16px;
    background: #ffffff;
    border: 1px solid var(--mm-border);
    border-radius: 24px;
    box-shadow: 0 1px 2px rgba(11, 22, 51, 0.04);
    cursor: pointer;
    transition:
        transform 0.3s var(--mm-ease),
        box-shadow 0.3s ease,
        border-color 0.3s ease;
}

/* ---------- Photo (the one memorable detail: the offset green arch) ---------- */

.team-photo-wrap {
    position: relative;
}

.team-photo-wrap::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 1.5px solid rgba(90, 197, 89, 0.7);
    border-radius: var(--mm-arch);
    transform: translate(7px, 7px);
    transition: transform 0.4s var(--mm-ease);
    pointer-events: none;
}

.team-photo {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1.15;
    overflow: hidden;
    border-radius: var(--mm-arch);
    background: var(--mm-tint);
}

.team-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.6s var(--mm-ease);
}

.team-initial {
    color: var(--mm-primary);
    font: 700 56px/1 var(--mm-font);
}

/* Alternate tone (brand green) so a row of cards doesn't look identical */
.team-photo.tone-b {
    background: var(--mm-tint-green);
}

.team-photo.tone-b .team-initial {
    color: var(--mm-green-ink);
}

/* One page-load sequence: cards rise in, staggered (max 7 steps) */
.team-item {
    animation: tm-rise 0.6s var(--mm-ease) backwards;
    animation-delay: calc(min(var(--i, 0), 7) * 70ms);
}

@keyframes tm-rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* ---------- Info ---------- */

.team-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 20px 8px 0;
}

.team-name {
    margin: 0 0 2px;
    color: var(--mm-dark);
    font: 700 18px/1.6 var(--mm-font);
}

.team-role {
    margin: 0 0 16px;
    color: var(--mm-primary);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.6;
}

.team-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--mm-border);
}

/* Sits above the "whole card is clickable" layer */
.team-social {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 6px;
}

/* ---------- Social buttons (cards + modal) ---------- */

.social-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--mm-border);
    border-radius: 50%;
    background: #ffffff;
    color: var(--mm-gray);
    font-size: 12.5px;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.25s var(--mm-ease);
}

.social-btn:active {
    background: var(--brand-color, var(--mm-primary));
    border-color: var(--brand-color, var(--mm-primary));
    color: #ffffff;
    transform: scale(0.94);
}

.social-gmail {
    --brand-color: #ea4335;
}

.social-facebook {
    --brand-color: #1877f2;
}

.social-telegram {
    --brand-color: #26a5e4;
}

.social-linkedin {
    --brand-color: #0a66c2;
}

/* ---------- Open button (arrow) ---------- */

.team-open {
    flex: none;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--mm-tint);
    color: var(--mm-primary);
    font-size: 13px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition:
        background-color 0.25s ease,
        color 0.25s ease,
        opacity 0.2s ease;
}

.team-open i {
    transition: transform 0.3s var(--mm-ease);
}

/* Stretched link: the button's ::after covers the whole card
   (the nearest positioned ancestor is .team-card). */
.team-open::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 24px;
}

.team-open:focus-visible {
    outline: none;
}

.team-open:focus-visible::after {
    outline: 2px solid var(--mm-primary);
    outline-offset: 3px;
}

.team-open.is-loading {
    opacity: 0.55;
}

.team-card:active .team-open {
    background: var(--mm-primary);
    color: #ffffff;
}

/* =========================================================
   MOUSE-ONLY HOVER EFFECTS
   (wrapped so they never get stuck after a tap on phones)
========================================================= */

@media (hover: hover) and (pointer: fine) {
    .team-card:hover {
        transform: translateY(-4px);
        border-color: rgba(29, 67, 254, 0.18);
        box-shadow: 0 18px 40px rgba(11, 22, 51, 0.08);
    }

    .team-card:hover .team-photo-wrap::before {
        transform: translate(11px, 11px);
    }

    .team-card:hover .team-photo img {
        transform: scale(1.04);
    }

    .team-card:hover .team-open {
        background: var(--mm-primary);
        color: #ffffff;
    }

    .team-card:hover .team-open i {
        transform: translateX(2px);
    }

    .social-btn:hover {
        background: var(--brand-color, var(--mm-primary));
        border-color: var(--brand-color, var(--mm-primary));
        color: #ffffff;
        transform: translateY(-2px);
    }

    .member-cta:hover {
        background: #1636d4;
        color: #ffffff;
        transform: translateY(-1px);
    }

    .member-modal-close:hover {
        background: var(--mm-dark);
        border-color: var(--mm-dark);
        color: #ffffff;
        transform: rotate(90deg);
    }
}

/* =========================================================
   PROFILE MODAL
========================================================= */

.member-modal {
    position: relative;
    max-height: 90vh;
    border-radius: 24px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 25px 60px rgba(11, 22, 51, 0.25);
}

.member-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 20;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--mm-border);
    border-radius: 50%;
    background: #ffffff;
    color: var(--mm-dark);
    font-size: 14px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.3s var(--mm-ease);
}

/* Open animation: rises and settles instead of Bootstrap's drop-in */
#openModal.fade .modal-dialog {
    transform: translateY(18px) scale(0.98);
    transition: transform 0.35s var(--mm-ease);
}

#openModal.show .modal-dialog {
    transform: none;
}

/* ---------- Two-column layout ---------- */

.member-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 0;
    overflow: hidden;
}

.member-side,
.member-main {
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #d7dcef transparent;
}

.member-side::-webkit-scrollbar,
.member-main::-webkit-scrollbar {
    width: 5px;
}

.member-side::-webkit-scrollbar-track,
.member-main::-webkit-scrollbar-track {
    background: transparent;
}

.member-side::-webkit-scrollbar-thumb,
.member-main::-webkit-scrollbar-thumb {
    background: #d7dcef;
    border-radius: 10px;
}

/* ---------- Left: identity ---------- */

.member-side {
    padding: 40px 24px 32px;
    background: var(--mm-bg-soft);
    border-right: 1px solid var(--mm-border);
    text-align: center;
}

.member-portrait {
    width: 168px;
    margin: 0 auto 26px;
}

.member-name {
    margin: 0 0 2px;
    color: var(--mm-dark);
    font: 700 20px/1.6 var(--mm-font);
}

.member-role {
    margin: 0 0 18px;
    color: var(--mm-primary);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.6;
}

.member-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    margin: 0 0 16px;
    padding: 10px 16px;
    border-radius: 12px;
    background: var(--mm-primary);
    color: #ffffff;
    font: 600 14px/1.4 var(--mm-font);
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(29, 67, 254, 0.18);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition:
        background-color 0.2s ease,
        transform 0.2s var(--mm-ease);
}

.member-cta:active {
    background: #1636d4;
    color: #ffffff;
    transform: scale(0.98);
}

.member-social {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.member-social .social-btn {
    width: 36px;
    height: 36px;
    font-size: 13px;
}

/* ---------- Quick facts ---------- */

.member-facts {
    display: grid;
    gap: 16px;
    margin: 26px 0 0;
    padding: 22px 0 0;
    border-top: 1px solid var(--mm-border);
    list-style: none;
    text-align: left;
}

.member-facts li {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    column-gap: 12px;
    align-items: start;
}

.fact-icon {
    grid-row: 1 / span 2;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--mm-border);
    border-radius: 50%;
    background: #ffffff;
    color: var(--mm-primary);
    font-size: 13px;
}

.fact-label {
    color: var(--mm-gray);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.6;
}

.fact-value {
    color: var(--mm-dark);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

/* ---------- Right: details ---------- */

.member-main {
    padding: 44px 40px 36px 36px;
}

.member-section + .member-section {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid var(--mm-border);
}

.member-section h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 10px;
    color: var(--mm-dark);
    font: 700 16px/1.6 var(--mm-font);
}

/* Small green dash marks where each section starts */
.member-section h4::before {
    content: "";
    width: 18px;
    height: 3px;
    border-radius: 3px;
    background: var(--mm-secondary);
}

.member-section p {
    margin: 0;
    color: #4a5468;
    font-size: 14.5px;
    line-height: 1.95;
    white-space: pre-line;
    overflow-wrap: break-word;
}

/* =========================================================
   EMPTY / LOADING
========================================================= */

.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--mm-gray);
}

.empty-state i {
    display: block;
    margin-bottom: 10px;
    font-size: 30px;
    opacity: 0.5;
}

.empty-state p {
    margin: 0;
    font-size: 13.5px;
}

.member-loading {
    padding: 80px 20px;
    text-align: center;
    color: var(--mm-gray);
}

.member-loading .spinner-border {
    margin-bottom: 12px;
    color: var(--mm-primary);
}

.member-loading p {
    margin: 0;
    font-size: 13.5px;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 991px) {
    .testimonial__area {
        padding: 80px 0;
    }
}

/* Tablet / phone: modal becomes one scrolling column */
@media (max-width: 767px) {
    .testimonial__area {
        padding: 70px 0;
    }

    /* Bottom sheet: slides up from the bottom edge */
    #openModal .modal-dialog {
        min-height: 100%;
        margin: 0 auto;
        align-items: flex-end;
    }

    #openModal.fade .modal-dialog {
        transform: translateY(60px);
    }

    #openModal.show .modal-dialog {
        transform: none;
    }

    .member-modal {
        max-height: 92vh;
        max-height: 92dvh;
        border-radius: 24px 24px 0 0;
    }

    .member-layout {
        display: block;
        max-height: 92vh;
        max-height: 92dvh;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .member-side,
    .member-main {
        max-height: none;
        overflow: visible;
    }

    .member-side {
        padding: 32px 20px 24px;
        border-right: 0;
        border-bottom: 1px solid var(--mm-border);
    }

    .member-portrait {
        width: 120px;
        margin-bottom: 22px;
    }

    .member-name {
        font-size: 18px;
    }

    .member-main {
        padding: 26px 22px 30px;
    }

    .member-section p {
        font-size: 14px;
    }
}

/* Phone: cards go horizontal (photo left, info right) so the list stays compact */
@media (max-width: 575px) {
    .team-card {
        flex-direction: row;
        align-items: stretch;
        gap: 16px;
        padding: 12px;
    }

    .team-photo-wrap {
        flex: none;
        width: 108px;
        align-self: flex-start;
    }

    .team-initial {
        font-size: 36px;
    }

    .team-info {
        min-width: 0;
        padding: 4px 0 0;
    }

    .team-name {
        font-size: 16.5px;
    }

    .team-role {
        margin-bottom: 12px;
        font-size: 13px;
    }

    .team-foot {
        padding-top: 10px;
    }
}

@media (max-width: 420px) {
    .member-modal-close {
        top: 12px;
        right: 12px;
        width: 34px;
        height: 34px;
    }
}

/* =========================================================
   REDUCE MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {
    .team-card,
    .team-card *,
    .team-photo-wrap::before,
    .social-btn,
    .member-cta,
    .member-modal-close,
    #openModal .modal-dialog {
        transition: none !important;
    }

    .team-item {
        animation: none !important;
    }
}
