/* Fresh Ink core styles. Copyright 2026 Real Mighty Joe Productions. Uses host vars --paper/--ink when present. */
:root{--fi-ink:var(--ink,#121212);--fi-paper:var(--paper,#f1ede4);--fi-focus:#0b3d91;--fi-focus2:#ffd60a;--fi-scale:1}
html{font-size:calc(100% * var(--fi-scale))}
.fi-sr{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.fi-skip{position:absolute;left:8px;top:-60px;z-index:1000;min-height:44px;min-width:44px;display:inline-flex;align-items:center;padding:0 1rem;background:var(--fi-ink);color:var(--fi-paper);font:700 1rem Georgia,serif;text-decoration:none;border:2px solid var(--fi-focus2)}
.fi-skip:focus{top:8px}
/* WCAG 2.4.7 / 2.4.11 / 2.4.13: two-tone ring visible on light and dark; never obscured by sticky bars */
:where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{outline:3px solid var(--fi-focus)!important;outline-offset:2px!important;box-shadow:0 0 0 6px var(--fi-focus2)!important;border-radius:2px}
:target,[tabindex="-1"]:focus{scroll-margin-top:120px;outline:none}
html{scroll-padding-top:120px;scroll-padding-bottom:120px}
/* tools + reader */
.fi-tools{position:fixed;left:8px;bottom:calc(var(--fi-bottom-offset,72px) + env(safe-area-inset-bottom));z-index:90;display:flex;flex-direction:column;align-items:flex-start;gap:.35rem;max-width:calc(100vw - 16px)}
.fi-tools-row{display:flex;flex-wrap:wrap;gap:.35rem;padding:.5rem;background:var(--fi-paper);color:var(--fi-ink);border:2px solid var(--fi-ink);box-shadow:3px 3px 0 var(--fi-ink)}
.fi-tools-row[hidden]{display:none}
.fi-btn,.fi-listen{min-height:44px;min-width:44px;padding:0 .8rem;border:2px solid var(--fi-ink);background:var(--fi-paper);color:var(--fi-ink);font:700 .9rem Georgia,"Times New Roman",serif;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:.35rem;line-height:1.1}
.fi-btn[aria-pressed=true],.fi-listen[aria-pressed=true]{background:var(--fi-ink);color:var(--fi-paper)}
.fi-launch{box-shadow:2px 2px 0 var(--fi-ink)}
.fi-listen{margin:.25rem 0 .5rem;font-size:.8rem}
.fi-reader{position:fixed;left:0;right:0;bottom:0;z-index:95;display:flex;flex-wrap:wrap;gap:.4rem;align-items:flex-end;padding:.5rem .6rem calc(.5rem + env(safe-area-inset-bottom));background:var(--fi-paper);color:var(--fi-ink);border-top:3px double var(--fi-ink)}
.fi-reader[hidden]{display:none}
.fi-lab{display:flex;flex-direction:column;font:700 .7rem Georgia,serif;letter-spacing:.08em;text-transform:uppercase}
.fi-lab select{min-height:44px;max-width:15rem;border:2px solid var(--fi-ink);background:var(--fi-paper);color:var(--fi-ink);font:.9rem Georgia,serif}
.fi-disclose{position:fixed;inset:auto 8px 70px 8px;z-index:100;max-width:30rem;padding:1rem;background:var(--fi-paper);color:var(--fi-ink);border:3px solid var(--fi-ink)}
.fi-disclose[hidden]{display:none}
body{padding-bottom:0}
html[data-fi-reading=playing] body,html[data-fi-reading=paused] body{padding-bottom:7rem}
/* reading highlight: CSS Custom Highlight + block fallback (colour is not the only cue: also underline/outline) */
::highlight(fi-reading){background:#ffe36e;color:#000;text-decoration:underline}
.fi-reading-block:not(.fi-has-cust){background:#ffe36e;color:#000;outline:2px solid #000}
.fi-reading-block.fi-has-cust{outline:2px dotted var(--fi-ink);outline-offset:3px}
/* ---- mobile-QA fixes (generic) */
.nr-lead a,.nr-list a,[class*=lead] a,[class*=lead] h1,[class*=lead] h2{white-space:normal!important;overflow-wrap:anywhere;word-break:normal}
@media (pointer:coarse),(max-width:760px){
  nav a,.np-skip,.fi-skip,header a,footer a,[class*=donate],[class*=Donate],button,select,input[type=button],input[type=submit],summary,[role=button],[role=tab],.np-tabs a,a.np-hb-link{min-height:44px;min-width:44px;display:inline-flex;align-items:center}
  nav a,footer a{padding-block:.5rem}
}
@media (orientation:landscape) and (max-height:500px){
  .np-mast{margin-top:.25rem;gap:.5rem}.np-mast p,.np-mast h1{margin-block:0!important;line-height:1}
  .np-mast h1,.np-mast .font-display{font-size:clamp(1.4rem,6vh,2.2rem)!important}
  .np-ear{display:none}nav.np-tabs{position:sticky;top:0}
  .np-edge{width:44px;max-width:44px}
  .fi-reader{padding-block:.25rem}
}
/* compact sticky desktop nav so it never hides page content (portfolio: class added by config.pageClasses) */
@media (min-width:900px){html.fi-compact-nav nav.np-tabs{position:static!important;flex-wrap:wrap;max-height:none}html.fi-compact-nav nav.np-tabs a{min-height:32px;padding:.1rem .45rem}}
/* ---- reduced motion: OS setting AND in-memory toggle */
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important}.aax-leaf{display:none!important}}
html.fi-rm *,html.fi-rm *::before,html.fi-rm *::after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important}
html.fi-rm .aax-leaf{display:none!important}
/* ---- high contrast: in-memory toggle (also on for prefers-contrast:more / forced-colors). Targets 7:1 */
html.fi-hc{--paper:#fff;--ink:#000;--line:#000;--muted:#000;--fi-paper:#fff;--fi-ink:#000;--fi-focus:#0000c8;background:#fff!important}
html.fi-hc body,html.fi-hc body *:not(img):not(svg):not(svg *):not(.fi-reading-block):not(.fi-ui):not(.fi-ui *){background-image:none!important;text-shadow:none!important;box-shadow:none}
html.fi-hc body{background:#fff!important;color:#000!important}
html.fi-hc main,html.fi-hc [role=main],html.fi-hc article,html.fi-hc section,html.fi-hc aside,html.fi-hc header,html.fi-hc footer,html.fi-hc div:not(.fi-ui):not(.fi-ui *){background-color:transparent!important}
html.fi-hc body :not(a):not(a *):not(svg *):not(.fi-ui):not(.fi-ui *){color:#000!important;opacity:1!important}
html.fi-hc body a:not(.fi-ui *):not(.fi-skip){color:#0000c8!important;text-decoration:underline!important;text-underline-offset:3px}
html.fi-hc body a:visited:not(.fi-ui *){color:#4b0082!important}
html.fi-hc button,html.fi-hc select,html.fi-hc input{border:2px solid #000!important;color:#000;background:#fff}
html.fi-hc hr,html.fi-hc table,html.fi-hc td,html.fi-hc th{border-color:#000!important}
html.fi-hc .fi-btn[aria-pressed=true],html.fi-hc .fi-listen[aria-pressed=true]{background:#000!important;color:#fff!important}
@media (forced-colors:active){.fi-btn,.fi-listen{border:2px solid ButtonText;forced-color-adjust:auto}::highlight(fi-reading){background:Highlight;color:HighlightText}}
