
/* =========================================================
   TRADERS DE ELITE — MOBILE STABILITY PATCH
   Header, hero and typography
========================================================= */

.site-header,
.site-header * {
    min-width: 0;
}

.site-header {
    isolation: isolate;
}

.site-header .nav-actions {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 4px;
    margin-left: 12px;
    padding: 3px;
    border: 1px solid var(--border-light);
    border-radius: 30px;
    background: #0c0c0e;
    position: relative;
    z-index: 103;
}

.site-header .nav-actions .btn {
    white-space: nowrap;
}

.header-inner {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

@media (max-width: 980px) {
    .site-header {
        height: 70px;
        padding: 0 10px;
    }

    .site-header.scrolled {
        height: 70px;
    }

    .site-header .brand {
        position: relative;
        z-index: 104;
        flex-shrink: 0;
    }

    .site-header .menu-toggle {
        position: relative;
        inset: auto;
        transform: none;
        z-index: 104;
        flex-shrink: 0;
    }

    /* The action buttons stay visible in the header on mobile. */
    .site-header .nav-actions {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        margin: 0;
        padding: 2px;
        gap: 3px;
        border-radius: 24px;
        background: rgba(12,12,14,.96);
        backdrop-filter: blur(12px);
    }

    .site-header .nav-actions .btn {
        min-height: 34px;
        height: 34px;
        padding: 0 8px;
        border-radius: 18px;
        font-size: 8px;
        line-height: 1;
        letter-spacing: 0;
        gap: 3px;
    }

    .main-nav {
        top: 70px;
        inset-block-start: 70px;
        height: calc(100dvh - 70px);
        padding-top: 18px;
        padding-bottom: 35px;
    }

    /* Never allow the fixed header to be pushed by long text. */
    .main-nav > a {
        min-width: 0;
        overflow-wrap: anywhere;
        word-break: normal;
    }

    /* Public homepage hero */
    .hero {
        width: min(92vw, var(--container));
        min-height: auto;
        padding: 115px 0 70px;
        margin: 0 auto;
        overflow: hidden;
    }

    .hero-content {
        width: 100%;
        max-width: 760px;
    }

    .hero h1 {
        margin: 22px 0 14px;
        font-size: clamp(32px, 10vw, 52px) !important;
        line-height: .98;
        overflow-wrap: anywhere;
    }

    .hero-slogan {
        max-width: 100%;
        font-size: 10px !important;
        line-height: 1.7;
        letter-spacing: .09em;
        overflow-wrap: anywhere;
    }

    .hero-description {
        max-width: 620px;
        font-size: 14px !important;
        line-height: 1.7;
    }

    .hero .eyebrow {
        max-width: 100%;
        font-size: 9px !important;
        line-height: 1.4;
        text-align: center;
    }

    .hero-actions {
        width: 100%;
        max-width: 440px;
        flex-direction: column;
        gap: 10px;
    }

    .hero-actions .btn {
        width: 100%;
        min-height: 46px;
        font-size: 11px;
    }

    .hero-market-card {
        width: 100%;
        max-width: 760px;
        margin-top: 32px;
    }

    /* All internal page heroes */
    .page-hero,
    .market-hero {
        width: min(92vw, var(--container));
        min-height: auto;
        margin: 0 auto;
        padding: 110px 0 65px;
        overflow: hidden;
    }

    .page-hero-content,
    .market-hero-content {
        width: 100%;
        max-width: 850px;
        min-width: 0;
    }

    .page-hero h1,
    .market-hero h1 {
        max-width: 100%;
        margin: 16px 0;
        font-size: clamp(32px, 10vw, 52px) !important;
        line-height: 1.02;
        letter-spacing: -.025em;
        overflow-wrap: anywhere;
    }

    .page-hero p,
    .market-hero p {
        max-width: 100%;
        font-size: 14px !important;
        line-height: 1.7;
        overflow-wrap: anywhere;
    }

    .page-hero .eyebrow,
    .market-hero .eyebrow {
        max-width: 100%;
        font-size: 9px !important;
        line-height: 1.4;
    }

    /* Typography across every public page */
    .section-heading h2,
    .page-heading h2,
    .section h2 {
        font-size: clamp(25px, 7vw, 34px) !important;
        line-height: 1.12;
        overflow-wrap: anywhere;
    }

    .section-kicker {
        font-size: 9px !important;
        line-height: 1.4;
    }

    .section p,
    .page-section p,
    .intro-copy p,
    .info-card p,
    .value-card p,
    .article-card p,
    .event-item p,
    .virtual-panel p {
        font-size: 14px !important;
        line-height: 1.7;
    }

    .section h3,
    .page-section h3,
    .info-card h3,
    .value-card h3,
    .article-card h3 {
        font-size: 17px !important;
        line-height: 1.3;
    }

    .btn {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    img,
    video,
    iframe,
    svg {
        max-width: 100%;
    }

    .container,
    .section,
    .page-section {
        max-width: 100%;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 650px) {
    .site-header .brand-text {
        display: none;
    }

    .site-header .brand-mark {
        width: 34px;
        height: 34px;
    }

    .site-header .nav-actions {
        max-width: calc(100vw - 92px);
    }

    .site-header .nav-actions .btn {
        min-width: 0;
        max-width: 105px;
        padding-inline: 7px;
        font-size: 7.5px;
    }

    .hero {
        padding-top: 105px;
    }

    .hero h1,
    .page-hero h1,
    .market-hero h1 {
        font-size: clamp(30px, 10vw, 46px) !important;
    }

    .hero-description,
    .page-hero p,
    .market-hero p {
        font-size: 13.5px !important;
    }

    .hero .eyebrow,
    .page-hero .eyebrow,
    .market-hero .eyebrow {
        font-size: 8px !important;
        padding: 8px 10px;
    }
}

@media (max-width: 360px) {
    .site-header .nav-actions .btn {
        padding-inline: 5px;
        font-size: 7px;
    }

    .site-header .nav-actions {
        gap: 2px;
    }

    .hero h1,
    .page-hero h1,
    .market-hero h1 {
        font-size: 29px !important;
    }

    .section-heading h2,
    .page-heading h2,
    .section h2 {
        font-size: 24px !important;
    }
}


/* =========================================================
   MOBILE TYPOGRAPHY + MENU REFINEMENT
   Applied only below 980px. Desktop remains unchanged.
========================================================= */

@media (max-width: 980px) {

    /* ---------- Header ---------- */
    .site-header {
        height: 70px;
        padding: 0 14px;
    }

    .site-header.scrolled {
        height: 70px;
    }

    .site-header .brand {
        z-index: 105;
    }

    .site-header .menu-toggle {
        display: flex;
        position: absolute;
        right: 12px;
        top: 50%;
        width: 42px;
        height: 42px;
        padding: 0;
        transform: translateY(-50%);
        z-index: 106;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 5px;
    }

    /* Hamburger -> X */
    .site-header .menu-toggle span {
        display: block;
        width: 23px;
        height: 2px;
        margin: 0;
        border-radius: 2px;
        background: var(--white);
        transform-origin: center;
        transition:
            transform .28s ease,
            opacity .2s ease,
            width .28s ease;
    }

    .site-header .menu-toggle.active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .site-header .menu-toggle.active span:nth-child(2) {
        opacity: 0;
        width: 0;
    }

    .site-header .menu-toggle.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .site-header .nav-actions {
        left: 50%;
        right: auto;
        top: 50%;
        transform: translate(-50%, -50%);
        width: max-content;
        max-width: calc(100vw - 108px);
        margin: 0;
        padding: 2px;
        gap: 3px;
        z-index: 105;
    }

    .site-header .nav-actions .btn {
        min-height: 34px;
        height: 34px;
        padding: 0 9px;
        font-size: 9px;
        line-height: 1;
        white-space: nowrap;
        letter-spacing: 0;
    }

    /* ---------- Global mobile type scale ---------- */
    body {
        font-size: 15px;
        line-height: 1.65;
    }

    .section,
    .page-section {
        width: min(92vw, var(--container));
    }

    /* Kicker / eyebrow */
    .eyebrow,
    .section-kicker,
    .page-kicker {
        font-size: 9px !important;
        line-height: 1.45 !important;
        letter-spacing: .10em;
    }

    /* Main hero */
    .hero h1,
    .page-hero h1,
    .market-hero h1 {
        font-size: clamp(31px, 9.5vw, 48px) !important;
        line-height: 1.02 !important;
        letter-spacing: -.035em;
        margin-top: 20px;
    }

    .hero-slogan {
        font-size: clamp(10px, 2.8vw, 13px) !important;
        line-height: 1.65 !important;
        letter-spacing: .08em;
    }

    .hero-description,
    .page-hero p,
    .market-hero p {
        font-size: clamp(13px, 3.6vw, 15px) !important;
        line-height: 1.7 !important;
    }

    /* Section headings */
    .section-heading h2,
    .page-heading h2,
    .section h2,
    .page-section h2 {
        font-size: clamp(25px, 7.2vw, 36px) !important;
        line-height: 1.12 !important;
        letter-spacing: -.025em;
    }

    .section-heading {
        margin-bottom: 34px;
    }

    /* Body copy */
    .section p,
    .page-section p,
    .intro-copy p,
    .info-card p,
    .value-card p,
    .course-card p,
    .article-card p,
    .event-item p,
    .virtual-panel p,
    .signup-copy p,
    .portal-card p,
    .transparency-copy p {
        font-size: clamp(13px, 3.7vw, 15px) !important;
        line-height: 1.7 !important;
    }

    /* Cards / subsection headings */
    .section h3,
    .page-section h3,
    .info-card h3,
    .value-card h3,
    .course-card h3,
    .article-card h3,
    .event-item h3 {
        font-size: clamp(16px, 4.8vw, 21px) !important;
        line-height: 1.25 !important;
    }

    .value-card span,
    .course-number,
    .article-card span,
    .event-item span {
        font-size: 9px !important;
        line-height: 1.4;
    }

    /* Smaller utility text: never 5px/7px on normal content */
    .market-card-top,
    .market-values small,
    .ticker-card small,
    .dash-header,
    .market-note {
        font-size: 10px !important;
        line-height: 1.45;
    }

    .ticker-card strong {
        font-size: clamp(19px, 5.5vw, 25px) !important;
    }

    .ticker-card span,
    .text-link,
    .course-card a,
    .article-card a,
    .event-item > a {
        font-size: 11px !important;
        line-height: 1.5;
    }

    .btn {
        font-size: 12px !important;
        line-height: 1.25;
    }

    .btn-small {
        font-size: 10px !important;
    }

    /* Form controls */
    input,
    textarea,
    select {
        font-size: 14px !important;
        line-height: 1.4;
    }

    label {
        font-size: 12px !important;
        line-height: 1.4;
    }

    /* Prevent any text from creating horizontal overflow */
    .section *,
    .page-section *,
    .hero *,
    .page-hero *,
    .market-hero *,
    .virtual-panel *,
    .transparency-box *,
    .article-card *,
    .course-card *,
    .value-card * {
        max-width: 100%;
    }

    h1, h2, h3, h4, h5, h6, p, a, span, small, strong, em {
        overflow-wrap: break-word;
    }
}

@media (max-width: 650px) {

    .site-header {
        padding-inline: 10px;
    }

    .site-header .nav-actions {
        max-width: calc(100vw - 92px);
    }

    .site-header .nav-actions .btn {
        min-height: 32px;
        height: 32px;
        padding-inline: 7px;
        font-size: 8px !important;
    }

    .site-header .brand-mark {
        width: 34px;
        height: 34px;
    }

    .hero,
    .page-hero,
    .market-hero {
        width: 92vw;
    }

    .hero h1,
    .page-hero h1,
    .market-hero h1 {
        font-size: clamp(30px, 9.5vw, 43px) !important;
    }

    .hero-description,
    .page-hero p,
    .market-hero p {
        font-size: 13.5px !important;
    }

    .section-heading h2,
    .page-heading h2,
    .section h2,
    .page-section h2 {
        font-size: clamp(24px, 7.5vw, 32px) !important;
    }

    .section p,
    .page-section p,
    .intro-copy p,
    .info-card p,
    .value-card p,
    .course-card p,
    .article-card p,
    .event-item p,
    .virtual-panel p,
    .signup-copy p,
    .portal-card p,
    .transparency-copy p {
        font-size: 14px !important;
    }

    .section h3,
    .page-section h3,
    .info-card h3,
    .value-card h3,
    .course-card h3,
    .article-card h3,
    .event-item h3 {
        font-size: 18px !important;
    }
}

@media (max-width: 380px) {

    .site-header .nav-actions .btn {
        padding-inline: 5px;
        font-size: 7.5px !important;
    }

    .hero h1,
    .page-hero h1,
    .market-hero h1 {
        font-size: 29px !important;
    }

    .hero-description,
    .page-hero p,
    .market-hero p {
        font-size: 13px !important;
    }

    .section-heading h2,
    .page-heading h2,
    .section h2,
    .page-section h2 {
        font-size: 24px !important;
    }

    .section p,
    .page-section p,
    .intro-copy p,
    .info-card p,
    .value-card p,
    .course-card p,
    .article-card p,
    .event-item p,
    .virtual-panel p,
    .signup-copy p,
    .portal-card p,
    .transparency-copy p {
        font-size: 13px !important;
    }
}
