/*
Theme Name: 4nt.org
Theme URI: https://4nt.org
Author: Early Buddhism Meditation Preservation Society
Description: Reading-first theme for 4nt.org — warm parchment palette, serif body type, sticky nav with dark/light toggle, persistent font size, a hybrid left sidebar (site nav + on-this-page outline), and a consistent footer on every page. Inspired by the s.4nt.org "Suttas, Side by Side" viewer.
Version: 0.1.35
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
Text Domain: fournt
*/

/* ============================================================
   THEME TOKENS  (light default; [data-theme="dark"] overrides)
   ============================================================ */
:root{
  --bg:#faf8f4;          --border:#ddd6c8;
  --text:#1a1612;        --muted:#6b6055;   --accent:#5c3d1e;
  --sec-bg:#f0ebe0;      --sec-border:#c8b89a;
  --line:#c8b89a;        --sidebar-bg:#f2ece0;
  --toc-hover:#e8dfc8;   --toc-act:#e0d4b8;
  --header-bg:#5c3d1e;   --header-text:#f5ede0;
  --link:#7a5220;

  --sw:270px;            /* sidebar width  */
  --hh:56px;             /* header height  */
  --fs:17px;             /* base reading font size (JS overrides html font-size) */
  --content-max:46rem;   /* comfortable measure for prose */
}
[data-theme="dark"]{
  --bg:#1a1612;          --border:#3a3028;
  --text:#e8dfc8;        --muted:#9a8878;   --accent:#c8a060;
  --sec-bg:#231e18;      --sec-border:#4a3c2c;
  --line:#4a3c2c;        --sidebar-bg:#1c1810;
  --toc-hover:#2a2418;   --toc-act:#322a1c;
  --header-bg:#241c10;   --header-text:#e8d8b8;
  --link:#d0a866;
}

*{box-sizing:border-box}
html{font-size:var(--fs)}
body{
  margin:0;
  font-family:Georgia,'Times New Roman',serif;
  background:var(--bg);color:var(--text);
  line-height:1.75;
  -webkit-font-smoothing:antialiased;
  transition:background .2s,color .2s;
}
a{color:var(--link);text-decoration:none}
a:hover{text-decoration:underline}
img{max-width:100%;height:auto}

/* ============================================================
   STICKY HEADER
   ============================================================ */
.site-header{
  position:fixed;top:0;left:0;right:0;z-index:300;
  height:var(--hh);
  display:flex;align-items:center;gap:.6rem;
  padding:0 .9rem;
  background:var(--header-bg);color:var(--header-text);
  box-shadow:0 2px 10px rgba(0,0,0,.28);
}
/* Left cluster order: logo › breadcrumbs › ☰ toggle › org name */
.hdr-left{display:flex;align-items:center;gap:.55rem;min-width:0;flex-shrink:1}
.site-logo{flex-shrink:0;display:block;width:38px;height:38px;border-radius:9px;
  overflow:hidden;box-shadow:0 1px 5px rgba(0,0,0,.3);opacity:.92;transition:opacity .15s}
.site-logo:hover{opacity:1;text-decoration:none}
.site-logo img{width:100%;height:100%;object-fit:cover;display:block}
/* breadcrumbs — small sans-serif trail on the dark header */
.crumbs{display:flex;align-items:center;flex-shrink:1;min-width:0;
  font-family:sans-serif;font-size:.68rem;opacity:.85;overflow:hidden}
.crumbs a{color:var(--header-text);white-space:nowrap}
.crumbs a:hover{text-decoration:underline}
.crumbs .sep-c{margin:0 .32rem;opacity:.5}
.crumbs .cur{opacity:.95;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:28vw}
/* organization name — its own home link, right of the ☰ toggle */
.site-name{flex-shrink:1;min-width:0;color:var(--header-text);
  font-size:1rem;letter-spacing:.02em;font-weight:600;white-space:nowrap;
  overflow:hidden;text-overflow:ellipsis}
.site-name:hover{text-decoration:none;opacity:.9}

.hdr-nav{flex:1;min-width:0;display:flex;justify-content:center}
.nav-menu{list-style:none;margin:0;padding:0;display:flex;align-items:center;gap:.2rem;flex-wrap:nowrap;overflow:hidden}
.nav-menu li{position:relative}
.nav-menu a{
  display:block;padding:.4rem .7rem;border-radius:5px;
  color:var(--header-text);font-family:sans-serif;font-size:.82rem;
  white-space:nowrap;transition:background .15s;
}
.nav-menu a:hover{background:rgba(255,255,255,.14);text-decoration:none}
.nav-menu .current-menu-item > a{background:rgba(255,255,255,.2)}
/* one level of dropdown */
.nav-menu ul{display:none;position:absolute;top:100%;left:0;z-index:10;
  list-style:none;margin:0;padding:.25rem;min-width:12rem;
  background:var(--bg);border:1px solid var(--sec-border);border-radius:6px;
  box-shadow:0 6px 18px rgba(0,0,0,.25)}
.nav-menu li:hover > ul{display:block}
.nav-menu ul a{color:var(--text)}
.nav-menu ul a:hover{background:var(--toc-hover)}

.hdr-ctl{display:flex;align-items:center;gap:.35rem;flex-shrink:0;margin-left:auto}
.fs-ctl{display:inline-flex;gap:.15rem}
.icon-btn{
  display:inline-flex;align-items:center;justify-content:center;
  min-width:30px;height:30px;padding:0 .5rem;
  border:1px solid rgba(255,255,255,.25);border-radius:5px;
  background:rgba(255,255,255,.1);color:var(--header-text);
  font-family:sans-serif;font-size:.8rem;line-height:1;cursor:pointer;
  transition:background .15s;
}
.icon-btn:hover{background:rgba(255,255,255,.2)}
.icon-btn.top-btn{font-size:1.05rem;padding:0 .45rem}
/* Colored emoji glyphs (🔝 back-to-top, 🔍 search) turned into light near-cream monochrome
   glyphs so they match the header's ☰/⚙ text glyphs and read on the brown header (which is
   dark in BOTH themes). grayscale removes hue; brightness lifts them toward cream. Neutral
   button bg/border are filter-invariant, so only the emoji changes. */
.icon-btn.mono-emoji{filter:grayscale(1) brightness(1.9)}

/* ============================================================
   LAYOUT SHELL  +  SIDEBAR
   ============================================================ */
.shell{display:flex;margin-top:var(--hh)}

.site-sidebar{
  position:fixed;top:var(--hh);left:0;bottom:0;
  width:var(--sw);z-index:200;
  background:var(--sidebar-bg);
  border-right:1px solid var(--sec-border);
  overflow-y:auto;overflow-x:hidden;
  scrollbar-width:thin;scrollbar-color:var(--sec-border) transparent;
  transition:transform .22s ease,background .2s;
}
.site-sidebar::-webkit-scrollbar{width:9px}
.site-sidebar::-webkit-scrollbar-thumb{background:var(--sec-border);border-radius:5px;border:2px solid var(--sidebar-bg)}
.site-sidebar::-webkit-scrollbar-thumb:hover{background:var(--accent)}
.sb-inner{padding:1rem .85rem 2rem}
.sb-block + .sb-block{margin-top:1.4rem}
.sb-label{
  font-size:.6rem;letter-spacing:.11em;text-transform:uppercase;
  color:var(--muted);font-weight:700;font-family:sans-serif;
  margin:0 0 .5rem .2rem;
}
/* collapsible section header (Site navigation) */
.sb-head{display:flex;align-items:center;justify-content:space-between;gap:.5rem;
  width:100%;background:none;border:none;cursor:pointer;color:inherit;font:inherit;
  text-align:left;padding:0 .2rem .5rem}
.sb-head .sb-label{margin:0}
.sb-toggle{flex-shrink:0;width:17px;height:17px;display:inline-flex;align-items:center;
  justify-content:center;border:1px solid var(--sec-border);border-radius:3px;
  background:var(--bg);color:var(--accent);font:bold .8rem monospace;line-height:1}
.sb-head:hover .sb-toggle{background:var(--toc-hover)}
.sb-nav.collapsed .sb-body{display:none}
/* sidebar site-nav menu */
.sb-menu{list-style:none;margin:0;padding:0;font-family:sans-serif}
.sb-menu li{margin:0}
.sb-menu a{display:block;padding:.34rem .5rem;border-radius:5px;
  color:var(--text);font-size:.82rem;border-left:3px solid transparent}
.sb-menu a:hover{background:var(--toc-hover);text-decoration:none}
.sb-menu .current-menu-item > a{background:var(--toc-act);border-left-color:var(--accent);font-weight:600}
.sb-menu ul{list-style:none;margin:.1rem 0 .1rem .6rem;padding:0}
.sb-menu ul a{font-size:.78rem;color:var(--muted)}

/* on-this-page — hierarchical H1–H6 tree */
.sb-toc{font-family:sans-serif}
.toc-tree,.toc-children{list-style:none;margin:0;padding:0}
.toc-children{margin-left:.65rem;border-left:1px solid var(--line);padding-left:.2rem}
.toc-item.collapsed > .toc-children{display:none}
.toc-row{display:flex;align-items:center;gap:.15rem}
.toc-tog{flex-shrink:0;width:15px;height:15px;display:inline-flex;align-items:center;
  justify-content:center;border:1px solid var(--sec-border);border-radius:3px;
  background:var(--bg);color:var(--accent);font:bold 9px monospace;line-height:1;
  cursor:pointer;padding:0}
.toc-tog:hover{background:var(--toc-hover)}
.toc-tog.spacer{border-color:transparent;background:none;cursor:default;visibility:hidden}
.toc-link{flex:1;min-width:0;padding:.24rem .4rem;border-radius:5px;font-size:.8rem;
  color:var(--muted);border-left:3px solid transparent;line-height:1.35;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.toc-link:hover{background:var(--toc-hover);color:var(--text);text-decoration:none}
.toc-link.active{background:var(--toc-act);border-left-color:var(--accent);color:var(--text);font-weight:600}

/* in-content outline: an always-present copy of the on-this-page tree, boxed at the
   top of the article. theme.js sets its default open/closed state to the inverse of
   the side TOC's visibility, and only builds it when there are >=2 headings. */
.page-outline{border:1px solid var(--border);background:var(--sec-bg);border-radius:10px;
  padding:.85rem 1.05rem 1rem;margin:0 0 2rem;font-family:sans-serif}
/* shared whole-row disclosure button (in-content outline + collapsible comments),
   modeled on the sidebar's .sb-head */
.po-head{display:flex;align-items:center;justify-content:space-between;gap:.6rem;
  width:100%;background:none;border:0;padding:0;cursor:pointer;color:inherit;font:inherit;text-align:left}
.po-title{font-size:.62rem;letter-spacing:.11em;text-transform:uppercase;
  color:var(--muted);font-weight:700}
.po-collapse{flex-shrink:0;width:18px;height:18px;display:inline-flex;
  align-items:center;justify-content:center;border:1px solid var(--sec-border);border-radius:3px;
  background:var(--bg);color:var(--accent);font:bold .78rem monospace;line-height:1;padding:0}
.po-head:hover .po-collapse{background:var(--toc-hover)}
.page-outline .toc-tree{margin-top:.55rem}
.page-outline.collapsed .toc-tree{display:none}
.page-outline.collapsed .po-head{margin:0}
.page-outline .toc-link{white-space:normal;overflow:visible;text-overflow:clip;
  font-size:.9rem;color:var(--link);line-height:1.4}
.page-outline .toc-link:hover{color:var(--text)}
.page-outline .toc-children{margin-left:.8rem}
.page-outline .toc-tog{width:16px;height:16px;font-size:10px}

/* collapsible comments: the whole comment area tucked behind a disclosure row.
   Collapsed by theme.js on load (progressive enhancement — no-JS shows it open). */
.comments-disclosure{border:1px solid var(--border);background:var(--sec-bg);border-radius:10px;
  padding:.85rem 1.05rem 1rem;margin:2.4rem 0 0;font-family:sans-serif}
.comments-disclosure .cd-body{margin-top:1rem}
.comments-disclosure.collapsed .cd-body{display:none}
.comments-disclosure.collapsed .po-head{margin:0}

/* ============================================================
   BLOG LANDING SECTIONS  (fournt_* shortcodes)
   ============================================================ */
.qbs-section{margin-top:2rem}
.qbs-section.qbs-archive{margin-top:1.3rem}
.qbs-seeall{margin:.9rem 0 0;font-family:sans-serif}
/* link lists: categories */
.qbs-list{list-style:none;margin:.7rem 0 0;padding:0;font-family:sans-serif}
.qbs-list li{padding:.4rem 0;border-bottom:1px solid var(--border);font-size:.98rem;color:var(--muted)}
.qbs-list li:last-child{border-bottom:0}
.qbs-list a{color:var(--link);text-decoration:none}
.qbs-list a:hover{text-decoration:underline}
/* accordion post feed */
.qbs-feed{list-style:none;margin:.4rem 0 0;padding:0}
.qbs-post{border-bottom:1px solid var(--border)}
.qbs-post:last-child{border-bottom:0}
.qbs-post-head{display:flex;align-items:center;gap:.75rem;padding:.55rem 0}
.qbs-thumb-link{flex:none;display:block;line-height:0;border-radius:6px}
.qbs-thumb-sm{width:52px;height:52px;object-fit:cover;border-radius:6px;border:1px solid var(--border);display:block}
.qbs-thumb-sm.qbs-mono{display:flex;align-items:center;justify-content:center;background:var(--sec-bg);
  color:var(--accent);font-family:Georgia,'Times New Roman',serif;font-weight:700;font-size:1.5rem;line-height:1}
.qbs-post-toggle{flex:1;min-width:0;display:flex;align-items:center;gap:.6rem;background:none;border:0;
  padding:.25rem 0;cursor:pointer;color:inherit;font:inherit;text-align:left;font-family:sans-serif}
.qbs-h-title{flex:1;min-width:0;font-size:1.05rem;line-height:1.35;color:var(--text)}
.qbs-post-toggle:hover .qbs-h-title{color:var(--accent)}
.qbs-date{font-size:.74rem;color:var(--muted);white-space:nowrap}
.qbs-tog{flex:none;width:18px;height:18px;display:inline-flex;align-items:center;justify-content:center;
  border:1px solid var(--sec-border);border-radius:3px;background:var(--bg);color:var(--accent);
  font:bold .78rem monospace;line-height:1}
.qbs-post-toggle:hover .qbs-tog,.qbs-year-head:hover .qbs-tog,.qbs-month-head:hover .qbs-tog{background:var(--toc-hover)}
.qbs-post-body{padding:.1rem 0 1.1rem}
.qbs-post.qbs-collapsed .qbs-post-body{display:none}
.qbs-post:not(.qbs-collapsed) .qbs-thumb-link{display:none}
.qbs-thumb-lg-link{display:block;line-height:0;margin:.2rem 0 .8rem;border-radius:8px;max-width:70%}
.qbs-thumb-lg{display:block;width:100%;height:224px;object-fit:cover;border-radius:8px}
.qbs-thumb-lg.qbs-mono{display:flex;align-items:center;justify-content:center;width:100%;height:112px;
  background:var(--sec-bg);color:var(--accent);font-family:Georgia,'Times New Roman',serif;font-weight:700;font-size:2.2rem}
.qbs-body-meta{font-family:sans-serif;font-size:.78rem;color:var(--muted);margin:0 0 .55rem}
.qbs-excerpt{margin:0 0 .7rem;line-height:1.6}
/* archive year -> month tree (month opens lazy-load its feed) */
.qbs-arch{list-style:none;margin:.6rem 0 0;padding:0;font-family:sans-serif}
.qbs-arch .qbs-year{border-bottom:1px solid var(--border)}
.qbs-arch .qbs-year:last-child{border-bottom:0}
.qbs-year-head,.qbs-month-head{display:flex;align-items:center;gap:.5rem;width:100%;background:none;border:0;
  cursor:pointer;color:var(--text);font:inherit;font-family:sans-serif;text-align:left}
.qbs-year-head{padding:.45rem 0}
.qbs-month-head{padding:.26rem 0}
.qbs-count{color:var(--muted);font-size:.8rem}
.qbs-months{list-style:none;margin:.1rem 0 .5rem 1.7rem;padding:0}
.qbs-year:not(.qbs-open) .qbs-months{display:none}
.qbs-month:not(.qbs-open) .qbs-month-feed{display:none}
.qbs-month-feed{margin:.1rem 0 .6rem 1.6rem}
.qbs-month-loading{list-style:none;color:var(--muted);font-family:sans-serif;font-size:.85rem;padding:.4rem 0}
.qbs-subscribe{margin-top:2rem}

/* off-canvas backdrop (mobile) */
.sidebar-overlay{display:none;position:fixed;inset:var(--hh) 0 0 0;z-index:150;
  background:rgba(0,0,0,.4)}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.site-main{
  margin-left:var(--sw);flex:1;min-width:0;
  padding:2rem 2rem 4rem;
  transition:margin-left .22s;
}
.content-wrap{max-width:var(--content-max);margin:0 auto}
.wide .content-wrap{max-width:64rem}   /* archives/listings a bit wider */

/* collapsed sidebar (desktop) */
html.sidebar-collapsed .site-sidebar{transform:translateX(-100%)}
html.sidebar-collapsed .site-main{margin-left:0}
html.sidebar-collapsed .content-wrap{max-width:52rem}

/* article typography */
.entry-header{margin:0 0 1.6rem}
.entry-title{font-size:2rem;line-height:1.25;margin:0 0 .4rem;color:var(--text);letter-spacing:.01em}
.entry-title a{color:inherit}
.entry-meta{font-family:sans-serif;font-size:.78rem;color:var(--muted)}
.reading-time{display:inline-flex;align-items:center;gap:.3em;white-space:nowrap}
.reading-time .rt-clock{flex:none;opacity:.8;position:relative;top:.03em}
.entry-content{font-size:1rem}
.entry-content > * + *{margin-top:1.1rem}
.entry-content h2{font-size:1.5rem;line-height:1.3;margin-top:2.2rem;
  padding-bottom:.3rem;border-bottom:1px solid var(--border);color:var(--text);
  scroll-margin-top:calc(var(--hh) + 14px)}
.entry-content h3{font-size:1.2rem;margin-top:1.8rem;color:var(--text);
  scroll-margin-top:calc(var(--hh) + 14px)}
.entry-content h4{font-size:1.05rem;margin-top:1.4rem;color:var(--accent);font-family:sans-serif}
.entry-content a{text-decoration:underline;text-underline-offset:2px}
.entry-content blockquote{margin:1.3rem 0;padding:.6rem 1.2rem;
  border-left:3px solid var(--accent);background:var(--sec-bg);border-radius:0 6px 6px 0;
  color:var(--text);font-style:italic}
.entry-content ul,.entry-content ol{padding-left:1.5rem}
.entry-content li + li{margin-top:.35rem}
.entry-content code{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:.9em;
  background:var(--sec-bg);border:1px solid var(--border);border-radius:4px;padding:.05em .35em}
.entry-content pre{background:var(--sec-bg);border:1px solid var(--border);border-radius:8px;
  padding:1rem 1.2rem;overflow-x:auto}
.entry-content pre code{background:none;border:none;padding:0}
.entry-content img{border-radius:8px}
.entry-content table{border-collapse:collapse;width:100%;font-size:.92rem}
.entry-content th,.entry-content td{border:1px solid var(--border);padding:.5rem .7rem;text-align:left}
.entry-content th{background:var(--sec-bg)}
.entry-content hr{border:none;border-top:1px solid var(--border);margin:2rem 0}

/* listing (index / archive) cards */
.post-card{padding:1.4rem 0;border-bottom:1px solid var(--border)}
.post-card .entry-title{font-size:1.4rem;margin-bottom:.3rem}
.post-card .entry-summary{color:var(--muted)}
.read-more{font-family:sans-serif;font-size:.82rem}

.page-nav{display:flex;justify-content:space-between;gap:1rem;margin-top:2rem;font-family:sans-serif;font-size:.85rem}

/* ============================================================
   FOOTER  (same on every page)
   ============================================================ */
.site-footer{
  margin-left:var(--sw);
  padding:1.5rem 1.8rem;
  border-top:1px solid var(--border);
  background:var(--sec-bg);color:var(--muted);
  font-family:sans-serif;font-size:.78rem;
  display:flex;align-items:center;gap:1.6rem;
  transition:margin-left .22s,background .2s;
}
html.sidebar-collapsed .site-footer{margin-left:0}
/* logos flank the text; both matched by HEIGHT (4nt is square, gorilla is wide) */
.ft-logo{flex-shrink:0;display:block}
.ft-logo:hover{text-decoration:none;opacity:.9}
.ft-logo img{height:128px;width:auto;border-radius:16px;display:block;box-shadow:0 1px 8px rgba(0,0,0,.22)}
/* centred text column */
.ft-text{flex:1;min-width:0;text-align:center;line-height:1.6}
.ft-tagline{color:var(--text);margin:0 0 .4rem;font-family:Georgia,serif;font-size:1.04rem}
/* links + social icons share one centred, wrapping row */
.ft-links-row{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;
  gap:.3rem .9rem;margin:.4rem 0}
.ft-links{list-style:none;padding:0;margin:0;display:flex;flex-wrap:wrap;
  align-items:center;gap:.3rem .9rem}
.ft-links a{color:var(--accent)}
/* social favicons — icon only, name in the tooltip; sit next to the last link */
.ft-social{display:inline-flex;align-items:center;gap:.5rem}
.ft-ico{display:inline-flex;padding:.15rem;border-radius:5px;line-height:0;transition:background .12s}
.ft-ico:hover{background:var(--toc-hover)}
.ft-ico img{width:16px;height:16px;display:block;border-radius:3px}
.ft-copy{opacity:.8;margin:.4rem 0 0}
@media (max-width:760px){
  .site-footer{flex-direction:column;gap:.9rem;text-align:center}
  .ft-logo img{height:96px}
}

/* ============================================================
   SEARCH POPOVER  (🔍 in the header)
   ============================================================ */
.search-wrap{position:relative;display:flex;align-items:center}
.search-pop{
  position:absolute;top:130%;right:0;z-index:500;display:none;
  padding:.4rem;background:var(--bg);border:1px solid var(--sec-border);
  border-radius:8px;box-shadow:0 6px 20px rgba(0,0,0,.3);
}
.search-pop.show{display:block}
.search-form{display:flex;align-items:center;gap:.3rem}
.search-input{
  width:15rem;max-width:60vw;padding:.4rem .55rem;
  border:1px solid var(--sec-border);border-radius:5px;
  background:var(--sec-bg);color:var(--text);
  font-family:sans-serif;font-size:.85rem;
}
.search-input:focus{outline:none;border-color:var(--accent)}
.search-input::placeholder{color:var(--muted);opacity:.75}
.search-go{color:var(--text);border-color:var(--sec-border);background:var(--sec-bg);flex-shrink:0}
.search-go:hover{background:var(--toc-hover)}

/* ============================================================
   SETTINGS POPOVER  (⚙ in the header)
   ============================================================ */
.settings-wrap{position:relative;display:flex;align-items:center}
.settings-pop{
  position:absolute;top:130%;right:0;z-index:500;display:none;
  min-width:12.5rem;padding:.4rem .55rem;
  background:var(--bg);color:var(--text);
  border:1px solid var(--sec-border);border-radius:8px;
  box-shadow:0 6px 20px rgba(0,0,0,.3);
}
.settings-pop.show{display:block}
.set-row{display:flex;align-items:center;justify-content:space-between;gap:.9rem;padding:.4rem .15rem}
.set-row + .set-row{border-top:1px solid var(--border)}
.set-lbl{font-family:sans-serif;font-size:.78rem;color:var(--text);white-space:nowrap}
.set-ctl{display:inline-flex;gap:.2rem}
/* buttons inside the popover use the light surface, not the dark-header style */
.settings-pop .icon-btn{
  color:var(--text);border-color:var(--sec-border);background:var(--sec-bg);
  min-width:30px;height:28px;
}
.settings-pop .icon-btn:hover{background:var(--toc-hover)}
#themeToggle{white-space:nowrap}

/* ============================================================
   RESPONSIVE  (sidebar becomes off-canvas)
   ============================================================ */
@media (max-width:900px){
  .hdr-nav{display:none}                     /* rely on sidebar nav on small screens */
  .site-main,.site-footer{margin-left:0}
  .content-wrap{max-width:100%}
  .site-sidebar{transform:translateX(-100%);box-shadow:2px 0 18px rgba(0,0,0,.3)}
  html.sidebar-open .site-sidebar{transform:translateX(0)}
  html.sidebar-open .sidebar-overlay{display:block}
  html.sidebar-collapsed .site-main{margin-left:0}
}
@media (max-width:520px){
  .site-name{max-width:42vw;overflow:hidden;text-overflow:ellipsis}
  .site-main{padding:1.3rem 1.1rem 3rem}
}

/* Featured image at the top of a single post (below title + meta). */
.entry-hero{margin:0 0 1.7rem;line-height:0}
.entry-hero img{width:100%;height:auto;display:block;border-radius:10px;border:1px solid var(--border)}
.entry-hero figcaption{line-height:1.5;font-size:.9rem;color:var(--muted);margin-top:.55rem;text-align:center}

/* ============================================================
   BLOG BROWSING  (post cards with thumbnails, categories)
   ============================================================ */
.post-card{display:flex;gap:1.3rem;align-items:flex-start;padding:1.4rem 0;border-bottom:1px solid var(--border)}
.post-thumb{flex-shrink:0;width:180px;display:block;line-height:0}
.post-thumb img{width:180px;height:120px;object-fit:cover;border-radius:8px;display:block}
.post-card-body{flex:1;min-width:0}
.post-card .entry-title{font-size:1.4rem;margin-bottom:.3rem}
.post-card .entry-summary{color:var(--muted)}
@media (max-width:560px){
  .post-card{flex-direction:column;gap:.7rem}
  .post-thumb,.post-thumb img{width:100%}
  .post-thumb img{height:180px}
}

/* sidebar: Blog (primary) item, categories sub-list */
.sb-primary{margin-bottom:.15rem}
.sb-primary a{font-weight:600}
.sb-sublabel{font-size:.58rem;letter-spacing:.09em;text-transform:uppercase;
  color:var(--muted);font-weight:700;font-family:sans-serif;margin:.9rem 0 .35rem .2rem}
.sb-cats{font-size:.98em}
.sb-cats .post-count,.sb-cats .count{color:var(--muted);font-size:.85em}

/* sidebar + footer widget areas */
.sb-widgets{font-family:sans-serif}
.widget{margin:0 0 1.2rem}
.widget-title{font-size:.6rem;letter-spacing:.11em;text-transform:uppercase;
  color:var(--muted);font-weight:700;font-family:sans-serif;margin:0 0 .5rem .2rem}
.widget ul{list-style:none;margin:0;padding:0}
.widget li{padding:.28rem .5rem;border-radius:5px;font-size:.82rem}
.widget li a{color:var(--text)}
.widget li a:hover{color:var(--accent)}
.footer-widgets{margin-left:var(--sw);background:var(--bg);
  border-top:1px solid var(--border);transition:margin-left .22s}
html.sidebar-collapsed .footer-widgets{margin-left:0}
.footer-widgets-inner{max-width:64rem;margin:0 auto;padding:2rem 2rem 1rem;
  display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:1.5rem;
  font-family:sans-serif;font-size:.85rem}
.footer-widgets a{color:var(--accent)}
@media (max-width:900px){.footer-widgets{margin-left:0}}

/* ---- "From the blog" recent-posts footer module ---- */
.footer-recent{margin-left:var(--sw);background:var(--bg);border-top:1px solid var(--border);
  transition:margin-left .22s}
html.sidebar-collapsed .footer-recent{margin-left:0}
.footer-recent-inner{max-width:64rem;margin:0 auto;padding:2rem 2rem 2.2rem}
.fr-title{font-family:sans-serif;font-size:.7rem;letter-spacing:.11em;text-transform:uppercase;
  color:var(--muted);font-weight:700;margin:0 0 1.1rem}
/* featured latest post */
.fr-feat{display:flex;gap:0;align-items:stretch;text-decoration:none;color:var(--text);
  background:var(--sec-bg);border:1px solid var(--border);border-radius:10px;overflow:hidden;
  transition:border-color .15s}
.fr-feat:hover{border-color:var(--accent);text-decoration:none}
.fr-feat-media{flex:0 0 42%;max-width:42%;display:block}
.fr-feat-media img{width:100%;height:100%;object-fit:cover;display:block}
.fr-feat-body{display:flex;flex-direction:column;gap:.45rem;padding:1.1rem 1.3rem}
.fr-feat-title{font-family:Georgia,'Times New Roman',serif;font-size:1.25rem;line-height:1.3;color:var(--accent)}
.fr-feat-date{font-family:sans-serif;font-size:.68rem;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}
.fr-feat-excerpt{font-family:Georgia,'Times New Roman',serif;font-size:.92rem;line-height:1.55;color:var(--text);
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
/* grid of older posts */
.fr-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:1rem;margin-top:1.2rem}
.fr-card{display:flex;gap:.7rem;align-items:center;text-decoration:none;color:var(--text);
  padding:.5rem;border-radius:8px;transition:background .15s}
.fr-card:hover{background:var(--toc-hover);text-decoration:none}
.fr-card-media{flex:0 0 56px;width:56px;height:56px;border-radius:6px;overflow:hidden;background:var(--sec-bg)}
.fr-card-media img{width:100%;height:100%;object-fit:cover;display:block}
.fr-card-mono{display:flex;align-items:center;justify-content:center;color:var(--accent);
  font-family:Georgia,'Times New Roman',serif;font-size:1.5rem;font-weight:700;line-height:1}
.fr-card-body{display:flex;flex-direction:column;gap:.15rem;min-width:0}
.fr-card-title{font-family:sans-serif;font-size:.82rem;font-weight:600;line-height:1.25;color:var(--text);
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.fr-card-snippet{font-family:sans-serif;font-size:.72rem;color:var(--muted);line-height:1.3;
  display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}
/* see older button */
.fr-more{margin:1.5rem 0 0;text-align:center}
.fr-more-btn{display:inline-block;font-family:sans-serif;font-size:.82rem;font-weight:600;
  padding:.55rem 1.3rem;border-radius:999px;background:var(--accent);color:var(--bg);
  text-decoration:none;transition:opacity .15s}
.fr-more-btn:hover{opacity:.9;text-decoration:none}
/* ---- subscribe: footer chip + modal dialog ---- */
/* The chip lives in .ft-links-row beside the social icons. The envelope never
   appears without the word: a bare glyph tests as "contact us" as often as
   "newsletter". */
.fs-open{display:inline-flex;align-items:center;gap:.35rem;font:600 .82rem/1.4 sans-serif;
  padding:.28rem .8rem;border-radius:999px;border:1px solid var(--accent);
  background:transparent;color:var(--accent);cursor:pointer;
  transition:background .15s,color .15s}
.fs-open:hover{background:var(--accent);color:var(--bg)}
.fs-open .fs-ico{font-size:.95rem;line-height:1}
/* Native <dialog>: Esc-to-close, focus trapping and inertness come free. */
dialog.fs-modal{padding:0;border:1px solid var(--sec-border);border-radius:14px;
  background:var(--sec-bg);color:var(--text);width:min(26rem,calc(100% - 2rem));
  box-shadow:0 12px 44px rgba(0,0,0,.35)}
dialog.fs-modal::backdrop{background:rgba(0,0,0,.55)}
.fs-modal-inner{position:relative;padding:1.5rem 1.6rem 1.6rem}
.fs-modal-title{font:700 1.05rem/1.3 sans-serif;color:var(--text);margin:0 0 .35rem}
.fs-modal-title .fs-ico{margin-right:.4rem}
.fs-blurb{font-family:sans-serif;font-size:.85rem;color:var(--text);margin:0 0 .9rem;line-height:1.4}
.fs-form{display:flex;flex-wrap:wrap;gap:.5rem}
.fs-form input[type=email]{flex:1 1 12rem;min-width:0;font-family:sans-serif;font-size:.9rem;
  padding:.55rem .8rem;border-radius:999px;border:1px solid var(--sec-border);
  background:var(--bg);color:var(--text)}
.fs-form input[type=email]::placeholder{color:var(--muted)}
.fs-form input[type=email]:focus{outline:2px solid var(--accent);outline-offset:1px;border-color:var(--accent)}
.fs-btn{font:600 .85rem sans-serif;padding:.55rem 1.3rem;border:0;border-radius:999px;
  background:var(--accent);color:var(--bg);cursor:pointer;transition:opacity .15s}
.fs-btn:hover{opacity:.9}
.fs-note{font-family:sans-serif;font-size:.72rem;color:var(--muted);margin:.7rem 0 0}
/* Jetpack's subscription block renders its own markup with INLINE styles
   (font-size:16px;padding:15px), which beat any plain rule — hence !important
   on exactly those two properties and nothing else. Scoped to .fs-modal so the
   /blog/ landing form keeps Jetpack's default look. */
.fs-modal .wp-block-jetpack-subscriptions__form-elements{display:flex;flex-wrap:wrap;gap:.5rem}
.fs-modal .wp-block-jetpack-subscriptions p{margin:0;flex:1 1 12rem;min-width:0}
.fs-modal .wp-block-jetpack-subscriptions input[type=email]{
  width:100%;font-family:sans-serif;font-size:.9rem !important;padding:.55rem .8rem !important;
  border-radius:999px;border:1px solid var(--sec-border);background:var(--bg);color:var(--text)}
.fs-modal .wp-block-jetpack-subscriptions input[type=email]:focus{
  outline:2px solid var(--accent);outline-offset:1px;border-color:var(--accent)}
.fs-modal .wp-block-jetpack-subscriptions button,
.fs-modal .wp-block-jetpack-subscriptions .wp-block-button__link{
  font-family:sans-serif;font-size:.85rem !important;font-weight:600;padding:.55rem 1.3rem !important;
  border:0;border-radius:999px;background:var(--accent);color:var(--bg);cursor:pointer}
.fs-modal .wp-block-jetpack-subscriptions button:hover,
.fs-modal .wp-block-jetpack-subscriptions .wp-block-button__link:hover{opacity:.9}
.fs-close{position:absolute;top:.5rem;right:.6rem;width:1.9rem;height:1.9rem;padding:0;
  border:0;border-radius:50%;background:transparent;color:var(--muted);
  font:1.25rem/1 sans-serif;cursor:pointer}
.fs-close:hover{background:var(--toc-hover);color:var(--text)}
/* End-of-post prompt: a quiet rule + one line of copy, so it reads as the close
   of the article rather than an ad block interrupting it. */
.fs-endpost{display:flex;flex-wrap:wrap;align-items:center;gap:.6rem .9rem;
  margin:2.2rem 0 .5rem;padding-top:1.1rem;border-top:1px solid var(--border)}
.fs-endpost-copy{font-family:sans-serif;font-size:.88rem;color:var(--muted);margin:0}
@media (max-width:620px){.fs-form input[type=email],.fs-btn{flex:1 1 100%}}

@media (max-width:900px){.footer-recent{margin-left:0}}
@media (max-width:560px){
  .fr-feat{flex-direction:column}
  .fr-feat-media,.fr-feat-media img{max-width:100%;flex-basis:auto;height:190px}
}

/* tags on single posts */
.post-tags{list-style:none;display:flex;flex-wrap:wrap;gap:.4rem;padding:0;
  margin:1.6rem 0 0;font-family:sans-serif}
.post-tags li{margin:0}
.post-tags a{display:inline-block;padding:.2rem .6rem;font-size:.76rem;
  background:var(--sec-bg);border:1px solid var(--border);border-radius:999px;color:var(--accent)}
.post-tags a:hover{background:var(--toc-hover);text-decoration:none}

/* ============================================================
   COMMENTS
   ============================================================ */
.comments-area{max-width:var(--content-max);margin:2.5rem auto 0;padding-top:1.5rem;
  border-top:1px solid var(--border)}
/* per-site notice at the top of the comment section (fournt_comment_notice) */
.comment-notice{background:var(--sec-bg);border:1px solid var(--border);
  border-left:3px solid var(--accent);border-radius:6px;padding:.7rem 1rem;
  margin:0 0 1.4rem;font-family:sans-serif;font-size:.9rem;line-height:1.5}
.comment-notice p{margin:0}
.comment-notice a{color:var(--link);font-weight:600}
.comments-title{font-size:1.3rem;margin:0 0 1.2rem}
/* end-of-post "being discussed on the forum" box (fournt_forum_box, only when the thread has replies) */
.forum-box{display:flex;gap:.8rem;align-items:flex-start;background:var(--sec-bg);
  border:1px solid var(--border);border-left:3px solid var(--accent);border-radius:8px;
  padding:.9rem 1.1rem;margin:2rem 0 1.2rem;font-family:sans-serif;line-height:1.45}
.forum-box-icon{flex-shrink:0;color:var(--accent);margin-top:.1rem}
.forum-box-body{min-width:0}
.forum-box-title{margin:0;font-weight:700;font-size:.98rem;color:var(--text)}
.forum-box-meta{margin:.15rem 0 .45rem;font-size:.82rem;color:var(--muted)}
.forum-box-link{color:var(--link);font-weight:600;font-size:.9rem;text-decoration:none}
.forum-box-link:hover{text-decoration:underline}
.comment-list{list-style:none;margin:0;padding:0}
.comment-list ol.children{list-style:none;margin:0 0 0 1.4rem;padding:0;
  border-left:1px solid var(--line)}
.comment-body{padding:1rem 0;border-bottom:1px solid var(--border)}
.comment-author{display:flex;align-items:center;gap:.6rem;font-family:sans-serif;font-size:.85rem}
.comment-author .avatar{border-radius:50%}
.comment-author .fn{font-weight:700;font-style:normal;color:var(--text)}
.comment-metadata{font-family:sans-serif;font-size:.72rem;color:var(--muted);margin:.15rem 0 .5rem}
.comment-metadata a{color:var(--muted)}
.comment-content{font-size:.95rem}
.comment-content > * + *{margin-top:.8rem}
.reply{font-family:sans-serif;font-size:.78rem}
.comment-respond{margin-top:1.8rem}
.comment-reply-title{font-size:1.15rem;margin:0 0 .8rem}
.comment-form label{display:block;font-family:sans-serif;font-size:.8rem;color:var(--muted);margin:.6rem 0 .2rem}
.comment-form input[type=text],.comment-form input[type=email],
.comment-form input[type=url],.comment-form textarea{
  width:100%;max-width:100%;padding:.5rem .6rem;font-family:inherit;font-size:.95rem;
  background:var(--sec-bg);color:var(--text);border:1px solid var(--sec-border);border-radius:6px}
.comment-form textarea:focus,.comment-form input:focus{outline:none;border-color:var(--accent)}
.form-submit .submit{cursor:pointer;padding:.5rem 1.1rem;font-family:sans-serif;
  background:var(--accent);color:var(--bg);border:none;border-radius:6px;font-size:.9rem}

/* 404 */
.error-404 .recent-posts{list-style:none;padding:0}
.error-404 .recent-posts li{padding:.3rem 0;border-bottom:1px solid var(--border)}

/* ============================================================
   SUBSCRIBE BOX  (Jetpack Subscriptions — blog index top & bottom)
   ============================================================ */
.subscribe-box{
  max-width:var(--content-max);
  margin:2rem auto;
  padding:1.3rem 1.5rem;
  background:var(--sec-bg);
  border:1px solid var(--sec-border);
  border-radius:10px;
}
.subscribe-box-title{margin:0 0 .3rem;font-size:1.25rem}
.subscribe-box-desc{margin:0 0 .9rem;color:var(--muted);font-size:.95rem}
.subscribe-box .wp-block-jetpack-subscriptions{margin:0}
.subscribe-box input[type=email]{
  width:100%;max-width:100%;padding:.5rem .6rem;font-family:inherit;font-size:.95rem;
  background:var(--bg);color:var(--text);border:1px solid var(--sec-border);border-radius:6px}
.subscribe-box input[type=email]:focus{outline:none;border-color:var(--accent)}
.subscribe-box button,
.subscribe-box .wp-block-button__link{
  cursor:pointer;padding:.5rem 1.1rem;font-family:sans-serif;font-size:.9rem;
  background:var(--accent);color:var(--bg);border:none;border-radius:6px}
.subscribe-box button:hover,
.subscribe-box .wp-block-button__link:hover{text-decoration:none;opacity:.92}

/* ============================================================
   SKIP LINK (accessibility)
   ============================================================ */
.skip-link{position:absolute;left:-9999px;top:0;z-index:999;
  background:var(--accent);color:#fff;padding:.6rem 1rem;border-radius:0 0 6px 0;
  font-family:sans-serif;font-size:.85rem}
.skip-link:focus{left:0;text-decoration:none}

/* respect reduced-motion */
@media (prefers-reduced-motion:reduce){
  *{transition:none!important;scroll-behavior:auto!important}
}

/* ============================================================
   IMAGE VIEWER (fournt-viewer) — opt-in via block "Additional
   CSS class(es)": fournt-viewer. Click opens the full-res image
   in an overlay with zoom in/out/reset + drag-to-pan.
   ============================================================ */
img.fournt-viewer{cursor:zoom-in}
body.fournt-lightbox-open{overflow:hidden}
.fournt-lightbox-overlay{position:fixed;inset:0;z-index:9999;
  background:rgba(0,0,0,.88);display:flex;align-items:center;justify-content:center}
.fournt-lightbox-overlay[hidden]{display:none}
.fournt-lightbox-stage{width:100%;height:100%;
  display:flex;align-items:center;justify-content:center;overflow:hidden}
.fournt-lightbox-stage.zoomable{cursor:grab}
.fournt-lightbox-stage.zoomable.dragging{cursor:grabbing}
.fournt-lightbox-img{max-width:90vw;max-height:80vh;user-select:none;
  -webkit-user-drag:none;transition:transform .1s ease-out;transform-origin:center center}
.fournt-lightbox-hint{position:absolute;top:20px;left:50%;
  transform:translate(-50%,-8px);background:var(--sec-bg);color:var(--text);
  border:1px solid var(--border);border-radius:999px;padding:.35rem .9rem;
  font-family:sans-serif;font-size:.78rem;opacity:0;pointer-events:none;
  transition:opacity .25s ease,transform .25s ease}
.fournt-lightbox-hint.show{opacity:1;transform:translate(-50%,0)}
/* Chrome must outrank the stage. Every child here is position:absolute with
   z-index:auto, so paint order was DOM order — and close/prev/next are written
   BEFORE the stage, so a zoomed image covered them while the controls and strip
   (written after) stayed visible. Explicit layers instead of source order. */
.fournt-lightbox-stage{z-index:0}
.fournt-lightbox-close,
.fournt-lightbox-nav,
.fournt-lightbox-controls,
.fournt-lightbox-strip{z-index:2}
.fournt-lightbox-close{position:absolute;top:16px;right:16px;width:40px;height:40px;
  border-radius:50%;border:1px solid var(--border);background:var(--sec-bg);
  color:var(--text);font-size:1.1rem;line-height:1;cursor:pointer}
.fournt-lightbox-close:hover{background:var(--accent);color:var(--header-text)}
.fournt-lightbox-nav{position:absolute;top:50%;transform:translateY(-50%);
  width:44px;height:44px;border-radius:50%;border:1px solid var(--border);
  background:var(--sec-bg);color:var(--text);font-size:1.5rem;line-height:1;
  cursor:pointer;display:flex;align-items:center;justify-content:center}
.fournt-lightbox-nav:hover{background:var(--accent);color:var(--header-text)}
.fournt-lightbox-nav[hidden]{display:none}
.fournt-lightbox-prev{left:16px}
.fournt-lightbox-next{right:16px}
.fournt-lightbox-controls{position:absolute;bottom:24px;left:50%;transform:translateX(-50%);
  display:flex;align-items:center;gap:8px;background:var(--sec-bg);border:1px solid var(--border);
  border-radius:999px;padding:6px}
.fournt-lightbox-controls button{width:36px;height:36px;border-radius:50%;
  border:1px solid var(--border);background:var(--bg);color:var(--text);
  font-size:1rem;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center}
.fournt-lightbox-controls button:hover{background:var(--accent);color:var(--header-text)}
.fournt-lightbox-count{font-family:sans-serif;font-size:.78rem;color:var(--muted);padding:0 .5rem}
.fournt-lightbox-count[hidden]{display:none}
.fournt-lightbox-strip{position:absolute;bottom:76px;left:50%;transform:translateX(-50%);
  display:flex;gap:6px;max-width:90vw;overflow-x:auto;padding:5px;
  background:var(--sec-bg);border:1px solid var(--border);border-radius:12px}
.fournt-lightbox-strip[hidden]{display:none}
.fournt-lightbox-thumb{flex:0 0 auto;width:52px;height:52px;padding:0;margin:0;
  border-radius:6px;border:2px solid transparent;background:none;cursor:pointer;
  overflow:hidden;opacity:.6}
.fournt-lightbox-thumb:hover{opacity:.9}
.fournt-lightbox-thumb.active{border-color:var(--accent);opacity:1}
.fournt-lightbox-thumb img{width:100%;height:100%;object-fit:cover;display:block}
