/*
Theme Name: CHHSKEL Theme
Theme URI: 
Author: Antigravity
Author URI: 
Description: A custom WordPress theme for Kelantan Chung Hwa Independent High School (吉兰丹中华独立中学). Features professional blue-white scheme, complex multi-level menu, fixed navigation, and custom footer.
Version: 2.0.0
License: GNU General Public License v2 or later
Text Domain: chhskel-theme
*/

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: #000066;
    background-color: #f8f9fd;
    line-height: 1.6;
    padding-top: 80px; /* For fixed nav */
}

a {
    color: #003399;
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #000066;
}

ul {
    list-style: none;
}

/* ==========================================================================
   Header & Fixed Navbar
   ========================================================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background-color: #ffffff;
    box-shadow: 0 4px 6px rgba(0, 0, 102, 0.08); /* lightly tinted shadow */
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
}

.site-branding {
    display: flex;
    align-items: center;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.site-logo img {
    height: 50px;
    width: auto;
}

.site-title-wrap {
    display: flex;
    flex-direction: column;
}

.site-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: #003399;
    margin: 0;
    line-height: 1.2;
}

.site-title-en {
    font-size: 0.75rem;
    color: #666;
    margin: 0;
}

/* ==========================================================================
   Navigation Menu (Level 1 - Main Bar)
   ========================================================================== */
.main-navigation ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Base Top Level UL */
.main-navigation > ul {
    display: flex;
    align-items: stretch;
    height: 80px;
}

/* Top Level LI */
.main-navigation > ul > li {
    position: relative;
    display: flex;
    align-items: center;
}

/* Top Level A */
.main-navigation > ul > li > a {
    display: block;
    padding: 0 15px;
    color: #003399;
    font-weight: 600;
    font-size: 0.95rem;
    position: relative;
    line-height: 80px;
}

/* Arrows for Level 1 */
.main-navigation > ul > li.has-children > a::after {
    content: '▾';
    margin-left: 6px;
    font-size: 0.8em;
}

/* Bottom Line Highlight Animation for top level */
.main-navigation > ul > li > a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #cc0000;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease-in-out;
}
.main-navigation > ul > li:hover > a::before {
    transform: scaleX(1);
    transform-origin: left;
}

/* ==========================================================================
   Sub-Menus (Level 2 & Level 3)
   ========================================================================== */

/* Submenu Containers (L2 and L3) */
.main-navigation ul ul {
    position: absolute;
    background-color: #ffffff;
    box-shadow: 0 10px 20px rgba(0, 0, 102, 0.12);
    min-width: 170px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border-top: 3px solid #003399;
    display: block;
    z-index: 99;
}

/* Dropdown Menu L2 (opens downwards from L1) */
.main-navigation > ul > li > ul {
    top: 100%;
    left: 0;
    transform: translateY(15px);
}

/* Dropdown Menu L3 (opens sideways from L2) */
.main-navigation ul ul ul {
    top: -3px; 
    left: 100%;
    border-top: none;
    border-left: 3px solid #003399;
    transform: translateX(15px);
}

/* Show Submenus on hover */
.main-navigation li:hover > ul {
    opacity: 1;
    visibility: visible;
    transform: translate(0, 0); 
}

/* Submenu LI Items */
.main-navigation ul ul li {
    display: block; 
    width: 100%; 
    position: relative; 
}

/* Submenu Links (A tags inside dropdowns) */
.main-navigation ul ul a {
    display: block; 
    width: 100%; 
    box-sizing: border-box; 
    padding: 12px 20px;
    line-height: normal;
    color: #444;
    border-bottom: 1px solid rgba(0, 51, 153, 0.1);
    font-weight: 500;
    white-space: nowrap; 
    transition: all 0.3s ease;
}

/* Arrows for Level 2 inside Submenus */
.main-navigation ul ul li.has-children > a {
    display: flex;
    justify-content: space-between; 
    align-items: center;
}
.main-navigation ul ul li.has-children > a::after {
    content: '▸';
    font-size: 0.9em;
    margin-left: 10px;
}

/* Hover effects for Submenu Links */
.main-navigation ul ul a:hover {
    background-color: #edf2f6;
    color: #003399;
    padding-left: 25px; 
}

/* Removing border from last item */
.main-navigation ul ul li:last-child > a {
    border-bottom: none;
}

/* Hide bottom line highlight for dropdown links */
.main-navigation ul ul a::before {
    display: none;
}


/* ==========================================================================
   Main Content Area
   ========================================================================== */
.site-main {
    min-height: calc(100vh - 80px - 300px);
    padding: 60px 5%;
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 102, 0.08); /* lightly tinted shadow */
    margin-top: 30px;
    margin-bottom: 30px;
    border-radius: 8px;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    background-color: #003399;
    color: #ffffff;
    padding: 60px 0 20px;
    font-size: 0.9rem;
}

.footer-widgets {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5%;
    gap: 30px;
}

.footer-widget {
    flex: 1;
    min-width: 250px;
}

.footer-widget h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-widget h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: #cc0000;
}

.footer-widget p,
.footer-widget ul {
    margin-bottom: 15px;
    color: #edf2f6;
}

.footer-widget a {
    color: #66ccff;
}

.footer-widget a:hover {
    color: #ff9999;
    text-decoration: underline;
}

.footer-contact li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-contact i {
    width: 20px;
    text-align: center;
}

.footer-map iframe {
    width: 100%;
    height: 200px;
    border: none;
    border-radius: 5px;
}

.site-info {
    text-align: center;
    padding-top: 30px;
    margin-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #a4c8e1;
    font-size: 0.85rem;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 1024px) {
    .site-header {
        flex-direction: column;
        padding: 10px 5%;
        height: auto;
        position: relative;
    }
    
    body {
        padding-top: 0;
    }

    .main-navigation > ul {
        flex-direction: column;
        width: 100%;
        display: none; 
        height: auto;
    }

    .main-navigation a {
        line-height: 3;
    }

    .main-navigation ul ul,
    .main-navigation ul ul ul {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        padding-left: 20px;
        display: none;
    }
}
