/* --- Variables --- */
:root {
    --color-primary: #A04000;    /* Terracotta */
    --color-secondary: #F4B400;  /* Harvest Gold */
    --color-success: #2E7D32;    /* Green */
    --color-cream: #FFF8E1;
    --font-heading: 'Merriweather', serif;
    --font-body: 'Open Sans', sans-serif;
}

/* --- Global Typography & Overrides --- */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; 
}

body {
    font-family: var(--font-body);
    color: #333;
}

.font-head { font-family: var(--font-heading); }
.bg-cream { background-color: var(--color-cream); }
.bg-black { background-color: #111; }
.bg-white-10 { background-color: rgba(255,255,255,0.1); }
.text-white-90 { color: rgba(255,255,255,0.9); }

/* --- Colors & Buttons --- */
.text-primary-custom { color: var(--color-primary) !important; }
.text-success-custom { color: var(--color-success) !important; }
.text-gold { color: var(--color-secondary) !important; }

.btn-primary-custom {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    transition: all 0.3s;
}
.btn-primary-custom:hover {
    background-color: #803000;
    border-color: #803000;
    transform: translateY(-2px);
}

.btn-gold {
    background-color: var(--color-secondary);
    color: #000;
    border: none;
    transition: all 0.3s;
}
.btn-gold:hover {
    background-color: #d49b00;
    transform: translateY(-2px);
}

.ls-2 { letter-spacing: 2px; }
.hover-gold:hover { color: var(--color-secondary) !important; transition: 0.3s; }

/* --- Navbar --- */
.navbar { transition: all 0.3s; }
.navbar-brand { font-size: 1.4rem; }
.nav-link { font-weight: 600; color: #444 !important; transition: 0.3s; }
.nav-link.active, .nav-link:hover { color: var(--color-primary) !important; }

/* --- Hero Carousel --- */
.carousel-item {
    background-size: cover;
    background-position: center;
    position: relative;
    height: 100vh;
    min-height: 600px;
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
    z-index: 1;
}

.carousel-caption {
    z-index: 2;
    bottom: 0;
    padding-bottom: 5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* --- Principle & Team Cards --- */
.principle-card, .team-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 4px solid var(--color-secondary) !important;
    background: #fff;
}

.team-card { border-radius: 15px; border-bottom: 4px solid transparent; }

.shadow-hover:hover, .team-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 1rem 3rem rgba(160, 64, 0, 0.15) !important;
}

.team-card:hover { border-bottom: 4px solid var(--color-primary); }

/* Icons and Images */
.icon-circle {
    width: 70px; height: 70px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

.icon-square {
    width: 50px; height: 50px;
    border-radius: 8px; 
}

.img-wrapper {
    width: 120px; height: 120px;
    position: relative;
}

.border-gold {
    border: 3px solid var(--color-secondary);
    padding: 3px;
    background-color: #fff;
}

/* --- Floating Action Button (Message) --- */
.btn-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1050;
    background-color: var(--color-secondary);
    color: #333;
    border-radius: 50px;
    padding: 15px 25px; 
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.3s;
    animation: pulse 2s infinite;
}

.btn-fab:hover {
    background-color: #e0a800;
    transform: scale(1.05);
    color: #000;
    animation: none;
}

/* --- Animations --- */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}
.scroll-reveal.visible { opacity: 1; transform: translateY(0); }

@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(244, 180, 0, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(244, 180, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(244, 180, 0, 0); }
}

.animate-fade-down { animation: fadeDown 1s ease forwards; }
.animate-fade-up { animation: fadeUp 1s ease forwards; opacity: 0; }
.delay-100 { animation-delay: 0.1s; transition-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; transition-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; transition-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; transition-delay: 0.4s; }

/* Responsive Adjustments */
@media (max-width: 768px) {
    .display-3 { font-size: 2.5rem; }
    .display-4 { font-size: 2rem; }
    .carousel-caption h1 { font-size: 2.2rem; }
    .hero-overlay { background: rgba(0,0,0,0.6); }
    .btn-fab { width: 60px; height: 60px; padding: 0; border-radius: 50%; }
}


/* --- Hero Carousel --- */
.carousel-item {
    /* Ensures image covers the whole area without stretching */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    
    /* DESKTOP: Fill the full screen height */
    height: 100vh; 
    min-height: 600px; /* Prevents it from being too short on wide monitors */
}

/* Dark Overlay for Readability */
.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    /* Gradient ensures text is readable even on bright images */
    background: linear-gradient(to right, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.3) 100%);
    z-index: 1;
}

.carousel-caption {
    z-index: 2;
    bottom: 0;
    padding-bottom: 5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* --- MOBILE SPECIFIC FIXES --- */
@media (max-width: 768px) {
    .carousel-item {
        /* FIX: Uses 'svh' to calculate height ignoring the mobile address bar */
        height: 100svh; 
        min-height: auto; /* Allow it to shrink to fit the phone screen exactly */
        
        /* Optional: Anchors image to top-center so faces aren't cut off */
        background-position: top center; 
    }

    .carousel-caption {
        /* Lift text up slightly on mobile so it's not too close to the bottom edge */
        padding-bottom: 3rem; 
    }
    
    .carousel-caption h1 {
        font-size: 2rem; /* Adjusted font size for mobile readability */
    }
    
    .hero-overlay {
        /* Darker overlay on mobile for better contrast */
        background: rgba(0,0,0,0.5); 
    }
}

/* --- MOBILE SPECIFIC FIXES --- */
@media (max-width: 768px) {
    .carousel-item {
        /* 1. Ensure image fills the screen but respects mobile browser bars */
        height: 100svh; 
        min-height: auto;
        background-position: center top; /* Focus on faces/upper part of image */
    }

    .carousel-caption {
        /* 2. FIX OVERLAP: Unset absolute bottom pinning */
        position: absolute;
        top: 0;
        bottom: 0;
        left: 5%;
        right: 5%;
        padding-bottom: 0;
        
        /* 3. Center content vertically using Flexbox */
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start; /* Aligns text to the left */
        text-align: left;
    }
    
    /* 4. Resize Text for Mobile */
    .carousel-caption h1 {
        font-size: 2rem; /* Smaller heading */
        line-height: 1.2;
        margin-bottom: 1rem;
    }

    .carousel-caption p.lead {
        font-size: 1rem; /* Smaller body text */
        line-height: 1.5;
        margin-bottom: 1.5rem;
    }

    /* 5. Stack Buttons on very narrow screens */
    .carousel-caption .d-flex {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .carousel-caption .btn {
        width: 100%; /* Make buttons full width for easier tapping */
        margin-bottom: 5px;
    }
    
    .hero-overlay {
        background: rgba(0,0,0,0.5); /* Slightly darker for better readability */
    }
}


/* --- MOBILE SPECIFIC FIXES --- */
@media (max-width: 768px) {
    .carousel-item {
        /* 1. Use 'svh' to fill the visible screen exactly */
        height: 100svh; 
        min-height: auto;
        /* Focus image on the center/top where faces usually are */
        background-position: center top; 
    }

    .carousel-caption {
        /* 2. Center content vertically */
        position: absolute;
        top: 0;
        bottom: 0;
        left: 5%;
        right: 5%;
        padding-bottom: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        text-align: left;
    }
    
    /* 3. Typography Adjustments */
    .carousel-caption h1 {
        font-size: 1.8rem; /* Slightly smaller for better fit */
        line-height: 1.2;
        margin-bottom: 0.8rem;
    }

    .carousel-caption p.lead {
        font-size: 0.95rem;
        line-height: 1.4;
        margin-bottom: 1.2rem;
        /* Limit text width to prevent reading fatigue */
        max-width: 90%; 
    }

    /* 4. CTA Button Fixes (The Main Issue) */
    .carousel-caption .d-flex {
        width: 100%; /* Ensure container spans width */
        flex-direction: column; /* Stack them for easy tapping */
        gap: 10px;
    }
    
    .carousel-caption .btn {
        width: 100%;        /* Full width for touch targets */
        padding: 10px 15px; /* REDUCED PADDING (was likely 15px 30px) */
        font-size: 0.9rem;  /* Smaller font */
        margin-bottom: 0;   /* Remove extra margin, use gap instead */
    }

    .hero-overlay {
        background: rgba(0,0,0,0.6); /* Darker overlay for text pop */
    }
}

/* Extra Small Screens (e.g., iPhone SE) - Safety check */
@media (max-width: 380px) {
    .carousel-caption h1 { font-size: 1.5rem; }
    .carousel-caption .btn { padding: 8px 12px; font-size: 0.85rem; }
}


/* --- TEAM PAGE ADVANCED STYLES --- */

/* 1. Page Header (Wave) */
.page-header {
    height: 400px;
    background-size: cover;
    background-position: center;
    margin-top: 76px;
    position: relative;
}

.custom-shape-divider-bottom-1680000000 {
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    overflow: hidden; line-height: 0; transform: rotate(180deg); z-index: 3;
}

.custom-shape-divider-bottom-1680000000 svg {
    position: relative; display: block; width: calc(100% + 1.3px); height: 60px;
}

.custom-shape-divider-bottom-1680000000 .shape-fill {
    fill: #ffffff; /* Matches the white section below */
}

/* 2. Floating Cards Logic */
.team-float-card {
    position: relative;
    transition: all 0.4s ease;
    margin-top: 60px; /* Crucial: Creates space for the head */
}

.float-img-wrapper {
    width: 150px;
    height: 150px;
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;
    border: 5px solid #fff;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    position: absolute;
    top: -75px; /* Pulls image exactly 50% out of the card */
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    transition: transform 0.4s ease;
}

.float-img-wrapper img {
    width: 100%; height: 100%; object-fit: cover;
}

.card-content {
    padding-top: 85px !important; /* Pushes text down so image doesn't cover it */
    background: #fff;
    border-top: 4px solid var(--color-secondary); /* Gold Top */
    border-radius: 12px;
}

/* Hover Effects */
@media (min-width: 992px) {
    .team-float-card:hover { transform: translateY(-10px); }
    .team-float-card:hover .float-img-wrapper { transform: translateX(-50%) scale(1.1); }
}

/* 3. Chairman Feature */
.chairman-img-wrapper {
    height: 100%;
    min-height: 350px;
}

.x-small {
    font-size: 0.85rem;
}

/* 4. Blob Background for About */
.blob-bg {
    position: absolute;
    top: -20px; right: -20px; bottom: -20px; left: -20px;
    background: var(--color-secondary);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    z-index: 1;
    opacity: 0.2;
}