/* Styling for the HTML rendered from Markdown content files (Content/UserGuide/** and Content/FAQ/**).
   This content is injected via @Html.Raw in Pages/Guide/Index.cshtml and Pages/Faq.cshtml, so it is never
   part of that page's own markup — Razor's CSS isolation (Index.cshtml.css) can only scope literal tags
   written in the .cshtml file itself, and has no way to tag elements that arrive as a raw HTML string at
   render time. These rules must therefore live in a normal, unscoped stylesheet instead of the page's
   scoped CSS file. Every rule below targets both the guide's content wrapper (.guide__section) and the
   FAQ's content wrapper (.faq-content) so the two render identically. */

.guide__section img,
.faq-content img {
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
/*    margin-inline: auto;
*/    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}

.guide__section pre,
.faq-content pre {
    background-color: var(--color-bg-subtle);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    overflow-x: auto;
}

.guide__section code,
.faq-content code {
    background-color: var(--color-bg-subtle);
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.9em;
}

.guide__section pre code,
.faq-content pre code {
    background-color: transparent;
    padding: 0;
}

.guide__section table,
.faq-content table {
    border-collapse: collapse;
    width: 100%;
}

.guide__section th,
.guide__section td,
.faq-content th,
.faq-content td {
    border: 1px solid var(--color-border);
    padding: var(--space-2) var(--space-3);
    text-align: left;
}

.guide__section hr,
.faq-content hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin-block: var(--space-6);
}

.guide__section .last-updated,
.faq-content .last-updated {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-top: var(--space-6);
}

.guide__section .callout,
.faq-content .callout {
    border-left: 4px solid var(--color-border);
    background-color: var(--color-bg-subtle);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    margin-block: var(--space-4);
}

.guide__section .callout p:last-child,
.guide__section .callout span:last-child,
.faq-content .callout p:last-child,
.faq-content .callout span:last-child {
    margin-bottom: 0;
}

.guide__section .callout::before,
.faq-content .callout::before {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: var(--space-1);
}

.guide__section .callout.info,
.faq-content .callout.info {
    border-left-color: var(--color-accent);
    background-color: rgb(0 113 193 / 0.08);
}

.guide__section .callout.info::before,
.faq-content .callout.info::before {
    content: "Note";
    color: var(--color-accent);
}

.guide__section .callout.tip,
.faq-content .callout.tip {
    border-left-color: #1a7f37;
    background-color: rgb(26 127 55 / 0.08);
}

.guide__section .callout.tip::before,
.faq-content .callout.tip::before {
    content: "Tip";
    color: #1a7f37;
}

.guide__section .callout.warn,
.faq-content .callout.warn {
    border-left-color: #b35900;
    background-color: rgb(179 89 0 / 0.08);
}

.guide__section .callout.warn::before,
.faq-content .callout.warn::before {
    content: "Warning";
    color: #b35900;
}

.guide__section .setting-block,
.faq-content .setting-block {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-block: var(--space-4);
    background-color: var(--color-surface);
}

.guide__section .setting-header,
.faq-content .setting-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.guide__section .setting-name,
.faq-content .setting-name {
    font-weight: 700;
}

.guide__section .setting-badge,
.guide__section .badge,
.faq-content .setting-badge,
.faq-content .badge {
    display: inline-block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background-color: var(--color-bg-subtle);
    color: var(--color-text-muted);
}

.guide__section .badge,
.faq-content .badge {
    margin-left: var(--space-2);
    vertical-align: middle;
}

.guide__section .setting-badge.badge-toggle,
.faq-content .setting-badge.badge-toggle {
    background-color: rgb(0 113 193 / 0.12);
    color: var(--color-accent);
}

.guide__section .setting-badge.badge-select,
.faq-content .setting-badge.badge-select {
    background-color: rgb(124 58 237 / 0.12);
    color: #6d28d9;
}

.guide__section .setting-badge.badge-input,
.faq-content .setting-badge.badge-input {
    background-color: rgb(13 148 136 / 0.12);
    color: #0d9488;
}

.guide__section .badge.optional,
.faq-content .badge.optional {
    background-color: rgb(0 113 193 / 0.12);
    color: var(--color-accent);
}

.guide__section .badge.req,
.faq-content .badge.req {
    background-color: rgb(220 38 38 / 0.12);
    color: #dc2626;
}

.guide__section .setting-body p:last-child,
.faq-content .setting-body p:last-child {
    margin-bottom: 0;
}

.guide__section .tbl-wrap,
.faq-content .tbl-wrap {
    overflow-x: auto;
    margin-block: var(--space-4);
}

.guide__section .tbl-wrap table,
.faq-content .tbl-wrap table {
    margin: 0;
}

.guide__section .val,
.faq-content .val {
    text-align: center;
    font-weight: 700;
    color: #1a7f37;
}

.guide__section .val-muted,
.faq-content .val-muted {
    text-align: center;
    color: var(--color-text-muted);
}

.guide__section .example-grid,
.faq-content .example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: var(--space-4);
    margin-block: var(--space-4);
}

.guide__section .example-card,
.faq-content .example-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    background-color: var(--color-bg-subtle);
}

.guide__section .example-card .card-head,
.guide__section .example-card .card-title,
.guide__section .example-card > strong,
.faq-content .example-card .card-head,
.faq-content .example-card .card-title,
.faq-content .example-card > strong {
    display: block;
    font-weight: 700;
    margin-bottom: var(--space-2);
}

.guide__section .example-card .card-num,
.faq-content .example-card .card-num {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-text-muted);
    margin-bottom: var(--space-1);
}

.guide__section .example-card .card-note,
.guide__section .example-card .card-body,
.faq-content .example-card .card-note,
.faq-content .example-card .card-body {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-top: var(--space-2);
}

.guide__section .example-card pre,
.faq-content .example-card pre {
    margin: 0;
    background-color: var(--color-surface);
}

.guide__section ul.bp-list,
.faq-content ul.bp-list {
    list-style: none;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-block: var(--space-4);
}

.guide__section ul.bp-list > li,
.faq-content ul.bp-list > li {
    position: relative;
    padding-left: var(--space-6);
}

.guide__section ul.bp-list > li::before,
.faq-content ul.bp-list > li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background-color: var(--color-accent);
}

.guide__section ol.flow,
.faq-content ol.flow {
    list-style: none;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    counter-reset: flow;
    margin-block: var(--space-4);
}

.guide__section ol.flow > li,
.faq-content ol.flow > li {
    position: relative;
    padding-left: var(--space-8);
    counter-increment: flow;
}

.guide__section ol.flow > li::before,
.faq-content ol.flow > li::before {
    content: counter(flow);
    position: absolute;
    left: 0;
    top: 0;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background-color: var(--color-accent);
    color: var(--color-accent-contrast);
    font-weight: 700;
    font-size: var(--font-size-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.guide__section .step-row,
.faq-content .step-row {
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
    margin-bottom: var(--space-3);
}

.guide__section .step-num,
.faq-content .step-num {
    flex: 0 0 1.6rem;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background-color: var(--color-accent);
    color: var(--color-accent-contrast);
    font-weight: 700;
    font-size: var(--font-size-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.guide__section .step-content,
.faq-content .step-content {
    flex: 1;
    padding-top: 0.1rem;
}

.guide__section .two-col-steps,
.faq-content .two-col-steps {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
    margin-block: var(--space-4);
}

@media (min-width: 40rem) {
    .guide__section .two-col-steps,
    .faq-content .two-col-steps {
        grid-template-columns: 1fr 1fr;
    }
}

.guide__section pre .kw,
.faq-content pre .kw {
    color: var(--color-accent);
    font-weight: 600;
}

.guide__section pre .s,
.faq-content pre .s {
    color: #1a7f37;
}

.guide__section pre .c,
.faq-content pre .c {
    color: var(--color-text-muted);
    font-style: italic;
}
