/* The public content pages (about, contact, terms, privacy, the user guide and the articles):
   static HTML nginx serves without the Blazor app, so a crawler reads them without running
   anything (docs/ADS.md). Same tokens as index.html and sunharvest.css; plain-named, so nginx
   serves it no-cache and a deploy shows at once. index.html (the front page) stays
   self-contained on purpose. The font is the app's own, served from /app/_content/. */
@font-face { font-family: "Space Grotesk Variable"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("/app/_content/SunHarvest.UI/fonts/space-grotesk-latin-wght-normal.woff2") format("woff2-variations"); unicode-range: U+0000-002F, U+003A-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Space Grotesk Variable"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("/app/_content/SunHarvest.UI/fonts/space-grotesk-latin-ext-wght-normal.woff2") format("woff2-variations"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
:root {
    color-scheme: light dark;
    --page: #f2f5f9; --surface: #ffffff; --ink: #0f172a; --ink-2: #46556b; --muted: #7a889d;
    --grid: #e2e8f0; --border: rgba(15, 23, 42, 0.10);
    --home: #2a78d6; --solar: #e8940f; --battery: #1baf7a; --import: #e34948; --export: #2a78d6; --good: #0ca30c;
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 12px 32px -14px rgba(15, 23, 42, 0.16);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --page: #0d0d0d; --surface: #1a1a19; --ink: #ffffff; --ink-2: #c3c2b7;
        --grid: #2c2c2a; --border: rgba(255, 255, 255, 0.10);
        --home: #3987e5; --solar: #d95926; --battery: #199e70; --import: #e66767; --export: #3987e5;
        --shadow: 0 1px 2px rgba(255, 255, 255, 0.05), 0 8px 20px -12px rgba(255, 255, 255, 0.10);
    }
}
:root[data-theme="dark"] {
    --page: #0d0d0d; --surface: #1a1a19; --ink: #ffffff; --ink-2: #c3c2b7;
    --grid: #2c2c2a; --border: rgba(255, 255, 255, 0.10);
    --home: #3987e5; --solar: #d95926; --battery: #199e70; --import: #e66767; --export: #3987e5;
    --shadow: 0 1px 2px rgba(255, 255, 255, 0.05), 0 8px 20px -12px rgba(255, 255, 255, 0.10);
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0; background: var(--page); color: var(--ink);
    font-family: "Space Grotesk Variable", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.6;
}
a { color: var(--home); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); font-weight: 750; margin: 0 0 0.75rem; }
h2 { font-size: clamp(1.3rem, 2.6vw, 1.6rem); font-weight: 700; margin: 2.25rem 0 0.6rem; scroll-margin-top: 80px; }
h3 { font-size: 1.1rem; font-weight: 650; margin: 1.6rem 0 0.4rem; scroll-margin-top: 80px; }
p, ul, ol, table, blockquote { margin: 0 0 1rem; }
li { margin-bottom: 0.35rem; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.9em; background: var(--surface); border: 1px solid var(--border); border-radius: 5px; padding: 0 0.3em; overflow-wrap: anywhere; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--ink-2); }
.hint { color: var(--muted); font-size: 0.9rem; }

/* header: the same bar as home.html */
header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--page) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.bar { display: flex; align-items: center; gap: 1rem; height: 60px; }
.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; flex-shrink: 0; }
.brand svg { width: 30px; height: 30px; border-radius: 7px; }
.brand .sun { color: var(--solar); }
header nav { margin-left: auto; display: flex; gap: 1.2rem; align-items: center; }
header nav a { color: var(--ink-2); text-decoration: none; font-size: 0.95rem; }
header nav a:hover, header nav a[aria-current] { color: var(--ink); }
.btn { display: inline-block; padding: 0.45rem 0.9rem; border-radius: 999px; font-weight: 600; text-decoration: none; border: 1px solid var(--border); color: var(--ink) !important; background: var(--surface); }
.btn.primary { background: var(--solar); border-color: var(--solar); color: #fff !important; }
.when-in { display: none !important; }
html.signed-in .when-in { display: inline-block !important; }
html.signed-in .when-out { display: none !important; }

/* the reading column */
main { padding: 2rem 0 3.5rem; }
.crumbs { font-size: 0.9rem; color: var(--muted); margin-bottom: 1.25rem; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
article { max-width: 46rem; overflow-wrap: break-word; }
article .lead { font-size: 1.15rem; color: var(--ink-2); }
article blockquote { border-left: 3px solid var(--solar); padding: 0.2rem 0 0.2rem 1rem; margin-left: 0; color: var(--ink-2); font-style: italic; }
.meta { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.5rem; }
.note { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 1rem 1.2rem; margin: 1.5rem 0; }
.note > :last-child { margin-bottom: 0; }
.table-wrap { overflow-x: auto; margin-bottom: 1rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; background: var(--surface); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); margin: 0; }
th, td { padding: 0.65rem 0.9rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 650; background: var(--page); }
tr:last-child td { border-bottom: 0; }

/* guide and article layouts: the page list beside the text on wide screens, under it on narrow */
.with-side { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 3rem; align-items: start; }
.with-side > aside { order: -1; position: sticky; top: 80px; font-size: 0.93rem; }
aside h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 0.6rem; }
aside ol, aside ul { list-style: none; padding: 0; margin: 0 0 1.5rem; }
aside li { margin: 0; }
aside a { display: block; padding: 0.3rem 0.6rem; border-radius: 8px; color: var(--ink-2); text-decoration: none; }
aside a:hover { background: var(--surface); color: var(--ink); }
aside a[aria-current] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.pager a { text-decoration: none; display: block; max-width: 48%; }
.pager a small { display: block; color: var(--muted); }
.pager .next { margin-left: auto; text-align: right; }

/* index cards (guide and articles) */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin: 1.5rem 0; padding: 0; list-style: none; }
.cards li { margin: 0; }
.cards a { display: block; height: 100%; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 1.1rem 1.25rem; text-decoration: none; color: var(--ink); }
.cards a:hover { outline: 2px solid var(--solar); }
.cards b { display: block; font-size: 1.05rem; margin-bottom: 0.25rem; }
.cards span { color: var(--ink-2); font-size: 0.93rem; }

.cta { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 1.25rem 1.4rem; margin-top: 2.5rem; }
.cta p { margin-bottom: 0.75rem; }
.cta .btn { margin-right: 0.5rem; }

footer { border-top: 1px solid var(--border); padding: 2.5rem 0 3rem; color: var(--ink-2); font-size: 0.9rem; }
footer .cols { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; }
footer .links { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin-top: 0.5rem; }
footer a { color: var(--ink-2); }

@media (max-width: 860px) {
    header nav a:not(.btn):not(.keep) { display: none; }
    .with-side { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
    .with-side > aside { order: 0; position: static; border-top: 1px solid var(--border); padding-top: 1.5rem; }
    .cards { grid-template-columns: 1fr; }
}
