/* ============================================
   TEAM SECTION — 5 Layouts + Options
   ============================================ */

.section-team .team-grid {
    display: grid;
    grid-template-columns: repeat(var(--team-cols, 4), 1fr);
    gap: 28px;
}

.team-card {
    cursor: pointer;
    position: relative;
    transition: transform 0.35s cubic-bezier(.2,.8,.2,1), box-shadow 0.35s;
}

/* ===== Image base ===== */
.team-card-image {
    position: relative;
    overflow: hidden;
    background: var(--card-bg, #16161d);
}
.team-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(.2,.8,.2,1);
}

/* ===== Image shapes ===== */
.team-shape-rounded .team-card-image { border-radius: 16px; aspect-ratio: 3/4; }
.team-shape-square .team-card-image { border-radius: 0; aspect-ratio: 1/1; }
.team-shape-circle .team-card-image { border-radius: 50%; aspect-ratio: 1/1; max-width: 220px; margin: 0 auto; }
.team-shape-hexagon .team-card-image {
    aspect-ratio: 1/1;
    max-width: 220px; margin: 0 auto;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    border-radius: 0;
}
/* Circle/hexagon: round the hover overlay to match the image edge */
.team-shape-circle .team-card-overlay { border-radius: 50%; max-width: 220px; margin: 0 auto; inset: 0 auto; left: 50%; transform: translateX(-50%); width: 100%; }
.team-shape-hexagon .team-card-overlay { clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%); max-width: 220px; margin: 0 auto; left: 50%; transform: translateX(-50%); width: 100%; }

/* ===== Borders ===== */
.team-border-solid .team-card-image { border: var(--team-border-width,3px) solid var(--team-border-color,#c9a961); }
.team-border-double .team-card-image { border: var(--team-border-width,3px) double var(--team-border-color,#c9a961); padding: 3px; }
.team-border-gradient .team-card-image {
    border: var(--team-border-width,3px) solid transparent;
    background: linear-gradient(var(--card-bg,#16161d),var(--card-bg,#16161d)) padding-box,
                linear-gradient(135deg, var(--team-border-color,#c9a961), color-mix(in srgb, var(--team-border-color,#c9a961) 40%, white)) border-box;
}
/* hexagon can't use border — use drop-shadow ring instead */
.team-shape-hexagon.team-border-solid .team-card-image,
.team-shape-hexagon.team-border-gradient .team-card-image,
.team-shape-hexagon.team-border-double .team-card-image {
    border: none;
    filter: drop-shadow(0 0 0 var(--team-border-color,#c9a961));
}

/* ===== Glow ===== */
.team-glow-orb {
    position: absolute; inset: -20%;
    background: radial-gradient(circle, var(--team-border-color,#c9a961) 0%, transparent 65%);
    opacity: 0.25; z-index: 0; pointer-events: none;
    filter: blur(20px);
}
.team-card-image img { position: relative; z-index: 1; }

/* ===== Position badge ===== */
.team-badge {
    position: absolute; bottom: 12px; inset-inline-start: 12px; z-index: 3;
    background: var(--team-border-color,#c9a961); color: #0a0a0f;
    font-size: 11px; font-weight: 700; padding: 5px 12px; border-radius: 50px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.3); max-width: calc(100% - 24px);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ===== Card body ===== */
.team-card-body { padding: 18px 8px 4px; text-align: center; }
.team-name { font-size: 18px; font-weight: 700; margin: 0 0 4px; color: var(--text, #fff); }
.team-position { font-size: 13.5px; color: var(--team-border-color,#c9a961); font-weight: 500; }

/* ===== Card background variants (wraps image + body) ===== */
.team-cardbg-card .team-card {
    background: var(--card-bg, #16161d);
    border-radius: 18px;
    padding: 14px 14px 18px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.25);
}
.team-cardbg-bordered .team-card {
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    border-radius: 18px;
    padding: 14px 14px 18px;
}
.team-cardbg-glass .team-card {
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    padding: 14px 14px 18px;
}
.team-cardbg-card .team-card-body,
.team-cardbg-bordered .team-card-body,
.team-cardbg-glass .team-card-body { padding-bottom: 0; }
/* "none" = clean, no wrapper — nothing extra needed */

/* ===== Info position: overlay on standard layouts ===== */
.team-info-overlay:not(.team-layout-overlay) .team-card-overlay {
    justify-content: flex-end;
    padding-bottom: 20px;
    background: linear-gradient(to top, rgba(10,10,15,0.95) 5%, rgba(10,10,15,0.2) 55%, transparent 100%);
}
.team-info-overlay:not(.team-layout-overlay) .team-card:hover .team-card-overlay { opacity: 1; }
.team-info-overlay .team-overlay-info { margin-top: 6px; }

/* ===== Info hidden: image only, taller ===== */
.team-info-off .team-card-body { display: none; }
.team-info-off.team-layout-overlay .team-overlay-info { display: none; }

/* ===== Overlay (social + cta) ===== */
.team-card-overlay {
    position: absolute; inset: 0; z-index: 2;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
    background: linear-gradient(to top, rgba(10,10,15,0.92) 0%, rgba(10,10,15,0.3) 60%, transparent 100%);
    opacity: 0; transition: opacity 0.35s;
}
.team-card:hover .team-card-overlay { opacity: 1; }
.team-overlay-info { text-align: center; padding: 0 12px; }
.team-overlay-cta span { color: var(--team-border-color,#c9a961); font-size: 13px; font-weight: 600; }

/* ===== Social icons ===== */
.team-social { display: flex; gap: 10px; }
.team-social a { display: flex; align-items: center; justify-content: center; color: #fff; transition: all 0.2s; }
.team-social-circle a, .team-social-square a { width: 38px; height: 38px; border: 1px solid rgba(255,255,255,0.4); }
.team-social-circle a { border-radius: 50%; }
.team-social-square a { border-radius: 8px; }
.team-social-circle a:hover, .team-social-square a:hover { background: var(--team-border-color,#c9a961); border-color: var(--team-border-color,#c9a961); color: #0a0a0f; transform: translateY(-3px); }
.team-social-plain a { width: 30px; height: 30px; }
.team-social-plain a:hover { color: var(--team-border-color,#c9a961); transform: translateY(-3px); }
.team-social-inline { justify-content: center; margin-top: 12px; }
.team-social-inline a { color: var(--text-muted, #888); border-color: var(--border); }

/* ============================================
   LAYOUT: Circular
   ============================================ */
.team-layout-circular .team-card-image { border-radius: 50%; aspect-ratio: 1/1; max-width: 200px; margin: 0 auto; }
.team-layout-circular.team-shape-hexagon .team-card-image { border-radius: 0; }
.team-layout-circular .team-card-overlay { border-radius: 50%; }

/* ============================================
   LAYOUT: Minimal
   ============================================ */
.team-layout-minimal .team-card-image { max-width: 130px; aspect-ratio: 1/1; border-radius: 50%; margin: 0 auto; }
.team-layout-minimal .team-card-overlay { display: none; }
.team-layout-minimal .team-name { font-size: 16px; }
.team-layout-minimal .team-position { font-size: 12.5px; }

/* ============================================
   LAYOUT: Overlay (info always inside image)
   ============================================ */
.team-layout-overlay .team-card-image { aspect-ratio: 3/4; border-radius: 16px; }
.team-layout-overlay .team-card-overlay { opacity: 1; justify-content: flex-end; padding-bottom: 22px; background: linear-gradient(to top, rgba(10,10,15,0.95) 10%, transparent 70%); }
.team-layout-overlay .team-overlay-info .team-name { font-size: 18px; }
.team-layout-overlay .team-social { margin-bottom: 8px; opacity: 0; transition: opacity 0.3s; }
.team-layout-overlay .team-card:hover .team-social { opacity: 1; }
.team-layout-overlay .team-overlay-cta { opacity: 0; transition: opacity 0.3s; }
.team-layout-overlay .team-card:hover .team-overlay-cta { opacity: 1; }

/* ============================================
   LAYOUT: Flip
   ============================================ */
.team-layout-flip { perspective: 1200px; }
.team-layout-flip .team-card-image { aspect-ratio: 3/4; border-radius: 16px; }
.team-flip-inner { position: relative; width: 100%; transition: transform 0.7s cubic-bezier(.2,.8,.2,1); transform-style: preserve-3d; }
.team-layout-flip .team-card:hover .team-flip-inner { transform: rotateY(180deg); }
.team-flip-front, .team-flip-back { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.team-flip-back {
    position: absolute; inset: 0; transform: rotateY(180deg);
    background: var(--card-bg, #16161d); border: 1px solid var(--team-border-color,#c9a961);
    border-radius: 16px; padding: 24px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; text-align: center; gap: 12px;
}
.team-flip-bio { font-size: 13px; line-height: 1.6; color: var(--text-muted, #aaa); margin: 0; }
.team-flip-cta { color: var(--team-border-color,#c9a961); font-size: 13px; font-weight: 600; margin-top: 4px; }
.team-flip-back .team-card-overlay { display: none; }

/* ============================================
   HOVER EFFECTS
   ============================================ */
.team-hover-lift .team-card:hover { transform: translateY(-10px); }
.team-hover-zoom .team-card:hover .team-card-image img { transform: scale(1.1); }
.team-hover-glow .team-card:hover { box-shadow: 0 0 30px -4px var(--team-border-color,#c9a961); }
.team-hover-tilt .team-card:hover { transform: perspective(800px) rotateX(4deg) rotateY(-4deg) translateY(-6px); }
/* flip ignores other hover transforms on the card itself */
.team-layout-flip.team-hover-lift .team-card:hover,
.team-layout-flip.team-hover-tilt .team-card:hover { transform: none; }

/* ============================================
   FADE-UP on scroll
   ============================================ */
.team-fade-up .team-card { opacity: 0; transform: translateY(28px); transition: opacity 0.6s ease, transform 0.6s ease; transition-delay: var(--team-delay, 0s); }
.team-fade-up.in-view .team-card { opacity: 1; transform: translateY(0); }
.team-fade-up.in-view.team-hover-tilt .team-card,
.team-fade-up.in-view.team-hover-lift .team-card { transform: translateY(0); }

/* ============================================
   RESPONSIVE — mobile-first auto collapse
   ============================================ */
@media (max-width: 1024px) {
    .section-team .team-grid { grid-template-columns: repeat(min(var(--team-cols,4), 3), 1fr); }
}
@media (max-width: 768px) {
    .section-team .team-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .team-name { font-size: 16px; }
    /* disable flip on touch — show front only, tap opens modal */
    .team-layout-flip .team-card:hover .team-flip-inner { transform: none; }
}
@media (max-width: 460px) {
    .section-team .team-grid { grid-template-columns: 1fr; max-width: 320px; margin: 0 auto; }
    .team-layout-minimal .team-grid { grid-template-columns: 1fr 1fr; }
}
