/* ==========================================================================
   contractorsglossary.com — Washington construction glossary.

   Design carried over from the approved prototype (site_or/index.html):
   cream paper, forest-green accent, Newsreader headings + Public Sans body.

   Section background/text colors come from the engine's per-scheme inline
   <style> (bc_render_scheme_css driven by bc_theme_palette). This file owns
   layout, typography and chrome. Block styles live at the bottom, one group
   per theme/blocks/*.php file.
   ========================================================================== */

:root {
  --max: 1120px;
  --measure: 880px;        /* article column */
  --text-measure: 720px;   /* paragraph line length */
  --gutter: 24px;

  --green: #1b4332;        /* primary brand green */
  --green-mid: #2d6a4f;    /* links on hover / accents */
  --green-deep: #16382a;   /* footer */
  --paper: #faf8f4;        /* page background */
  --paper-warm: #f4f1e9;   /* inner-page hero */
  --paper-mint: #eef2ea;   /* home hero */
  --paper-panel: #f2efe6;  /* callout panels */
  --card: #ffffff;
  --rule: #e2ddd2;
  --rule-soft: #f0ece2;

  --ink: #23282b;
  --ink-strong: #1c2420;
  --ink-body: #383e42;
  --ink-soft: #4a5054;
  --muted: #8a8577;
  --muted-deep: #6f7569;

  --sans: 'Public Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --serif: Newsreader, Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
body > main { flex: 1; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); }
a:hover { color: var(--green-mid); }

.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }
.wrap-narrow { max-width: var(--measure); margin: 0 auto; padding-inline: var(--gutter); }

.eyebrow {
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--green-mid);
}
.label-caps {
  font-size: 12px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
}

/* ==========================================================================
   Header
   ========================================================================== */

.topbar {
  background: var(--green);
  color: #d8e4dc;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 7px var(--gutter);
  text-align: center;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  padding-block: 14px;
}

.brand { text-decoration: none; display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.brand__name { font-family: var(--serif); font-size: 24px; font-weight: 600; color: var(--green); }
.brand__tld { font-size: 11px; letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; }

.nav { display: flex; gap: 20px; font-size: 14px; font-weight: 500; flex: 1; }
.nav a { text-decoration: none; color: #454b4e; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--green); }

/* Search — the results panel is built by search.js */
.search { position: relative; width: 260px; }
.search__input {
  width: 100%;
  padding: 8px 12px;
  font-size: 13.5px;
  font-family: var(--sans);
  border: 1px solid #d8d2c4;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  outline: none;
}
.search__input:focus { border-color: var(--green-mid); }
.search__panel {
  position: absolute;
  top: 42px;
  right: 0;
  width: 340px;
  background: #fff;
  border: 1px solid #d8d2c4;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(27, 67, 50, 0.14);
  overflow: hidden;
  z-index: 50;
}
.search__hit { display: block; padding: 10px 14px; text-decoration: none; border-bottom: 1px solid var(--rule-soft); }
.search__hit:last-child { border-bottom: 0; }
.search__hit:hover, .search__hit.is-active { background: #f4f1e9; }
.search__hit-label { display: block; font-size: 13.5px; font-weight: 500; color: var(--ink); }
.search__hit-cat { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.search__empty { padding: 12px 14px; font-size: 13px; color: var(--muted); }

.cat-tabs { display: flex; gap: 4px; overflow-x: auto; padding-inline: var(--gutter); max-width: var(--max); margin: 0 auto; }
.cat-tabs a {
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-deep);
  padding: 8px 12px 10px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.cat-tabs a:hover { color: var(--green); }
.cat-tabs a.is-active { color: var(--green); border-bottom-color: var(--green); }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer { background: var(--green-deep); color: #b9cbc0; }
.site-footer a { color: #d8e4dc; }
.site-footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
  padding: 44px var(--gutter) 30px;
  max-width: var(--max);
  margin: 0 auto;
}
.site-footer__brand-name { font-family: var(--serif); font-size: 20px; font-weight: 600; color: #f0f4ef; margin-bottom: 10px; }
.site-footer__brand-sub { font-size: 12px; letter-spacing: 0.13em; text-transform: uppercase; color: #7fa08c; line-height: 1.9; }
.site-footer__head { font-size: 11px; letter-spacing: 0.13em; text-transform: uppercase; font-weight: 700; color: #7fa08c; margin-bottom: 8px; }
.site-footer p { font-size: 13px; line-height: 1.65; margin: 0; }
.site-footer__links { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.site-footer__bar {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 14px var(--gutter);
  text-align: center;
  font-size: 12px;
  color: #7fa08c;
}

/* ==========================================================================
   Blocks
   ========================================================================== */

/* --- term-hero: breadcrumbs + category + H1 + intro + review date --------- */

.term-hero { border-bottom: 1px solid var(--rule); }
.term-hero__inner { max-width: var(--measure); margin: 0 auto; padding: 52px var(--gutter) 44px; }

.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: #6a705f; text-decoration: none; }
.crumbs a:hover { color: var(--green); }
.crumbs span[aria-current] { color: var(--muted); }
.crumbs__sep { color: #c3bda9; }

.term-hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(30px, 4.6vw, 42px);
  line-height: 1.12;
  margin: 12px 0 20px;
  color: var(--ink-strong);
  text-wrap: pretty;
  max-width: 760px;
}
.term-hero__lede {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.62;
  color: #43493f;
  margin: 0 0 14px;
  max-width: var(--text-measure);
  text-wrap: pretty;
}
.term-hero__meta { display: flex; gap: 18px; margin-top: 22px; font-size: 12.5px; color: var(--muted); }
.term-hero__meta strong { color: #5a604f; font-weight: 600; }

/* --- prose-section: an H2 section of the article -------------------------- */

.article { max-width: var(--measure); margin: 0 auto; padding-inline: var(--gutter); }

.prose-section { padding: 30px 0 6px; }
.prose-section > h2 {
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
  font-weight: 700;
  margin: 0 0 16px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}
.prose-section__body > p {
  font-size: 15.5px;
  line-height: 1.72;
  color: var(--ink-body);
  margin: 0 0 14px;
  max-width: var(--text-measure);
  text-wrap: pretty;
}
.prose-section__body h3 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  color: var(--ink-strong);
  margin: 22px 0 10px;
}
.prose-section__body ul,
.prose-section__body ol {
  margin: 0 0 14px;
  padding: 0 0 0 2px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: var(--text-measure);
}
.prose-section__body li {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-body);
}
.prose-section__body li::before { content: "·"; color: var(--green-mid); font-weight: 700; line-height: 1.6; }
.prose-section__body a { color: var(--green); font-weight: 500; }
.prose-section__body blockquote {
  margin: 0 0 14px;
  padding: 12px 18px;
  background: var(--paper-panel);
  border-left: 3px solid var(--green-mid);
  font-size: 15px;
  color: var(--ink-soft);
}

/* --- related-terms / official-sources: link lists ------------------------- */

.link-list { padding: 30px 0 6px; }
.link-list > h2 {
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
  font-weight: 700;
  margin: 0 0 16px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}
.link-list ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: var(--text-measure);
}
.link-list li { display: grid; grid-template-columns: 14px 1fr; gap: 10px; font-size: 15px; line-height: 1.6; }
.link-list li::before { content: "·"; color: var(--green-mid); font-weight: 700; line-height: 1.6; }
.link-list a { color: var(--green); font-weight: 500; text-decoration: none; }
.link-list a:hover { text-decoration: underline; }
.link-list__url { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; word-break: break-all; }

/* --- glossary-faq -------------------------------------------------------- */

.faq { padding: 30px 0 6px; }
.faq > h2 {
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
  font-weight: 700;
  margin: 0 0 16px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}
.faq__item {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 0 0 10px;
  max-width: var(--text-measure);
}
.faq__q { font-family: var(--serif); font-size: 16.5px; font-weight: 600; color: var(--ink-strong); margin: 0 0 6px; }
.faq__a { font-size: 14.5px; line-height: 1.65; color: var(--ink-soft); margin: 0; }

/* --- category-cards (home + /glossary/) ---------------------------------- */

.cards { padding: 44px 0 8px; }
.cards__head { margin-bottom: 16px; }
.cards__grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card {
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.card:hover { border-color: var(--green); box-shadow: 0 8px 24px rgba(27, 67, 50, 0.09); }
.card__count { font-size: 11px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--green-mid); font-weight: 600; }
.card__title { font-family: var(--serif); font-size: 21px; font-weight: 500; color: var(--ink-strong); }
.card__sub { font-size: 13px; color: var(--muted-deep); line-height: 1.5; }

/* --- term-cards (category hub) ------------------------------------------- */

.term-cards__grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.term-card {
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.term-card:hover { border-color: var(--green); box-shadow: 0 8px 24px rgba(27, 67, 50, 0.09); }
.term-card__term { font-family: var(--serif); font-size: 18px; font-weight: 500; color: var(--ink-strong); }
.term-card__title { font-size: 12.5px; color: var(--muted-deep); line-height: 1.45; }

/* --- az-index ------------------------------------------------------------ */

.az__group { display: grid; grid-template-columns: 64px 1fr; gap: 18px; padding: 18px 0; border-top: 1px solid var(--rule); }
.az__letter { font-family: var(--serif); font-size: 32px; font-weight: 500; color: var(--green-mid); line-height: 1; }
.az__items { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 20px; }
.az__items a { font-size: 14px; color: #33393d; text-decoration: none; padding: 3px 0; }
.az__items a:hover { color: var(--green); text-decoration: underline; }

/* --- term-nav (prev / next) ---------------------------------------------- */

.term-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 36px;
  padding: 20px var(--gutter) 56px;
  border-top: 1px solid var(--rule);
  max-width: var(--measure);
  margin-inline: auto;
}
.term-nav a { text-decoration: none; max-width: 46%; }
.term-nav__dir { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.term-nav__label { font-size: 14px; font-weight: 500; color: var(--green); }
.term-nav__next { text-align: right; margin-left: auto; }

/* --- callout ------------------------------------------------------------- */

.callout {
  max-width: var(--text-measure);
  margin: 28px auto 0;
  background: var(--paper-panel);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 18px 22px;
  font-size: 13.5px;
  line-height: 1.6;
  color: #5a604f;
}
.callout__head { font-size: 11px; letter-spacing: 0.13em; text-transform: uppercase; font-weight: 700; color: var(--muted); margin-bottom: 6px; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
  .site-header__inner { flex-wrap: wrap; gap: 14px; }
  .nav { order: 3; width: 100%; flex: none; }
  .search { flex: 1; width: auto; min-width: 180px; }
  .search__panel { width: 100%; }
}

@media (max-width: 600px) {
  /* Brand and search stop competing for one row: brand alone, then a
     full-width search, then the nav. The category tabs keep scrolling. */
  .brand__name { font-size: 20px; }
  .site-header__inner { gap: 10px; }
  /* Three stacked rows plus the tab strip is ~190px — too much to pin to the
     top of a phone screen, so the header scrolls away here. */
  .site-header { position: static; }
  .search { order: 2; flex: 0 0 100%; width: 100%; }
  .term-hero__inner { padding: 34px var(--gutter) 30px; }
  .term-hero__lede { font-size: 17px; }
  .az__group { grid-template-columns: 40px 1fr; gap: 12px; }
  .az__letter { font-size: 26px; }
  .term-nav { flex-direction: column; }
  .term-nav a, .term-nav__next { max-width: 100%; text-align: left; margin-left: 0; }
}
