/*
Theme Name: Afrezza Theme v2
Theme URI: https://afrezzahcp.com/
Description: Clean, modern theme for Afrezza HCP.
Version: 2.0.0
Author: MomentForge
*/

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* OneTrust cookie consent SDK — use the site's body font for consistency. */
#onetrust-consent-sdk {
    font-family: 'CeraPro-Regular', sans-serif;
}

/* Screen-reader-only utility — used by the SEO module to inject a canonical
   <h1> on every page without altering the visible design. The H1 is in the
   DOM (crawlers + assistive tech read it) but not visible. */
.afz-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Un-reset OneTrust cookie banner internals — the universal `* { margin: 0;
   padding: 0; }` above wipes OneTrust's own spacing and breaks its layout.
   Letting its CDN-provided CSS take over for everything inside its widgets. */
[id^="onetrust-"],
[id^="onetrust-"] *,
[id^="ot-"],
[id^="ot-"] *,
[class*="ot-sdk"],
[class*="ot-sdk"] *,
#onetrust-consent-sdk,
#onetrust-consent-sdk * {
    margin: revert;
    padding: revert;
    box-sizing: content-box;
}

/* Anchor-scroll offset applied directly on every section with an ID.
   scroll-margin-top is per-target, can't be ignored by container detection,
   and overrides whatever the browser would compute as the landing spot.
   Change this number to adjust the offset. */
section[id],
.site-content [id] {
    scroll-margin-top: 120px;
}
@media (max-width: 1024px) {
    section[id],
    .site-content [id] {
        scroll-margin-top: 40px;
    }
}

/* Disable browser scroll-anchoring so layout shifts (sticky nav placeholder
   toggling) don't cause counter-scrolls. */
html, body { overflow-anchor: none !important; }

:root {
    --color-purple-dark: #5E0D8B;
    --color-pink: #9b1889;
    --color-orange: #F5AB2F;
    --color-black: #1D1D1D;
    --color-white: #ffffff;
    --color-bg: #F7F4F9;
    --color-hover-bg: #E7E5E5;
    --color-category-text: #2E2E2E;
    --font-cera-regular: 'CeraPro-Regular', sans-serif;
    --font-cera-bold: 'CeraPro-Bold', sans-serif;
    --font-helvetica: 'HelveticaNeueLTPro', sans-serif;
    --site-max-width: 1440px;
}

@font-face { font-family: "CeraPro-Light"; font-weight: 300; src: url("fonts/CeraPro/CeraPro-Light.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "CeraPro-Regular"; font-weight: 400; src: url("fonts/CeraPro/CeraPro-Regular.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "CeraPro-Medium"; font-weight: 500; src: url("fonts/CeraPro/CeraPro-Medium.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "CeraPro-Bold"; font-weight: 700; src: url("fonts/CeraPro/CeraPro-Bold.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "HelveticaNeueLTPro"; font-weight: 400; src: url("fonts/HelveticaNeueLTPro/HelveticaNeueLTPro-Cn.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "HelveticaNeueLTPro-Bd"; font-weight: 700; src: url("fonts/HelveticaNeueLTPro/HelveticaNeueLTPro-Bd.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "HelveticaNeueLTPro-Roman"; font-weight: 400; src: url("fonts/HelveticaNeueLTPro/HelveticaNeueLTPro-Roman.otf") format("opentype"); font-display: swap; }
@font-face { 
    font-family: "HelveticaNeueLTPro-BdCn"; 
    font-weight: 700; 
    src: url("fonts/HelveticaNeueLTPro/Helvetica-Neue-LT-Com-77-Bold-Condensed.ttf") format("truetype"); 
    font-display: swap; 
}
/* ============================================
   HEADER - DESKTOP
   ============================================ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--color-bg);
}

.header-inner {
    max-width: var(--site-max-width);
    margin: 0 auto;
    padding-left: 80px;
    padding-right: 62px;
    padding-top: 14px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.header-topbar {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 256px;
}

.topbar-left {
    color: #000;
    font-family: var(--font-cera-regular);
    font-size: 12px;
    font-weight: 400;
    line-height: normal;
    flex-shrink: 0;
}

.topbar-right {
    display: flex;
    align-items: flex-start;
    gap: 62px;
}

.topbar-links {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 24px;
}

.topbar-links li a {
    color: var(--color-black);
    font-family: var(--font-cera-regular);
    font-size: 14px;
    font-weight: 400;
    line-height: normal;
    text-decoration: none;
    transition: color 0.2s;
}

.topbar-links li a:hover {
    color: var(--color-purple-dark);
}

.btn-request-rep {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 158px;
    height: 48px;
    background: var(--color-orange);
    border-radius: 0 0 8px 8px;
    color: var(--color-black);
    font-family: var(--font-cera-bold);
    font-size: 14px;
    font-weight: 700;
    line-height: 15px;
    text-decoration: none;
    filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.25));
    transition: opacity 0.2s;
    flex-shrink: 0;
    margin-top: -14px;
}

.btn-request-rep:hover {
    opacity: 0.9;
    color: var(--color-black);
    text-decoration: none;
}

.btn-request-rep .icon-info {
    width: 8px;
    height: 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.header-nav {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-bottom: 35px;
    margin-top: 1px;
}

.site-logo { display: block; flex-shrink: 0; }
.site-logo img { width: 208px; height: 48px; object-fit: contain; }

.main-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 39px;
}

.main-menu > li { position: relative; }

.main-menu > li > a {
    color: var(--color-black);
    font-family: var(--font-cera-bold);
    font-size: 17px;
    font-weight: 700;
    line-height: normal;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    transition: color 0.2s;
    white-space: nowrap;
    padding-bottom: 0px;
}

.main-menu > li > a:hover,
.main-menu > li:hover > a {
    color: var(--color-purple-dark);
    text-decoration: none;
}

/* Efficacy / Safety dropdown triggers are <a> without href (only open the
   dropdown on hover). Keep the pointer cursor + prevent text-selection so
   they still feel interactive. */
.main-menu > li.menu-item-has-children > a:not([href]) {
    cursor: pointer;
    user-select: none;
}

.menu-arrow {
    display: inline-flex;
    align-items: center;
    margin-left: 2px;
    margin-top: 0px;
    transition: transform 0.3s ease;
}

.menu-arrow svg { width: 9px; height: 8px; }

.main-menu > li:hover .menu-arrow svg path {
    fill: var(--color-purple-dark);
}

/* Active state — matches hover when the current URL is within the section.
   Desktop only; mobile menu uses a separate markup that isn't affected here. */
.main-menu > li.is-active > a {
    color: var(--color-purple-dark);
}
.main-menu > li.is-active .menu-arrow svg path {
    fill: var(--color-purple-dark);
}

.main-menu .sub-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    border-radius: 8px;
    border: 1px solid var(--color-purple-dark);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(2px);
    list-style: none;
    z-index: 100;
    overflow: hidden;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    pointer-events: none;
}

.main-menu > li.menu-item-has-children::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 12px;
}

.main-menu > li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.sub-menu--efficacy { width: 198px; }
.sub-menu--safety { width: 245px; min-height: 75px; }
.sub-menu--safety li:first-child a { padding-top: 12px; }
.sub-menu--safety li:last-child a { padding-bottom: 12px; }

.sub-menu .menu-category {
    padding: 15px 15.57px 0 15.57px;
    color: var(--color-category-text);
    font-family: var(--font-helvetica);
    font-size: 14px;
    font-weight: 400;
    line-height: normal;
}

.sub-menu .menu-divider {
    height: 1px;
    background: var(--color-purple-dark);
    margin: 4px 15.57px;
}

.sub-menu li a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    padding: 0 15.57px;
    color: #000;
    font-family: var(--font-cera-bold);
    font-size: 16px;
    font-weight: 700;
    line-height: 30px;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.sub-menu li a:hover {
    background: var(--color-hover-bg);
    color: var(--color-purple-dark);
    text-decoration: none;
}

.sub-menu li a .sub-arrow {
    display: none;
    width: 11px;
    height: 11px;
    transition: opacity 0.2s ease;
}

.sub-menu li a:hover .sub-arrow {
    display: inline-flex;
    align-items: center;
}

.sub-menu li a .sub-arrow svg { width: 11px; height: 11px; }

.site-content { min-height: 60vh; overflow-x: hidden; }
.site-footer { padding: 48px 0; background: var(--color-white); border-top: 1px solid #eee; text-align: center; }
.container { width: 100%; max-width: var(--site-max-width); margin: 0 auto; padding: 0 24px; }

/* Hide mobile-only elements on desktop */
.mobile-nav-right { display: none; }
.mobile-menu { display: none; }
.nav-toggle { display: none; }

/* ============================================
   RESPONSIVE DESKTOP
   ============================================ */
@media (max-width: 1439px) {
    .header-topbar { gap: 0; justify-content: space-between; }
}

@media (max-width: 1350px) {
    .header-inner { padding-left: 50px; padding-right: 40px; }
    .main-menu { gap: 25px; }
    .main-menu > li > a { font-size: 15px; }
    .topbar-links { gap: 18px; }
    .topbar-links li a { font-size: 13px; }
    .topbar-right { gap: 40px; }
    .btn-request-rep { width: 140px; height: 44px; font-size: 13px; }
    .site-logo img { width: 180px; height: auto; }
}

@media (max-width: 1150px) {
    .header-inner { padding-left: 30px; padding-right: 30px; }
    .main-menu { gap: 18px; }
    .main-menu > li > a { font-size: 14px; }
    .topbar-links { gap: 14px; }
    .topbar-links li a { font-size: 12px; }
    .topbar-right { gap: 30px; }
    .btn-request-rep { width: 130px; height: 40px; font-size: 12px; }
    .site-logo img { width: 160px; height: auto; }
    .header-nav { padding-bottom: 25px; }
}

/* ============================================
   MOBILE (991px and below)
   ============================================ */
@media (max-width: 991px) {
    .header-inner {
        padding: 8px 20px 7.26px 20px;
    }

    .header-topbar {
        gap: 0;
        justify-content: space-between;
        align-items: center;
    }

    .topbar-left {
        font-family: 'Roboto Condensed', sans-serif;
        font-size: 12px;
        font-weight: 400;
        color: #000;
    }

    /* Mobile topbar: hide every link except "Prescribing Information"
       (the 2nd <li>) and render it as a real clickable <a> to the PDF.
       Was previously a CSS-generated `::before` text — not clickable. */
    .topbar-links {
        display: flex;
        gap: 0;
        padding: 0;
        margin: 0;
        list-style: none;
    }
    .topbar-links li { display: none; }
    .topbar-links li:nth-child(2) { display: block; }
    .topbar-links li:nth-child(2) a {
        font-family: 'Roboto Condensed', sans-serif;
        font-size: 12px;
        font-weight: 700;
        color: #000;
        text-decoration: none;
    }
    .topbar-right { gap: 0; }
    .btn-request-rep { display: none; }

    .header-nav {
        align-items: center;
        padding-bottom: 0;
        margin-top: 12.25px;
        justify-content: space-between;
    }

    .site-logo img {
        width: 146px;
        height: 34px;
    }

    .main-menu { display: none; }

    .mobile-nav-right {
        display: flex;
        align-items: center;
        gap: 15px;
        flex-shrink: 0;
    }

    /* Mobile Request a Rep */
    .btn-request-rep-mobile {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        width: auto;
        padding: 0 16px;
        height: 46.495px;
        background: var(--color-orange);
        border-radius: 6px;
        color: var(--color-black);
        font-family: var(--font-cera-bold);
        font-size: 14px;
        font-weight: 700;
        line-height: 15px;
        text-decoration: none;
        filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.25));
        flex-shrink: 0;
        white-space: nowrap;
    }

    .icon-info-mobile {
        width: 8px;
        height: 17px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .btn-rep-text {
        font-family: var(--font-cera-bold);
        font-size: 14px;
        font-weight: 700;
        line-height: 15px;
        color: var(--color-black);
    }

    .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
        flex-shrink: 0;
        width: 37px;
        height: 20px;
    }

    .burger-icon, .close-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Mobile Menu Dropdown - smooth slide */
    .mobile-menu {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        border-radius: 0 0 8px 8px;
        background: linear-gradient(0deg, rgba(0, 0, 0, 0.20) 0%, rgba(0, 0, 0, 0.20) 100%), #7E3DA2;
        z-index: 999;
        overflow: hidden;
        max-height: 0;
        transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1);
        pointer-events: none;
    }

    .mobile-menu.active {
        /* `100vh` on mobile counts the area under the browser's collapsible
           top/bottom chrome (URL bar, Brave/Safari bottom bars), so the
           bottom of the menu can get covered. `100dvh` (dynamic viewport
           height) tracks only the actually-visible area — the menu always
           fits inside the real visible space and the footer-of-menu items
           (Facebook/YouTube/Instagram) become reachable on short screens. */
        max-height: calc(100vh - 80px);             /* fallback for older browsers */
        max-height: calc(100dvh - 80px);
        pointer-events: auto;
        overflow-y: auto;
        overflow-x: hidden;
        /* Scroll stays inside the menu; can't chain out to the page */
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        /* Reserve room at the bottom so the last items (social icons) aren't
           hidden behind a collapsible bottom UI bar that animates in. */
        padding-bottom: env(safe-area-inset-bottom, 0px);
        /* Hide the right-side scrollbar — touch-scroll still works */
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .mobile-menu.active::-webkit-scrollbar {
        width: 0;
        height: 0;
        display: none;
    }

    /* When the mobile menu is open, lock the page behind it so the user
       can't scroll the page through/around the menu. Applied to <html>
       via JS class .afz-menu-lock. */
    html.afz-menu-lock,
    html.afz-menu-lock body {
        overflow: hidden !important;
        touch-action: none;
    }

    .mobile-menu-inner {
        /* Extra bottom padding gives the user a small empty scrollable area
           below the social icons — useful on short-viewport phones where
           the menu content is just slightly taller than the visible area. */
        padding: 18px 20px 48px 20px;
    }

    .mobile-link-primary {
        display: block;
        color: #FFF;
        font-family: var(--font-cera-bold);
        font-size: 16px;
        font-weight: 700;
        line-height: 24px;
        text-decoration: none;
    }

    .mobile-sub-links {
        padding-left: 20px;
        margin-top: 10px;
    }

    .mobile-category {
        display: block;
        padding-left: 1px;
        padding-bottom: 2px;
        color: #C1C1C1;
        font-family: var(--font-cera-regular);
        font-size: 14px;
        font-weight: 400;
        line-height: 16px;
    }

    .mobile-category-divider {
        height: 1px;
        background: #C1C1C1;
        width: 70px;
        margin-left: 1px;
    }

    .mobile-category-divider--wide {
        width: 174px;
    }

    .mobile-sub-link {
        display: block;
        padding-left: 5px;
        color: #FFF;
        font-family: var(--font-cera-bold);
        font-size: 14px;
        font-weight: 700;
        line-height: 24px;
        text-decoration: none;
    }

    .mobile-divider {
        height: 1px;
        background: #A8A8A8;
        margin-top: 20px;
    }

    .mobile-secondary-links {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-top: 17px;
    }

    .mobile-secondary-links a {
        color: #FFF;
        font-family: var(--font-cera-regular);
        font-size: 13px;
        font-weight: 400;
        line-height: 20px;
        text-decoration: none;
    }

    .mobile-social {
        display: flex;
        align-items: center;
        gap: 37px;
        margin-top: 17px;
        padding-bottom: 11px;
    }

    .social-icon {
        display: inline-flex;
        align-items: center;
    }
}

/* ============================================
   MOBILE SMALL (440px+) - Request a Rep one line
   ============================================ */
@media (min-width: 440px) and (max-width: 991px) {
    .btn-rep-text br { display: none; }
}

/* ============================================
   MOBILE SMALL (365px and below)
   ============================================ */
@media (max-width: 365px) {
    .btn-request-rep-mobile {
        gap: 8px;
        padding: 0 10px;
        height: 40px;
    }

    .btn-rep-text {
        font-size: 12px;
        line-height: 13px;
    }

    .site-logo img {
        width: 120px;
        height: auto;
    }

    .mobile-nav-right {
        gap: 10px;
    }
}

/* ============================================
   MOBILE TINY (330px and below)
   ============================================ */
@media (max-width: 330px) {
    .topbar-left {
        font-size: 10px;
    }

    .topbar-links li:nth-child(2) a {
        font-size: 10px;
    }

    .btn-request-rep-mobile {
        gap: 6px;
        padding: 0 8px;
        height: 36px;
    }

    .btn-rep-text {
        font-size: 11px;
        line-height: 12px;
    }

    .site-logo img {
        width: 100px;
        height: auto;
    }

    .mobile-nav-right {
        gap: 8px;
    }

    .nav-toggle {
        width: 30px;
        height: 16px;
    }
}

/* Admin bar fix */
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }