/* ─────────────────────────────────────────────────────────────
 * Analoxia site-level overrides. Loaded LAST, after all design CSS.
 * Keep design files (homepage.css etc.) pristine; fixes live here.
 * ───────────────────────────────────────────────────────────── */

/* Defensive: never allow horizontal page overflow on narrow viewports.
 * In mobile / DevTools device mode, a page wider than the viewport makes
 * the layout viewport expand, which shoves the fixed mobile drawer
 * (right:0) off-screen to the right. `overflow-x: clip` on html AND body
 * pins the document to the viewport width without creating a scroll
 * container (so position:sticky on the header keeps working). The AI
 * persona carousel keeps its own overflow-x:auto and still scrolls. */
html, body { overflow-x: clip; }

/* Mobile overflow hardening. Some pages (article bodies, service/pricing
 * cards) had children wider than the phone viewport, so overflow-x:clip cut
 * them off. Let grid/flex children shrink (min-width:0), wrap long CTA labels
 * and unbreakable words, and cap media to the viewport width. */
@media (max-width: 600px) {
    .container *, .section *, .art-grid *, .prose * { min-width: 0; }
    .btn { white-space: normal; }
    img, svg, video, iframe, table, pre { max-width: 100%; }
    p, h1, h2, h3, h4, li, a, span, code { overflow-wrap: break-word; }
}

/* SSR flash banner (lead form success, shown after a 0-JS POST + redirect). */
.site-flash {
    background: #ECFDF5;
    border-bottom: 1px solid #A7F3D0;
    color: #047857;
}
.site-flash-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-block: 12px;
    font-size: 15px;
    font-weight: 600;
}
.site-flash-inner svg { width: 18px; height: 18px; flex: none; }

/* Nav dropdowns must be fully opaque so the dark hero never shows
 * through. (The design's var(--bg) was not resolving on the panel.) */
/* The header's backdrop-filter blur created a compositing context that
 * stopped the overflowing dropdown panel from painting its background
 * (hero showed through). Drop the blur, keep a clean solid header. */
.header {
    background: #FFFFFF !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}
.header .dropdown,
.header .dropdown-mega {
    background: #FFFFFF !important;
    z-index: 1000 !important;
    transform: none !important;
}
/* keep a fade on open without the transform layer that broke painting */
.header .nav-item:hover .dropdown,
.header .nav-item[data-open] .dropdown,
.header .nav-item:focus-within .dropdown {
    transform: none !important;
}

/* ─────────────────────────────────────────────────────────────
 * Frontend admin bar (only rendered for signed-in staff).
 * Sticky bar that stacks ABOVE the site's sticky header.
 * ───────────────────────────────────────────────────────────── */
.analoxia-adminbar {
    position: sticky;
    top: 0;
    z-index: 100001;
    background: #0A0A0F;
    color: #fff;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.analoxia-adminbar .aab-inner {
    max-width: 1200px;
    margin: 0 auto;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    gap: 16px;
}
.analoxia-adminbar .aab-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #fff;
}
.analoxia-adminbar .aab-brand svg { width: 16px; height: 16px; color: #A78BFA; }
.analoxia-adminbar .aab-links { display: flex; align-items: center; gap: 6px; }
.analoxia-adminbar a {
    color: #E6E6F0;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 600;
    line-height: 1;
}
.analoxia-adminbar a:hover { background: rgba(255, 255, 255, 0.10); color: #fff; text-decoration: none; }
.analoxia-adminbar .aab-edit { background: linear-gradient(120deg, #3B82F6, #7C3AED); color: #fff; }
.analoxia-adminbar .aab-edit:hover { filter: brightness(1.08); background: linear-gradient(120deg, #3B82F6, #7C3AED); }
.analoxia-adminbar form { margin: 0; display: inline; }
.analoxia-adminbar button {
    background: transparent;
    border: 0;
    color: #9A9AAE;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-family: inherit;
    font-size: 13px;
}
.analoxia-adminbar button:hover { background: rgba(255, 255, 255, 0.10); color: #fff; }

/* push the site's sticky header down so it pins below the admin bar */
.has-admin-bar .header { top: 40px; }

/* ─────────────────────────────────────────────────────────────
 * Mega-menu fix.
 *
 * ROOT CAUSE: the design set `.nav-item-mega { position: static }`,
 * so the absolutely-positioned panel anchored to the nearest
 * positioned ancestor, the full-width sticky `.header`, at left:32px
 * of the VIEWPORT. On wide screens the centered nav sits far to the
 * right while the panel floated to the far left, leaving a big empty
 * gap (what looked like "empty space on the right").
 *
 * FIX: anchor the panel to the centered `.container` (.header-inner)
 * instead, so it stays under the nav. Also hug content width so the
 * 1fr columns no longer stretch past their text.
 *
 * IMPORTANT: scope the `position: relative` to desktop only. The mega
 * menu only renders at >=1024px; below that it is the fixed mobile
 * drawer. Applying position:relative at all widths changed the
 * containing block for the fixed drawer on narrow viewports and shoved
 * it off-screen. Desktop-only scoping leaves the mobile drawer alone.
 * ───────────────────────────────────────────────────────────── */
@media (min-width: 1024px) {
    .header .header-inner { position: relative; }
}
.header .dropdown-mega {
    left: 0 !important;
    right: auto !important;
    grid-template-columns: repeat(3, max-content) !important;
    width: max-content !important;
    min-width: 0 !important;
    max-width: calc(100vw - 64px);
    column-gap: 44px;
}

/* ─────────────────────────────────────────────────────────────
 * Mobile nav drawer: full-screen on phones.
 * The design capped it at min(86vw, 360px), so on a ~466px phone it was
 * a thin white side panel: the page peeked through on the left and the
 * bottom was a big empty strip. It looked unfinished. Make it a proper
 * full-width mobile menu, with the items and CTA spaced out so the panel
 * does not look half-empty.
 * ───────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .header .drawer {
        width: 100%;
        max-width: 100%;
        border-left: 0;
        padding: var(--space-5) var(--space-6) var(--space-8);
        gap: 4px;
    }
    /* roomier tap targets on a full-screen menu */
    .header .drawer > details > summary,
    .header .drawer > a {
        padding-block: var(--space-4);
        font-size: var(--text-h4);
        border-bottom: 1px solid var(--border-subtle);
    }
    /* sub-links as a tidy vertical list, not inline-wrapped text */
    .header .drawer details a {
        display: block;
        font-size: var(--text-body);
        padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
    }
    .header .drawer details > summary { border-bottom: 0; }
    .header .drawer details { border-bottom: 1px solid var(--border-subtle); padding-bottom: var(--space-2); }
    /* pin the CTA to the bottom (thumb zone) so the screen does not look half-empty */
    .header .drawer .btn {
        margin-top: auto;
        width: 100%;
        justify-content: center;
    }
}

/* ─────────────────────────────────────────────────────────────
 * Mobile pixel polish.
 * ───────────────────────────────────────────────────────────── */
/* "What's your bottleneck?" pills: the design made them a horizontal
 * scroll on phones, which cut off the last pill ("Need coaching"). Wrap
 * them instead so every option is visible. */
@media (max-width: 559px) {
    .picker-pills {
        flex-wrap: wrap !important;
        overflow-x: visible !important;
        justify-content: center;
        row-gap: var(--space-2);
    }
    .picker-bar { justify-content: center; }
}

/* ─────────────────────────────────────────────────────────────
 * Back to top (global, every page). JS (back-to-top.js, loaded in
 * the layout) toggles .is-visible after the user scrolls past 300px.
 * ───────────────────────────────────────────────────────────── */
.to-top {
    position: fixed;
    right: var(--space-6);
    bottom: var(--space-6);
    z-index: 100002;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--brand-gradient);
    color: #fff;
    border: 0;
    box-shadow: var(--shadow-lg);
    text-decoration: none;
    font-size: 20px;
    line-height: 1;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity var(--duration-base) var(--ease-out), transform var(--duration-base) var(--ease-out), visibility var(--duration-base);
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { filter: brightness(1.06); color: #fff; text-decoration: none; }
.to-top:focus-visible { outline: none; box-shadow: var(--shadow-focus-ring); }
@media (max-width: 560px) {
    .to-top { right: var(--space-4); bottom: var(--space-4); }
}

/* Honeypot: hidden anti-spam field. Real users never see or focus it. */
.hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
