/*
Theme Name: School Website Child
Theme URI: https://school-website-template.local
Description: Child theme for the school website template. Uses Astra as parent.
Author: School Template
Author URI: https://school-website-template.local
Template: astra
Version: 1.0.0
License: GPL v2 or later
Text Domain: school-template
*/

/* =============================================
 * School Footer & Lightbox CSS Variables
 *
 * These are style.css-specific variables not
 * present in core.css. Branding variables
 * (--school-primary, --school-secondary, etc.)
 * are defined in core.css and overridden
 * dynamically via wp_head from ACF options.
 * ============================================= */
:root {
    --school-footer-bg: #0f2444;
    --school-footer-text: #ffffff;
}

/* Utility classes using branding variables */
.has-primary-color   { color: var(--school-primary); }
.has-secondary-color { color: var(--school-secondary); }
.has-accent-color    { color: var(--school-accent); }
.has-primary-bg      { background-color: var(--school-primary); }
.has-secondary-bg    { background-color: var(--school-secondary); }
.has-accent-bg       { background-color: var(--school-accent); }

/* =============================================
 * Premium 3-Row Header
 * ============================================= */

/* --- Row 1: Top Contact Bar --- */
.school-header-top {
    background: var(--school-header-top-bg, #0f2444);
    color: var(--school-header-top-color, #ffffff);
    font-size: 0.85rem;
    padding: 0.4rem 0;
    display: none; /* Hidden on mobile by default */
}

.school-header-top__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--school-container, 1200px);
    margin: 0 auto;
    padding: 0 24px;
}

.school-header-top__left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.school-header-top__left a,
.school-header-top__right a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.school-header-top__left a:hover,
.school-header-top__right a:hover {
    color: var(--school-secondary);
}

.school-header-top__right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.school-header-top__social {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.school-header-top__social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.85);
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.school-header-top__social a:hover {
    background: var(--school-secondary);
    color: #fff;
}

/* --- Row 2: Logo + School Name --- */
.school-header-main {
    background: var(--school-header-main-bg, #ffffff);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    position: relative;
    z-index: 100;
}

.school-header-main__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--school-container, 1200px);
    margin: 0 auto;
    padding: 0.75rem 24px;
}

.school-header-main__brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
}

.school-header-main__logo img {
    max-height: 60px;
    width: auto;
    display: block;
}

.school-header-main__school-name {
    display: flex;
    flex-direction: column;
}

.school-header-main__name {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--school-primary);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.school-header-main__tagline {
    font-size: 0.8rem;
    color: #888;
    font-weight: 400;
    line-height: 1.3;
}

/* --- Row 3: Navigation + Apply Button --- */
.school-header-nav {
    background: var(--school-primary);
    position: relative;
    z-index: 99;
}

.school-header-nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--school-container, 1200px);
    margin: 0 auto;
    padding: 0 24px;
}

.school-header-nav__menu {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}

.school-header-nav__menu li {
    position: relative;
    margin: 0;
}

.school-header-nav__menu a {
    display: block;
    padding: 0.85rem 1.25rem;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.school-header-nav__menu a:hover,
.school-header-nav__menu .current-menu-item > a {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.school-header-nav__cta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.school-header-nav__cta .school-btn {
    padding: 0.5em 1.25em;
    font-size: 0.85rem;
    background: var(--school-secondary);
    border-color: var(--school-secondary);
    color: #fff;
    border-radius: 6px;
}

.school-header-nav__cta .school-btn:hover {
    background: #fff;
    color: var(--school-primary);
    border-color: #fff;
}

/* --- Mobile Toggle --- */
.school-header__toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
}

/* =============================================
 * Sticky Header
 * ============================================= */
.school-header.is-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    animation: school-header-slide-down 0.3s ease;
}

.school-header.is-sticky .school-header-top {
    display: none;
}

.school-header.is-sticky .school-header-main {
    box-shadow: var(--school-header-sticky-shadow, 0 4px 20px rgba(0,0,0,0.1));
}

.school-header.is-sticky .school-header-main__logo img {
    max-height: 45px;
}

.school-header.is-sticky .school-header-main__name {
    font-size: 1.1rem;
}

.school-header.is-sticky .school-header-main__tagline {
    display: none;
}

.school-header.is-sticky .school-header-nav {
    display: none;
}

@keyframes school-header-slide-down {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Sticky header spacer to prevent content jump */
.school-header-spacer {
    display: none;
}

body.has-sticky-header .school-header-spacer {
    display: block;
}

/* =============================================
 * Header / branding area (Astra overrides)
 * ============================================= */
.site-branding .school-logo img {
    max-height: 80px;
    width: auto;
}

.ast-sticky-active .site-branding .school-logo img {
    max-height: 60px;
}

/* =============================================
 * Full-Width Layout — Remove Astra Sidebar
 * =============================================
 * Forces the homepage to use full available width
 * by removing the right-side empty column.
 */
.school-homepage .ast-container {
    max-width: 1200px;
    width: 100%;
    padding: 0 24px;
    margin: 0 auto;
}

.school-homepage .content-area {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.school-homepage .site-content .ast-container {
    max-width: 100% !important;
    padding: 0 !important;
}

.school-homepage .ast-sidebar,
.school-homepage #secondary,
.school-homepage .widget-area {
    display: none !important;
}

/* Ensure no Astra default padding/margins interfere */
.school-homepage .site-content {
    padding: 0 !important;
    margin: 0 !important;
}

.school-homepage .ast-row {
    margin: 0 !important;
}

.school-homepage .ast-article-single {
    padding: 0 !important;
    margin: 0 !important;
}

/* =============================================
 * Smooth scroll
 * ============================================= */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =============================================
 * Responsive — Mobile Header
 * ============================================= */
@media (max-width: 768px) {
    .school-header-top {
        display: none !important;
    }

    .school-header-main__inner {
        padding: 0.5rem 16px;
    }

    .school-header-main__logo img {
        max-height: 45px;
    }

    .school-header-main__name {
        font-size: 1.1rem;
    }

    .school-header-main__tagline {
        display: none;
    }

    .school-header-nav__menu {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background: var(--school-primary);
        box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    }

    .school-header-nav__menu.is-open {
        display: flex;
    }

    .school-header-nav__menu a {
        padding: 0.75rem 1.25rem;
        border-top: 1px solid rgba(255,255,255,0.1);
    }

    .school-header__toggle {
        display: block;
    }

    .school-header-nav__cta .school-btn {
        padding: 0.4em 1em;
        font-size: 0.8rem;
    }

    .school-header-nav__inner {
        padding: 0 16px;
    }
}

@media (min-width: 769px) {
    .school-header-top {
        display: block !important;
    }
}

/* =============================================
 * Premium Footer
 * ============================================= */
.school-footer {
    background: var(--school-footer-bg, #0f2444);
    color: var(--school-footer-text, #ffffff);
    font-family: var(--school-font-primary);
}

.school-footer__main {
    padding: 4rem 0 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.school-footer__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

.school-footer__brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.school-footer__logo-img {
    max-height: 60px;
    width: auto;
    filter: brightness(0) invert(1);
}

.school-footer__school-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}

.school-footer__desc {
    color: rgba(255,255,255,0.65);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    max-width: 320px;
}

.school-footer__social-links {
    display: flex;
    gap: 0.75rem;
}

.school-footer__social-links .school-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.85);
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.school-footer__social-links .school-social-link:hover {
    background: var(--school-secondary);
    color: #fff;
    transform: translateY(-3px);
}

.school-footer__title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1.25rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.school-footer__title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--school-secondary);
    border-radius: 2px;
}

.school-footer__menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.school-footer__menu li {
    margin-bottom: 0.6rem;
}

.school-footer__menu a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.school-footer__menu a::before {
    content: '›';
    font-size: 1.2rem;
    color: var(--school-secondary);
    transition: transform 0.2s ease;
}

.school-footer__menu a:hover {
    color: var(--school-secondary);
    transform: translateX(4px);
}

.school-footer__contact {
    list-style: none;
    margin: 0;
    padding: 0;
}

.school-footer__contact-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: rgba(255,255,255,0.7);
    font-size: 0.95rem;
    line-height: 1.5;
}

.school-footer__contact-item .dashicons {
    color: var(--school-secondary);
    font-size: 1.2rem;
    width: auto;
    height: auto;
    margin-top: 2px;
    flex-shrink: 0;
}

.school-footer__contact-item a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color 0.2s ease;
}

.school-footer__contact-item a:hover {
    color: var(--school-secondary);
}

.school-footer__map-placeholder {
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: rgba(255,255,255,0.4);
    font-size: 0.85rem;
}

.school-footer__map-placeholder .dashicons {
    font-size: 2.5rem;
    width: auto;
    height: auto;
}

/* Footer Bottom Bar */
.school-footer__bottom {
    padding: 1.25rem 0;
    background: rgba(0,0,0,0.2);
}

.school-footer__bottom-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

.school-footer__copyright {
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    margin: 0;
}

.school-footer__credit {
    color: rgba(255,255,255,0.4);
    font-size: 0.8rem;
    margin: 0;
}

.school-footer__credit a {
    color: var(--school-secondary);
    text-decoration: none;
}

.school-footer__credit a:hover {
    text-decoration: underline;
}

/* Footer Responsive */
@media (min-width: 768px) {
    .school-footer__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .school-footer__bottom-inner {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

@media (min-width: 1024px) {
    .school-footer__grid {
        grid-template-columns: 2fr 1fr 1fr 1.5fr;
    }
}

@media (max-width: 480px) {
    .school-footer__main {
        padding: 2.5rem 0 1.5rem;
    }

    .school-footer__grid {
        gap: 2rem;
    }

    .school-footer__brand {
        flex-direction: column;
        text-align: center;
    }

    .school-footer__desc {
        max-width: 100%;
        text-align: center;
    }

    .school-footer__social-links {
        justify-content: center;
    }

    .school-footer__title::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .school-footer__title {
        text-align: center;
    }

    .school-footer__contact-item {
        justify-content: center;
    }

    .school-footer__menu {
        text-align: center;
    }
}

/* =============================================
 * Gallery Lightbox
 * ============================================= */
.school-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.92);
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.school-lightbox.is-active {
    display: flex;
}

.school-lightbox__img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.school-lightbox__close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.school-lightbox__close:hover {
    opacity: 1;
}

.school-gallery-preview__item {
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.school-gallery-preview__item::after {
    content: '🔍';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 2rem;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2;
}

.school-gallery-preview__item:hover::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.school-gallery-preview__item:hover .school-gallery-preview__img {
    transform: scale(1.08);
}

.school-gallery-preview__img {
    transition: transform 0.4s ease;
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: var(--school-border-radius);
}

/* =============================================
 * Responsive Breakpoints Coverage
 * ============================================= */

/* 1920px+ */
@media (min-width: 1920px) {
    .school-hero__title {
        font-size: 4rem;
    }
    .school-hero {
        min-height: 80vh;
    }
}

/* 1440px */
@media (min-width: 1440px) and (max-width: 1919px) {
    .school-hero__title {
        font-size: 3.5rem;
    }
}

/* 1280px */
@media (min-width: 1280px) and (max-width: 1439px) {
    .school-hero__title {
        font-size: 3rem;
    }
}

/* 1024px */
@media (min-width: 1024px) and (max-width: 1279px) {
    .school-hero__title {
        font-size: 2.8rem;
    }
    .school-hero {
        min-height: 75vh;
    }
    .school-stats__grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
    }
    .school-facilities-preview__grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .school-whyus__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 390px */
@media (max-width: 390px) {
    .school-hero {
        min-height: 45vh;
    }
    .school-hero__title {
        font-size: 1.5rem;
    }
    .school-hero__tagline {
        font-size: 0.9rem;
    }
    .school-hero__actions {
        flex-direction: column;
        align-items: center;
    }
    .school-hero__actions .school-btn {
        width: 100%;
        max-width: 220px;
    }
    .school-stat__number {
        font-size: 1.5rem;
    }
    .school-stat__label {
        font-size: 0.75rem;
    }
    .school-footer__grid {
        gap: 1.5rem;
    }
    .school-footer__school-name {
        font-size: 1.1rem;
    }
}
