/*
Theme Name: Themify Ultra Child
Description: Child theme for Themify Ultra
Author: Themify
Template: themify-ultra
*/

/* write custom css below */

/* ============================================
   School Mobile Menu Styles
   ============================================ */

/* Toggle Button */
#school-mobile-menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 8px;
    z-index: 1001;
    transition: none;
    touch-action: manipulation;
    margin-left: auto; /* Right align */
    margin-right: 0;
}

/* Ensure parent container allows right alignment */
.school-menu-toggle {
    margin-left: auto !important;
    margin-right: 0 !important;
}

#school-mobile-menu-toggle:hover {
    background: none;
    box-shadow: none;
    transform: none;
}

#school-mobile-menu-toggle span {
    display: block;
    height: 2px;
    width: 24px;
    background: #000;
    transition: 0.3s;
    border-radius: 2px;
}

/* Mobile Menu Overlay */
#school-mobile-menu-overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: #fff;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#school-mobile-menu-overlay.active {
    display: block;
}

/* Menu Header with Logo and Close Button */
.school-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e5e5e5;
    position: relative;
}

.school-menu-logo img {
    height: auto;
    max-width: 120px;
    display: block;
}

.school-menu-logo-text {
    font-size: 18px;
    font-weight: 600;
    color: #000;
    display: block;
}

.school-menu-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    transition: opacity 0.2s;
}

.school-menu-close:hover {
    opacity: 0.7;
}

.school-menu-close svg {
    width: 24px;
    height: 24px;
}

/* Menu Content Container */
.school-menu-content {
    padding: 0 20px 20px;
}

/* Navigation Menu */
.school-menu-nav {
    margin: 20px 0;
}

.school-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.school-menu-list li {
    margin: 0;
    padding: 0;
}

.school-menu-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    color: #000;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    border-bottom: 1px solid #f0f0f0;
    transition: color 0.2s;
}

.school-menu-list li.current-menu-item > a,
.school-menu-list li.current_page_item > a {
    color: #0073e6;
}

.school-menu-list a:hover {
    color: #0073e6;
}

/* Submenu Styles */
.school-menu-list .sub-menu {
    display: none;
    list-style: none;
    padding: 0;
    margin: 0;
    padding-left: 20px;
    padding-top: 8px;
    padding-bottom: 8px;
}

.school-menu-list li.menu-item-has-children.open > .sub-menu {
    display: block;
}

.school-menu-list .sub-menu li {
    margin: 0;
}

.school-menu-list .sub-menu a {
    padding: 12px 0;
    font-size: 14px;
    color: #666;
    border-bottom: 1px solid #f5f5f5;
}

.school-menu-list .sub-menu a:hover {
    color: #0073e6;
}

/* Menu Item Icon (Triangle) - Only show for items with children */
.school-menu-list a::after {
    display: none; /* Hide by default */
}

.school-menu-list li.menu-item-has-children > a {
    cursor: pointer;
}

.school-menu-list li.menu-item-has-children > a::after {
    display: block;
    content: '';
    width: 0;
    height: 0;
    border-left: 6px solid #999;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    margin-left: 10px;
    transition: transform 0.3s, border-color 0.2s;
    flex-shrink: 0;
}

.school-menu-list li.menu-item-has-children.open > a::after {
    transform: rotate(90deg);
    border-left-color: #0073e6;
}

.school-menu-list li.menu-item-has-children > a:hover::after,
.school-menu-list li.menu-item-has-children.current-menu-item > a::after {
    border-left-color: #0073e6;
}

/* CTA Buttons Grid */
.school-menu-cta-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 30px 0 20px;
}

.school-cta-btn {
    display: block;
    padding: 14px 16px;
    text-align: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: 4px;
    color: #fff;
    transition: opacity 0.2s, transform 0.1s;
    border: none;
}

.school-cta-btn:active {
    transform: scale(0.98);
}

.school-cta-green {
    background-color: #4CAF50;
}

.school-cta-red {
    background-color: #E53935;
}

.school-cta-orange {
    background-color: #FF9800;
}

.school-cta-purple {
    background-color: #9C27B0;
}

.school-cta-btn:hover {
    opacity: 0.9;
    color: #fff;
}

/* Split Buttons */
.school-menu-split-buttons {
    display: flex;
    margin: 20px 0 30px;
    border-radius: 4px;
    overflow: hidden;
}

.school-split-btn {
    flex: 1;
    padding: 14px 16px;
    text-align: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    transition: opacity 0.2s;
    border: none;
}

.school-split-left {
    background-color: #8B0000;
}

.school-split-right {
    background-color: #E53935;
}

.school-split-btn:hover {
    opacity: 0.9;
    color: #fff;
}

/* Footer with CBSE Info */
.school-menu-footer {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 0;
    border-top: 1px solid #e5e5e5;
    margin-top: 20px;
}

.school-cbse-logo img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.school-cbse-info {
    flex: 1;
}

.school-cbse-label {
    font-size: 11px;
    color: #666;
    margin: 0 0 4px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.school-cbse-number {
    font-size: 16px;
    font-weight: 600;
    color: #000;
    margin: 0;
}

/* Responsive Adjustments */
@media (min-width: 769px) {
    #school-mobile-menu-overlay {
        max-width: 400px;
        right: 0;
        left: auto;
        box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    }
}

/* Prevent body scroll when menu is open */
body.school-menu-open {
    overflow: hidden;
}

/* ============================================
   Desktop Dropdown Menu Styles
   ============================================ */

/* Main Navigation Container - Adjust selector based on your theme */
#main-nav,
.main-nav,
#primary-menu,
.primary-menu,
.main-navigation,
nav ul.menu,
nav ul.nav-menu,
.menu-primary-container,
.wp-block-navigation__container {
    position: relative;
}

/* Dropdown Container - Two Column Layout */
.desktop-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    overflow: hidden;
    z-index: 1000;
    width: 768px;
    max-width: 768px;
    padding: 20px;
    margin-top: 0; /* No space - stick directly to menu */
    box-sizing: border-box;
}

/* Right-aligned dropdown if menu item is near right edge */
.menu-item-has-children:last-child .desktop-dropdown-menu,
.menu-item-has-children:nth-last-child(2) .desktop-dropdown-menu {
    left: auto;
    right: 0;
}

/* Show dropdown on hover */
.menu-item-has-children:hover > .desktop-dropdown-menu,
.menu-item-has-children.open > .desktop-dropdown-menu {
    display: block;
}

/* Two Column Layout */
.desktop-dropdown-content {
    display: flex;
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Left Column - Menu Items (30% width) */
.desktop-dropdown-nav {
    flex: 0 0 calc(30% - 10px);
    list-style: none;
    padding: 0;
    margin: 0;
    padding-right: 10px;
    box-sizing: border-box;
    max-width: calc(30% - 10px);
}

.desktop-dropdown-nav li {
    margin: 0;
    padding: 0;
}

.desktop-dropdown-nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    color: #000;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 4px;
    margin-bottom: 4px;
    position: relative;
}

/* Triangle arrow indicator */
.desktop-dropdown-nav a::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 6px solid #999;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    transition: all 0.3s ease;
    opacity: 0;
}

.desktop-dropdown-nav a:hover::after,
.desktop-dropdown-nav li.active > a::after {
    opacity: 1;
    border-left-color: #0073e6;
    transform: translateX(5px);
}

.simple-menu .desktop-dropdown-nav a:hover::after,
.simple-menu .desktop-dropdown-nav li.active > a::after {
    display: none !important;
}


/* Active/Hover State */
.desktop-dropdown-nav a:hover,
.desktop-dropdown-nav li.active > a {
    background-color: #f5f5f5;
    color: #0073e6;
    padding-left: 20px;
}

.desktop-dropdown-nav li.active > a {
    background-color: #e3f2fd;
    color: #0073e6;
    font-weight: 600;
}

/* Right Column - Image Display (70% width) */
.desktop-dropdown-image {
    flex: 0 0 calc(70% - 10px);

    max-width: calc(70% - 10px);
    width: calc(70% - 10px);
    border-radius: 8px;
    overflow: hidden;
    background: #f9f9f9;
    position: relative;
    box-sizing: border-box;
}

.desktop-dropdown-image img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.4s ease;
    box-sizing: border-box;
}

/* Default image state */
.desktop-dropdown-image .default-image {
    opacity: 1;
}

.desktop-dropdown-image .hover-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.desktop-dropdown-image .hover-image.active {
    opacity: 1;
}

.desktop-dropdown-image .default-image.hidden {
    opacity: 0;
}

/* Menu items without images - simple dropdown */
.desktop-dropdown-menu.simple-menu {
    width: auto;
    min-width: 200px;
    max-width: 300px;
    padding: 10px 0;
}

.desktop-dropdown-menu.simple-menu .desktop-dropdown-nav {
    flex: none;
    width: 100%;
    max-width: 100%;
    padding-right: 0;
    list-style: none;
    padding: 0;
    margin: 0;
}

.desktop-dropdown-menu.simple-menu .desktop-dropdown-nav li {
    margin: 0;
    padding: 0;
}

.desktop-dropdown-menu.simple-menu .desktop-dropdown-nav a {
    display: block;
    padding: 12px 20px;
    color: #000;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.desktop-dropdown-menu.simple-menu .desktop-dropdown-nav a:hover {
    background-color: #f5f5f5;
    color: #0073e6;
}

.desktop-dropdown-menu.simple-menu .desktop-dropdown-image {
    display: none;
}

.desktop-dropdown-menu.simple-menu .desktop-dropdown-content {
    display: none;
}

/* Responsive - Hide on mobile, show on desktop */
@media (max-width: 768px) {
    .desktop-dropdown-menu {
        display: none !important;
    }
}

/* Ensure parent menu item can trigger dropdown */
.menu-item-has-children {
    position: relative;
}

.menu-item-has-children > a {
    position: relative;
}

/* Desktop Menu Container Styles */
.school-desktop-menu-container {
    position: relative;
}

.school-desktop-menu-wrapper {
    position: relative;
}

.school-desktop-nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap; /* Allow menu items to wrap to next line */
    align-items: center;
    gap: 0;
}

.school-desktop-nav-menu li {
    position: relative; /* Restore relative positioning for dropdown */
    margin: 0;
    flex-shrink: 0; /* Prevent items from shrinking */
}

.school-desktop-nav-menu > li > a {
    display: block;
    padding: 12px 20px;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease;
    white-space: nowrap; /* Keep menu item text on one line, but allow item to wrap */
}

.school-desktop-nav-menu > li:hover > a,
.school-desktop-nav-menu > li.current-menu-item > a {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Hide default WordPress submenu on desktop */
@media (min-width: 769px) {
    .menu-item-has-children .sub-menu {
        display: none !important;
    }
    
    .menu-item-has-children:hover .desktop-dropdown-menu,
    .menu-item-has-children.open .desktop-dropdown-menu {
        display: block !important;
    }
}

/* Show default submenu on mobile */
@media (max-width: 768px) {
    .desktop-dropdown-menu {
        display: none !important;
    }
    
    .menu-item-has-children .sub-menu {
        display: block !important;
    }
}

/* Arrow indicator for parent items */
.menu-item-has-children > a::after {
    content: '';
    width: 0;
    height: 0;
    border-top: 5px solid currentColor;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    margin-left: 8px;
    display: inline-block;
    vertical-align: middle;
}

/* Purple border around entire dropdown on hover (optional - matching image style) */
.menu-item-has-children:hover .desktop-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid #9C27B0;
    border-radius: 8px;
    z-index: -1;
    background: #fff;
}

/* Submenu items styling */
.desktop-dropdown-nav .sub-menu {
    display: none;
    list-style: none;
    padding: 0;
    margin: 8px 0 0 20px;
}

.desktop-dropdown-nav .sub-menu li {
    margin-bottom: 4px;
}

.desktop-dropdown-nav .sub-menu a {
    font-size: 14px;
    color: #666;
    padding: 8px 15px;
}

.desktop-dropdown-nav .sub-menu a:hover {
    color: #0073e6;
    background-color: #f0f0f0;
}