/* ======================================================
   START TEAM STYLE (Fixed & ThemeForest Ready)
====================================================== */
/* ==========================================================================
   LUXURY TEAM STYLES
   ========================================================================== */

:root {
    /* Ensure these match your global variables, fallback provided */
    /* FIXED: Use variable instead of hardcoded hex to support theme switching */
    --color-primary: var(--color-accent, #D4AF37);
    --color-primary-dark: var(--color-accent-dark, #B9902E);
    --color-dark: var(--color-dark, #1A1714);
    --color-light: var(--color-light, #FBFAF7);
    --color-gray: var(--color-text-muted, #6D6761);
    --font-serif: var(--font-serif, 'Playfair Display', Georgia, serif);
    --font-sans: var(--font-sans, 'Poppins', system-ui, sans-serif);
    --transition-smooth: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* --- HERO SECTION --- */
.team-hero {
    position: relative;
    height: 85vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #fff;
    text-align: center;
}

.hero-media {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1;
}

.hero-video, .hero-image {
     width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.7));
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 800px;
    padding: 2rem;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeInUp 1s ease forwards 0.3s;
}

.hero-subtitle {
    font-size: 1.25rem;
    font-weight: 300;
    margin-bottom: 2.5rem;
    opacity: 0;
    animation: fadeInUp 1s ease forwards 0.6s;
}

/* Parallax Elements */
.parallax-element {
    position: absolute;
    z-index: 2;
    pointer-events: none;
    opacity: 0.6;
    /* FIXED: Changed to ease for smoother motion on high refresh displays */
    transition: transform 0.1s ease;
}

.floating-plate { 
    top: 20%; left: 10%; width: 150px; 
    background-size: contain; background-repeat: no-repeat; 
}
.floating-wine { 
    bottom: 20%; right: 10%; width: 100px; 
    background-size: contain; background-repeat: no-repeat; 
}
.floating-utensils { 
    top: 15%; right: 15%; width: 120px; 
    background-size: contain; background-repeat: no-repeat; 
}

/* --- KEY TEAM (Leadership) --- */
.key-team-section {
    padding: 6rem 0;
    text-align: center;
}

.section-head { margin-bottom: 4rem; }

.section-title {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    color: var(--color-dark);
    margin-bottom: 1rem;
}

.divider {
    width: 60px; height: 3px;
    /* FIXED: Use variable */
    background: var(--color-primary);
    margin: 0 auto;
}

.key-team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
}

.key-member {
    background: var(--color-light);
    border: 1px solid color-mix(in srgb, var(--color-dark), transparent 5%);
    padding: 2rem;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    /* FIXED: Added cursor for accessibility context */
    cursor: default;
}

.key-member:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px color-mix(in srgb, var(--color-dark), transparent 8%);
    border-color: var(--color-primary);
}

.card-media img {
    width: 180px; height: 180px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1.5rem;
    border: 3px solid var(--color-light);
    box-shadow: 0 5px 15px color-mix(in srgb, #000, transparent 10%);
}

.signature {
    position: absolute;
    top: 2rem; right: 2rem;
    width: 80px; opacity: 0.6;
}

.member-name { 
    font-family: var(--font-serif); 
    font-size: 1.75rem; 
    margin-bottom: 0.5rem; 
}

.member-role { 
    /* FIXED: Use variable */
    color: var(--color-primary); 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    font-size: 0.9rem; 
    font-weight: 600; 
    margin-bottom: 1rem; 
}

/* --- TEAM GRID & FILTERS --- */
.team-grid-section {
    padding: 4rem 0 6rem; 
    background-color: #f9f9f9;
}

.team-controls {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--color-dark);
    padding: 0.8rem 2rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: var(--font-sans);
    font-weight: 500;
    transition: var(--transition-smooth);
    color: var(--color-dark);
}

/* FIXED: Added Focus State for A11y */
.filter-btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.filter-btn:hover, .filter-btn.active {
    background: var(--color-dark);
    color: var(--color-primary);
    border-color: var(--color-dark);
}

.team-members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.team-member {
    position: relative;
    height: 450px; /* Fixed height for flip effect context */
    perspective: 1000px;
    /* FIXED: Must be pointer to be interactive */
    cursor: pointer;
}

/* We simulate flip using opacity/transform for better control without extra markup */
.card-front, .card-back {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    backface-visibility: hidden; /* Standard flip support */
    transition: var(--transition-smooth);
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px color-mix(in srgb, #000, transparent 5%);
}

.card-back {
    opacity: 0;
    transform: rotateY(180deg);
    /* FIXED: Use variable */
    background: var(--color-dark);
    color: #fff;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 2;
}

/* Interaction: Click to Flip (Triggered via JS class) */
.team-member.flipped .card-front {
    opacity: 0;
    transform: rotateY(-180deg);
    pointer-events: none;
}
.team-member.flipped .card-back {
    opacity: 1;
    transform: rotateY(0deg);
    pointer-events: auto;
}

.card-front img {
    width: 100%; height: 70%;
    object-fit: cover;
}

.member-meta {
    padding: 1.5rem;
    text-align: center;
}

.member-meta h3 { 
    font-family: var(--font-serif); 
    font-size: 1.5rem; 
    margin-bottom: 0.2rem; 
}

.member-meta .role { 
    /* FIXED: Use variable */
    color: var(--color-primary); 
    font-size: 0.9rem; 
    text-transform: uppercase; 
}

.member-overlay-actions {
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    /* FIXED: Removed pointer-events: none to allow clicking buttons */
    background: rgba(255,255,255,0.95);
    padding: 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.team-member:hover .member-overlay-actions {
    transform: translateY(0);
}

/* Card Back Styling */
.full-bio { 
    font-size: 1rem; 
    line-height: 1.6; 
    color: #ccc; 
    margin-bottom: 2rem; 
}

/* --- MODAL --- */
.team-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    /* FIXED: Lowered Z-Index to prevent plugin conflicts */
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}

.team-modal.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.modal-inner {
    background: #fff;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    box-shadow: 0 25px 50px color-mix(in srgb, #000, transparent 50%);
    /* FIXED: Improved animation for smoother entry */
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.team-modal.is-visible .modal-inner { 
    transform: translateY(0); 
}

.modal-close {
    position: absolute;
    top: 1rem; right: 1rem;
    background: transparent;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10;
    color: var(--color-dark);
    line-height: 1;
    /* FIXED: Added Focus State */
}
.modal-close:focus-visible {
    outline: 2px solid var(--color-primary);
    border-radius: 4px;
}

.modal-image {
    background: #f0f0f0;
    height: 100%;
    min-height: 400px;
}

.modal-image img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    display: block; 
}

.modal-info {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.modal-name { 
    font-family: var(--font-serif); 
    font-size: 2.5rem; 
    /* FIXED: Use variable */
    color: var(--color-dark); 
}

.modal-role { 
    /* FIXED: Use variable */
    color: var(--color-primary); 
    font-size: 1.1rem; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    margin-bottom: 1.5rem; 
}

.modal-bio { 
    font-size: 1.1rem; 
    /* FIXED: Use variable */
    color: var(--color-gray); 
    line-height: 1.8; 
    margin-bottom: 2rem; 
}

/* --- ANIMATIONS --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .hero-title { font-size: 2.5rem; }
    
    .modal-inner { 
        grid-template-columns: 1fr; 
    }
    
    .modal-image { 
        height: 300px; 
        min-height: auto; 
    }
    
    .modal-info { 
        padding: 2rem; 
    }

    /* FIXED: Hide parallax elements on mobile to save resources */
    .floating-plate, 
    .floating-wine, 
    .floating-utensils { 
        display: none; 
    }
}

/* ======================================================
   END TEAM STYLE
====================================================== */