/* Universal critical CSS — covers above-the-fold for every template so the
   rest of the stylesheets can be deferred without FOUC. Kept small (≈3KB)
   and limited to what visible-without-scroll usually needs: reset, body,
   headings, container, header chrome, nav, hero shell, link colour. */

*,*::before,*::after{box-sizing:border-box}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
html,body{margin:0;padding:0;line-height:1.5;color:#0f172a;background:#fff;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,sans-serif}
body{min-height:100vh;display:flex;flex-direction:column;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased}
main{flex:1}
img,picture,video,canvas,svg{max-width:100%;height:auto;display:block}
img{vertical-align:middle}
a{color:#2563eb;text-decoration:none;background:transparent}
a:hover{text-decoration:underline}
button,input,select,textarea{font:inherit;color:inherit}
h1,h2,h3,h4,h5,h6{margin:0 0 .5em;line-height:1.2;font-weight:700;color:inherit}
h1{font-size:clamp(1.75rem,1.3rem+1.6vw,2.5rem)}
h2{font-size:clamp(1.4rem,1.15rem+1.0vw,1.875rem)}
h3{font-size:clamp(1.15rem,1.05rem+.5vw,1.4rem)}
p{margin:0 0 1em}
small{font-size:.875em}
hr{border:0;border-top:1px solid #e5e7eb;margin:1em 0}
.container{width:100%;max-width:1200px;margin-inline:auto;padding-inline:1rem}
.skip{position:absolute;left:-9999px;top:0;background:#0f172a;color:#fff;padding:8px 12px;z-index:9999;border-radius:0 0 6px 0}
.skip:focus{left:0}
[hidden]{display:none!important}

/* Generic header/footer/nav scaffolding — colours come from theme CSS later */
.gh-head,.site-header,.ws-head,.ml-head{position:sticky;top:0;z-index:40;backdrop-filter:blur(12px);transition:background .2s ease}
header .container,header > div{display:flex;align-items:center;justify-content:space-between}
nav a{display:inline-block;padding:.4em .6em}

/* Hero shell — most templates use a tall image-block at the top */
.gh-hero,.hero,.ml-hero{position:relative;min-height:280px;overflow:hidden}
.gh-hero-bg,.hero-bg{position:absolute;inset:0;z-index:0}
.gh-hero-content,.hero-content{position:relative;z-index:1}

/* Page-grid: feed cards / sections rendered as grid */
.gh-feed,.ws-grid,.ml-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:24px}

/* CSS-only fallback for prefers-color-scheme: covers the no-data-theme race */
@media (prefers-color-scheme: dark){
  html:not([data-theme]),html:not([data-theme]) body{background:#111827;color:#e5e7eb}
  html:not([data-theme]) a{color:#60a5fa}
  html:not([data-theme]) hr{border-top-color:#374151}
}
