/* =========================================
   Animations
   ========================================= */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes lineGrow {
    from { width: 0; }
    to { width: 80px; }
}

/* =========================================
   Global Layout
   ========================================= */
.team-page-wrapper {
    background-color: var(--theme-palette-color-7);
    font-family: 'Inter', 'Lato', sans-serif;
    color: var(--theme-palette-color-3);
    width: 100%;
    overflow-x: hidden; /* Prevent horizontal scroll */
    box-sizing: border-box;
}

/* =========================================
   1. Hero Section
   ========================================= */
.team-hero {
    text-align: center;
    padding: 100px 5% 80px; /* Use % for padding */
    width: 100%;
    box-sizing: border-box;
    animation: fadeInUp 0.8s ease-out forwards;
}

.sub-headline {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--theme-palette-color-2);
    display: block;
    margin-bottom: 20px;
    font-weight: 600;
}

.team-hero h2 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 5vw, 4.5rem); /* Responsive Font Size */
    color: var(--theme-palette-color-4);
    margin: 0 0 30px 0;
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1.1;
}

.hero-line {
    width: 80px;
    height: 2px;
    background-color: var(--theme-palette-color-1);
    margin: 0 auto 40px;
    animation: lineGrow 1s ease-out forwards;
}

.team-hero p {
    font-size: 1.25rem;
    line-height: 1.7;
    color: var(--theme-palette-color-3);
    max-width: 800px; /* Only constrain text for readability */
    margin: 0 auto;
    opacity: 0.9;
}

/* =========================================
   2. Team Grid (Wide & Fluid)
   ========================================= */
.team-grid {
    display: grid;
    /* Min 280px wide, but fill remaining space */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px; /* Tighter gap for modern look */
    width: 95%; /* Almost full width */
    margin: 0 auto 120px;
    box-sizing: border-box;
}

.team-card {
    display: block;
    background-color: var(--theme-palette-color-8);
    text-decoration: none;
    position: relative;
    opacity: 0; 
    animation: fadeInUp 0.8s ease-out forwards;
    animation-delay: var(--delay, 0s);
    transition: transform 0.4s ease;
}

.team-card:hover {
    transform: translateY(-10px);
    z-index: 10;
}

.image-wrapper {
    width: 100%;
    aspect-ratio: 3/4; /* Consistent portrait ratio */
    overflow: hidden;
    position: relative;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    filter: grayscale(20%);
}

.team-card:hover .image-wrapper img {
    transform: scale(1.1);
    filter: grayscale(0%);
}

.card-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0);
    transition: background 0.3s ease;
}

.info-content {
    padding: 25px 15px;
    text-align: center;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.team-card:hover .info-content {
    border-bottom-color: var(--theme-palette-color-1);
}

.info-content h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    color: var(--theme-palette-color-4);
    margin: 0 0 5px 0;
}

.info-content .role {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--theme-palette-color-1);
    display: block;
    margin-bottom: 15px;
}

.info-content .desc {
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
    color: var(--theme-palette-color-3);
    opacity: 0.8;
}

/* =========================================
   3. The Zhrrii Aesthetic (Pillars)
   ========================================= */
.pillars-section {
    width: 100%;
    padding: 0 0 100px;
    box-sizing: border-box;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}
.section-title h3 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    color: var(--theme-palette-color-4);
}

.pillars-container {
    display: flex;
    flex-wrap: nowrap; /* Force single row on desktop */
    width: 95%;
    height: 500px; /* Tall aesthetic cards */
    margin: 0 auto;
    gap: 10px;
}

.pillar-card {
    position: relative;
    flex-grow: 1; /* All share space equally initially */
    flex-basis: 0;
    overflow: hidden;
    transition: flex-grow 0.5s ease; /* Smooth expansion */
    border: 1px solid var(--theme-palette-color-5);
    background-color: var(--theme-palette-color-8);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 40px;
    cursor: default;
}

/* Hover Effect: Expand (Desktop Only) */
.pillar-card:hover {
    flex-grow: 3; /* Hovered item takes 3x space */
    background-color: var(--theme-palette-color-5); /* Slight color shift */
}

.pillar-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.05));
    z-index: 0;
    opacity: 0.5;
    transition: opacity 0.5s;
}
.pillar-card:hover .pillar-bg {
    opacity: 1;
}

.pillar-content {
    position: relative;
    z-index: 1;
    opacity: 0.7;
    transition: all 0.5s ease;
    transform: translateY(20px);
}

.pillar-card:hover .pillar-content {
    opacity: 1;
    transform: translateY(0);
}

.pillar-num {
    font-family: 'Playfair Display', serif;
    font-size: 4rem;
    color: var(--theme-palette-color-1);
    opacity: 0.2;
    display: block;
    line-height: 1;
    margin-bottom: 10px;
}

.pillar-content h4 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--theme-palette-color-4);
    margin: 0 0 10px 0;
    white-space: nowrap; /* Keep title on one line */
}

.pillar-content p {
    font-size: 1.1rem;
    color: var(--theme-palette-color-3);
    max-width: 400px;
    opacity: 0; /* Hide text initially */
    transform: translateY(10px);
    transition: all 0.4s 0.1s ease;
}

.pillar-card:hover .pillar-content p {
    opacity: 1; /* Show text on hover */
    transform: translateY(0);
}

/* =========================================
   4. Quote Banner (Full Width Block)
   ========================================= */
.quote-banner {
    width: 100%;
    background-color: var(--theme-palette-color-1); /* Brand Color */
    color: #fff; /* Always white */
    padding: 120px 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.quote-container blockquote {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-style: italic;
    margin: 0 0 30px 0;
    line-height: 1.3;
}

.quote-container cite {
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    opacity: 0.8;
    font-style: normal;
}

/* =========================================
   5. Editorial Promise (Wide)
   ========================================= */
.values-section {
    width: 100%;
    background-color: var(--theme-palette-color-5);
    padding: 100px 5%;
    box-sizing: border-box;
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 60px; /* Very wide gap */
}

.value-item h4 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--theme-palette-color-4);
    border-top: 1px solid var(--theme-palette-color-1);
    padding-top: 20px;
    margin-bottom: 15px;
}

.value-item p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--theme-palette-color-3);
}

/* =========================================
   6. CTA
   ========================================= */
.join-us-section {
    padding: 100px 20px;
    text-align: center;
    background-color: var(--theme-palette-color-8);
}

.join-content {
    max-width: 600px;
    margin: 0 auto;
}

.join-content h4 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    margin-bottom: 20px;
    color: var(--theme-palette-color-4);
}

.btn-join {
    display: inline-block;
    margin-top: 30px;
    padding: 15px 50px;
    background-color: transparent;
    border: 1px solid var(--theme-palette-color-4);
    color: var(--theme-palette-color-4);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-join:hover {
    background-color: var(--theme-palette-color-4);
    color: var(--theme-palette-color-8); /* Text becomes BG color */
}

/* =========================================
   MOBILE & TABLET OPTIMIZATION (CRITICAL FIXES)
   ========================================= */
@media (max-width: 900px) {
    
    /* 1. Hero Adjustments */
    .team-hero {
        padding: 60px 20px;
    }
    .team-hero h2 {
        font-size: 2.5rem; /* Prevent headline from being too huge */
    }

    /* 2. Grid Adjustments */
    .team-grid {
        width: 100%; /* Full width on mobile */
        padding: 0 15px; /* Add padding to container instead of margin */
        gap: 40px; /* More space between cards */
        grid-template-columns: 1fr; /* Force single column on small screens */
    }

    /* 3. Pillars Section Fix (Vertical Stack) */
    .pillars-container {
        flex-direction: column; /* Stack vertically */
        height: auto; /* Allow auto height based on content */
        width: 100%;
        padding: 0 15px;
        box-sizing: border-box;
    }

    .pillar-card {
        width: 100%;
        height: auto;
        min-height: 250px; /* Minimum height for touch targets */
        margin-bottom: 20px;
        flex-grow: 0 !important; /* Force disable flex growth */
        flex-basis: auto !important;
        padding: 30px;
    }

    /* Disable hover expansion logic on touch */
    .pillar-card:hover {
        flex-grow: 0;
        background-color: var(--theme-palette-color-8);
    }

    /* Make text always visible */
    .pillar-content {
        transform: translateY(0);
        opacity: 1;
    }

    .pillar-content p {
        opacity: 1 !important; /* Force show text */
        transform: translateY(0) !important;
        margin-top: 10px;
        max-width: 100%;
    }

    .pillar-num {
        font-size: 3rem;
    }

    .pillar-content h4 {
        font-size: 1.8rem;
        white-space: normal; /* Allow text wrapping */
    }

    /* 4. Quote Banner Fix */
    .quote-banner {
        padding: 80px 20px;
    }
    .quote-container blockquote {
        font-size: 1.8rem; /* Smaller for mobile */
    }

    /* 5. Values Grid Fix */
    .values-grid {
        grid-template-columns: 1fr; /* Single column */
        gap: 40px;
    }
}
