/* Tamil Phonics compact responsive header - 2026-09-04 */
.tp-top-contact {
    position: relative;
    z-index: 1101;
    min-height: 34px;
    color: #fff;
    background: #073f91;
    font-family: "Hind Madurai", "Manrope", sans-serif;
}

.tp-top-contact-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 34px;
    font-size: 12px;
    font-weight: 600;
}

.tp-top-contact-links,
.tp-top-link {
    display: flex;
    align-items: center;
}

.tp-top-contact-links { gap: 18px; }
.tp-top-link { gap: 6px; color: inherit; text-decoration: none; }
.tp-top-link:hover { color: #ffd166; }
.tp-whatsapp .tp-top-icon { color: #53dc8c; }

.tp-site-header {
    position: sticky;
    top: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 122px;
    padding: 0 clamp(18px, 4vw, 72px);
    border-bottom: 1px solid #e5eaf2;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 5px 22px rgba(8, 42, 91, .06);
}

.tp-brand-row {
    display: flex;
    flex: 0 0 650px;
    align-items: center;
    justify-content: space-between;
    width: auto !important;
    max-width: none !important;
    min-width: 0;
    margin: 0 !important;
    padding: 8px 0 !important;
}

.tp-brand {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
    color: #073f91;
    text-decoration: none;
}

.tp-brand-logo {
    flex: 0 0 auto;
    width: 110px !important;
    height: 110px !important;
    object-fit: contain;
}

.tp-brand-text { display: grid; min-width: 0; line-height: 1.15; }
.tp-brand-title-ta {
    overflow: visible;
    max-width: none;
    color: #073f91;
    font-family: "Hind Madurai", sans-serif;
    font-size: clamp(20px, 1.5vw, 28px);
    font-weight: 700;
    text-overflow: clip;
    white-space: nowrap;
}
.tp-brand-title-en { margin-top: 4px; color: #133c78; font-size: 13px; font-weight: 700; }
.tp-brand-tagline { margin-top: 4px; color: #0096a6; font-size: 11px; font-weight: 700; }

.tp-nav-bar {
    flex: 1 1 auto;
    min-width: 0;
    border: 0 !important;
    background: transparent !important;
}

.tp-nav-container {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.tp-main-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
    width: 100%;
}

.tp-nav-link,
.tp-course-button {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 9px 7px;
    border: 0;
    border-radius: 9px;
    color: #10254a;
    background: transparent;
    font-family: "Hind Madurai", sans-serif;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.tp-nav-link:hover,
.tp-nav-link:focus-visible,
.tp-course-button:hover,
.tp-course-button:focus-visible { color: #073f91; background: #eef5ff; }

.tp-course-nav { position: relative; }
.tp-nav-arrow { margin-left: 5px; transition: transform .2s ease; }
.tp-course-nav.is-open .tp-nav-arrow { transform: rotate(180deg); }

/* The existing course-menu.php outputs this class. */
.courses-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    z-index: 1210;
    width: min(760px, calc(100vw - 40px));
    max-height: 70vh;
    overflow: auto;
    padding: 18px;
    border: 1px solid #dce5f1;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 20px 48px rgba(9, 42, 88, .18);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, -8px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}
.tp-course-nav:hover .courses-dropdown-menu,
.tp-course-nav:focus-within .courses-dropdown-menu,
.tp-course-nav.is-open .courses-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.tp-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 1px solid #d8e1ef;
    border-radius: 11px;
    color: #073f91;
    background: #fff;
    font-size: 25px;
    cursor: pointer;
}

.account-menu { position: relative; margin-left: 4px; }
.account-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 9px 12px;
    border: 0;
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(135deg, #073f91, #135bb2);
    box-shadow: 0 8px 20px rgba(7, 63, 145, .18);
    font-family: "Hind Madurai", sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.account-button-en { font-family: "Manrope", sans-serif; font-size: 10px; opacity: .82; }
.account-icon { display: inline-flex; width: 19px; height: 19px; }
.account-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; }
.account-arrow { transition: transform .2s ease; }
.account-menu.is-open .account-arrow { transform: rotate(180deg); }

.account-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: 1200;
    display: block;
    width: 310px;
    padding: 10px;
    border: 1px solid #dce5f1;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 20px 48px rgba(9, 42, 88, .18);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}
.account-menu.is-open .account-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}
.account-dropdown-heading { padding: 8px 10px 10px; color: #073f91; font-weight: 700; }
.account-dropdown-heading small { color: #64748b; font-family: "Manrope", sans-serif; font-size: 11px; }
.account-dropdown > a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px;
    border-radius: 10px;
    color: #12284c;
    text-decoration: none;
}
.account-dropdown > a:hover { background: #eef7fa; }
.role-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #e9f7f6; }
.account-dropdown strong,
.account-dropdown small { display: block; }
.account-dropdown strong { font-size: 14px; }
.account-dropdown small { color: #64748b; font-family: "Manrope", sans-serif; font-size: 11px; }

@media (max-width: 1500px) {
    .tp-site-header { padding-inline: 20px; }
    .tp-brand-row { flex-basis: 555px; }
    .tp-brand-title-ta { font-size: 22px; }
    .tp-nav-link,
    .tp-course-button { padding-inline: 5px; font-size: 13px; }
    .account-button { padding-inline: 10px; }
    .account-button-en { display: none; }
}

@media (max-width: 1280px) {
    .tp-site-header { padding-inline: 24px; }
    .tp-brand-row { flex-basis: 440px; min-width: 0; }
    .tp-brand-logo { width: 94px !important; height: 94px !important; }
    .tp-brand-title-ta {
        max-width: 325px;
        overflow: visible;
        font-size: 18px;
        line-height: 1.25;
        text-overflow: clip;
        white-space: normal;
    }
    .tp-brand-title-en,
    .tp-brand-tagline { display: none; }
    .tp-nav-link,
    .tp-course-button { padding-inline: 8px; font-size: 14px; }
    .account-button-en { display: none; }
}

@media (max-width: 1000px) {
    .tp-top-contact-links { gap: 10px; }
    .tp-top-contact-links .tp-top-link span:last-child { display: none; }

    .tp-site-header {
        display: block;
        min-height: 76px;
        padding: 0;
    }
    .tp-brand-row {
        width: min(100% - 28px, 1180px) !important;
        min-width: 0;
        margin-inline: auto !important;
        padding: 7px 0 !important;
    }
    .tp-brand-logo { width: 75px !important; height: 75px !important; }
    .tp-brand-title-ta { max-width: 54vw; font-size: 17px; }
    .tp-menu-toggle { display: inline-flex !important; }
    .tp-menu-toggle.is-active { color: #fff; background: #073f91; }

    .tp-nav-bar { position: relative; }
    .tp-main-nav {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1150;
        display: none !important;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        max-height: calc(100vh - 76px);
        overflow-y: auto;
        padding: 12px 14px 18px;
        border-top: 1px solid #e4eaf2;
        background: #fff;
        box-shadow: 0 20px 35px rgba(9, 42, 88, .16);
    }
    .tp-main-nav.open,
    .tp-main-nav.is-open { display: flex !important; }
    .tp-nav-link,
    .tp-course-button { justify-content: space-between; width: 100%; min-height: 46px; padding: 12px 14px; font-size: 15px; }
    .tp-course-nav { width: 100%; }
    .courses-dropdown-menu {
        position: static;
        display: none;
        width: 100%;
        max-height: none;
        padding: 10px;
        border: 0;
        border-radius: 10px;
        background: #f4f8fc;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none;
    }
    .tp-course-nav.is-open .courses-dropdown-menu { display: block; transform: none; }
    .courses-dropdown-grid { grid-template-columns: 1fr !important; }

    .account-menu { width: 100%; margin: 4px 0 0; }
    .account-button { justify-content: flex-start; width: 100%; min-height: 48px; padding: 12px 14px; }
    .account-button-en { display: inline; }
    .account-arrow { margin-left: auto; }
    .account-dropdown {
        position: static;
        display: none;
        width: 100%;
        margin-top: 4px;
        padding: 7px;
        border: 0;
        border-radius: 10px;
        background: #f4f8fc;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none;
    }
    .account-menu.is-open .account-dropdown { display: block; }
}

@media (max-width: 600px) {
    .tp-top-message { font-size: 11px; }
    .tp-top-contact-links { display: none; }
    .tp-brand-title-ta { display: none; }
    .tp-brand-row { min-height: 82px; }
    .tp-brand-logo { width: 72px !important; height: 72px !important; }
}
