/**
 * E-Prime Theme — Builder CSS
 * Off-Canvas, Scroll-to-Top, Sticky Header, Mobile Menu Bar, Responsive
 *
 * @package E-Prime
 */

/* ============================================
   SITE LOGO
   ============================================ */
.site-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
}
.site-logo-image { display:flex; align-items:center; flex-shrink:0; }
.site-logo-image img { display:block; height:auto; transition: all 0.3s ease; }
.site-logo-text { display:flex; flex-direction:column; min-width:0; }
.school-name { font-weight:700; line-height:1.2; display:block; transition: font-size 0.3s ease; }
.school-tagline { display:block; margin-top:2px; transition: font-size 0.3s ease; }

/* ============================================
   HEADER MAIN
   ============================================ */
.header-main .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    transition: min-height 0.3s ease;
}

/* ============================================
   STICKY HEADER — Logo Only (No Menu)
   Uses position:fixed via JS, not CSS sticky
   ============================================ */
.header-main.is-stuck {
    z-index: 1000;
    transition: all 0.3s ease;
}

/* Glass Effect — Frosted glass look on scroll */
.header-main.is-stuck.glass-effect {
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.header-main.is-stuck.glass-fallback {
    /* Fallback for browsers without backdrop-filter */
    background: rgba(255, 255, 255, 0.95) !important;
}

.header-main.is-stuck .school-tagline {
    display: none;
}

.header-main.is-stuck .site-logo {
    gap: 8px;
}

/* Sticky spacer — prevents content jump */
.header-sticky-spacer {
    display: block;
    transition: height 0.3s ease;
}

/* ============================================
   MOBILE MENU BAR — Below header, mobile only
   ============================================ */
.mobile-menu-bar {
    display: none;
    background: var(--primary);
    color: #fff;
    padding: 10px 0;
    position: relative; /* NOT sticky/fixed — scrolls away naturally */
    z-index: 999;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* When header is stuck (sticky), mobile menu bar should NOT be visible */
.mobile-menu-bar.is-hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.mobile-menu-bar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mobile-menu-bar-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* NO icon before text — removed ::before */

.mobile-hamburger {
    background: rgba(255,255,255,0.15) !important;
    border-radius: 6px !important;
    padding: 6px 8px !important;
}

.mobile-hamburger .hamburger-line {
    background: #fff !important;
}

/* ============================================
   HEADER HTML / SHORTCODE
   ============================================ */
.header-custom-html {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.topbar-custom-html {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================
   LAYOUT 2 — Centered Logo
   ============================================ */
.header-main.layout-2 .container {
    flex-direction: column;
    text-align: center;
    gap: 10px;
}
.header-main.layout-2 .site-logo { justify-content: center; }

/* ============================================
   LAYOUT 3 — Logo | Nav Center | Actions Right
   ============================================ */
.header-main.layout-3 .container {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 20px;
}
.header-center-nav { display:flex; align-items:center; justify-content:center; }
.inline-menu { display:flex; align-items:center; list-style:none; margin:0; padding:0; }
.inline-menu li { position:relative; }
.inline-menu li a { display:block; padding:10px 16px; color:var(--text-dark); font-size:0.95rem; font-weight:500; transition:all 0.3s; border-bottom:2px solid transparent; }
.inline-menu li a:hover, .inline-menu li.current-menu-item>a { color:var(--primary); border-bottom-color:var(--primary); }
.inline-menu .sub-menu { position:absolute; top:100%; left:0; min-width:220px; background:var(--bg-white); box-shadow:0 8px 24px rgba(0,0,0,0.12); border-radius:0 0 6px 6px; opacity:0; visibility:hidden; transform:translateY(10px); transition:all 0.3s; z-index:100; }
.inline-menu li:hover>.sub-menu { opacity:1; visibility:visible; transform:translateY(0); }
.inline-menu .sub-menu li a { color:var(--text-dark); padding:10px 16px; border-bottom:1px solid var(--bg-gray); font-size:0.9rem; }
.inline-menu .sub-menu li a:hover { background:var(--primary-light); color:var(--primary); }
.header-actions { display:flex; align-items:center; gap:15px; }
.header-actions .header-search input { padding:8px 14px; border:2px solid var(--bg-gray); border-radius:20px; background:var(--bg-light); color:var(--text-dark); font-size:0.85rem; width:180px; }
.header-actions .header-search button { position:absolute; right:4px; top:50%; transform:translateY(-50%); background:none; border:none; color:var(--text-medium); cursor:pointer; padding:4px 8px; }

/* ============================================
   LAYOUT 4 — Full Width Nav
   ============================================ */
.header-main.layout-4 .container { flex-direction:column; gap:0; }
.header-main.layout-4 .site-logo { justify-content:center; margin-bottom:8px; }

/* ============================================
   OFF-CANVAS MENU (transform-only positioning)
   ============================================ */
.offcanvas-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}
.offcanvas-overlay.active {
    opacity: 1;
    visibility: visible;
}

.offcanvas-menu {
    position: fixed;
    top: 0;
    height: 100%;
    z-index: 9999;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-overflow-scrolling: touch;
    box-shadow: 4px 0 25px rgba(0,0,0,0.15);
}

.offcanvas-menu.offcanvas-left {
    left: 0;
    transform: translateX(-100%);
}
.offcanvas-menu.offcanvas-right {
    right: 0;
    transform: translateX(100%);
}
.offcanvas-menu.active {
    transform: translateX(0) !important;
}

/* Off-Canvas Header */
.offcanvas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--bg-gray);
    min-height: 60px;
}
.offcanvas-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}
.offcanvas-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.3rem;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 10;
    position: relative;
    min-width: 36px;
    min-height: 36px;
}
.offcanvas-close:hover {
    background: var(--bg-gray);
}
.offcanvas-close:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.offcanvas-menu-title {
    padding: 15px 20px;
    font-weight: 700;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--bg-gray);
}

/* Off-Canvas Nav */
.offcanvas-body {
    padding: 10px 0;
}
.offcanvas-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}
.offcanvas-nav li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    cursor: pointer;
}
.offcanvas-nav li a:hover {
    padding-left: 24px;
}
.offcanvas-nav .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: none;
}
.offcanvas-nav .sub-menu.open {
    display: block;
}

/* ── Off-Canvas Chevron Icon (real <i> tag via JS, not CSS pseudo-element) ── */
.offcanvas-nav .menu-item-has-children > a .oc-chevron {
    font-size: 0.75rem;
    margin-left: auto;
    padding-left: 8px;
    transition: transform 0.25s ease;
    color: inherit;
    opacity: 0.7;
    flex-shrink: 0;
}
.offcanvas-nav .menu-item-has-children.open > a .oc-chevron {
    transform: rotate(180deg);
    opacity: 1;
}

/* Hide old CSS pseudo-element chevron (if any) */
.offcanvas-nav .menu-item-has-children > a::after {
    display: none !important;
}

.offcanvas-custom-html {
    padding: 20px;
    border-top: 1px solid var(--bg-gray);
    margin-top: 10px;
}

/* Hamburger Button */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 10;
}
.hamburger-line {
    display: block;
    width: 26px;
    height: 3px;
    border-radius: 2px;
    background: currentColor;
    transition: all 0.3s ease;
}
.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}
.hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}
.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* ============================================
   SCROLL TO TOP
   ============================================ */
.back-to-top {
    position: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}
.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* ============================================
   FOOTER GRID
   ============================================ */
.footer-grid { display:grid; }

/* ── Footer Above — Widget row above main footer ── */
.footer-above {
    padding: 20px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-above-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}
.footer-above .widget {
    margin-bottom: 0;
    flex: 1;
    min-width: 200px;
}

/* ── Footer Bottom Bar — Flexible layout ── */
.footer-bottom-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
}
.footer-bottom-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 18px;
    flex-wrap: wrap;
}
.footer-bottom-menu li a {
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
    transition: color 0.3s;
}
.footer-bottom-menu li a:hover {
    color: #fff;
}

/* ============================================
   RESPONSIVE — 3-Tier: Mobile / Tablet / Desktop
   ============================================ */

/* ── TABLET (769px – 1024px) ── */
@media (min-width: 769px) and (max-width: 1024px) {
    .mobile-menu-bar { display: none !important; }
    .offcanvas-menu { display: none !important; }
    .offcanvas-overlay { display: none !important; }
    .hamburger-btn { display: none !important; }
    .footer-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .header-center-nav { display: none !important; }
    .header-actions { display: none !important; }
    .header-main.layout-3 .container { display: flex; justify-content: space-between; }
    .header-html-after-nav { display: none; }
    .header-html-before-nav { display: none; }
}

/* ── MOBILE (≤768px) ── */
@media (max-width: 768px) {
    .mobile-menu-bar { display: block; }
    .main-navigation { display: none !important; }
    .header-html-before-nav { display: none; }
    .header-html-after-nav { display: none; }
    .hamburger-btn { display: flex; }
    .site-logo { gap: 8px; }
    .top-bar .container { flex-direction: column; gap: 8px; text-align: center; }
    .top-bar-left, .top-bar-right { justify-content: center; flex-wrap: wrap; }
    .footer-grid { grid-template-columns: 1fr !important; }
}

/* ── DESKTOP (≥769px) — Hide offcanvas & mobile bar ── */
@media (min-width: 769px) {
    .mobile-menu-bar { display: none !important; }
    /* Hamburger in header is always hidden on desktop (handled by mobile-menu-bar on mobile) */
    .site-header .hamburger-btn { display: none !important; }
    .offcanvas-menu { display: none !important; }
    .offcanvas-overlay { display: none !important; }
}

/* ============================================
   FOOTER WIDGETS
   ============================================ */
.footer-col .widget { margin-bottom:0; }
.footer-col .widget-title { font-size:1.05rem; margin-bottom:18px; padding-bottom:10px; display:inline-block; }
.footer-col .widget ul li { padding:8px 0; border-bottom:1px solid rgba(255,255,255,0.05); }
.footer-col .widget ul li a:hover { padding-left:5px; }

/* ============================================
   FOOTER BOTTOM BAR
   ============================================ */
.footer-bottom { padding:20px 0; }
.footer-bottom p { margin:0; font-size:0.85rem; }
.footer-bottom a { color:var(--primary); }

/* ============================================
   FOOTER RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .footer-col { text-align: center; }
    .footer-col h3 { display: block; }
    .footer-social { justify-content: center; }
    .footer-contact li { justify-content: center; }
}

@media (max-width: 768px) {
    .footer-bottom { padding: 15px 0; }
