/* Chord Grove — site stylesheet (W2 quality pass rebuild)
   Palette derived from the site's existing theme colour (#b6532f).
   Fonts: existing already-loaded Google Fonts (Fraunces + Inter), unchanged. */
:root {
  --oat: #f5efe4;
  --cream: #faf6ee;
  --rust: #b6532f;      /* mid */
  --rust-dark: #8b3e22; /* deep */
  --rust-tint: #f1d9ca; /* tint */
  --sage: #7a8a6c;
  --sage-dark: #4f5f43;
  --charcoal: #2d2a26;
  --ink: #1c1a17;
  --muted: #6f685e;
  --line: #d9cfbe;
  --line-soft: #ebe2d0;
  --shadow: 0 1px 0 rgba(28,26,23,0.04), 0 8px 24px -16px rgba(28,26,23,0.18);
  --radius: 10px;
  --gap-section: 3.2rem;
  --maxw: 1180px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4 { font-family: 'Fraunces', Georgia, serif; color: var(--charcoal); font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 1.5rem + 1.6vw, 2.4rem); }
h2 { font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.6rem); }
h3 { font-size: 1.15rem; }
small, .small { font-size: .85rem; }
a { color: var(--rust-dark); text-decoration: none; }
a:hover { color: var(--rust); text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, label:focus-within { outline: 3px solid var(--rust); outline-offset: 2px; }
p { margin: 0 0 1em; }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--rust-dark); color: #fff; padding: 10px 16px; z-index: 100; }
.skip-link:focus { left: 12px; top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* TOPBAR */
.topbar { background: var(--rust-dark); color: #f6e9df; }
.topbar-inner { padding-top: 6px; padding-bottom: 6px; font-size: .78rem; letter-spacing: .03em; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.topbar a { color: #fff; text-decoration: underline; }

/* HEADER */
.site-header { background: var(--oat); border-bottom: 1px solid var(--line); position: relative; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; gap: 20px; flex-wrap: wrap; position: relative; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--charcoal); }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--rust); flex: none; }
.brand-name { font-family: 'Fraunces', Georgia, serif; font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; display: block; line-height: 1; }
.brand-sub { font-size: .7rem; text-transform: uppercase; letter-spacing: .18em; color: var(--muted); display: block; margin-top: 4px; }
.primary-nav { display: flex; gap: 22px; align-items: center; }
.primary-nav a { color: var(--charcoal); font-weight: 500; font-size: .95rem; }
.nav-toggle-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.nav-toggle-label { display: none; align-items: center; justify-content: center; flex-direction: column; gap: 3px; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: #fff; }
.nav-toggle-label .bar { display: block; width: 18px; height: 2px; background: var(--charcoal); }
.meganav { display: none; background: #efe7d6; border-bottom: 1px solid var(--line); }
.meganav-grid { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; padding: 10px 24px; }
.meganav-grid > div { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 14px; }
.meganav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .2em; color: var(--sage-dark); margin-right: 4px; font-weight: 600; }
.meganav-grid a { color: var(--charcoal); font-size: .92rem; }
.nav-cats-mobile { display: flex; flex-direction: column; gap: 2px; width: 100%; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
.nav-cats-mobile .meganav-label { display: block; margin: 6px 0 2px; }

/* BREADCRUMB */
.breadcrumb { background: var(--cream); border-bottom: 1px solid var(--line-soft); padding: 10px 0; font-size: .82rem; }
.breadcrumb .container { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--rust-dark); }
.breadcrumb .sep { color: var(--line); }
.breadcrumb [aria-current="page"] { color: var(--charcoal); font-weight: 500; }

/* HERO (home) */
.hero { background: linear-gradient(180deg, var(--oat) 0%, var(--cream) 100%); padding: 48px 0 44px; border-bottom: 1px solid var(--line-soft); }
.hero-inner { display: grid; grid-template-columns: 1fr; gap: 32px; align-items: center; }
.hero-eyebrow { color: var(--rust); font-size: .8rem; text-transform: uppercase; letter-spacing: .25em; font-weight: 600; }
.hero h1 { margin-top: 14px; }
.hero p.lede { font-size: 1.05rem; color: var(--charcoal); max-width: 560px; }
.hero-stats { display: flex; gap: 24px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.hero-stat strong { font-family: 'Fraunces',Georgia,serif; font-size: 1.5rem; color: var(--rust-dark); display: block; line-height: 1; }
.hero-stat span { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .15em; }
.hero-photo { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; }

/* HUB HERO (category / listing pages) */
.hub-hero .container { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.hub-hero-text { flex: 1 1 360px; }
.hub-hero-img { flex: none; width: 180px; height: 180px; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }

/* SECTIONS */
section.block { padding: 36px 0; }
section.block.alt { background: var(--oat); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.section-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 22px; gap: 24px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head .more { font-size: .9rem; color: var(--rust-dark); font-weight: 500; }

/* CARDS */
.card-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.card { background: #fff; border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-2px); box-shadow: 0 1px 0 rgba(28,26,23,0.06), 0 16px 32px -16px rgba(28,26,23,0.25); text-decoration: none; }
.card-body { padding: 16px 16px 18px; flex: 1; display: flex; flex-direction: column; }
.card-meta { font-size: .74rem; text-transform: uppercase; letter-spacing: .15em; color: var(--sage-dark); font-weight: 600; margin-bottom: 8px; }
.card-title { font-family: 'Fraunces',Georgia,serif; font-size: 1.1rem; color: var(--charcoal); margin: 0 0 6px; line-height: 1.25; }
.card-source { font-size: .85rem; color: var(--muted); margin-bottom: 12px; }
.card-tags { display: flex; gap: 6px; margin-top: auto; flex-wrap: wrap; }
.tag { font-size: .7rem; padding: 3px 9px; background: var(--oat); border: 1px solid var(--line); border-radius: 99px; color: var(--charcoal); }

/* CATEGORY STRIP (home) */
.category-strip { display: grid; grid-template-columns: 1fr; gap: 16px; }
.cat-card { background: #fff; border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; text-align: left; transition: all .15s ease; display: block; color: inherit; }
.cat-card:hover { border-color: var(--rust); text-decoration: none; transform: translateY(-2px); }
.cat-card-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.cat-card-body { padding: 16px 18px 18px; }
.cat-card-num { font-family: 'Fraunces',Georgia,serif; font-size: 1.7rem; color: var(--rust); line-height: 1; }
.cat-card-label { font-family: 'Fraunces',Georgia,serif; font-size: 1.02rem; margin-top: 6px; color: var(--charcoal); }
.cat-card-blurb { font-size: .85rem; color: var(--muted); margin-top: 6px; }

/* PATTERN PAGE */
.pattern-layout { display: grid; grid-template-columns: 1fr; gap: 36px; padding: 36px 0; }
.pattern-main { min-width: 0; }
.pattern-hero { display: block; margin-bottom: 24px; }
.pattern-thumb-banner { width: 140px; height: 140px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); float: right; margin: 0 0 16px 16px; }
.pattern-thumb-banner img { width: 100%; height: 100%; object-fit: cover; }
.pattern-meta-eyebrow { color: var(--rust); font-size: .78rem; text-transform: uppercase; letter-spacing: .22em; font-weight: 600; }
.pattern-name { font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.4rem); margin: 12px 0 8px; }
.pattern-source-box { color: var(--muted); font-size: .92rem; margin-bottom: 18px; line-height: 1.6; }
.pattern-source-box strong { color: var(--charcoal); font-weight: 600; }
.pattern-source-box a { font-weight: 500; }
.pattern-body p { font-size: 1rem; color: var(--ink); }
.pattern-body { max-width: 65ch; clear: both; }
.pattern-body h2 { margin-top: 1.4em; }
.pattern-body ul { padding-left: 1.2em; }
.pattern-body code { background: var(--oat); padding: 1px 5px; border-radius: 4px; font-size: .92em; }
.notes-card { background: var(--oat); border-left: 3px solid var(--sage); padding: 16px 20px; margin: 22px 0; border-radius: 0 6px 6px 0; clear: both; }
.notes-card strong { display: block; font-family: 'Fraunces',Georgia,serif; color: var(--charcoal); margin-bottom: 4px; }
.related { padding-top: 26px; border-top: 1px solid var(--line); margin-top: 30px; clear: both; }

.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { padding: 6px 0; border-bottom: 1px dashed var(--line-soft); }
.link-list li:last-child { border-bottom: 0; }
.link-list a { color: var(--charcoal); font-size: .92rem; }

/* CATEGORY/INDEX PAGE HEAD */
.page-head { background: var(--oat); padding: 36px 0 30px; border-bottom: 1px solid var(--line-soft); }
.page-head .crumb { font-size: .75rem; text-transform: uppercase; letter-spacing: .2em; color: var(--muted); margin-bottom: 10px; }
.page-head h1 { margin: 0 0 12px; }
.page-head p.lede { color: var(--charcoal); max-width: 720px; font-size: 1.02rem; margin: 0; }
.page-head .stats { margin-top: 14px; color: var(--muted); font-size: .88rem; }

/* TABLES (data tables, used wherever a page renders one) */
.table-scroll { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data-table caption { text-align: left; color: var(--muted); margin-bottom: 8px; }
table.data-table th, table.data-table td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); text-align: left; }
table.data-table thead th { background: var(--oat); color: var(--charcoal); font-weight: 600; position: sticky; top: 0; }
table.data-table tbody th[scope="row"] { position: sticky; left: 0; background: var(--cream); }
table.data-table tbody tr:nth-child(even) { background: rgba(182,83,47,0.04); }

/* CONTENT MEDIA */
figure { margin: 22px 0; }
.content-photo { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; max-width: 480px; }
figcaption { font-size: .82rem; color: var(--muted); margin-top: 6px; }
.contact-block { background: #fff; border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 20px 22px; margin: 20px 0; }
.contact-block a { font-weight: 600; }

/* FOOTER */
.site-footer { background: var(--charcoal); color: #d9cfbe; padding: 40px 0 22px; margin-top: 52px; }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 12px; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 26px; margin-bottom: 26px; }
.footer-grid p, .footer-grid a { color: #c5b9a3; font-size: .9rem; }
.footer-grid .link-list li { border-bottom-color: rgba(255,255,255,.08); }
.footer-grid a:hover { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); color: #8a8074; font-size: .82rem; flex-wrap: wrap; gap: 8px; }

/* RESPONSIVE: 360 (default/mobile-first above), 768, 1200 */
@media (max-width: 767px) {
  .primary-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--oat); border-bottom: 1px solid var(--line); flex-direction: column; align-items: flex-start; padding: 12px 24px 18px; gap: 2px; box-shadow: var(--shadow); z-index: 50; }
  .primary-nav a { padding: 8px 0; width: 100%; }
  .nav-toggle-label { display: flex; }
  .nav-toggle-input:checked + .nav-toggle-label + .primary-nav { display: flex; }
}
@media (min-width: 768px) {
  .header-inner { flex-wrap: nowrap; }
  .hero-inner { grid-template-columns: 1.3fr 1fr; }
  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .card-grid.dense { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .category-strip { grid-template-columns: repeat(3,1fr); }
  .footer-grid { grid-template-columns: 1.3fr 1fr 1fr 1fr; }
  .pattern-hero { display: flow-root; }
  .pattern-thumb-banner { width: 200px; height: 200px; }
  .meganav { display: block; }
  .nav-cats-mobile { display: none; }
}
@media (min-width: 1200px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .card-grid.dense { grid-template-columns: repeat(4, 1fr); }
  .category-strip { grid-template-columns: repeat(5,1fr); }
  .pattern-thumb-banner { width: 220px; height: 220px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
@media print {
  .topbar, .site-header, .meganav, .breadcrumb, .site-footer, .nav-toggle-label, .hub-hero-img, .pattern-thumb-banner, .cat-card-img { display: none !important; }
  body { background: #fff; color: #000; }
  .pattern-body, article { max-width: 100%; }
  a { color: #000; text-decoration: underline; }
}

.brand-text { display: flex; flex-direction: column; }
.footer-legal { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
