/* ---------------------------------------------------------------------------
   Shared stylesheet. Identical on every site; the brand colors are injected
   as --brand / --brand-dark / --accent from site.php.

   This file is the STRUCTURE. Each site's personality -- fonts, hero
   treatment, textures, motifs -- lives in its own assets/css/theme.css,
   which ships from sites/<domain>/ and loads after this file.
   Prefer editing a theme.css over editing this file.
   --------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --ink: #1a1a1a;
  --ink-soft: #555;
  --line: #e4e4e7;
  --bg: #ffffff;
  --bg-soft: #f7f7f8;
  --radius: 10px;
  --max: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: Georgia, "Times New Roman", serif;

  /* Theme hooks. A theme.css overrides these rather than restating rules. */
  --brand-contrast: #fff;          /* text that sits on --brand */
  --hero-bg: linear-gradient(160deg, var(--brand) 0%, var(--brand-dark) 100%);
  --hero-ink: #fff;
  --header-bg: var(--bg);
  --footer-bg: var(--brand-dark);
  --logo-height: 44px;
  --head-transform: none;
  --head-spacing: normal;
  --head-weight: 700;
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--brand-dark); }

h1, h2, h3, h4 {
  font-family: var(--font-head); line-height: 1.2; margin: 0 0 .5em;
  font-weight: var(--head-weight);
  text-transform: var(--head-transform);
  letter-spacing: var(--head-spacing);
}
h1 { font-size: clamp(2rem, 5vw, 2.9rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.2rem; }

p, ul, ol { margin: 0 0 1.1em; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.section { padding: 56px 20px; }
.center { text-align: center; }

.skip {
  position: absolute; left: -9999px; top: 0; background: var(--brand);
  color: #fff; padding: 10px 16px; z-index: 100;
}
.skip:focus { left: 0; }

/* ---- Header ------------------------------------------------------------- */
.site-header { border-bottom: 1px solid var(--line); background: var(--header-bg); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 16px; }
.brand { text-decoration: none; color: var(--ink); }
.brand-name { font-family: var(--font-head); font-size: 1.25rem; font-weight: 700; }
.brand-logo { max-height: var(--logo-height); width: auto; }

.site-nav ul { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
.site-nav a { text-decoration: none; color: var(--ink-soft); font-size: .95rem; padding: 6px 0; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--brand); }
.site-nav a[aria-current="page"] { border-bottom: 2px solid var(--brand); }

.nav-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; transition: .2s; }

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 100%; left: 0; right: 0;
              background: var(--bg); border-bottom: 1px solid var(--line); padding: 12px 20px; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 4px; }
  .site-nav a { display: block; padding: 10px 0; }
  .header-inner { position: relative; }
}

/* ---- Hero and bands ----------------------------------------------------- */
.hero {
  background: var(--hero-bg);
  color: var(--hero-ink); padding: 84px 20px; text-align: center;
  position: relative; overflow: hidden;
}
.hero h1 { margin-bottom: .3em; }
.hero > .wrap { position: relative; z-index: 1; }
.lede { font-size: 1.2rem; opacity: .95; max-width: 46ch; margin-inline: auto; }
.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }

.band { background: var(--bg-soft); padding: 56px 20px; text-align: center; border-top: 1px solid var(--line); }

/* ---- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-block; background: var(--brand); color: var(--brand-contrast); text-decoration: none;
  padding: 12px 24px; border-radius: var(--radius); font-weight: 600; font-size: .98rem;
  border: 2px solid var(--brand); transition: .15s;
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: var(--brand-contrast); }
.btn-ghost { background: transparent; border-color: rgba(255,255,255,.7); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.15); border-color: #fff; }
.btn-light { background: var(--brand); }

/* ---- Cards -------------------------------------------------------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 24px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; background: var(--bg); }
.card h2 { font-size: 1.25rem; }
.card p:last-child { margin-bottom: 0; }

.section-title { border-bottom: 2px solid var(--accent); display: inline-block; padding-bottom: 4px; }

/* ---- Prose (about pages, blog posts) ------------------------------------ */
.prose { max-width: 72ch; }
.prose img { border-radius: var(--radius); margin: 1.5em 0; }
.prose blockquote {
  margin: 1.5em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--accent);
  color: var(--ink-soft); font-style: italic;
}
.prose pre {
  background: #1e1e24; color: #eaeaea; padding: 16px; border-radius: var(--radius);
  overflow-x: auto; font-size: .9rem;
}
.prose code { background: var(--bg-soft); padding: 2px 5px; border-radius: 4px; font-size: .92em; }
.prose pre code { background: none; padding: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }

/* ---- Blog --------------------------------------------------------------- */
.post-list { display: grid; gap: 36px; }
.post-item { border-bottom: 1px solid var(--line); padding-bottom: 28px; }
.post-item:last-child { border-bottom: 0; }
.post-item h2, .post-item h3 { margin-bottom: .2em; }
.post-item a { text-decoration: none; }
.post-item a:hover { text-decoration: underline; }
.post-thumb { border-radius: var(--radius); margin-bottom: 14px; }
.post-hero { border-radius: var(--radius); margin: 1.2em 0 2em; width: 100%; }
.meta { color: var(--ink-soft); font-size: .9rem; }
.draft { background: var(--accent); color: #1a1a1a; font-size: .7rem; padding: 2px 7px;
         border-radius: 4px; vertical-align: middle; text-transform: uppercase; letter-spacing: .05em; }
.tags { margin-top: 2em; }
.tag { display: inline-block; background: var(--bg-soft); border: 1px solid var(--line);
       border-radius: 999px; padding: 3px 12px; font-size: .82rem; margin-right: 6px; color: var(--ink-soft); }

/* ---- Forms -------------------------------------------------------------- */
.gform { margin: 2em 0; }
.gform iframe { width: 100%; border: 0; }
.notice { background: #fff8e1; border: 1px solid var(--accent); padding: 14px 18px; border-radius: var(--radius); }

/* ---- Footer ------------------------------------------------------------- */
.site-footer { background: var(--footer-bg); color: rgba(255,255,255,.85); margin-top: 0; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; padding-block: 44px; }
.site-footer a { color: #fff; }
.site-footer p { margin: 0 0 .35em; font-size: .95rem; }
.footer-name { font-family: var(--font-head); font-size: 1.1rem; font-weight: 700; color: #fff; }
.social { list-style: none; margin: 0 0 10px; padding: 0; display: flex; gap: 16px; }
.copyright, .footer-note { font-size: .85rem; opacity: .75; }

/* Visually hidden but available to screen readers. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

/* ---- Focus ------------------------------------------------------------- */
:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
