/**
 * Site-wide UI polish — load after site-performance.css on every public page.
 * Fixes horizontal scroll jitter, sticky nav scrollbars, table overflow, and CTA layout.
 */

/* —— Prevent horizontal page scroll —— */
html.ha-unified {
    overflow-x: clip;
    max-width: 100%;
}

html.ha-unified body {
    overflow-x: clip;
    max-width: 100%;
    min-width: 0;
}

html.ha-unified main,
html.ha-unified header,
html.ha-unified footer,
html.ha-unified .container,
html.ha-unified .content-card,
html.ha-unified .programs-page__card,
html.ha-unified .programs-catalog {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

html.ha-unified main img,
html.ha-unified main video,
html.ha-unified main iframe,
html.ha-unified main svg:not(.program-showcase-icon svg) {
    max-width: 100%;
}

/* —— Sticky chip / tab strips: no visible scrollbar —— */
html.ha-unified .programs-quick-nav,
html.ha-unified .program-quick-nav,
html.ha-unified .about-quick-nav,
html.ha-unified .infra-quick-nav,
html.ha-unified .hwt-quick-nav,
html.ha-unified .ins-quick-nav,
html.ha-unified .con-quick-nav,
html.ha-unified .programs-filter-bar,
html.ha-unified .programs-pathway-steps,
html.ha-unified .con-intent-tabs,
html.ha-unified .infra-unit-filter {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html.ha-unified .programs-quick-nav::-webkit-scrollbar,
html.ha-unified .program-quick-nav::-webkit-scrollbar,
html.ha-unified .about-quick-nav::-webkit-scrollbar,
html.ha-unified .infra-quick-nav::-webkit-scrollbar,
html.ha-unified .hwt-quick-nav::-webkit-scrollbar,
html.ha-unified .ins-quick-nav::-webkit-scrollbar,
html.ha-unified .con-quick-nav::-webkit-scrollbar,
html.ha-unified .programs-filter-bar::-webkit-scrollbar,
html.ha-unified .programs-pathway-steps::-webkit-scrollbar,
html.ha-unified .con-intent-tabs::-webkit-scrollbar,
html.ha-unified .infra-unit-filter::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

@media (min-width: 992px) {
    html.ha-unified .programs-quick-nav,
    html.ha-unified .program-quick-nav,
    html.ha-unified .about-quick-nav,
    html.ha-unified .infra-quick-nav,
    html.ha-unified .hwt-quick-nav,
    html.ha-unified .ins-quick-nav,
    html.ha-unified .con-quick-nav,
    html.ha-unified .programs-filter-bar,
    html.ha-unified .con-intent-tabs,
    html.ha-unified .infra-unit-filter {
        flex-wrap: wrap !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
    }
}

@media (max-width: 991px) {
    html.ha-unified .programs-quick-nav,
    html.ha-unified .program-quick-nav,
    html.ha-unified .about-quick-nav,
    html.ha-unified .infra-quick-nav,
    html.ha-unified .hwt-quick-nav,
    html.ha-unified .ins-quick-nav,
    html.ha-unified .con-quick-nav,
    html.ha-unified .programs-filter-bar,
    html.ha-unified .con-intent-tabs,
    html.ha-unified .infra-unit-filter {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        padding-bottom: 8px;
    }
}

/* —— Programs pathway & batch strips —— */
html.ha-unified .programs-pathway-steps {
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

html.ha-unified .programs-batch-strip,
html.ha-unified .batch-info-strip,
html.ha-unified .con-power-stats,
html.ha-unified .power-stats-bar {
    max-width: 100%;
    min-width: 0;
}

/* —— Data tables —— */
html.ha-unified .programs-compare-wrap,
html.ha-unified .table-responsive,
html.ha-unified .ha-table-scroll,
html.ha-unified .program-batch-wrap,
html.ha-unified .refund-window-table-wrap {
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

html.ha-unified .programs-compare-table th,
html.ha-unified .programs-compare-table td,
html.ha-unified .calendar-table th,
html.ha-unified .calendar-table td {
    overflow-wrap: break-word;
    word-break: normal;
}

/* —— Top bar & CTA rows —— */
html.ha-unified .top-bar-content,
html.ha-unified .top-action-btn {
    min-width: 0;
    max-width: 100%;
}

html.ha-unified .top-action-btn {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

html.ha-unified .cta-buttons,
html.ha-unified .programs-cta-row,
html.ha-unified .program-hero-cta,
html.ha-unified .con-hero-cta,
html.ha-unified .programs-spotlight-cta,
html.ha-unified .btn-group,
html.ha-unified .con-cta-btns {
    flex-wrap: wrap;
    gap: 12px;
    max-width: 100%;
}

/* —— Program spotlight cards —— */
html.ha-unified .programs-flagship-spotlight,
html.ha-unified .fee-promo-box {
    min-width: 0;
}

@media (max-width: 900px) {
    html.ha-unified .programs-flagship-spotlight__aside,
    html.ha-unified .programs-spotlight-cta {
        width: 100%;
    }

    html.ha-unified .programs-spotlight-cta .btn-card,
    html.ha-unified .programs-spotlight-cta .ha-counselling-trigger {
        width: 100%;
        justify-content: center;
        box-sizing: border-box;
    }
}

/* —— Mobile nav drawer —— */
@media (max-width: 991px) {
    html.ha-unified .nav-links.is-open {
        max-height: min(72vh, 520px);
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }
}

/* —— Footer grid —— */
html.ha-unified .footer-grid,
html.ha-unified .footer-col {
    min-width: 0;
}

html.ha-unified .horizontal-legal-links {
    display: grid !important;
    width: 100%;
    min-width: 0;
    justify-items: stretch;
    gap: 10px;
}

/* —— Hero meta & stat bars —— */
html.ha-unified .hero-meta,
html.ha-unified .program-hero-stats,
html.ha-unified .about-hero-meta,
html.ha-unified .infra-hero-meta,
html.ha-unified .hwt-hero-meta,
html.ha-unified .ins-hero-meta,
html.ha-unified .con-hero-meta {
    max-width: 100%;
    min-width: 0;
}

/* —— Long contact values & URLs —— */
html.ha-unified .con-contact-card__value,
html.ha-unified .con-contact-card__value a,
html.ha-unified .contact-info-boxes a {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* —— Counselling modal —— */
html.ha-unified .ha-counselling-modal__dialog {
    max-width: min(calc(100vw - 24px), 520px);
    max-height: min(96vh, 820px);
    overflow: hidden;
    overscroll-behavior: contain;
}

html.ha-unified .ha-counselling-modal__cta,
html.ha-unified .ha-counselling-modal__cta:hover,
html.ha-unified .ha-counselling-modal__cta:focus-visible {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    text-decoration: none !important;
}

html.ha-unified .ha-counselling-modal__cta i {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* —— Fee / policy tables in prose —— */
html.ha-unified .ha-fee-table-wrap,
html.ha-unified #fee-eligibility .programs-compare-wrap {
    margin-bottom: 1rem;
}

/* —— Enroll step cards —— */
html.ha-unified .enrollment-process,
html.ha-unified .step-card {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: break-word;
}

/* —— Subtle scrollbars only inside intentional scroll regions (desktop) —— */
@media (min-width: 769px) {
    html.ha-unified .table-responsive::-webkit-scrollbar,
    html.ha-unified .programs-compare-wrap::-webkit-scrollbar,
    html.ha-unified .ha-table-scroll::-webkit-scrollbar {
        height: 6px;
    }

    html.ha-unified .table-responsive::-webkit-scrollbar-thumb,
    html.ha-unified .programs-compare-wrap::-webkit-scrollbar-thumb,
    html.ha-unified .ha-table-scroll::-webkit-scrollbar-thumb {
        background: rgba(0, 115, 5, 0.22);
        border-radius: 999px;
    }
}
