/* ==========================================================================
   Broken Bone Theory - Template Kit
   Single stylesheet. No framework. No build step.
   Convert to WordPress by enqueueing this file from functions.php.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  color-scheme: light;
  /* Surfaces */
  --ground:        #FAF9F6;
  --surface:       #FFFFFF;
  --surface-alt:   #F1EFE9;

  /* Ink */
  --ink:           #1C2B36;
  --ink-soft:      #44535F;
  --ink-mute:      #59646E;

  /* Lines */
  --rule:          #E2DFD6;
  --rule-strong:   #C8C4B8;

  /* Accent */
  --accent:        #2F6B7E;
  --accent-dark:   #23525F;
  --accent-wash:   #E4EEF1;

  /* Care / crisis */
  --care:          #8A4B2A;
  --care-wash:     #F7EAE0;

  /* Evidence callout */
  --fact:          #3F6340;
  --fact-wash:     #E6EEE3;

  /* Type */
  --font-head: Lora, Georgia, "Times New Roman", serif;
  --font-body: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Space */
  --gutter: 20px;
  --measure: 40rem;

  --shadow: 0 1px 3px rgba(28, 43, 54, .07);
  --radius: 4px;
}



/* --------------------------------------------------------------------------
   2. Reset and base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-dark); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.shell { width: 100%; max-width: 1140px; margin-inline: auto; padding-inline: var(--gutter); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: 12px 18px; font-weight: 600;
}
.skip-link:focus { left: 8px; top: 8px; }

/* --------------------------------------------------------------------------
   3. Header (identical on every page)
   -------------------------------------------------------------------------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 40;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 68px;
}
.brand {
  font-family: var(--font-head);
  font-size: 1.24rem; font-weight: 600; letter-spacing: -.01em;
  color: var(--ink); text-decoration: none; line-height: 1.15;
}
.brand span { display: block; font-family: var(--font-body); font-size: .62rem;
  letter-spacing: .13em; text-transform: uppercase; color: var(--ink-mute);
  font-weight: 600; margin-top: 3px; }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--rule-strong);
  color: var(--ink); padding: 8px 12px; font: inherit; font-size: .85rem;
  border-radius: var(--radius); cursor: pointer;
}

.site-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.site-nav a {
  color: var(--ink-soft); text-decoration: none;
  font-size: .93rem; font-weight: 500; padding-block: 6px;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.site-nav .nav-cta a {
  background: var(--accent); color: #fff; padding: 8px 15px;
  border-radius: var(--radius); border-bottom: 0;
}
.site-nav .nav-cta a:hover { background: var(--accent-dark); color: #fff; border-bottom: 0; }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--surface); border-bottom: 1px solid var(--rule);
    box-shadow: var(--shadow); padding: 12px var(--gutter) 18px;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav li { border-bottom: 1px solid var(--rule); }
  .site-nav li:last-child { border-bottom: 0; }
  .site-nav a { display: block; padding: 13px 0; }
  .site-nav .nav-cta { padding-top: 12px; }
  .site-nav .nav-cta a { display: inline-block; }
}

/* --------------------------------------------------------------------------
   4. Article layout
   -------------------------------------------------------------------------- */
.page-wrap { padding-block: 34px 60px; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 52px;
  align-items: start;
}
@media (max-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 36px; }
}

.crumbs { font-size: .82rem; color: var(--ink-mute); margin-bottom: 20px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--rule-strong); }
.crumbs a { color: var(--ink-mute); }

.article-head { margin-bottom: 30px; }
.kicker {
  font-size: .7rem; letter-spacing: .14em; text-transform: uppercase;
  font-weight: 700; color: var(--accent); margin: 0 0 12px;
}
h1 {
  font-family: var(--font-head); font-weight: 600;
  font-size: clamp(2rem, 5.2vw, 2.9rem); line-height: 1.12;
  letter-spacing: -.016em; margin: 0 0 16px; text-wrap: balance;
}
.dek {
  font-size: 1.15rem; line-height: 1.6; color: var(--ink-soft);
  margin: 0 0 24px; max-width: var(--measure);
}

/* Byline */
.byline {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 16px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
}
.byline img, .byline .avatar {
  width: 52px; height: 52px; border-radius: 50%; flex: 0 0 auto;
  background: var(--surface-alt); border: 1px solid var(--rule);
  display: grid; place-items: center; font-family: var(--font-head);
  font-size: 1.15rem; color: var(--accent); font-weight: 600;
}
.byline-text { font-size: .88rem; line-height: 1.5; color: var(--ink-mute); }
.byline-text strong { display: block; font-size: .98rem; color: var(--ink); font-weight: 600; }
.byline-text a { font-weight: 600; }

/* --------------------------------------------------------------------------
   5. Prose
   -------------------------------------------------------------------------- */
.prose { max-width: var(--measure); }
.prose > * { max-width: 100%; }

.prose h2 {
  font-family: var(--font-head); font-weight: 600;
  font-size: clamp(1.45rem, 3.4vw, 1.85rem); line-height: 1.2;
  letter-spacing: -.01em; margin: 2.4em 0 .6em; text-wrap: balance;
  padding-top: .6em; border-top: 1px solid var(--rule);
}
.prose h2:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.prose h3 {
  font-family: var(--font-head); font-weight: 600;
  font-size: 1.2rem; line-height: 1.3; margin: 1.9em 0 .45em; text-wrap: balance;
}
.prose p { margin: 0 0 1.15em; }
.prose ul, .prose ol { margin: 0 0 1.3em; padding-left: 1.3em; }
.prose li { margin-bottom: .55em; }
.prose li::marker { color: var(--accent); }
.prose strong { font-weight: 600; color: var(--ink); }
.prose blockquote {
  margin: 1.6em 0; padding: 4px 0 4px 22px;
  border-left: 3px solid var(--accent);
  font-family: var(--font-head); font-size: 1.08rem; line-height: 1.55;
  color: var(--ink-soft); font-style: italic;
}
.prose blockquote cite {
  display: block; margin-top: 10px; font-family: var(--font-body);
  font-size: .8rem; font-style: normal; color: var(--ink-mute);
}
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.4em 0; }

.lead { font-size: 1.1rem; color: var(--ink-soft); }

/* Callouts */
.callout {
  background: var(--accent-wash); border-left: 4px solid var(--accent);
  padding: 18px 20px; margin: 1.8em 0; font-size: .97rem; line-height: 1.62;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.callout p:last-child { margin-bottom: 0; }
.callout .callout-title {
  display: block; font-weight: 700; font-size: .72rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 8px;
}

.callout.care { background: var(--care-wash); border-left-color: var(--care); }
.callout.care .callout-title { color: var(--care); }
.callout.care a { color: var(--care); font-weight: 600; }

.callout.fact { background: var(--fact-wash); border-left-color: var(--fact); }
.callout.fact .callout-title { color: var(--fact); }

/* Key takeaways */
.takeaways {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 22px 24px; margin: 0 0 32px;
  box-shadow: var(--shadow);
}
.takeaways h2 {
  font-family: var(--font-body); font-size: .74rem !important; letter-spacing: .13em;
  text-transform: uppercase; color: var(--ink-mute); font-weight: 700;
  margin: 0 0 12px !important; border-top: 0 !important; padding-top: 0 !important;
}
.takeaways ul { margin: 0; padding-left: 1.15em; }
.takeaways li { margin-bottom: .5em; font-size: .97rem; }
.takeaways li:last-child { margin-bottom: 0; }

/* Definition box */
.definition {
  background: var(--surface-alt); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 20px 22px; margin: 1.8em 0;
}
.definition p { margin: 0; font-size: 1.02rem; }
.definition .definition-term {
  display: block; font-family: var(--font-head); font-weight: 600;
  font-size: 1.1rem; margin-bottom: 7px; color: var(--ink);
}

/* Tables */
.table-scroll { overflow-x: auto; margin: 1.8em 0; border: 1px solid var(--rule); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; min-width: 480px; background: var(--surface); font-size: .93rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { background: var(--surface-alt); font-weight: 600; font-size: .78rem;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
tr:last-child td { border-bottom: 0; }

/* FAQ */
.faq { margin: 1.5em 0; border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  cursor: pointer; padding: 16px 30px 16px 0; position: relative;
  font-family: var(--font-head); font-weight: 600; font-size: 1.05rem;
  line-height: 1.35; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 4px; top: 14px;
  font-family: var(--font-body); font-size: 1.4rem; font-weight: 400;
  color: var(--accent); line-height: 1;
}
.faq details[open] summary::after { content: "\2212"; }
.faq .faq-body { padding: 0 0 18px; font-size: .97rem; }
.faq .faq-body p:last-child { margin-bottom: 0; }

/* Sources */
.sources { margin-top: 2.6em; padding-top: 1.6em; border-top: 2px solid var(--ink); }
.sources h2 { border-top: 0 !important; padding-top: 0 !important; margin-top: 0 !important; }
.sources ol { font-size: .87rem; color: var(--ink-soft); padding-left: 1.3em; }
.sources li { margin-bottom: .7em; }

/* Author card */
.author-card {
  display: flex; gap: 20px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 24px; margin-top: 2.6em;
  box-shadow: var(--shadow);
}
.author-card .avatar-lg {
  width: 84px; height: 84px; border-radius: 50%; flex: 0 0 auto;
  background: var(--accent-wash); border: 1px solid var(--rule);
  display: grid; place-items: center;
  font-family: var(--font-head); font-size: 1.7rem; font-weight: 600; color: var(--accent);
}
.author-card .author-body { flex: 1 1 260px; }
.author-card h2 {
  font-family: var(--font-head); font-size: 1.15rem !important; margin: 0 0 4px !important;
  border-top: 0 !important; padding-top: 0 !important;
}
.author-card .credential { font-size: .84rem; color: var(--ink-mute); margin: 0 0 10px; }
.author-card p { font-size: .93rem; margin-bottom: .8em; }

/* --------------------------------------------------------------------------
   6. Sidebar
   -------------------------------------------------------------------------- */
.sidebar { position: sticky; top: 92px; font-size: .92rem; }
@media (max-width: 1000px) { .sidebar { position: static; } }

.widget {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 20px;
}
.widget h2 {
  font-family: var(--font-body); font-size: .72rem; letter-spacing: .13em;
  text-transform: uppercase; color: var(--ink-mute); font-weight: 700;
  margin: 0 0 12px; border-top: 0; padding-top: 0;
}
.widget ol, .widget ul { margin: 0; padding-left: 1.15em; }
.widget li { margin-bottom: .5em; line-height: 1.45; }
.widget li:last-child { margin-bottom: 0; }
.widget a { text-decoration: none; }
.widget a:hover { text-decoration: underline; }

.widget.care-widget { background: var(--care-wash); border-color: var(--care); }
.widget.care-widget h2 { color: var(--care); }
.widget.care-widget p { margin: 0 0 .7em; font-size: .9rem; line-height: 1.55; }
.widget.care-widget p:last-child { margin-bottom: 0; }
.widget.care-widget a { color: var(--care); font-weight: 600; }

/* --------------------------------------------------------------------------
   7. Generic page (trust pages)
   -------------------------------------------------------------------------- */
.page-narrow { max-width: 46rem; margin-inline: auto; }
.page-narrow h1 { margin-bottom: 20px; }

.contact-list { list-style: none; padding: 0; margin: 1.5em 0; }
.contact-list li {
  padding: 14px 0; border-bottom: 1px solid var(--rule);
  display: flex; gap: 14px; flex-wrap: wrap;
}
.contact-list li:last-child { border-bottom: 0; }
.contact-list .label {
  flex: 0 0 130px; font-size: .76rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-mute); font-weight: 700; padding-top: 3px;
}
.contact-list .value { flex: 1 1 200px; }

/* Resource list */
.resource-list { list-style: none; padding: 0; margin: 1.6em 0; display: grid; gap: 14px; }
.resource-list li {
  background: var(--surface); border: 1px solid var(--rule);
  border-left: 4px solid var(--care); border-radius: var(--radius); padding: 18px 20px;
}
.resource-list .r-name { font-family: var(--font-head); font-weight: 600; font-size: 1.08rem; margin: 0 0 4px; }
.resource-list .r-contact { font-weight: 600; color: var(--care); margin: 0 0 6px; font-size: 1.02rem; }
.resource-list .r-note { margin: 0; font-size: .9rem; color: var(--ink-soft); }

/* --------------------------------------------------------------------------
   8. Footer (identical on every page)
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--surface); border-top: 1px solid var(--rule);
  padding-block: 44px 28px; margin-top: 60px; font-size: .9rem;
}
.footer-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 30px; padding-bottom: 30px; border-bottom: 1px solid var(--rule);
}
.footer-col h2 {
  font-size: .72rem; letter-spacing: .13em; text-transform: uppercase;
  color: var(--ink-mute); font-weight: 700; margin: 0 0 12px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: .55em; }
.footer-col a { color: var(--ink-soft); text-decoration: none; }
.footer-col a:hover { color: var(--accent); text-decoration: underline; }
.footer-col p { margin: 0 0 .8em; color: var(--ink-soft); line-height: 1.6; }

.footer-care {
  background: var(--care-wash); border: 1px solid var(--care);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 30px;
  font-size: .9rem; line-height: 1.6; color: var(--ink);
}
.footer-care strong { color: var(--care); }
.footer-care a { color: var(--care); font-weight: 600; }

.footer-legal {
  padding-top: 22px; display: flex; flex-wrap: wrap; gap: 10px 26px;
  justify-content: space-between; align-items: baseline;
  color: var(--ink-mute); font-size: .82rem; line-height: 1.6;
}
.footer-legal p { margin: 0; max-width: 62ch; }
.footer-legal nav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-legal a { color: var(--ink-mute); text-decoration: none; }
.footer-legal a:hover { color: var(--accent); text-decoration: underline; }

.disclaimer {
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--rule);
  font-size: .8rem; color: var(--ink-mute); line-height: 1.65; max-width: 80ch;
}

/* --------------------------------------------------------------------------
   9. Print
   -------------------------------------------------------------------------- */
@media print {
  .site-header, .sidebar, .site-footer, .nav-toggle { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .layout { display: block; }
  a::after { content: " (" attr(href) ")"; font-size: .8em; color: #555; }
}


/* author photos */
.byline img.avatar{ width:52px; height:52px; border-radius:50%; object-fit:cover;
  flex:0 0 auto; border:1px solid var(--rule); background:var(--surface-alt); display:block; }
.author-card img.avatar-lg{ width:84px; height:84px; border-radius:50%; object-fit:cover;
  flex:0 0 auto; border:1px solid var(--rule); background:var(--surface-alt); display:block; }
.prose img.author-portrait{ width:200px; height:200px; border-radius:50%; object-fit:cover;
  border:1px solid var(--rule); margin:0 0 4px; }
@media (max-width:560px){ .prose img.author-portrait{ width:150px; height:150px; } }


/* content figures */
.bbt-fig{ margin:2em 0; }
.bbt-fig img{ width:100%; height:auto; display:block; border:1px solid var(--rule);
  border-radius:var(--radius); background:var(--surface); }
.bbt-fig figcaption{ margin-top:10px; font-size:.86rem; line-height:1.55;
  color:var(--ink-mute); }
.bbt-hero{ margin-top:0; margin-bottom:2.2em; }
.bbt-hero img{ border:0; border-radius:var(--radius); }


/* light only */
html, body.wp-site-blocks, body{ background:var(--ground) !important; color:var(--ink) !important; }
.prose, .prose p, .prose li, .takeaways li, .widget, .widget li,
.page-narrow, .page-narrow p, .page-narrow li{ color:var(--ink); }
.takeaways{ background:var(--surface); }
.takeaways li{ color:var(--ink); }
.byline-text{ color:var(--ink-mute); }
.byline-text strong{ color:var(--ink); }
.bbt-fig figcaption{ color:var(--ink-mute); }

/* small-text contrast */
.takeaways h2, .widget h2, .footer-col h2{ color:#4A555F; }
.bbt-fig figcaption, .byline-text{ color:#59646E; }

/* stacked sidebar alignment */
@media (max-width:1000px){
  .sidebar{ max-width:var(--measure); margin-inline:0; }
  .sidebar .widget{ margin-bottom:16px; }
  .sidebar .widget:last-child{ margin-bottom:0; }
}

/* hub cards */
.hub-list{ display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr));
  gap:26px; margin:2em 0 0; }
.hub-item{ display:flex; flex-direction:column; background:var(--surface);
  border:1px solid var(--rule); border-radius:var(--radius); overflow:hidden;
  box-shadow:var(--shadow); transition:border-color .15s ease, transform .15s ease; }
.hub-item:hover{ border-color:var(--accent); transform:translateY(-2px); }
.hub-media{ display:block; line-height:0; border-bottom:1px solid var(--rule);
  background:var(--alt,var(--surface-alt)); }
.hub-item img.hub-thumb{ width:100%; height:auto; aspect-ratio:3/2;
  object-fit:cover; object-position:top center; display:block; }
.hub-body{ padding:20px 22px 24px; display:flex; flex-direction:column; gap:8px; }
.hub-item h2{ font-family:var(--font-head); font-size:1.12rem; line-height:1.3;
  margin:0; border-top:0; padding-top:0; text-wrap:balance; }
.hub-item h2 a{ color:var(--ink); text-decoration:none; }
.hub-item:hover h2 a{ color:var(--accent); }
.hub-item p{ margin:0; font-size:.93rem; line-height:1.55; color:var(--ink-mute); }
@media (prefers-reduced-motion:reduce){ .hub-item{ transition:none; }
  .hub-item:hover{ transform:none; } }
@media (max-width:560px){ .hub-list{ gap:18px; } }

/* hub page width */
.hub-page{ max-width:none; }
.hub-page > h1{ max-width:var(--measure); }
.hub-page > .prose{ max-width:none; }
.hub-page > .prose > p,
.hub-page > .prose > ul,
.hub-page > .prose > h2,
.hub-page > .prose > h3{ max-width:var(--measure); }
