/* Site map design layer.
 *
 * The presentation layer for Components/Pages/SitemapPage.razor. Global CSS,
 * linked from App.razor, so the same two rules the sibling page sheets call out
 * apply here:
 *
 * 1. Nothing confines these rules to this page, so every selector is qsm-
 *    prefixed or a descendant of one. No bare element selectors.
 * 2. Any @keyframes would carry the qsm- prefix too, so they cannot collide
 *    with the compiled Tailwind bundle or with home's qh-, pricing's qp-, the
 *    blog's qb- or the help centre's qc- animations.
 *
 * These rules are unlayered and Tailwind v4's utilities live inside @layer, so
 * they win regardless of specificity. Keep every selector class-based.
 *
 * Palette is the logo ramp the pricing, blog and help-centre pages share:
 * #a22dea (magenta-violet) → #7b5ee5 → #5b5de2 (indigo-blue), with #4f46e5 as
 * the primary. Deliberately one accent rather than a per-card hue ramp — the
 * page is a dense index and a card is told apart by its heading, not its
 * colour.
 *
 * Reading order the layout is built around: a compact hero → a search card that
 * filters the list below it → a masonry of count-badged cards, each a menu with
 * its pages, three-level menus carrying collapsible sub-groups.
 *
 * The masonry is CSS multi-column, not grid. A grid would give every card in a
 * row the height of the tallest one, which on a page whose cards run from one
 * link to seventeen leaves most of them mostly empty; columns pack by height
 * instead. break-inside on the card is what stops one splitting across the
 * column boundary.
 */

/* ── shared ─────────────────────────────────────────────────────────── */
.qsm-page {
    background: linear-gradient(180deg, #fbfaff 0%, #f7f7fc 420px, #f7f7fc 100%);
    padding: 0 0 68px;
}

/* Visually hidden, still read out. */
.qsm-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── hero ───────────────────────────────────────────────────────────── */
.qsm-hero {
    position: relative;
    overflow: hidden;
    padding: 46px 0 34px;
}

.qsm-hero__aurora {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.qsm-hero__aurora i {
    position: absolute;
    display: block;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .45;
}

.qsm-hero__aurora i:nth-child(1) {
    width: 380px;
    height: 380px;
    top: -190px;
    left: -120px;
    background: radial-gradient(circle, rgba(162, 45, 234, .28), transparent 68%);
}

.qsm-hero__aurora i:nth-child(2) {
    width: 340px;
    height: 340px;
    top: -170px;
    right: -90px;
    background: radial-gradient(circle, rgba(91, 93, 226, .28), transparent 68%);
}

.qsm-hero .boxed-container {
    position: relative;
    z-index: 1;
}

.qsm-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    padding: 0;
    list-style: none;
    font-size: 13px;
    color: #6b7280;
}

.qsm-crumbs a {
    color: #6b7280;
    text-decoration: none;
    transition: color .2s ease;
}

.qsm-crumbs a:hover {
    color: #4f46e5;
}

.qsm-crumbs__sep {
    color: #d1d5db;
}

.qsm-crumbs__now {
    color: #111827;
    font-weight: 600;
}

.qsm-hero__title {
    margin: 0;
    font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem);
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -.025em;
    color: #0f172a;
}

.qsm-accent {
    background: linear-gradient(100deg, #a22dea 0%, #7b5ee5 52%, #5b5de2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.qsm-hero__lede {
    margin: 12px 0 0;
    max-width: 620px;
    font-size: 1rem;
    line-height: 1.65;
    color: #4b5563;
}

/* ── search card ────────────────────────────────────────────────────── */
.qsm-search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px 26px;
    margin: 0 0 22px;
    padding: 20px 22px;
    border-radius: 18px;
    border: 1px solid rgba(17, 24, 39, .07);
    background: #fff;
    box-shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 14px 34px -26px rgba(17, 24, 39, .30);
}

.qsm-search__intro {
    flex: 0 1 260px;
    min-width: 0;
}

.qsm-search__title {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 800;
    letter-spacing: -.015em;
    color: #111827;
}

.qsm-search__hint {
    margin: 4px 0 0;
    font-size: .8125rem;
    line-height: 1.5;
    color: #6b7280;
}

.qsm-search__field {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 340px;
    min-width: 0;
    padding: 4px 4px 4px 38px;
    border-radius: 12px;
    border: 1px solid rgba(17, 24, 39, .12);
    background: #f9fafb;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.qsm-search__field:focus-within {
    background: #fff;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, .14);
}

.qsm-search__ic {
    position: absolute;
    left: 13px;
    width: 16px;
    height: 16px;
    color: #9ca3af;
    pointer-events: none;
}

.qsm-search__input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 8px 10px 8px 0;
    border: 0;
    background: transparent;
    font-size: .875rem;
    color: #111827;
    outline: none;
    /* Safari draws its own clear button and rounds the field; both fight the
       one this card already provides. */
    -webkit-appearance: none;
    appearance: none;
}

.qsm-search__input::placeholder {
    color: #9ca3af;
}

.qsm-search__btn {
    flex: none;
    padding: 8px 18px;
    border: 0;
    border-radius: 9px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    font-size: .8125rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: filter .2s ease, transform .2s ease;
}

.qsm-search__btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.qsm-search__btn:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

.qsm-empty {
    margin: 0 0 22px;
    padding: 16px 20px;
    border-radius: 14px;
    border: 1px dashed rgba(79, 70, 229, .30);
    background: rgba(79, 70, 229, .04);
    font-size: .875rem;
    line-height: 1.6;
    color: #4b5563;
}

/* ── card masonry ───────────────────────────────────────────────────── */
.qsm-grid {
    columns: 1;
    column-gap: 22px;
}

.qsm-card {
    /* Multi-column would otherwise cut a card in half at the column boundary. */
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    display: inline-block;
    width: 100%;
    margin: 0 0 22px;
    padding: 18px 20px 16px;
    border-radius: 16px;
    border: 1px solid rgba(17, 24, 39, .07);
    background: #fff;
    box-shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 12px 30px -26px rgba(17, 24, 39, .28);
}

.qsm-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 0 12px;
    margin: 0 0 12px;
    border-bottom: 1px solid rgba(17, 24, 39, .07);
}

.qsm-card__title {
    margin: 0;
    min-width: 0;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -.01em;
    color: #111827;
}

.qsm-card__title a {
    color: inherit;
    text-decoration: none;
    transition: color .2s ease;
}

.qsm-card__title a:hover {
    color: #4f46e5;
}

.qsm-card__count {
    flex: none;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(79, 70, 229, .09);
    font-size: 11px;
    font-weight: 700;
    color: #4f46e5;
    white-space: nowrap;
}

/* ── collapsible groups ─────────────────────────────────────────────── */
.qsm-group + .qsm-group {
    margin-top: 6px;
}

.qsm-group__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 8px;
    border-radius: 9px;
    cursor: pointer;
    list-style: none;
    font-size: .8125rem;
    font-weight: 700;
    color: #374151;
    transition: background-color .18s ease, color .18s ease;
}

/* Safari draws a disclosure triangle unless both of these are cleared. */
.qsm-group__head::-webkit-details-marker {
    display: none;
}

.qsm-group__head::marker {
    content: "";
}

.qsm-group__head:hover {
    background: rgba(79, 70, 229, .06);
    color: #4f46e5;
}

.qsm-group__head:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 1px;
}

.qsm-group__chev {
    flex: none;
    width: 15px;
    height: 15px;
    color: #9ca3af;
    transition: transform .2s ease, color .18s ease;
}

.qsm-group[open] > .qsm-group__head .qsm-group__chev {
    transform: rotate(180deg);
}

.qsm-group__head:hover .qsm-group__chev {
    color: #4f46e5;
}

.qsm-group > .qsm-links {
    /* Indented under its heading, with a rule to carry the eye down the group. */
    margin-left: 8px;
    padding-left: 10px;
    border-left: 1px solid rgba(79, 70, 229, .16);
}

/* ── links ──────────────────────────────────────────────────────────── */
.qsm-links {
    margin: 0;
    padding: 0;
    list-style: none;
}

.qsm-link {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 8px;
    font-size: .8125rem;
    line-height: 1.5;
    color: #4b5563;
    text-decoration: none;
    transition: background-color .16s ease, color .16s ease;
}

.qsm-link:hover {
    background: rgba(79, 70, 229, .06);
    color: #4f46e5;
}

.qsm-link:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 1px;
}

.qsm-link__chev {
    flex: none;
    width: 12px;
    height: 12px;
    margin-top: 4px;
    color: #a5b4fc;
    transition: transform .16s ease, color .16s ease;
}

.qsm-link:hover .qsm-link__chev {
    color: #4f46e5;
    transform: translateX(2px);
}

.qsm-link__label {
    min-width: 0;
}

/* ── responsive ─────────────────────────────────────────────────────── */
@media (min-width: 768px) {
    .qsm-hero {
        padding: 60px 0 40px;
    }

    .qsm-grid {
        columns: 2;
    }
}

@media (min-width: 1280px) {
    .qsm-grid {
        columns: 3;
    }
}

@media (prefers-reduced-motion: reduce) {
    .qsm-search__btn,
    .qsm-link,
    .qsm-link__chev,
    .qsm-group__chev {
        transition: none;
    }

    .qsm-search__btn:hover,
    .qsm-link:hover .qsm-link__chev {
        transform: none;
    }
}
