/* ============================================================
 * BP Menu v3 — professional mega-menu styles (Tectum-grade).
 *
 * Skin-agnostic — uses --bs-* design tokens so it picks up the
 * current skin's brand colors automatically. Skins can still
 * override any --bp-mega-* var at a higher specificity.
 *
 * Toggle states:
 *   - .bp-menu__item--mega_parent.is-open  ← set by JS (hover-intent + click)
 *   - .bp-menu__item--mega_parent.show     ← Bootstrap dropdown compat
 *
 * Rendered DOM:
 *
 *   <li class="bp-menu__item bp-menu__item--mega_parent">
 *     <a class="bp-menu__link bp-menu__mega-trigger">…<i class="…chevron-down"/></a>
 *     <ul class="bp-menu bp-mega__panel" data-layout="columns|grid|stack" data-cols="N">
 *       <li class="bp-menu__item bp-menu__item--mega_column">
 *         <header class="bp-mega__col-head">…</header>
 *         <ul class="bp-menu">…links / cards…</ul>
 *       </li>
 *       …
 *     </ul>
 *   </li>
 * ============================================================ */

:root {
    --bp-mega-radius: 16px;
    --bp-mega-gap: 2rem;
    --bp-mega-pad: 2rem;
    --bp-mega-max-width: 1280px;
    --bp-mega-top: 64px;       /* updated by JS to match the sticky header's bottom edge */
    --bp-mega-shift: 0px;      /* updated by JS to keep panel inside viewport */
    --bp-mega-shadow:
        0 24px 60px -20px rgba(0, 0, 0, 0.22),
        0 10px 30px -12px rgba(0, 0, 0, 0.10),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    --bp-mega-ease: cubic-bezier(0.2, 0, 0.13, 1);
    --bp-mega-dur-in: 220ms;
    --bp-mega-dur-out: 160ms;
}

/* ============================================================
 * Mega parent (trigger row container)
 * ============================================================ */
.bp-menu__item--mega_parent {
    /* Panel uses `position: fixed` so the <li> can stay in whatever
       positioning context the nav lays out with. No override here. */
}

.bp-menu__mega-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.bp-menu__mega-trigger .bp-menu__chevron {
    font-size: 0.7em;
    transition: transform var(--bp-mega-dur-in) var(--bp-mega-ease);
    opacity: 0.7;
}
.bp-menu__item--mega_parent.is-open > .bp-menu__mega-trigger .bp-menu__chevron,
.bp-menu__item--mega_parent.show > .bp-menu__mega-trigger .bp-menu__chevron {
    transform: rotate(180deg);
    opacity: 1;
}

/* ============================================================
 * Panel — fixed-positioned, viewport-aware, clamped, soft shadow
 *
 * Why `position: fixed`:
 *   - The blueprint header is sticky/fixed/translate'd, which makes ancestor
 *     containing blocks unpredictable. With `fixed` the panel always anchors
 *     to the viewport — JS measures the header's bottom edge and writes it
 *     to `--bp-mega-top` so the panel sits flush under the header regardless
 *     of scroll, header-hide animation, or front-page-overlay variants.
 *   - JS also writes `--bp-mega-shift` if the panel would overflow either
 *     viewport edge, so it always fits on screen.
 * ============================================================ */
.bp-mega__panel {
    position: fixed;
    top: var(--bp-mega-top, 64px);
    left: 50%;
    width: min(calc(100vw - 2rem), var(--bp-mega-max-width));
    max-width: calc(100vw - 2rem);
    margin: 0;
    padding: var(--bp-mega-pad);

    /* Visual */
    background: var(--bs-body-bg, #fff);
    color: var(--bs-body-color, #1a1a1a);
    border-radius: var(--bp-mega-radius);
    box-shadow: var(--bp-mega-shadow);
    list-style: none;

    /* Hidden state */
    transform: translateX(calc(-50% + var(--bp-mega-shift, 0px))) translateY(8px);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    z-index: 1100;   /* above sticky header so the panel covers anything below */

    /* Transition: open quick-ish, close slightly faster. */
    transition:
        opacity var(--bp-mega-dur-out) var(--bp-mega-ease),
        transform var(--bp-mega-dur-out) var(--bp-mega-ease),
        visibility 0s linear var(--bp-mega-dur-out);

    /* Grid */
    display: grid;
    gap: var(--bp-mega-gap);

    /* Tall panels: scroll inside, don't break the viewport */
    max-height: calc(100vh - var(--bp-mega-top, 64px) - 1.5rem);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

/* Prevent grid items from blowing past the panel due to min-width: auto.
   This is the classic "min-content sized grid item" gotcha. */
.bp-mega__panel > * {
    min-width: 0;
}

/* Suppress skins' animated link underline (a::after / a::before) inside the whole
   mega panel — it bleeds onto cards, CTA, featured, loop and column links. The mega
   CSS provides its own hover affordances instead. */
.bp-mega__panel a::after,
.bp-mega__panel a::before {
    content: none !important;
    display: none !important;
    background: none !important;
}

.bp-menu__item--mega_parent.is-open > .bp-mega__panel,
.bp-menu__item--mega_parent.show > .bp-mega__panel {
    opacity: 1;
    transform: translateX(calc(-50% + var(--bp-mega-shift, 0px))) translateY(0);
    pointer-events: auto;
    visibility: visible;
    transition:
        opacity var(--bp-mega-dur-in) var(--bp-mega-ease),
        transform var(--bp-mega-dur-in) var(--bp-mega-ease),
        visibility 0s linear 0s;
}

/* No CSS-only :hover fallback any more — the panel uses `position: fixed`,
   so `--bp-mega-top` must be JS-set before the panel can show without floating
   over the header. JS handles the open/close + position update. */

/* ============================================================
 * Hard overrides — beat any legacy `.blueprint-dropdown-menu` rules in skin
 * CSS that use !important. We use a compound selector (two classes) so the
 * specificity (0,2,0) wins over single-class !important rules (0,1,0).
 * This is a defensive measure for cases where the renderer still emits the
 * legacy class (e.g. cached HTML predating the renderer change).
 * ============================================================ */
ul.bp-mega__panel,
.bp-mega__panel.blueprint-dropdown-menu,
.bp-mega__panel.sub-menu {
    position: fixed !important;
    top: var(--bp-mega-top, 64px) !important;
    left: 50% !important;
    width: min(calc(100vw - 2rem), var(--bp-mega-max-width)) !important;
    max-width: calc(100vw - 2rem) !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: var(--bp-mega-pad) !important;
    transform: translateX(calc(-50% + var(--bp-mega-shift, 0px))) translateY(8px) !important;
    border-radius: var(--bp-mega-radius) !important;
    box-shadow: var(--bp-mega-shadow) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: var(--bs-body-bg, #fff) !important;
}

.bp-menu__item--mega_parent.is-open > .bp-mega__panel,
.bp-menu__item--mega_parent.show > .bp-mega__panel {
    transform: translateX(calc(-50% + var(--bp-mega-shift, 0px))) translateY(0) !important;
}

/* Full-width variant — anchor=full per-menu setting. Panel spans the viewport. */
.bp-mega__panel--full,
ul.bp-mega__panel.bp-mega__panel--full {
    width: 100vw !important;
    max-width: 100vw !important;
    border-radius: 0 !important;
    left: 50% !important;
    transform: translateX(-50%) translateY(8px) !important;
}
.bp-menu__item--mega_parent.is-open > .bp-mega__panel--full,
.bp-menu__item--mega_parent.show > .bp-mega__panel--full {
    transform: translateX(-50%) translateY(0) !important;
}

/* ============================================================
 * Layouts
 * ============================================================ */
/* Default grid — 12 columns. Every mega_column applies `grid-column: span N`
   inline, so columns place themselves and wrap automatically when a row fills.
   Pattern user wants — col(6) col(6) | col(12) | col(4) col(4) col(4) — works out
   of the box on a 12-col base. */
.bp-mega__panel,
.bp-mega__panel[data-layout="grid"],
.bp-mega__panel[data-layout="columns"] {
    grid-template-columns: repeat(var(--bp-mega-cols, 12), minmax(0, 1fr));
    grid-auto-flow: row dense;
}
.bp-mega__panel[data-layout="stack"] {
    grid-template-columns: minmax(0, 1fr);
    max-width: 520px;
}

/* Override --bp-mega-cols via data-cols (set by mega_parent's mega_cols config). */
.bp-mega__panel[data-cols="2"]  { --bp-mega-cols: 2; }
.bp-mega__panel[data-cols="3"]  { --bp-mega-cols: 3; }
.bp-mega__panel[data-cols="4"]  { --bp-mega-cols: 4; }
.bp-mega__panel[data-cols="5"]  { --bp-mega-cols: 5; }
.bp-mega__panel[data-cols="6"]  { --bp-mega-cols: 6; }
.bp-mega__panel[data-cols="8"]  { --bp-mega-cols: 8; }
.bp-mega__panel[data-cols="10"] { --bp-mega-cols: 10; }
.bp-mega__panel[data-cols="12"] { --bp-mega-cols: 12; }

/* ============================================================
 * Column — header + child link list
 * ============================================================ */
.bp-menu__item--mega_column {
    list-style: none;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.bp-mega__col-head {
    position: relative;
    margin: 0 0 0.85rem;
    padding-bottom: 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bs-secondary-color, #6c757d);
    border-bottom: 1px solid var(--bs-border-color, rgba(0, 0, 0, 0.08));
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.bp-mega__col-head::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 24px;
    height: 2px;
    background: var(--bs-primary, #0d6efd);
    border-radius: 2px;
}
.bp-mega__col-head .bp-menu__icon { color: var(--bs-primary, #0d6efd); }
.bp-mega__col-label { line-height: 1.2; }

/* Column's child <ul> — vertical link list */
.bp-menu__item--mega_column > .bp-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
}

/* Links inside a column */
.bp-menu__item--mega_column > .bp-menu > li > .bp-menu__link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.55rem;
    margin: 0 -0.55rem;
    font-size: 0.875rem;
    line-height: 1.35;
    color: var(--bs-body-color, #1a1a1a);
    text-decoration: none;
    border-radius: 6px;
    transition:
        color 150ms var(--bp-mega-ease),
        background 150ms var(--bp-mega-ease),
        transform 200ms var(--bp-mega-ease);
}
.bp-menu__item--mega_column > .bp-menu > li > .bp-menu__link:hover,
.bp-menu__item--mega_column > .bp-menu > li > .bp-menu__link:focus-visible {
    color: var(--bs-primary, #0d6efd);
    background: rgba(var(--bs-primary-rgb, 13, 110, 253), 0.06);
    transform: translateX(2px);
    outline: none;
}
.bp-menu__item--mega_column > .bp-menu > li > .bp-menu__link .bp-menu__icon {
    flex-shrink: 0;
    font-size: 1rem;
    color: var(--bs-primary, #0d6efd);
    opacity: 0.6;
    transition: opacity 150ms var(--bp-mega-ease), transform 150ms var(--bp-mega-ease);
}
.bp-menu__item--mega_column > .bp-menu > li > .bp-menu__link:hover .bp-menu__icon {
    opacity: 1;
    transform: scale(1.08);
}
.bp-menu__item--mega_column > .bp-menu > li > .bp-menu__link .bp-menu__label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Optional description (item->description_pl/en rendered as <small>) */
.bp-menu__item--mega_column > .bp-menu .bp-menu__desc {
    display: block;
    font-size: 0.75rem;
    color: var(--bs-secondary-color, #6c757d);
    margin-top: 0.1rem;
    font-weight: 400;
    line-height: 1.35;
}

/* "View all" trailing link convention — kind=special with class hint, or last link with .bp-menu__view-all */
.bp-menu__view-all,
.bp-menu__item--mega_column > .bp-menu > li.is-view-all > .bp-menu__link {
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px dashed var(--bs-border-color, rgba(0, 0, 0, 0.08));
    font-weight: 600;
    color: var(--bs-primary, #0d6efd) !important;
}

/* ============================================================
 * Image card (mega_image_card)
 * ============================================================ */
.bp-mega__card {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    text-decoration: none;
    color: inherit;
    border-radius: 10px;
    overflow: hidden;
    transition:
        transform 250ms var(--bp-mega-ease),
        box-shadow 250ms var(--bp-mega-ease);
    position: relative;
}
.bp-mega__card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.18);
}

.bp-mega__card-image {
    position: relative;
    overflow: hidden;
    background: var(--bs-tertiary-bg, #f8f9fa);
    border-radius: 10px;
}
.bp-mega__card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 600ms var(--bp-mega-ease);
}
.bp-mega__card:hover .bp-mega__card-image img {
    transform: scale(1.06);
}

.bp-mega__card-image--16-9 { aspect-ratio: 16 / 9; }
.bp-mega__card-image--4-3  { aspect-ratio: 4 / 3; }
.bp-mega__card-image--1-1  { aspect-ratio: 1 / 1; }
.bp-mega__card-image--21-9 { aspect-ratio: 21 / 9; }
.bp-mega__card-image--3-2  { aspect-ratio: 3 / 2; }

/* Overlay variant — text on top of image */
.bp-mega__card--overlay { color: #fff; }
.bp-mega__card--overlay .bp-mega__card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.25) 55%, transparent 100%);
    pointer-events: none;
}
.bp-mega__card--overlay .bp-mega__card-body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1rem 1.1rem;
    z-index: 1;
}
.bp-mega__card--overlay .bp-mega__card-title,
.bp-mega__card--overlay .bp-mega__card-desc {
    color: #fff;
}

.bp-mega__card-body { padding: 0 0.15rem; }
.bp-mega__card-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--bs-body-color, #1a1a1a);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.bp-mega__card-title::after {
    content: '\2192';   /* → */
    font-size: 0.85em;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 200ms var(--bp-mega-ease), transform 200ms var(--bp-mega-ease);
    color: var(--bs-primary, #0d6efd);
}
.bp-mega__card:hover .bp-mega__card-title::after {
    opacity: 1;
    transform: translateX(0);
}
.bp-mega__card-desc {
    margin: 0.2rem 0 0;
    font-size: 0.78rem;
    color: var(--bs-secondary-color, #6c757d);
    line-height: 1.45;
}

/* ============================================================
 * CTA box (mega_cta_box)
 * ============================================================ */
.bp-mega__cta-box {
    padding: 1.4rem 1.3rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
    min-height: 160px;
    color: #fff;
    position: relative;
    overflow: hidden;
    transition: transform 250ms var(--bp-mega-ease), box-shadow 250ms var(--bp-mega-ease);
}
.bp-mega__cta-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.25);
}

.bp-mega__cta-box--primary { background: var(--bs-primary, #0d6efd); }
.bp-mega__cta-box--secondary { background: var(--bs-secondary, #6c757d); }
.bp-mega__cta-box--amber { background: #f59e0b; }
.bp-mega__cta-box--dark { background: var(--bs-dark, #1a1a1a); }
.bp-mega__cta-box--gradient {
    background: linear-gradient(135deg,
        var(--bs-primary, #0d6efd) 0%,
        var(--bs-info, #6366f1) 100%);
}
.bp-mega__cta-box--with-image {
    background-size: cover;
    background-position: center;
}
.bp-mega__cta-box--with-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.35));
    z-index: 0;
}
.bp-mega__cta-box-body {
    position: relative;
    z-index: 1;
}

.bp-mega__cta-box-title {
    display: block;
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.25;
}
.bp-mega__cta-box-desc {
    margin: 0 0 1rem;
    font-size: 0.85rem;
    opacity: 0.92;
    line-height: 1.45;
}
.bp-mega__cta-box-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(8px);
    color: #fff !important;
    text-decoration: none;
    border-radius: 7px;
    font-weight: 600;
    font-size: 0.85rem;
    align-self: flex-start;
    transition: background 150ms var(--bp-mega-ease), transform 150ms var(--bp-mega-ease);
    border: 1px solid rgba(255, 255, 255, 0.25);
}
.bp-mega__cta-box-btn:hover {
    background: rgba(255, 255, 255, 0.30);
    transform: translateX(3px);
}

/* ============================================================
 * Loop — card display mode (locations w/ logo, posts w/ thumb, realizations w/ hero)
 * The loop's own <ul> handles the grid (inline grid-template + per-item span).
 * Here we style the individual card link.
 * ============================================================ */
.bp-menu--loop { list-style: none; margin: 0; padding: 0; }
.bp-menu--loop > li { list-style: none; margin: 0; }

.bp-menu__loop-card {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.5rem;
    margin: 0;
    text-decoration: none;
    color: var(--bs-body-color, #1a1a1a);
    border-radius: 10px;
    border: 1px solid transparent;
    transition: background 150ms var(--bp-mega-ease), border-color 150ms var(--bp-mega-ease), transform 150ms var(--bp-mega-ease);
}
/* Kill skin's animated link underline (a::after / a::before) bleeding onto cards. */
.bp-menu__loop-card::after,
.bp-menu__loop-card::before,
.bp-menu__loop-card-title::after,
.bp-menu__loop-card-title::before {
    content: none !important;
    display: none !important;
    background: none !important;
}
.bp-menu__loop-card:hover,
.bp-menu__loop-card:focus-visible {
    background: rgba(var(--bs-primary-rgb, 13, 110, 253), 0.05);
    border-color: rgba(var(--bs-primary-rgb, 13, 110, 253), 0.15);
    transform: translateY(-1px);
    outline: none;
}

.bp-menu__loop-card-media {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bs-tertiary-bg, #f1f3f5);
}
.bp-menu__loop-card-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;   /* logos/herby look best uncropped; thumbs still fill */
    display: block;
}
.bp-menu__loop-card-media--icon {
    color: var(--bs-primary, #0d6efd);
    font-size: 1.25rem;
    background: rgba(var(--bs-primary-rgb, 13, 110, 253), 0.08);
}

.bp-menu__loop-card-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.bp-menu__loop-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--bs-body-color, #1a1a1a);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bp-menu__loop-card:hover .bp-menu__loop-card-title { color: var(--bs-primary, #0d6efd); }
.bp-menu__loop-card-sub {
    font-size: 0.75rem;
    color: var(--bs-secondary-color, #6c757d);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================================
 * Featured posts (mega_featured_posts)
 * ============================================================ */
.bp-mega__featured-heading {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bs-secondary-color, #6c757d);
    margin: 0 0 0.85rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--bs-border-color, rgba(0, 0, 0, 0.08));
    position: relative;
}
.bp-mega__featured-heading::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 24px;
    height: 2px;
    background: var(--bs-primary, #0d6efd);
    border-radius: 2px;
}

.bp-mega__featured-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.bp-mega__featured-link {
    display: flex;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    padding: 0.4rem;
    margin: -0.4rem;
    border-radius: 8px;
    transition: background 150ms var(--bp-mega-ease);
}
.bp-mega__featured-link:hover {
    background: rgba(var(--bs-primary-rgb, 13, 110, 253), 0.05);
}

.bp-mega__featured-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.bp-mega__featured-body { flex: 1; min-width: 0; }

.bp-mega__featured-title {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.2rem;
    color: var(--bs-body-color, #1a1a1a);
    transition: color 150ms var(--bp-mega-ease);
}
.bp-mega__featured-link:hover .bp-mega__featured-title {
    color: var(--bs-primary, #0d6efd);
}

.bp-mega__featured-date {
    font-size: 0.72rem;
    color: var(--bs-secondary-color, #6c757d);
}

.bp-mega__featured-excerpt {
    margin: 0.25rem 0 0;
    font-size: 0.78rem;
    color: var(--bs-secondary-color, #6c757d);
    line-height: 1.45;
}

/* ============================================================
 * Mobile — panel collapses inline, no float, full width
 * ============================================================ */
@media (max-width: 991.98px) {
    .bp-mega__panel {
        position: static;
        top: auto;
        left: auto;
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        width: 100%;
        max-width: 100%;
        max-height: none;
        overflow: visible;
        padding: 0.5rem 0 1rem;
        margin: 0;
        background: transparent;
        box-shadow: none;
        border-radius: 0;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 1rem;
        display: none;
        z-index: auto;
    }
    .bp-menu__item--mega_parent.is-open > .bp-mega__panel,
    .bp-menu__item--mega_parent.show > .bp-mega__panel {
        display: grid;
    }
    .bp-mega__card-image { max-width: 240px; }
    .bp-mega__cta-box { min-height: auto; }
}

/* ============================================================
 * CTA buttons — item rendered as a button (cta_style on the <li>).
 * These styles ship with the always-enqueued mega CSS so CTAs work on every
 * skin without per-skin .bp-cta-* definitions. High specificity (.is-cta +
 * style class + > child) so they win over the skin's plain `.…menu-list a`.
 * ============================================================ */
.bp-menu__item.is-cta > .bp-menu__link,
.bp-menu__item.is-cta > .bp-menu__mega-trigger {
    display: inline-flex !important;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.1rem;
    border-radius: var(--bp-radius-button, 0.5rem);
    font-weight: 600;
    text-decoration: none !important;
    border: 2px solid transparent;
    line-height: 1.2;
    transition: filter 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.bp-menu__item.is-cta > .bp-menu__link::after,
.bp-menu__item.is-cta > .bp-menu__link::before { content: none !important; display: none !important; }

/* color uses !important so the skin's `.…menu-list a { color: … !important }` can't
   override the button text (#4 — primary CTA keeps white text, not skin link color). */
.bp-menu__item.is-cta.bp-cta-primary > .bp-menu__link        { background: var(--bs-primary, #0d6efd); color: #fff !important; border-color: var(--bs-primary, #0d6efd); }
.bp-menu__item.is-cta.bp-cta-secondary > .bp-menu__link      { background: var(--bs-secondary, #6c757d); color: #fff !important; border-color: var(--bs-secondary, #6c757d); }
.bp-menu__item.is-cta.bp-cta-outline-primary > .bp-menu__link   { background: transparent; color: var(--bs-primary, #0d6efd) !important; border-color: var(--bs-primary, #0d6efd); }
.bp-menu__item.is-cta.bp-cta-outline-secondary > .bp-menu__link { background: transparent; color: var(--bs-secondary, #6c757d) !important; border-color: var(--bs-secondary, #6c757d); }
.bp-menu__item.is-cta.bp-cta-ghost > .bp-menu__link          { background: rgba(0, 0, 0, 0.05); color: var(--bs-body-color, #1a1a1a) !important; }
.bp-menu__item.is-cta.bp-cta-amber > .bp-menu__link          { background: #f59e0b; color: #fff !important; border-color: #f59e0b; }

.bp-menu__item.is-cta.bp-cta-primary > .bp-menu__link:hover,
.bp-menu__item.is-cta.bp-cta-secondary > .bp-menu__link:hover,
.bp-menu__item.is-cta.bp-cta-amber > .bp-menu__link:hover { filter: brightness(1.08); color: #fff !important; transform: translateY(-1px); }
.bp-menu__item.is-cta.bp-cta-outline-primary > .bp-menu__link:hover   { background: var(--bs-primary, #0d6efd); color: #fff !important; }
.bp-menu__item.is-cta.bp-cta-outline-secondary > .bp-menu__link:hover { background: var(--bs-secondary, #6c757d); color: #fff !important; }
.bp-menu__item.is-cta.bp-cta-ghost > .bp-menu__link:hover { background: rgba(0, 0, 0, 0.1); }

/* CTA arrow — nudges right on hover. */
.bp-menu__cta-arrow { transition: transform 0.15s ease; }
.bp-menu__link:hover .bp-menu__cta-arrow { transform: translateX(3px); }

/* Sizes */
.bp-menu__item.is-cta.bp-cta-size-sm > .bp-menu__link { padding: 0.3rem 0.8rem; font-size: 0.85rem; }
.bp-menu__item.is-cta.bp-cta-size-lg > .bp-menu__link { padding: 0.65rem 1.4rem; font-size: 1.05rem; }

/* Align right (cta_align=right → .ms-auto on the <li>) — ensure utility exists. */
.bp-menu__item.is-cta.ms-auto { margin-left: auto !important; }

/* ============================================================
 * Link display modes (link / entity / special — `display` config)
 *   default     → icon + label (no extra CSS needed)
 *   icon-right  → label then icon
 *   rich        → icon + (title + description below)
 * ============================================================ */
.bp-menu__link--display-icon-right {
    flex-direction: row;
}
.bp-menu__link--display-rich {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}
.bp-menu__link--display-rich .bp-menu__icon {
    flex-shrink: 0;
    font-size: 1.15rem;
    margin-top: 0.1rem;
    color: var(--bs-primary, #0d6efd);
}
.bp-menu__link-body {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}
.bp-menu__link--display-rich .bp-menu__label {
    font-weight: 600;
    line-height: 1.3;
}
.bp-menu__desc {
    font-size: 0.78rem;
    color: var(--bs-secondary-color, #6c757d);
    line-height: 1.4;
    font-weight: 400;
}

/* ============================================================
 * Heading (section title) — styles + sizes
 * ============================================================ */
.bp-menu__heading {
    margin: 0.5rem 0 0.35rem;
    color: var(--bs-body-color, #1a1a1a);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.bp-menu__heading .bp-menu__icon { color: var(--bs-primary, #0d6efd); }
.bp-menu__heading--h4 { font-size: 1.15rem; }
.bp-menu__heading--h5 { font-size: 1rem; }
.bp-menu__heading--h6 { font-size: 0.78rem; }

.bp-menu__heading--uppercase {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--bs-secondary-color, #6c757d);
}
.bp-menu__heading--bold { font-weight: 700; }
.bp-menu__heading--normal { font-weight: 500; }

/* Accent — uppercase label with a short underline bar (like mega column heads). */
.bp-menu__heading--accent {
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--bs-secondary-color, #6c757d);
    padding-bottom: 0.45rem;
    border-bottom: 1px solid var(--bs-border-color, rgba(0,0,0,0.08));
    margin-bottom: 0.6rem;
}
.bp-menu__heading--accent::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 24px;
    height: 2px;
    background: var(--bs-primary, #0d6efd);
    border-radius: 2px;
}

/* Boxed — pill/box background. */
.bp-menu__heading--boxed {
    display: inline-flex;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    font-size: 0.72rem;
    color: var(--bs-primary, #0d6efd);
    background: rgba(var(--bs-primary-rgb, 13, 110, 253), 0.10);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
}

/* ============================================================
 * Container — inline group display (children shown directly, not a dropdown)
 * ============================================================ */
.bp-menu__container--inline {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--bs-secondary-color, #6c757d);
    padding: 0.3rem 0;
}
.bp-menu__container--inline .bp-menu__icon { color: var(--bs-primary, #0d6efd); }

/* Force the inline container's child list to be a visible static group
   (override the dropdown hover-reveal / absolute positioning). */
.bp-container-inline > .bp-menu,
.bp-container-inline > .blueprint-dropdown-menu {
    position: static !important;
    display: flex !important;
    flex-direction: column;
    gap: 0.1rem;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    box-shadow: none !important;
    border: 0 !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0.25rem 0 0 !important;
    min-width: 0 !important;
    backdrop-filter: none !important;
}

/* ============================================================
 * Image card — side layout (image left, text right)
 * ============================================================ */
.bp-mega__card--side {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
}
.bp-mega__card--side .bp-mega__card-image {
    flex: 0 0 88px;
    width: 88px;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
}
.bp-mega__card--side .bp-mega__card-body {
    flex: 1;
    min-width: 0;
    padding: 0;
}
.bp-mega__card--side .bp-mega__card-title { margin: 0; }

/* ============================================================
 * Nested (level 3+) dropdowns — side flyout for NON-mega menus.
 *
 * The renderer only wires hover-reveal at depth 0 (skin header.css targets
 * `.blueprint-has-dropdown`, which the renderer sets only on top-level <li>).
 * Two problems with deeper submenus left unstyled:
 *   1. The skin's reveal rule uses a *descendant* combinator
 *      (`.blueprint-has-dropdown:hover .blueprint-dropdown-menu`), so hovering the
 *      top item flashes EVERY nested submenu open at once, stacked below the parent.
 *   2. Nested menus inherit `top:100%; left:50%` → they overlap their parent.
 * Fix: re-hide nested dropdowns by default (higher specificity than the skin's
 * reveal) and open them as a right-side flyout only when their OWN parent <li>
 * is hovered / focused / programmatically expanded. Scoped to nav context only —
 * drawer/sidebar/inline submenus expand inline (accordion) via skin header.css.
 * ============================================================ */
.bp-menu--nav .blueprint-dropdown-menu .bp-menu__item.has-children {
    position: relative;
}

/* Default hidden + side-flyout geometry. The extra `.sub-menu` qualifier raises
   specificity to (0,4,0) so this beats the skin's (0,3,0) descendant reveal. */
.bp-menu--nav .blueprint-dropdown-menu .blueprint-dropdown-menu.sub-menu {
    top: -0.4rem;
    left: 100%;
    right: auto;
    transform: translateX(8px);
    opacity: 0;
    visibility: hidden;
}

.bp-menu--nav .blueprint-dropdown-menu .bp-menu__item.has-children:hover > .blueprint-dropdown-menu.sub-menu,
.bp-menu--nav .blueprint-dropdown-menu .bp-menu__item.has-children:focus-within > .blueprint-dropdown-menu.sub-menu,
.bp-menu--nav .blueprint-dropdown-menu .bp-menu__item.has-children.is-expanded > .blueprint-dropdown-menu.sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Flyout that would overflow the right viewport edge flips to the left.
   JS (bp-menu-mega.js) tags the parent <li> with .bp-flyout-left at hover time. */
.bp-menu--nav .blueprint-dropdown-menu .bp-menu__item.has-children.bp-flyout-left > .blueprint-dropdown-menu.sub-menu {
    left: auto;
    right: 100%;
    transform: translateX(-8px);
}
.bp-menu--nav .blueprint-dropdown-menu .bp-menu__item.has-children.bp-flyout-left:hover > .blueprint-dropdown-menu.sub-menu,
.bp-menu--nav .blueprint-dropdown-menu .bp-menu__item.has-children.bp-flyout-left.is-expanded > .blueprint-dropdown-menu.sub-menu {
    transform: translateX(0);
}

/* Nested parent row: chevron points to the side (set in renderStandardLink). */
.bp-menu__chevron--flyout {
    margin-left: auto;
    font-size: 0.7em;
    opacity: 0.6;
}
