/* Solar for IoT — shared styles, matched to the highprofilesite house theme.
   Light by default; :root.wf-dark applies the dark palette (same mechanism and
   localStorage key 'wfTheme' as the rest of the site, so the choice is shared). */

:root{
  --bg:#ffffff; --fg:#1b1d20; --muted:#5b6168; --rule:#e3e6ea; --rule-strong:#c7cace;
  --accent:#137a37; --link:#137a37; --code-bg:#f4f5f6; --head:#137a37;
  --stripe:rgba(19,122,55,.055); --maxw:46rem;
}
:root.wf-dark{
  color-scheme:dark;
  --bg:#1b1d20; --fg:#e8eaed; --muted:#9aa0a6; --rule:#2a2f34; --rule-strong:#3a3f44;
  --accent:#5fcf83; --link:#8ab4f8; --code-bg:#26292c; --head:#5fcf83;
  --stripe:rgba(95,207,131,.08);
}

*{box-sizing:border-box}
html{background:var(--bg);scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{
  margin:0; max-width:none; padding:0;
  background:var(--bg); color:var(--fg);
  font:17px/1.62 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
}

/* ---- site bar (full width) ---- */
.wf-site-bar{
  position:sticky; top:0; z-index:20;
  display:flex; align-items:center; justify-content:space-between; gap:1rem;
  padding:.55rem clamp(1.1rem,4vw,2rem);
  background:rgba(255,255,255,.9); backdrop-filter:blur(8px);
  border-bottom:1px solid var(--rule);
}
:root.wf-dark .wf-site-bar{background:rgba(20,23,26,.9)}
.wf-site-bar .brand{color:var(--fg);text-decoration:none;font-weight:700;letter-spacing:-.01em}
.wf-site-bar nav{display:flex;align-items:center;gap:1.1rem;font-size:.95rem}
.wf-site-bar nav a{color:var(--muted);text-decoration:none}
.wf-site-bar nav a:hover,.wf-site-bar nav a[aria-current=page]{color:var(--accent);font-weight:700}
.wf-theme-toggle{background:none;border:1px solid var(--rule-strong);border-radius:6px;
  padding:.1rem .45rem;cursor:pointer;color:var(--fg);font-size:1rem;line-height:1.4}
.wf-theme-toggle:hover{border-color:var(--accent)}
.wf-theme-toggle .wf-icon-sun{display:none}
:root.wf-dark .wf-theme-toggle .wf-icon-moon{display:none}
:root.wf-dark .wf-theme-toggle .wf-icon-sun{display:inline}

/* ---- content column ---- */
main.doc{max-width:var(--maxw);margin:0 auto;padding:1.4rem clamp(1.1rem,4vw,1.5rem) 4rem}
#title-block-header{margin:.8rem 0 1.6rem}
h1.title{font-size:clamp(1.8rem,5vw,2.2rem);line-height:1.18;letter-spacing:-.02em;margin:.3rem 0}
.subtitle{color:var(--muted);font-weight:400}
p.author,p.date{color:var(--muted);margin:.15rem 0;font-size:.95rem}

h1{font-size:1.7rem;line-height:1.2;margin:2rem 0 .4rem;letter-spacing:-.015em}
h2{font-size:1.32rem;margin:2.2rem 0 .5rem;padding-top:.5rem;border-top:1px solid var(--rule);line-height:1.25}
h3{font-size:1.1rem;margin:1.5rem 0 .3rem}
p{margin:.7rem 0}
a{color:var(--link);text-decoration:none}
a:hover{text-decoration:underline}
ul,ol{padding-left:1.35rem}
li{margin:.3rem 0}
hr{border:none;border-top:1px solid var(--rule);margin:2.2rem 0}
strong{color:var(--fg);font-weight:700}

blockquote{margin:1.1rem 0;padding:.5rem 1rem;border-left:3px solid var(--accent);
  background:var(--stripe);border-radius:0 6px 6px 0;color:var(--fg)}
blockquote p{margin:.35rem 0}

/* ---- code ---- */
code{font-family:ui-monospace,"SF Mono",Menlo,Consolas,monospace;font-size:.86em;
  background:var(--code-bg);padding:.1em .35em;border-radius:4px}
pre{background:var(--code-bg);padding:.85rem 1rem;border-radius:8px;overflow-x:auto;
  border:1px solid var(--rule)}
pre code{background:none;padding:0;font-size:.82rem;line-height:1.45}

/* ---- figures ---- */
figure{margin:1.7rem 0;text-align:center}
img{max-width:100%;height:auto;border-radius:6px}
figcaption{color:var(--muted);font-size:.88rem;line-height:1.4;margin:.55rem auto 0;max-width:36rem}

/* ---- tables (scroll horizontally if wide) ---- */
table{display:block;width:max-content;max-width:100%;overflow-x:auto;
  border-collapse:collapse;margin:1.2rem 0;font-size:.9rem}
th,td{border:1px solid var(--rule);padding:.4rem .6rem;text-align:left;vertical-align:top}
thead th{color:var(--head);font-weight:700}
tbody tr:nth-child(even){background:var(--stripe)}

/* ---- table of contents ---- */
nav#TOC{margin:1.4rem 0 2rem;padding:.9rem 1.2rem;border:1px solid var(--rule);
  border-radius:10px;background:var(--stripe)}
nav#TOC::before{content:"Contents";display:block;font-weight:700;color:var(--fg);
  margin-bottom:.35rem;font-size:.95rem}
nav#TOC ul{list-style:none;padding-left:0;margin:0}
nav#TOC ul ul{padding-left:1rem}
nav#TOC li{margin:.12rem 0}
nav#TOC a{color:var(--muted)}
nav#TOC a:hover{color:var(--accent)}

/* keep wide display math from forcing a horizontal page scroll */
.math.display{display:block;overflow-x:auto;overflow-y:hidden;padding:.2rem 0}

/* ---- footer ---- */
.wf-foot{max-width:var(--maxw);margin:0 auto;padding:1.5rem clamp(1.1rem,4vw,1.5rem) 3rem;
  border-top:1px solid var(--rule);color:var(--muted);font-size:.85rem;line-height:1.5}
.wf-foot a{color:var(--link)}
