/* ========================================================================
   COMPLETE FIX: Header Alignment + Hero Section Visibility
   ======================================================================== */

/* ===== FIX 1: Header Alignment (Prevents Logo/Nav Overlap) ===== */

.mobile-only {
    display: none !important;
}

nav.nav-container {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding: 15px 60px !important;
    box-sizing: border-box !important;
    gap: 40px !important;
    /* Minimum gap between components */
}

.logo {
    display: flex !important;
    align-items: center !important;
    flex: 0 0 auto !important;
    /* Don't shrink or grow */
    z-index: 10 !important;
    text-decoration: none !important;
    min-width: fit-content !important;
}

.logo-img {
    height: 70px !important;
    /* Increased from 55px */
    width: auto !important;
    margin-right: 20px !important;
}

.logo-text {
    font-size: 1.8rem !important;
    /* Increased from 1.4rem */
    white-space: nowrap !important;
    font-weight: 800 !important;
    color: var(--primary-blue) !important;
}

.nav-list {
    display: flex !important;
    list-style: none !important;
    gap: 20px !important;
    /* Reduced from 30px */
    margin: 0 !important;
    padding: 0 !important;
    justify-content: flex-end !important;
    /* Changed from center to push away from logo */
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

.nav-list li {
    margin: 0 !important;
    white-space: nowrap !important;
}

.nav-cta-button {
    flex: 0 0 auto !important;
    /* Don't shrink or grow */
    padding: 12px 25px !important;
    white-space: nowrap !important;
    font-weight: bold !important;
    background: var(--accent-gold) !important;
    color: var(--primary-blue) !important;
    border-radius: 5px !important;
    text-decoration: none !important;
}

/* ===== FIX 2: Hero Section Visibility ===== */

/* Ensure main content accounts for fixed header */
main {
    margin-top: 0 !important;
}

/* Fix hero section to be visible and properly sized */
.hero-section,
.trust-hero {
    min-height: 85vh !important;
    height: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 150px 20px 80px !important;
    position: relative !important;
    background-size: cover !important;
    background-position: center !important;
    background-attachment: fixed !important;
    margin-top: 0 !important;
}

/* Ensure background image loads */
.trust-hero {
    background: linear-gradient(rgba(10, 38, 71, 0.7), rgba(10, 38, 71, 0.7)),
        url('/images/trust-hero.png') center/cover !important;
    background-size: cover !important;
    background-position: center !important;
}

/* Hero content styling */
.hero-content {
    position: relative !important;
    z-index: 2 !important;
    max-width: 900px !important;
    margin: 0 auto !important;
    text-align: center !important;
    color: white !important;
}

.hero-content h1 {
    color: white !important;
    font-size: clamp(2.5rem, 5vw, 4.5rem) !important;
    margin-bottom: 25px !important;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3) !important;
}

.hero-content p {
    color: rgba(255, 255, 255, 0.95) !important;
    font-size: clamp(1rem, 2vw, 1.3rem) !important;
    line-height: 1.8 !important;
    margin-bottom: 30px !important;
}

/* Ensure hero CTA buttons are visible */
.hero-cta-group {
    display: flex !important;
    gap: 20px !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    margin-top: 30px !important;
}

/* ===== FIX 3: School Hero Section ===== */

.school-hero {
    min-height: 85vh !important;
    background: linear-gradient(rgba(10, 38, 71, 0.5), rgba(10, 38, 71, 0.5)),
        url('/images/school-hero.png') !important;
    background-size: cover !important;
    background-position: center !important;
    background-attachment: fixed !important;
}

@media (max-width: 1400px) {
    header.school-header .nav-list {
        gap: 10px !important;
    }

    header.school-header .logo-text {
        font-size: 1.4rem !important;
        white-space: nowrap !important;
    }
}

@media (max-width: 1300px) {
    header.school-header .logo-text {
        display: none !important;
        /* Hide long title text earlier on school site to prevent overlap */
    }
}

@media (max-width: 1200px) {
    nav.nav-container {
        gap: 30px !important;
    }

    .logo-text {
        font-size: 1.5rem !important;
    }

    /* Specific fix for school header with many links */
    header.school-header .nav-container {
        display: flex !important;
        justify-content: space-between !important;
        width: 100% !important;
        max-width: 1400px !important;
        padding: 0 40px !important;
    }
}

header.school-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 1000 !important;
    background: #fff !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
}

@media (min-width: 993px) {
    header.school-header .nav-container {
        max-width: 100% !important;
        width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0 40px !important;
    }

    header.school-header .logo {
        flex: 0 0 450px !important;
        /* Fixed width to protect logo area */
        margin-right: 20px !important;
        z-index: 2 !important;
    }

    header.school-header .nav-list {
        flex: 1 1 auto !important;
        display: flex !important;
        justify-content: flex-end !important;
        /* Push links to the right */
        gap: 15px !important;
        margin: 0 20px !important;
        min-width: 0 !important;
        overflow: hidden !important;
        /* Prevent links from bleeding out */
        white-space: nowrap !important;
    }

    /* Ensure links themselves stay readable */
    header.school-header .nav-list li {
        flex-shrink: 0 !important;
    }

    header.school-header .nav-cta-button {
        flex: 0 0 auto !important;
        z-index: 2 !important;
    }
}

@media (max-width: 1300px) {
    .nav-list {
        gap: 20px !important;
    }

    .logo-text {
        font-size: 1.5rem !important;
    }
}

@media (max-width: 1100px) {
    .nav-list {
        gap: 15px !important;
    }

    .logo-text {
        font-size: 1.3rem !important;
    }

    .logo-img {
        height: 60px !important;
    }

    nav.nav-container {
        padding: 10px 30px !important;
        gap: 20px !important;
    }

    .hero-section,
    .trust-hero,
    .school-hero {
        min-height: 70vh !important;
        padding: 140px 20px 60px !important;
    }
}

@media (max-width: 992px) {

    /* Mobile menu */
    nav.nav-container {
        display: flex !important;
        justify-content: space-between !important;
        padding: 10px 20px !important;
        height: 80px !important;
    }

    header.school-header .logo {
        flex: 0 1 auto !important;
        /* Allow shrinking */
        max-width: 250px !important;
        /* Limit logo space on mobile */
        margin-right: 10px !important;
    }

    .nav-list {
        display: none !important;
        position: fixed !important;
        top: 80px !important;
        left: 0 !important;
        width: 100% !important;
        height: calc(100vh - 80px) !important;
        background: rgba(255, 255, 255, 0.98) !important;
        /* Slight transparency */
        backdrop-filter: blur(10px) !important;
        /* Glass effect */
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 20px !important;
        gap: 35px !important;
        z-index: 999 !important;
        overflow-y: auto !important;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
        transform: translateY(-10px) !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    .nav-list.active {
        display: flex !important;
        transform: translateY(0) !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    .nav-list li a {
        font-size: 1.5rem !important;
        /* Larger font size */
        font-weight: 500 !important;
        color: var(--primary-blue) !important;
        text-decoration: none !important;
        transition: color 0.3s ease !important;
    }

    .nav-list li a:hover {
        color: var(--accent-gold) !important;
    }

    /* Mobile CTA Link Style */
    .nav-cta-button-mobile {
        display: inline-block !important;
        background: var(--accent-gold) !important;
        color: var(--primary-blue) !important;
        padding: 15px 40px !important;
        /* Bigger padding */
        border-radius: 50px !important;
        /* Rounded corners for premium feel */
        font-weight: 800 !important;
        text-align: center !important;
        margin-top: 20px !important;
        text-decoration: none !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    }

    .mobile-only {
        display: block !important;
        width: 100% !important;
        padding: 0 40px !important;
    }

    /* Fix general alignment and padding for mobile */
    .section-padding {
        padding: 40px 0 !important;
    }

    .container {
        padding: 0 15px !important;
        width: 100% !important;
        overflow-x: hidden !important;
    }

    /* Prevent horizontal scrolling on rows and columns */
    .row,
    .card-row,
    .contact-grid,
    .director-card,
    .footer-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .col,
    .card,
    .contact-info-panel,
    .contact-form-panel,
    .director-details,
    .footer-col {
        width: 100% !important;
        flex: 1 1 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    h1 {
        font-size: 2rem !important;
        line-height: 1.2 !important;
        word-wrap: break-word !important;
    }

    h2 {
        font-size: 1.6rem !important;
        line-height: 1.3 !important;
    }

    h3 {
        font-size: 1.3rem !important;
    }

    /* Fix hero content padding and text on mobile */
    .hero-content,
    .director-hero-section,
    .page-header {
        padding: 80px 15px 40px !important;
        text-align: center !important;
    }

    .hero-content p,
    .page-header p {
        font-size: 0.95rem !important;
        line-height: 1.6 !important;
        margin-bottom: 20px !important;
    }

    /* School hero background fix */
    .school-hero {
        min-height: 70vh !important;
        padding-top: 100px !important;
    }

    /* Director image responsiveness */
    .director-image-container {
        width: 100% !important;
        flex: 1 1 100% !important;
        max-width: 300px !important;
        margin: 0 auto 20px auto !important;
    }

    .director-card {
        padding: 20px !important;
    }

    .card-icon-placeholder {
        width: 80px !important;
        height: 80px !important;
        background: #eee !important;
        border-radius: 50% !important;
        margin: 0 auto 15px auto !important;
    }

    .founder-quote {
        font-size: 1rem !important;
        padding-left: 15px !important;
    }

    .logo-img {
        height: 55px !important;
    }

    .logo-text {
        font-size: 1.2rem !important;
        display: block !important;
        /* Ensure some text is visible if it fits */
    }

    .menu-toggle {
        display: flex !important;
        z-index: 1001 !important;
    }

    .nav-cta-button {
        display: none !important;
    }

    /* Hero adjustments */
    .hero-section,
    .trust-hero,
    .school-hero {
        min-height: 60vh !important;
        padding: 100px 15px 50px !important;
        background-attachment: scroll !important;
    }
}

@media (max-width: 768px) {
    .logo-img {
        height: 45px !important;
    }

    .logo-text {
        font-size: 1.1rem !important;
    }

    .hero-content h1 {
        font-size: 2rem !important;
    }
}

@media (max-width: 480px) {
    .logo-img {
        height: 40px !important;
    }

    .logo-text {
        font-size: 1rem !important;
    }

    nav.nav-container {
        padding: 8px 15px !important;
    }
}

/* ===== NEW FIX: Mobile Menu Toggle & Footer Alignment ===== */

/* Mobile menu toggle button */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle .bar {
    height: 3px;
    width: 100%;
    background-color: var(--primary-blue);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.menu-toggle.active .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Make hamburger icon visible when triggered */
@media (max-width: 992px) {
    .menu-toggle {
        display: flex !important;
    }
}

/* Footer alignment fixes */
.footer-contact .contact-item {
    display: flex !important;
    align-items: center !important;
    /* Forces vertical alignment of icon and text */
    gap: 15px !important;
    margin-bottom: 12px !important;
}

.footer-contact .contact-item i {
    flex-shrink: 0 !important;
    width: 20px !important;
    text-align: center !important;
    margin-top: 0 !important;
    /* Reset any top-alignment margin */
}

.footer-contact .contact-item p {
    margin: 0 !important;
    line-height: 1.2 !important;
}

/* Ensure social icons in footer are visible and properly sized */
.footer-social .social-link {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
}

.footer-social .social-link i {
    font-size: 1.2rem !important;
}