/* Guide pages (/guides/) and the slide-out guide panel (js/guide_panel.js).
   Loaded only where a guide or a guide button is on the page. */

.guide-prose { font-size: 0.92rem; line-height: 1.7; color: var(--color-content-main); overflow-wrap: anywhere; }
.guide-prose > * + * { margin-top: 0.85rem; }
.guide-prose h2, .guide-prose h3 { font-family: var(--font-heading); font-weight: 700; line-height: 1.3; color: var(--color-content-heading); scroll-margin-top: calc(var(--nav-h, 4rem) + 1rem); }
.guide-prose h2 { margin-top: 2rem; padding-top: 1.25rem; font-size: 1.25rem; border-top: 1px solid var(--color-border-subtle); }
.guide-prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.guide-prose h3 { margin-top: 1.5rem; font-size: 1.02rem; }
.guide-prose strong { color: var(--color-content-heading); }
.guide-prose a { color: var(--color-accent-hover); text-decoration: underline; text-underline-offset: 2px; }
.guide-prose a:hover { color: var(--color-accent-light); }
.guide-prose ul, .guide-prose ol { padding-left: 1.4rem; }
.guide-prose ul { list-style: disc; }
.guide-prose li + li { margin-top: 0.35rem; }
.guide-prose li > ul, .guide-prose li > ol { margin-top: 0.35rem; }
.guide-prose ul li::marker { color: var(--color-accent-hover); }
.guide-prose code { padding: 0.1rem 0.35rem; border-radius: 0.3rem; font: 600 0.82em var(--font-data); color: var(--color-content-heading); background: color-mix(in srgb, var(--color-accent) 12%, transparent); overflow-wrap: anywhere; }

.guide-prose img { display: block; max-width: 100%; height: auto; margin-inline: auto; border: 1px solid var(--color-border-subtle); border-radius: 0.5rem; }
/* A screenshot that hasn't been supplied yet leaves an empty paragraph */
.guide-prose p:empty { display: none; }

/* Numbered steps: the number sits in a badge so a long guide stays scannable */
.guide-prose ol { list-style: none; padding-left: 0; counter-reset: guide-step; }
.guide-prose ol > li { position: relative; padding-left: 2.4rem; counter-increment: guide-step; }
.guide-prose ol > li + li { margin-top: 0.75rem; }
.guide-prose ol > li::before { content: counter(guide-step); position: absolute; left: 0; top: 0.1rem; width: 1.6rem; height: 1.6rem; display: flex; align-items: center; justify-content: center; border-radius: 999px; font: 700 0.75rem var(--font-data); color: var(--color-base-main); background: var(--color-accent); }

.guide-table { overflow-x: auto; }
.guide-prose table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.guide-prose th, .guide-prose td { padding: 0.55rem 0.7rem; border: 1px solid var(--color-border-subtle); text-align: left; vertical-align: top; }
.guide-prose th { color: var(--color-content-heading); background: color-mix(in srgb, var(--color-base-main) 50%, transparent); white-space: nowrap; }

.guide-callout { --tone: var(--color-accent); margin-inline: 0; padding: 0.75rem 0.9rem; border-left: 3px solid var(--tone); border-radius: 0.4rem; background: color-mix(in srgb, var(--tone) 9%, transparent); }
.guide-callout > * + * { margin-top: 0.5rem; }
.guide-callout--tip { --tone: var(--color-status-good); }
.guide-callout--warn { --tone: var(--color-warning); }
.guide-callout > p:first-child::before { display: block; margin-bottom: 0.15rem; font-size: 0.65rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--tone); content: "Good to know"; }
.guide-callout--tip > p:first-child::before { content: "Tip"; }
.guide-callout--warn > p:first-child::before { content: "Watch out"; }

/* The small "?" beside a setting */
.guide-help { display: inline-flex; align-items: center; justify-content: center; width: 1.15rem; height: 1.15rem; margin-left: 0.3rem; padding: 0; vertical-align: middle; border: 1px solid var(--color-border-medium); border-radius: 999px; font: 700 0.68rem/1 var(--font-sans, sans-serif); color: var(--color-content-muted); background: transparent; cursor: pointer; text-transform: none; letter-spacing: 0; }
.guide-help:hover, .guide-help:focus-visible { color: var(--color-base-main); background: var(--color-accent); border-color: var(--color-accent); }

/* Slide-out panel. Sits beside the page with no backdrop, so the page stays usable. */
.guide-panel { position: fixed; z-index: 70; top: var(--nav-h, 4rem); right: 0; bottom: 0; width: min(27rem, 100vw); display: flex; flex-direction: column; border-left: 1px solid var(--color-border-medium); background: var(--color-base-main); box-shadow: -1.5rem 0 3rem rgb(0 0 0 / 0.35); transform: translateX(100%); visibility: hidden; transition: transform 0.2s ease, visibility 0.2s; }
.guide-panel.is-open { transform: none; visibility: visible; }
.guide-panel-bar { display: flex; align-items: center; gap: 0.5rem; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--color-border-subtle); }
.guide-panel-bar select { flex: 1; min-width: 0; }
.guide-panel-close, .guide-panel-size { display: flex; padding: 0.35rem; border: 0; border-radius: 0.4rem; color: var(--color-content-muted); background: transparent; cursor: pointer; }
.guide-panel-size:hover { color: var(--color-accent-hover); }
.guide-panel-shrink, .guide-panel.is-full .guide-panel-grow { display: none; }
.guide-panel.is-full .guide-panel-shrink { display: block; }
/* Full screen: the same panel across the whole page, with the text kept to a readable width */
.guide-panel.is-full { width: 100vw; border-left: 0; }
.guide-panel.is-full .guide-panel-bar, .guide-panel.is-full .guide-panel-scroll > * { width: min(54rem, 100%); margin-inline: auto; }
.guide-panel.is-full .guide-panel-bar { border-bottom: 0; }
.guide-panel-close:hover { color: var(--color-status-error); }
.guide-panel-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 1rem 1rem 3rem; overscroll-behavior: contain; outline: none; }
.guide-panel-head { margin-bottom: 1rem; }
.guide-panel-title { margin: 0.3rem 0 0.25rem; font-family: var(--font-heading); font-size: 1.3rem; line-height: 1.25; color: var(--color-content-heading); }
.guide-panel-sub { margin: 0; font-size: 0.85rem; color: var(--color-content-muted); }
.guide-panel-links { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.6rem; font-size: 0.78rem; font-weight: 700; }
.guide-panel-links a { color: var(--color-accent-hover); }
.guide-panel .guide-prose h2, .guide-panel .guide-prose h3 { scroll-margin-top: 0.75rem; }
.guide-panel-status { padding: 2rem 1rem; text-align: center; font-size: 0.85rem; color: var(--color-content-muted); }
/* The heading the panel was opened at */
.guide-prose .is-target { animation: guide-target 1.6s ease-out; }
@keyframes guide-target { from { background: color-mix(in srgb, var(--color-accent) 30%, transparent); } to { background: transparent; } }

@media (max-width: 767px) {
    /* A full-screen sheet, above the mobile bottom nav */
    .guide-panel { top: 0; width: 100vw; z-index: 9000; border-left: 0; }
    .guide-panel-size { display: none; }
}

/* Index and guide pages */
/* The guide page's three columns: all guides, the guide, and its contents. Set
   here, not with utility classes, so the layout never waits on a CSS rebuild. */
.guide-layout { display: grid; gap: 1.5rem; align-items: start; grid-template-columns: minmax(0, 1fr); }
.guide-layout > article { min-width: 0; }
.guide-side { display: none; }
@media (min-width: 1024px) {
    .guide-layout { grid-template-columns: 15rem minmax(0, 1fr); }
    .guide-side { display: block; position: sticky; top: calc(var(--nav-h, 4rem) + 1rem); max-height: calc(100vh - var(--nav-h, 4rem) - 2rem); overflow-y: auto; }
    .guide-side--toc { display: none; }
}
@media (min-width: 1280px) {
    .guide-layout--toc { grid-template-columns: 15rem minmax(0, 1fr) 14rem; }
    .guide-side--toc { display: block; }
}
.guide-toc { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.1rem; font-size: 0.82rem; }
.guide-toc a { display: block; padding: 0.3rem 0.6rem; border-left: 2px solid var(--color-border-subtle); color: var(--color-content-muted); text-decoration: none; }
.guide-toc a:hover { color: var(--color-content-heading); border-left-color: var(--color-accent); }
.guide-toc a[aria-current="page"] { color: var(--color-accent-hover); border-left-color: var(--color-accent); font-weight: 700; }
.guide-nav-group { margin: 1.1rem 0 0.35rem; font-size: 0.65rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-content-muted); }
.guide-nav-group:first-child { margin-top: 0; }
/* Share icon beside a heading, shown on hover: copies a link to that section or command */
.guide-anchor { display: inline-flex; align-items: center; gap: 0.35rem; margin-left: 0.5rem; vertical-align: middle; color: var(--color-content-muted); text-decoration: none !important; opacity: 0; transition: opacity 0.15s; }
.guide-anchor svg { width: 0.8em; height: 0.8em; }
.guide-prose h2:hover .guide-anchor, .guide-prose h3:hover .guide-anchor, .guide-anchor:focus-visible { opacity: 1; }
.guide-anchor:hover { color: var(--color-accent-hover); }
.guide-anchor.is-copied::after { content: "Link copied"; font: 600 0.7rem var(--font-sans, sans-serif); letter-spacing: 0; text-transform: none; }
.guide-anchor.is-copied { opacity: 1; color: var(--color-status-good); }
/* No hover on touch screens, so the icon is always there, kept faint */
@media (hover: none) { .guide-anchor { opacity: 0.55; } }
.guide-card { display: flex; gap: 0.8rem; height: 100%; padding: 1rem; border: 1px solid var(--color-border-subtle); border-radius: 0.6rem; text-decoration: none; background: color-mix(in srgb, var(--color-base-main) 35%, transparent); transition: border-color 0.15s, transform 0.15s; }
.guide-card:hover { border-color: var(--color-accent); transform: translateY(-1px); }
.guide-card-icon { flex-shrink: 0; display: flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem; border-radius: 0.5rem; color: var(--color-accent-hover); background: color-mix(in srgb, var(--color-accent) 12%, transparent); }
.guide-card-icon svg { width: 1.2rem; height: 1.2rem; }
.guide-card-title { margin: 0; font-size: 0.95rem; font-weight: 700; color: var(--color-content-heading); }
.guide-card-text { margin: 0.2rem 0 0.4rem; font-size: 0.8rem; line-height: 1.5; color: var(--color-content-muted); }
