/**
 * IH Header + Sub-header styles
 * Extracted from homepage for reuse across all pages.
 */

/* ═══ Variables (subset needed by header) ═══ */
:root {
    --ih-primary: #3b44b5;
    --text-black: #000000;
    --border-dark: #333;
    --radius-btn: 21.5px;
    --radius-pill: 500px;
    --content-max: 1200px;
}

/* ═══ Container ═══ */
.ih-container {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0;
}

@media (max-width: 1200px) {
    .ih-container { padding: 0 30px; }
}

@media (max-width: 768px) {
    .ih-container { padding: 0 16px; }
}
@media (max-width: 480px) {
    .ih-container { padding: 0 12px; }
}

/* ═══ Buttons ═══ */
.ih-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 22px;
    border-radius: var(--radius-btn);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s;
    white-space: nowrap;
    text-decoration: none;
}
.ih-btn:hover { opacity: 0.85; }
.ih-btn--primary { background: var(--ih-primary); color: #fff; }
.ih-btn--outline { background: transparent; color: var(--text-black); border: 1px solid var(--border-dark); }
.ih-btn--pill { border-radius: var(--radius-pill); }
.ih-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ═══ HEADER ═══ */
.ih-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    height: 109px;
    display: flex;
    align-items: center;
    padding: 0 24px;
}
.ih-header .ih-container {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1380px;
}
.ih-header__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    text-decoration: none;
}
.ih-header__logo-mark {
    position: relative;
    width: 57px;
    height: 57px;
    flex-shrink: 0;
}
.ih-header__logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.ih-header__logo-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-black);
}
.ih-header__logo-sub {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-black);
}

.ih-header__nav {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto;
    margin-right: 20px;
}
.ih-header__nav a {
    font-size: 15px;
    font-weight: 400;
    color: var(--text-black);
    transition: color 0.2s;
    white-space: nowrap;
    text-decoration: none;
    position: relative;
}
.ih-header__nav a:hover { color: var(--ih-primary); }

.ih-header__nav a::after,
.ih-subheader__links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--ih-primary);
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.ih-header__nav a:hover::after,
.ih-subheader__links a:hover::after {
    width: 100%;
}

.ih-header__ctas {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.ih-header__ctas .ih-btn { font-size: 15px; padding: 9px 18px; }

button.ih-mobile-toggle,
.ih-header button.ih-mobile-toggle,
.ih-header .ih-mobile-toggle {
    display: none;
    background: transparent !important;
    background-color: transparent !important;
    border: 1.5px solid #e0e0e0 !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin-left: auto;
    position: relative;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    border-radius: 12px !important;
    transition: border-color 0.3s ease, box-shadow 0.3s ease !important;
    z-index: 102;
    -webkit-appearance: none !important;
    appearance: none !important;
    box-shadow: none !important;
    outline: none !important;
}
button.ih-mobile-toggle:hover,
.ih-header button.ih-mobile-toggle:hover {
    border-color: var(--ih-primary) !important;
    box-shadow: 0 2px 8px rgba(59,68,181,0.12) !important;
}
button.ih-mobile-toggle span,
.ih-mobile-toggle span {
    display: block !important;
    width: 20px !important;
    height: 2px !important;
    background: #333 !important;
    background-color: #333 !important;
    border-radius: 2px !important;
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    transition: all 0.35s cubic-bezier(0.16,1,0.3,1) !important;
    margin: 0 !important;
    padding: 0 !important;
}
.ih-mobile-toggle span:nth-child(1) { top: 14px !important; }
.ih-mobile-toggle span:nth-child(2) { top: 21px !important; width: 14px !important; }
.ih-mobile-toggle span:nth-child(3) { top: 28px !important; }

/* Hamburger → X animation */
.ih-mobile-toggle--open span:nth-child(1) {
    top: 21px !important;
    transform: translateX(-50%) rotate(45deg) !important;
    background: var(--ih-primary) !important;
}
.ih-mobile-toggle--open span:nth-child(2) {
    opacity: 0 !important;
    width: 0 !important;
}
.ih-mobile-toggle--open span:nth-child(3) {
    top: 21px !important;
    transform: translateX(-50%) rotate(-45deg) !important;
    background: var(--ih-primary) !important;
}

/* ═══ SUB-HEADER ═══ */
.ih-subheader {
    background: var(--ih-primary);
    height: 71px;
    display: flex;
    align-items: center;
    padding: 0 24px;
}
.ih-subheader__links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
}
.ih-subheader__links a {
    font-size: 18px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    position: relative;
    padding: 8px 16px;
    border-radius: 8px;
    transition: color 0.25s, background-color 0.25s;
}
.ih-subheader__links a:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.12);
}
.ih-subheader__links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.ih-subheader__links a:hover::after {
    transform: translateX(-50%) scaleX(1);
}

/* ═══ Responsive ═══ */
@media (max-width: 1024px) {
    .ih-header__nav { display: none; }
    button.ih-mobile-toggle,
    .ih-header button.ih-mobile-toggle,
    .ih-header .ih-mobile-toggle,
    .ih-mobile-toggle { display: block !important; }
    .ih-header__ctas { margin-left: auto; margin-right: 12px; }
}

@media (max-width: 768px) {
    .ih-header { height: 72px; padding: 0 16px; }
    .ih-header__ctas { display: none; }
    .ih-subheader {
        height: auto;
        min-height: 48px;
        padding: 10px 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
    }
    .ih-subheader::-webkit-scrollbar { display: none; }
    .ih-subheader::after {
        content: '';
        position: sticky;
        right: 0;
        top: 0;
        flex-shrink: 0;
        width: 40px;
        height: 100%;
        background: linear-gradient(to right, transparent, var(--ih-primary));
        pointer-events: none;
    }
    .ih-subheader__links {
        gap: 4px;
        flex-wrap: nowrap;
        padding: 0 16px;
        padding-right: 40px;
    }
    .ih-subheader__links a {
        font-size: 13px;
        white-space: nowrap;
        padding: 6px 12px;
        flex-shrink: 0;
    }
}

/* ═══════════════════════════════════════════
   MOBILE MENU PANEL
   ═══════════════════════════════════════════ */

.ih-mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 101;
    pointer-events: none;
    visibility: hidden;
}
.ih-mobile-menu--open {
    pointer-events: auto;
    visibility: visible;
}

/* Backdrop */
.ih-mobile-menu__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.35s ease;
}
.ih-mobile-menu--open .ih-mobile-menu__backdrop {
    opacity: 1;
}

/* Slide-in Panel */
.ih-mobile-menu__panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(340px, 85vw);
    height: 100%;
    background: #fff;
    box-shadow: -8px 0 40px rgba(0,0,0,0.12);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16,1,0.3,1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.ih-mobile-menu--open .ih-mobile-menu__panel {
    transform: translateX(0);
}

/* Panel Header */
.ih-mobile-menu__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}
.ih-mobile-menu__header .ih-header__logo-mark {
    width: 44px;
    height: 44px;
}
button.ih-mobile-menu__close,
.ih-mobile-menu__close {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    border-radius: 10px !important;
    border: 1.5px solid #e5e7eb !important;
    background: #fff !important;
    background-color: #fff !important;
    color: #495057 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.25s ease !important;
    flex-shrink: 0;
    padding: 0 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    box-shadow: none !important;
}
button.ih-mobile-menu__close:hover,
.ih-mobile-menu__close:hover {
    background: #f8f9fa !important;
    border-color: #ced4da !important;
    transform: rotate(90deg);
}
.ih-mobile-menu__close svg {
    width: 20px !important;
    height: 20px !important;
    stroke-width: 2.5 !important;
}

/* Nav Links */
.ih-mobile-menu__nav {
    display: flex;
    flex-direction: column;
    padding: 12px 0;
    flex-shrink: 0;
}
.ih-mobile-menu__nav a {
    display: flex;
    align-items: center;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 500;
    color: #212529;
    text-decoration: none;
    position: relative;
    transition: background 0.2s ease, color 0.2s ease;
    /* Stagger entrance */
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.35s ease, transform 0.35s ease, background 0.2s ease, color 0.2s ease;
}
.ih-mobile-menu__nav a.ih-mobile-menu__nav-link--visible {
    opacity: 1;
    transform: translateX(0);
}
.ih-mobile-menu__nav a::before {
    content: '';
    width: 3px;
    height: 0;
    background: var(--ih-primary);
    border-radius: 2px;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    transition: height 0.25s cubic-bezier(0.16,1,0.3,1);
}
.ih-mobile-menu__nav a:hover {
    background: rgba(59,68,181,0.04);
    color: var(--ih-primary);
}
.ih-mobile-menu__nav a:hover::before {
    height: 24px;
}

/* Course Tags */
.ih-mobile-menu__courses {
    padding: 8px 24px 20px;
    flex-shrink: 0;
}
.ih-mobile-menu__label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #adb5bd;
    margin-bottom: 12px;
}
.ih-mobile-menu__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.ih-mobile-menu__tags a {
    display: inline-flex;
    padding: 7px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ih-primary);
    background: rgba(59,68,181,0.07);
    text-decoration: none;
    transition: all 0.25s ease;
    white-space: nowrap;
}
.ih-mobile-menu__tags a:hover {
    background: var(--ih-primary);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59,68,181,0.25);
}

/* CTAs */
.ih-mobile-menu__ctas {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px 24px 80px;
    margin-top: auto;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}
.ih-mobile-menu__ctas .ih-btn {
    padding: 13px 22px;
    font-size: 15px;
    border-radius: var(--radius-pill);
}
.ih-mobile-menu__ctas .ih-btn--primary {
    box-shadow: 0 4px 16px rgba(59,68,181,0.3);
}
.ih-mobile-menu__ctas .ih-btn--outline {
    border-color: #dee2e6;
}

/* Hide mobile menu on desktop */
@media (min-width: 1025px) {
    .ih-mobile-menu { display: none; }
}
