/**
 * IISc Divi Navigation - Main Stylesheet
 * Version: 1.0.0
 * EXACT COPY FROM HTML VERSION
 */

/* Google Fonts - loaded via PHP */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;600;700&family=Source+Sans+3:wght@400;500;600;700&display=swap');

/* ============================================
   CSS RESET & BASE STYLES
============================================ */
.iisc-nav-wrapper *,
.iisc-nav-wrapper *::before,
.iisc-nav-wrapper *::after,
.iisc-header *,
.iisc-header *::before,
.iisc-header *::after,
.iisc-mobile-nav *,
.iisc-mobile-nav *::before,
.iisc-mobile-nav *::after,
.iisc-mobile-overlay *,
.iisc-mobile-overlay *::before,
.iisc-mobile-overlay *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* IISc Brand Colors */
    --iisc-blue: #003366;
    --iisc-blue-dark: #002244;
    --iisc-orange: #E86A33;
    --iisc-orange-hover: #d55a25;
    --iisc-gold: #C9A227;
    
    /* Neutral Colors */
    --white: #ffffff;
    --off-white: #f8f9fa;
    --gray-100: #f1f3f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    
    /* Typography */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Spacing */
    --nav-height: 60px;
    --header-height: 80px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.iisc-header a,
.iisc-mobile-nav a {
    text-decoration: none;
    color: inherit;
}

.iisc-header button,
.iisc-mobile-nav button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

.iisc-header ul,
.iisc-header ol,
.iisc-mobile-nav ul,
.iisc-mobile-nav ol {
    list-style: none;
}

.iisc-header img,
.iisc-mobile-nav img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   HEADER SECTION
============================================ */
.iisc-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 1000;
    font-family: var(--font-body);
    line-height: 1.6;
}

.header-top {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none !important;
}

.logo-section:hover {
    text-decoration: none !important;
}

.logo-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--iisc-blue) 0%, var(--iisc-blue-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-icon svg {
    width: 36px;
    height: 36px;
    fill: var(--white);
    color: var(--white);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--iisc-blue);
    line-height: 1.2;
}

.logo-subtitle {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--iisc-orange);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-widget-area {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 1rem;
}

.header-widget-area a {
    color: inherit;
    text-decoration: none;
}

/* Responsive: hide widget area on mobile */
@media (max-width: 767px) {
    .header-widget-area {
        display: none;
    }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-box {
    display: none;
    align-items: center;
    background: var(--gray-100);
    border-radius: 25px;
    padding: 0.5rem 1rem;
    gap: 0.5rem;
    transition: var(--transition-fast);
}

.search-box:focus-within {
    background: var(--white);
    box-shadow: 0 0 0 2px var(--iisc-blue);
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.9rem;
    width: 180px;
    font-family: inherit;
}

.search-box svg {
    width: 18px;
    height: 18px;
    color: var(--gray-500);
    flex-shrink: 0;
}

.btn-search {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--iisc-orange);
    color: var(--white);
    border-radius: 50%;
    transition: var(--transition-fast);
}

.btn-search:hover {
    background: var(--iisc-orange-hover);
    transform: scale(1.05);
}

.btn-search svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   NAVIGATION BAR
============================================ */
.nav-wrapper {
    background: linear-gradient(180deg, var(--iisc-blue) 0%, var(--iisc-blue-dark) 100%);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Mobile Menu Toggle */
.mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: var(--white);
    border-radius: 8px;
    transition: var(--transition-fast);
    margin: 0.5rem 0;
}

.mobile-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-toggle svg {
    width: 24px;
    height: 24px;
}

.mobile-toggle .icon-close {
    display: none;
}

.mobile-toggle.active .icon-menu {
    display: none;
}

.mobile-toggle.active .icon-close {
    display: block;
}

/* Main Navigation */
.main-nav {
    display: none;
    flex: 1;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-list {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-item {
    position: relative;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 1rem 1.25rem;
    color: var(--white);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition-fast);
    white-space: nowrap;
    text-decoration: none !important;
}

.nav-link:hover,
.nav-link:focus,
.nav-item:hover > .nav-link,
.nav-item.active > .nav-link {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    text-decoration: none !important;
}

.nav-link.highlight {
    background: var(--iisc-orange);
}

.nav-link.highlight:hover {
    background: var(--iisc-orange-hover);
}

.nav-link svg {
    width: 14px;
    height: 14px;
    transition: transform var(--transition-fast);
}

.nav-item:hover > .nav-link svg,
.nav-item.active > .nav-link svg {
    transform: rotate(180deg);
}

/* ============================================
   DROPDOWN MENUS
============================================ */
.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--white);
    border-radius: 0 0 12px 12px;
    box-shadow: var(--shadow-xl);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-normal);
    z-index: 100;
    border-top: 3px solid var(--iisc-orange);
    
    /* NO SCROLL - let it expand */
    max-height: none;
    overflow: visible;
}

.nav-item:hover > .dropdown,
.nav-item.active > .dropdown,
.nav-item.touch-active > .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-inner {
    padding: 0.75rem 0;
}

.dropdown-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.5rem;
    color: var(--gray-700);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
    text-decoration: none !important;
    border-left: 3px solid transparent;
    white-space: nowrap;
}

.dropdown-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, rgba(0,51,102,0.08) 0%, transparent 100%);
    transition: width var(--transition-fast);
}

.dropdown-link:hover {
    background: var(--gray-100);
    color: var(--iisc-blue);
    padding-left: 1.75rem;
    border-left-color: var(--iisc-orange);
    text-decoration: none !important;
}

.dropdown-link:hover::before {
    width: 100%;
}

.dropdown-link svg {
    width: 14px;
    height: 14px;
    opacity: 0;
    transform: translateX(-5px);
    transition: all var(--transition-fast);
    color: var(--iisc-orange);
}

.dropdown-link:hover svg {
    opacity: 1;
    transform: translateX(0);
}

/* ═══════════════════════════════════════════════════════
   3RD-LEVEL CASCADING SUBMENU (FLYOUT TO RIGHT)
   ═══════════════════════════════════════════════════════ */

/* Parent link with children - show orange arrow always */
.dropdown-link--has-children {
    font-weight: 600;
}

.dropdown-link--has-children .dropdown-arrow-right {
    opacity: 1 !important;
    transform: translateX(0) !important;
    color: var(--iisc-orange);
}

/* Wrapper div that contains both the parent link AND the submenu */
.dropdown-item-has-submenu {
    position: relative;
}

/* The 3rd-level submenu - appears to the RIGHT */
.dropdown-submenu {
    position: absolute;
    top: 0;
    left: 100%;
    min-width: 220px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.1);
    border-left: 3px solid var(--iisc-orange);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: all 0.2s ease;
    z-index: 200;
    padding: 0.5rem 0;
    margin-left: 0;
}

/* Show submenu when hovering the wrapper */
.dropdown-item-has-submenu:hover > .dropdown-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Highlight parent when hovering */
.dropdown-item-has-submenu:hover > .dropdown-link--has-children {
    background: var(--gray-100);
    color: var(--iisc-orange);
    border-left-color: var(--iisc-orange);
}

/* Submenu links styling */
.dropdown-submenu .dropdown-link {
    font-size: 0.85rem;
    padding: 0.75rem 1.25rem;
    color: var(--gray-600);
    border-left: none;
}

.dropdown-submenu .dropdown-link::before {
    display: none;
}

.dropdown-submenu .dropdown-link:hover {
    background: var(--gray-100);
    color: var(--iisc-blue);
    padding-left: 1.5rem;
}

.dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 0.5rem 1rem;
}

.dropdown-header {
    padding: 0.75rem 1.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
}

/* Mega Dropdown - For Admission */
.dropdown.mega {
    min-width: 500px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    /* inherit max-height & overflow-y:auto from .dropdown */
}

.nav-item:hover > .dropdown.mega,
.nav-item.active > .dropdown.mega,
.nav-item.touch-active > .dropdown.mega {
    transform: translateX(-50%) translateY(0);
}

.mega-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.mega-column {
    padding: 1.25rem 0;
    position: relative;
}

.mega-column:first-child {
    border-right: 1px solid var(--gray-200);
}

.mega-column:first-child::after {
    content: '';
    position: absolute;
    right: 0;
    top: 1.25rem;
    bottom: 1.25rem;
    width: 1px;
    background: linear-gradient(180deg, transparent 0%, var(--gray-300) 20%, var(--gray-300) 80%, transparent 100%);
}

.mega-title {
    padding: 0.65rem 1.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--iisc-blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.mega-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: linear-gradient(180deg, var(--iisc-orange) 0%, var(--iisc-orange-hover) 100%);
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(232,106,51,0.3);
}

/* ============================================
   MOBILE NAVIGATION
============================================ */
.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 85vw;
    max-width: 320px;
    height: 100%;
    background: var(--white);
    z-index: 999;
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    font-family: var(--font-body);
}

.mobile-nav.active {
    transform: translateX(0);
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--iisc-blue);
    position: sticky;
    top: 0;
    z-index: 10;
}

.mobile-nav-title {
    color: var(--white);
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
}

.mobile-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--white);
    border-radius: 8px;
    transition: var(--transition-fast);
}

.mobile-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

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

.mobile-nav-list {
    padding: 1rem 0;
    margin: 0;
    list-style: none;
}

.mobile-nav-item {
    border-bottom: 1px solid var(--gray-200);
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    transition: var(--transition-fast);
    text-decoration: none !important;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
}

.mobile-nav-link:hover {
    background: var(--gray-100);
    color: var(--iisc-blue);
    text-decoration: none !important;
}

.mobile-nav-link svg {
    width: 20px;
    height: 20px;
    color: var(--gray-400);
    transition: transform var(--transition-fast);
}

.mobile-nav-item.active > .mobile-nav-link svg {
    transform: rotate(180deg);
}

.mobile-dropdown {
    display: none;
    background: var(--gray-100);
    padding: 0.5rem 0;
}

.mobile-nav-item.active > .mobile-dropdown {
    display: block;
}

.mobile-dropdown-section {
    padding: 0.5rem 0;
}

.mobile-dropdown-title {
    padding: 0.5rem 2rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--iisc-orange);
}

.mobile-dropdown-link {
    display: block;
    padding: 0.75rem 2.5rem;
    font-size: 0.95rem;
    color: var(--gray-600);
    transition: var(--transition-fast);
    text-decoration: none !important;
}

.mobile-dropdown-link:hover {
    background: var(--gray-200);
    color: var(--iisc-blue);
    text-decoration: none !important;
}

/* ── 3rd-level (and deeper) expandable sub-group ── */
.mobile-sub-item {
    position: relative;
}

.mobile-sub-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    padding: 0.7rem 1.5rem 0.7rem 2rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--iisc-blue);
    background: var(--gray-100);
    border: none;
    border-bottom: 1px solid var(--gray-200);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: var(--transition-fast);
}

/* when the title span is inside the button keep its own style */
.mobile-sub-btn .mobile-dropdown-title {
    padding: 0;
    margin: 0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--iisc-orange);
    font-weight: 700;
    flex: 1;                          /* push arrow to the far right */
}

.mobile-sub-btn svg {
    width: 14px;                      /* small chevron – matches dropdown-link */
    height: 14px;
    color: var(--gray-400);
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

.mobile-sub-btn:hover {
    background: var(--gray-200);
}

/* arrow flips when expanded */
.mobile-sub-item.active > .mobile-sub-btn svg {
    transform: rotate(180deg);
}

/* the nested list – hidden by default, shown when parent is active */
.mobile-sub-dropdown {
    display: none;
    background: var(--gray-100);
    border-left: 3px solid var(--iisc-orange);
    margin-left: 2rem;
}

.mobile-sub-item.active > .mobile-sub-dropdown {
    display: block;
}

/* links inside the sub-dropdown get a little extra left indent */
.mobile-sub-dropdown .mobile-dropdown-link {
    padding-left: 1.25rem;
}

/* Mobile Overlay */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* When mobile menu is open: lock the page behind it but keep the nav scrollable */
body.mobile-menu-active {
    overflow: hidden;          /* stop the page itself from scrolling */
    touch-action: none;        /* prevent pinch/pan on the locked page */
}

/* ============================================
   HERO SECTION (Demo)
============================================ */
.hero {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--iisc-blue) 0%, var(--iisc-blue-dark) 50%, #001a33 100%);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero-content {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    color: var(--white);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    color: var(--white);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    max-width: 700px;
}

.hero-title span {
    color: var(--iisc-orange);
}

.hero-text {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.8);
    max-width: 600px;
    margin-bottom: 2rem;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all var(--transition-fast);
    text-decoration: none !important;
}

.btn-primary {
    background: var(--iisc-orange);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--iisc-orange-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(232, 106, 51, 0.3);
    color: var(--white);
}

.btn-outline {
    background: transparent;
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-outline:hover {
    background: var(--white);
    color: var(--iisc-blue);
    border-color: var(--white);
}

.btn svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
============================================ */

/* Mobile (below 768px) - Prevent horizontal overflow */
@media (max-width: 767px) {
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    .iisc-header {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    .header-top,
    .nav-container {
        overflow-x: hidden;
    }
    
    /* Ensure mobile nav doesn't exceed viewport */
    .mobile-nav {
        width: min(85vw, 320px);
    }
}

/* Tablet and up */
@media (min-width: 768px) {
    .search-box {
        display: flex;
    }

    .btn-search {
        display: none;
    }

    .logo-title {
        font-size: 1.75rem;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .mobile-toggle {
        display: none !important;
    }

    .main-nav {
        display: flex !important;
    }

    .mobile-nav,
    .mobile-overlay {
        display: none !important;
    }

    .nav-link {
        padding: 1.15rem 1rem;
    }

    .hero-content {
        padding: 6rem 2rem;
    }
}

/* ── Laptop / short-viewport tweaks ────────────────────────
   Laptops typically land in 1024-1279 px width AND often have
   a short viewport (720-800 px).  We tighten dropdown padding
   and lower the max-height so scrolling kicks in earlier. */
@media (min-width: 1024px) and (max-height: 860px) {
    .dropdown {
        max-height: calc(100vh - 140px);
    }

    .dropdown-link {
        padding: 0.6rem 1.25rem;
        font-size: 0.85rem;
    }

    .mega-title {
        padding: 0.4rem 1.25rem;
        font-size: 0.8rem;
    }

    .dropdown-header {
        padding: 0.55rem 1.25rem 0.35rem;
    }

    .dropdown-divider {
        margin: 0.35rem 1rem;
    }

    .mega-column {
        padding: 0.75rem 0;
    }
}

/* Large Desktop */
@media (min-width: 1280px) {
    .nav-link {
        padding: 1.15rem 1.5rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .nav-item:hover > .dropdown {
        opacity: 0;
        visibility: hidden;
    }

    .nav-item.touch-active > .dropdown {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .nav-item.touch-active > .dropdown.mega {
        transform: translateX(-50%) translateY(0);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus states for accessibility */
.nav-link:focus-visible,
.dropdown-link:focus-visible,
.mobile-nav-link:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--iisc-orange);
    outline-offset: 2px;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 2rem;
    background: var(--iisc-blue);
    color: var(--white);
    border-radius: 0 0 8px 8px;
    z-index: 10000;
    transition: top var(--transition-fast);
    text-decoration: none !important;
}

.skip-link:focus {
    top: 0;
}

/* ============================================
   DIVI THEME OVERRIDES
============================================ */

/* Reset ALL Divi styles that might conflict */
#main-content .iisc-header,
#et-main-area .iisc-header,
.et-db #et-boc .iisc-header,
body.et-pb-preview .iisc-header,
#page-container .iisc-header {
    font-family: var(--font-body) !important;
    line-height: 1.6 !important;
}

#main-content .nav-link,
#et-main-area .nav-link,
.et-db #et-boc .nav-link,
#page-container .nav-link {
    font-family: var(--font-body) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

#main-content .logo-title,
#et-main-area .logo-title,
.et-db #et-boc .logo-title,
#page-container .logo-title {
    font-family: var(--font-display) !important;
}

/* Fix Divi link colors */
.iisc-header a,
.iisc-header a:hover,
.iisc-header a:focus,
.mobile-nav a,
.mobile-nav a:hover,
.mobile-nav a:focus {
    text-decoration: none !important;
}

.nav-link,
.nav-link:hover,
.nav-link:focus {
    color: var(--white) !important;
}

.dropdown-link,
.dropdown-link:hover {
    color: var(--gray-700) !important;
}

.dropdown-link:hover {
    color: var(--iisc-blue) !important;
}

/* Ensure proper z-index */
.et-l .iisc-header,
.et-fb .iisc-header {
    z-index: 999999 !important;
}

/* Fix for Divi's default padding/margin */
.et_pb_section .iisc-header,
.et_pb_row .iisc-header,
.et_pb_column .iisc-header {
    margin: 0 !important;
    padding: 0 !important;
}

/* Divi Code Module fix */
.et_pb_code .iisc-header {
    width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
}

/* Print styles */
@media print {
    .iisc-header {
        position: static !important;
    }
    
    .mobile-toggle,
    .mobile-nav,
    .mobile-overlay,
    .search-box,
    .btn-search {
        display: none !important;
    }
    
    .main-nav {
        display: flex !important;
    }
}
