/* Help Center: contextual icon, drawer, article typography, and the /help pages (ADR-0026).
   Mobile-first is the hard requirement: the drawer is a full-screen overlay under 768px and a
   side panel on desktop. Colors/spacing come from xal-tokens.css. */

/* ---- Contextual help icon --------------------------------------------------------------- */

.xal-help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 6px;
    margin: 0;
    cursor: pointer;
    color: var(--xal-text-secondary);
    line-height: 1;
    border-radius: 50%;
    vertical-align: middle;
}

    .xal-help-icon:hover,
    .xal-help-icon:focus-visible {
        color: var(--xal-gold);
    }

    .xal-help-icon .xal-icon {
        width: 1.15em;
        height: 1.15em;
    }

/* Touch targets: ≥44px on mobile (house standard for tap targets). */
@media (max-width: 767.98px) {
    .xal-help-icon {
        min-width: 44px;
        min-height: 44px;
    }
}

/* ---- Drawer ------------------------------------------------------------------------------ */

/* Above MudBlazor dialogs (~1400) so contextual help opened from inside a dialog lands on
   top of it, below popovers/tooltips. */
.xal-help-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1450;
}

.xal-help-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(420px, 100vw);
    display: flex;
    flex-direction: column;
    background: var(--xal-bg-card);
    border-left: var(--xal-border-card);
    box-shadow: var(--xal-shadow-lg);
    z-index: 1451;
    animation: xal-help-slide-in 0.18s ease-out;
}

@keyframes xal-help-slide-in {
    from { transform: translateX(24px); opacity: 0.5; }
    to { transform: translateX(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .xal-help-drawer {
        animation: none;
    }
}

/* Mobile: the drawer IS the screen. */
@media (max-width: 767.98px) {
    .xal-help-drawer {
        width: 100vw;
        border-left: none;
    }
}

.xal-help-drawer__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px 12px;
    border-bottom: var(--xal-border-card);
}

.xal-help-drawer__heading {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.xal-help-drawer__title {
    font-weight: 600;
    font-size: 1.05rem;
}

.xal-help-drawer__full-link {
    font-size: 0.8rem;
    color: var(--xal-text-secondary);
    text-decoration: none;
}

    .xal-help-drawer__full-link:hover {
        color: var(--xal-gold);
        text-decoration: underline;
    }

.xal-help-drawer__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--xal-text-secondary);
    cursor: pointer;
    padding: 8px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
}

    .xal-help-drawer__close:hover {
        color: var(--xal-gold);
    }

.xal-help-drawer__body {
    overflow-y: auto;
    padding: 16px 20px 32px;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.xal-help-drawer__loading {
    color: var(--xal-text-secondary);
}

/* ---- Article typography (shared: drawer body + Help Center article) ---------------------- */

.xal-help-article {
    font-size: 0.95rem;
    line-height: 1.6;
}

    .xal-help-article h2 {
        font-size: 1.05rem;
        font-weight: 600;
        margin: 1.4em 0 0.4em;
    }

    .xal-help-article h3 {
        font-size: 0.95rem;
        font-weight: 600;
        margin: 1.2em 0 0.3em;
    }

    .xal-help-article p {
        margin: 0 0 0.8em;
    }

    .xal-help-article ul,
    .xal-help-article ol {
        margin: 0 0 0.8em;
        padding-left: 1.3em;
    }

    .xal-help-article li {
        margin-bottom: 0.35em;
    }

    .xal-help-article a {
        color: var(--xal-gold);
        text-decoration: none;
    }

        .xal-help-article a:hover {
            text-decoration: underline;
        }

    /* Callouts: "> **Note:** ..." blockquotes per docs/help/STYLE.md. */
    .xal-help-article blockquote {
        margin: 0 0 0.8em;
        padding: 10px 14px;
        border-left: 3px solid var(--xal-gold);
        background: rgba(212, 175, 55, 0.07);
        border-radius: 0 6px 6px 0;
    }

        .xal-help-article blockquote p {
            margin: 0;
        }

    .xal-help-article code {
        font-size: 0.85em;
        background: rgba(255, 255, 255, 0.08);
        padding: 1px 5px;
        border-radius: 4px;
    }

    .xal-help-article img,
    .xal-help-article svg {
        max-width: 100%;
    }

.xal-help-article__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.6em;
}

/* ---- Help Center pages ------------------------------------------------------------------- */

.xal-help-center__hero {
    text-align: center;
    margin-bottom: 20px;
}

.xal-help-center__title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 4px;
}

.xal-help-center__subtitle {
    color: var(--xal-text-secondary);
    margin: 0;
}

.xal-help-center__search {
    margin: 0 auto 24px;
    max-width: 560px;
}

.xal-help-center__search-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    color: inherit;
    background: var(--xal-bg-card);
    border: var(--xal-border-card);
    border-radius: 999px;
    outline: none;
}

    .xal-help-center__search-input:focus-visible {
        border-color: var(--xal-gold);
    }

.xal-help-center__results {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    max-width: 560px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.xal-help-center__result {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 16px;
    background: var(--xal-bg-card);
    border: var(--xal-border-card);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
}

    .xal-help-center__result:hover {
        border-color: var(--xal-gold);
    }

.xal-help-center__result-title {
    font-weight: 600;
}

.xal-help-center__result-desc {
    font-size: 0.85rem;
    color: var(--xal-text-secondary);
}

.xal-help-center__no-results {
    text-align: center;
    color: var(--xal-text-secondary);
}

.xal-help-center__section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 28px 0 12px;
}

.xal-help-center__personas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

    /* Persona cards reuse .xal-em-format-card; as anchors they need link resets. */
    .xal-help-center__personas .xal-em-format-card {
        text-decoration: none;
        color: inherit;
    }

.xal-help-center__area {
    margin-bottom: 32px;
}

/* The area heading used to sit smaller and dimmer than the topic links beneath it, so long topic
   lists ran together as one wall of links. Gold + uppercase + a hairline rule makes each group's
   start unmistakable at a glance. */
.xal-help-center__area-title {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--xal-gold);
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--xal-gold-border);
}

.xal-help-center__area ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.xal-help-center__topic-link {
    color: inherit;
    text-decoration: none;
}

    .xal-help-center__topic-link:hover {
        color: var(--xal-gold);
        text-decoration: underline;
    }

.xal-help-center__breadcrumb {
    display: flex;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--xal-text-secondary);
    margin-bottom: 16px;
}

    .xal-help-center__breadcrumb a {
        color: var(--xal-text-secondary);
        text-decoration: none;
    }

        .xal-help-center__breadcrumb a:hover {
            color: var(--xal-gold);
        }

.xal-help-center__related {
    margin-top: 24px;
}
