/* J Bild Therapy, site styles.
   Colours and fonts live in :root so the weave identity can be tuned in one place. */

:root {
  --ink: #2b2b2b;
  --ink-soft: #4d524b;
  --paper: #f7f3ec;
  --paper-deep: #efe8dc;
  --card: #fffdf9;
  --thread-a: #4f5c4c;   /* logo: deep green strand */
  --thread-b: #a8714f;   /* warm accent */
  --thread-c: #adbaa2;   /* logo: sage strand */
  --line: #ddd4c4;
  --focus: #a8714f;
  --link: #4f5c4c;
  --shadow: 0 1px 2px rgba(43,43,43,.06), 0 8px 24px rgba(43,43,43,.06);

  --font-head: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;

  --measure: 68ch;
  --wrap: 1120px;
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #ece8df; --ink-soft: #c4c3b8; --paper: #191c18; --paper-deep: #20241f;
    --card: #232822; --thread-a: #a9bb9e; --thread-b: #d39a72; --thread-c: #adbaa2;
    --line: #3a4237; --link: #bccbb1; --focus: #d39a72;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  }
}
:root[data-theme="dark"] {
  --ink: #ece8df; --ink-soft: #c4c3b8; --paper: #191c18; --paper-deep: #20241f;
  --card: #232822; --thread-a: #a9bb9e; --thread-b: #d39a72; --thread-c: #adbaa2;
  --line: #3a4237; --link: #bccbb1; --focus: #d39a72;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.7;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; top: 1rem; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.2; color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); margin: 0 0 1rem; letter-spacing: -.01em; }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); margin: 2.6rem 0 .8rem; }
h3 { font-size: 1.25rem; margin: 2rem 0 .5rem; }
p, ul, ol { margin: 0 0 1.1rem; }
li { margin-bottom: .35rem; }
strong { font-weight: 700; }

/* ---------- Header ---------- */
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); position: relative; z-index: 50; }
.site-header .wrap { display: flex; flex-direction: column; align-items: center; gap: 3rem; padding-top: 3.5rem; padding-bottom: 2.2rem; }
.brand { display: flex; align-items: center; gap: 1.8rem; text-decoration: none; color: var(--ink); }
.brand img, .brand svg { width: 66px; height: 140px; flex: none; }
.brand-text { font-family: var(--font-head); font-size: 2.9rem; font-weight: 500; line-height: 1.05; }
.brand-text small { display: block; font-family: var(--font-body); font-size: 1rem; font-weight: 400; color: var(--thread-a); letter-spacing: .42em; margin-top: .7rem; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; padding: .45rem .8rem; font: inherit; color: var(--ink); cursor: pointer; }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav > ul { display: flex; align-items: center; gap: .25rem; }
.site-nav a, .site-nav button.sub-toggle { display: block; padding: .55rem .85rem; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 1.08rem; background: none; border: 0; font-family: inherit; cursor: pointer; }
.site-nav a:hover, .site-nav button.sub-toggle:hover { background: var(--paper-deep); }
.site-nav a[aria-current="page"] { color: var(--thread-a); font-weight: 700; }
.site-nav .has-sub { position: relative; }
.site-nav .has-sub > .sub { display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; min-width: 260px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: .4rem; }
.site-nav .has-sub:hover > .sub, .site-nav .has-sub:focus-within > .sub, .site-nav .has-sub.open > .sub { display: block; }
/* invisible bridge so the pointer can move from the menu item down into its sub-menu */
.site-nav .has-sub > .sub::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
@media (min-width: 941px) { .site-nav .has-sub > a { padding-right: 1.3rem; position: relative; }
  .site-nav .has-sub > a::after { content: ""; position: absolute; right: .55rem; top: 50%; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-70%) rotate(45deg); opacity: .6; } }
.site-nav .sub a { padding: .45rem .7rem; }
.site-nav .nav-cta a { background: var(--thread-a); color: #fff; margin-left: .4rem; }
.site-nav .nav-cta a:hover { background: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .site-nav .nav-cta a { color: #1a1f18; } }

@media (max-width: 940px) {
  .site-header .wrap { padding-top: 1.8rem; padding-bottom: 1rem; gap: 1.1rem; }
  .brand { gap: 1rem; }
  .brand img, .brand svg { width: 38px; height: 80px; }
  .brand-text { font-size: 1.8rem; }
  .brand-text small { font-size: .78rem; letter-spacing: .32em; }
  .nav-toggle { display: inline-block; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--line); padding: .5rem 16px 1rem; max-height: calc(100vh - 120px); overflow-y: auto; z-index: 60; }
  .site-nav.open { display: block; }
  .site-nav > ul { flex-direction: column; align-items: stretch; }
  .site-nav .has-sub > .sub { position: static; display: block; box-shadow: none; border: 0; padding: 0 0 0 .8rem; background: none; min-width: 0; }
  .site-nav button.sub-toggle { display: none; }
  .site-nav .has-sub > a { font-weight: 700; }
  .site-nav .nav-cta a { margin: .5rem 0 0; text-align: center; }
}

/* ---------- Weave motif ---------- */
.weave-band { height: 14px; background-image: url("/assets/weave-band.svg"); background-repeat: repeat-x; background-size: auto 14px; opacity: .9; }

/* ---------- Page hero ---------- */
.hero { padding: 3.2rem 0 2rem; }
.hero .wrap { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 860px) { .hero.has-img .wrap { grid-template-columns: 1.15fr .85fr; } }
.hero .eyebrow { font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; color: var(--thread-b); font-weight: 700; margin-bottom: .6rem; }
.hero-figure { position: relative; isolation: isolate; margin-right: 14px; }
.hero-figure img { border-radius: var(--radius); aspect-ratio: 1 / 1; object-fit: cover; width: 100%; box-shadow: var(--shadow); }
.hero-figure::before { content: ""; position: absolute; inset: 14px -14px -14px 14px; border: 2px solid var(--thread-c); border-radius: calc(var(--radius) + 4px); z-index: -1; }
.lede { font-size: 1.15rem; color: var(--ink-soft); }

/* ---------- Content ---------- */
main { display: block; }
.prose { max-width: var(--measure); }
.content { padding: 2.4rem 0; }
.content.band-alt { background: var(--paper-deep); }
.content + .content:not(.band-alt) { padding-top: 2.4rem; }
.hero + .content { padding-top: 1rem; }
.hero + .content.band-alt { padding-top: 2.4rem; }
.content .prose > h2:first-child, .content .callout > h2:first-child, .content .wrap > h2:first-child { margin-top: 0; }
.content .wrap > .prose { margin: 0 auto; }
.prose figure { margin: 1.8rem 0; }
.prose figure img { border-radius: var(--radius); width: 100%; max-height: 420px; object-fit: cover; }
.prose ul li::marker { color: var(--thread-b); }
.prose blockquote { margin: 1.6rem 0; padding: 1rem 1.3rem; border-left: 4px solid var(--thread-c); background: var(--card); border-radius: 0 12px 12px 0; font-family: var(--font-head); font-size: 1.15rem; }

.btn { display: inline-block; padding: .8rem 1.35rem; border-radius: 999px; background: var(--thread-a); color: #fff; text-decoration: none; font-weight: 700; line-height: 1.2; border: 2px solid var(--thread-a); }
.btn:hover { background: var(--ink); border-color: var(--ink); }
.btn.secondary { background: transparent; color: var(--thread-a); }
.btn.secondary:hover { background: var(--paper-deep); color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn:not(.secondary) { color: #1a1f18; } }
.btn-row { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.6rem 0; }
.prose p > .btn:only-child { margin: .4rem 0; }

.callout { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.5rem; box-shadow: var(--shadow); margin: 2rem 0; }
.callout h2, .callout h3 { margin-top: 0; }

/* cards */
.cards { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin: 1.5rem 0 2rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.4rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .5rem; text-decoration: none; color: var(--ink); position: relative; overflow: hidden; }
.card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: linear-gradient(90deg, var(--thread-a) 0 33%, var(--thread-b) 33% 66%, var(--thread-c) 66%); }
.card h3 { margin: .3rem 0 0; font-size: 1.15rem; }
.card p { margin: 0; color: var(--ink-soft); font-size: .98rem; }
a.card:hover { border-color: var(--thread-a); }
.card img { border-radius: 10px; aspect-ratio: 16/10; object-fit: cover; margin-bottom: .3rem; }

/* home sections */
.split { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 860px) { .split { grid-template-columns: 220px 1fr; } }
.portrait img { border-radius: 50%; aspect-ratio: 1/1; object-fit: cover; width: 200px; border: 4px solid var(--card); box-shadow: 0 0 0 2px var(--thread-c); }
.band { background: var(--paper-deep); padding: 3rem 0; }
.band h2:first-child { margin-top: 0; }

/* blog */
.post-meta { color: var(--ink-soft); font-size: .95rem; margin-bottom: 1.5rem; }
.post-cover img { border-radius: var(--radius); width: 100%; max-height: 460px; object-fit: cover; margin-bottom: 2rem; }

/* forms */
.form { display: grid; gap: 1.1rem; max-width: 560px; }
.form label { font-weight: 700; display: block; margin-bottom: .3rem; }
.form .hint { font-weight: 400; color: var(--ink-soft); font-size: .92rem; }
.form input, .form select, .form textarea { width: 100%; font: inherit; padding: .7rem .85rem; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); }
.form textarea { min-height: 160px; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--thread-a); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--thread-a) 25%, transparent); }
.form .check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
.form .check input { width: auto; margin-top: .35rem; }
.hidden { display: none; }
.form button { justify-self: start; cursor: pointer; font: inherit; font-weight: 700; }

.cal-embed { min-height: 640px; width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.cal-fallback { margin-top: 1rem; font-size: .95rem; color: var(--ink-soft); }

.notice { border: 2px dashed var(--thread-b); border-radius: var(--radius); padding: 1.2rem 1.4rem; background: var(--card); }

/* ---------- Footer ---------- */
.pre-footer { padding: 3rem 0; text-align: center; background: var(--paper); }
.pre-footer p.tagline { font-family: var(--font-head); font-size: 1.4rem; margin: 0 0 1.4rem; }
.site-footer { background: #3e483c; color: var(--paper); padding: 2.6rem 0 2rem; font-size: .95rem; }
.site-footer a { color: var(--paper); }
.footer-grid { display: grid; gap: 2rem; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 1.3fr 1fr 1fr; } }
.site-footer h2 { color: var(--paper); font-size: 1.05rem; margin: 0 0 .7rem; font-family: var(--font-body); letter-spacing: .04em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.badges { display: flex; flex-wrap: wrap; gap: 1rem 1.4rem; align-items: center; justify-content: space-between; margin-top: 2.2rem; padding-top: 1.6rem; border-top: 1px solid rgba(255,255,255,.18); }
@media (max-width: 700px) { .badges { justify-content: center; } }
.badges a.logo-badge, .badges span.logo-badge { display: inline-flex; align-items: center; background: #fff; border-radius: 8px; padding: .35rem .55rem; }
.badges a.logo-badge:hover { outline: 2px solid var(--thread-c); }
.badges img { height: 44px; width: auto; max-width: none; }
.badge { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: .3rem .8rem; font-size: .85rem; text-decoration: none; color: var(--paper); }
.badge::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--thread-c); }
a.badge:hover { border-color: var(--paper); background: rgba(255,255,255,.08); }
.footer-small { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid rgba(255,255,255,.18); display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; color: #cfc8ba; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .site-footer { background: #10120f; } }

.crisis { font-size: .9rem; color: #cfc8ba; margin-top: .8rem; }
.hero-figure figure, .portrait figure { margin: 0; }
.prose figure img { aspect-ratio: 16 / 9; max-height: 380px; }
.form + p { margin-top: 1.8rem; }
@media (max-width: 859px) { .hero-figure { max-width: 340px; } }
.hero-person { display: flex; align-items: center; gap: 1.4rem; margin-bottom: 1.2rem; }
.hero-person h1 { margin: 0; }
.hero-portrait { width: 140px; height: 140px; border-radius: 50%; object-fit: cover; border: 4px solid var(--card); box-shadow: 0 0 0 2px var(--thread-c); flex: none; }
@media (max-width: 520px) { .hero-portrait { width: 96px; height: 96px; } }
.badges img { max-height: none; }

/* ---------- Free guides (Joel's .jbr snippets) ---------- */
.guide .jbr p.intro { font-style: italic; color: var(--ink-soft); border-left: 3px solid var(--thread-c); padding: .2rem 0 .2rem 1rem; margin: 0 0 1.8rem; }
.guide .jbr details { border-bottom: 1px solid var(--line); padding: .9rem 0; }
.guide .jbr details:first-of-type { border-top: 1px solid var(--line); }
.guide .jbr summary { cursor: pointer; font-weight: 700; list-style: none; position: relative; padding-right: 2rem; }
.guide .jbr summary::-webkit-details-marker { display: none; }
.guide .jbr summary::after { content: "+"; position: absolute; right: .2rem; top: -.1rem; font-size: 1.4rem; font-weight: 400; color: var(--thread-b); }
.guide .jbr details[open] summary::after { content: "\2013"; }
.guide .jbr table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: .97rem; }
.guide .jbr th, .guide .jbr td { border: 1px solid var(--line); padding: .6rem .75rem; text-align: left; vertical-align: top; }
.guide .jbr th { background: var(--paper-deep); font-weight: 700; }
.guide .jbr .tabs { margin: 1rem 0; }
.guide .jbr .tabbtns { display: flex; flex-wrap: wrap; gap: .4rem; border-bottom: 2px solid var(--line); }
.guide .jbr .tabbtns button { background: var(--paper-deep); border: 1px solid var(--line); border-bottom: none; padding: .55rem .9rem; cursor: pointer; font: inherit; font-weight: 700; color: var(--ink-soft); border-radius: 8px 8px 0 0; }
.guide .jbr .tabbtns button.active { background: var(--card); color: var(--thread-a); }
.guide .jbr .tabpanel { display: none; border: 1px solid var(--line); border-top: none; padding: 1rem 1.1rem; background: var(--card); border-radius: 0 0 10px 10px; }
.guide .jbr .tabpanel.active { display: block; }
.guide .jbr .check { display: block; margin: .6rem 0; padding: .65rem .8rem; background: var(--card); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.guide .jbr .check input { margin-right: .6rem; transform: scale(1.15); accent-color: var(--thread-a); }
.guide .jbr .counter { margin: .9rem 0; font-weight: 700; color: var(--thread-a); }
.guide .jbr .safebox { background: var(--card); border: 1px solid var(--thread-c); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 1.6rem 0; }
.guide .jbr .supportcard { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: .7rem .9rem; margin: .6rem 0; }
.guide .jbr .supportcard .who { font-weight: 700; }
.guide .jbr .supportcard .contact { color: var(--thread-a); font-weight: 700; font-size: .95rem; }
.guide .jbr .note { font-size: .9rem; color: var(--ink-soft); }
.guide .jbr ul { padding-left: 1.4rem; }
@media (max-width: 600px) { .guide .jbr table { display: block; overflow-x: auto; } .guide .jbr th, .guide .jbr td { padding: .5rem; font-size: .92rem; } }
.guide .jbr > h2:first-child { margin-top: 0; }
.guide .jbr .safebox h2 { margin-top: 0; }

/* ---------- Availability label and form note ---------- */
.avail { display: inline-flex; align-items: center; gap: .55rem; margin: 0 0 1rem; padding: .3rem .95rem; border-radius: 999px; background: var(--card); color: var(--ink); border: 1px solid var(--line); font-size: .95rem; font-weight: 700; line-height: 1.4; }
.avail::before { content: ""; flex: none; width: .6rem; height: .6rem; border-radius: 50%; background: #3f8a55; }
.avail.few::before, .avail.wait::before { background: #c27c0e; }
.avail.closed::before { background: #8a8a8a; }
.form .form-note { display: block; margin: .1rem 0 .45rem; line-height: 1.5; }

/* ---------- Contrast fixes (Nov 2026) ---------- */
.site-footer, .site-footer a, .site-footer h2 { color: #f7f3ec; }
.hero .eyebrow { color: #8b5a3a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero .eyebrow { color: var(--thread-b); } }
:root[data-theme="dark"] .hero .eyebrow { color: var(--thread-b); }

/* ---------- Home page hero with a picture behind the words ---------- */
/* --wl, --wn and --wd are set on the section by the build: the wash strength each picture needs for readable words */
.hero.hero-bg { --wl: .8; --wn: .8; --wd: .62; --hero-wash: rgb(247 243 236 / var(--wl)); position: relative; isolation: isolate; overflow: hidden; display: grid; align-items: center; min-height: min(70vh, 640px); padding: 3.2rem 0 3.2rem; text-align: center; background: var(--paper-deep); }
.hero.hero-bg .hero-bgimg { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: center 62%; z-index: -2; }
.hero.hero-bg::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--hero-wash); }
/* the heading may run wider than the text under it, so it sits on two lines on a desktop screen */
.hero.hero-bg .wrap { display: block; max-width: 1120px; }
.hero.hero-bg h1 { margin: 0 auto 1.9rem; max-width: 1040px; }
.hero.hero-bg .lede { font-size: 1.18rem; color: var(--ink); max-width: 800px; margin-inline: auto; }
.hero.hero-bg .btn-row { justify-content: center; margin: 1.6rem 0 0; }
.hero.hero-bg .btn-row .btn { font-size: 1.1rem; padding: .95rem 1.7rem; box-shadow: var(--shadow); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero.hero-bg { --hero-wash: rgb(25 28 24 / var(--wn)); } }
:root[data-theme="dark"] .hero.hero-bg { --hero-wash: rgb(25 28 24 / var(--wn)); }
.hero.hero-bg.dark { --hero-wash: rgb(22 26 22 / var(--wd)) !important; }
.hero.hero-bg.dark h1, .hero.hero-bg.dark .lede, .hero.hero-bg.dark .lede a { color: #fff; }
.hero.hero-bg.dark h1, .hero.hero-bg.dark .lede { text-shadow: 0 1px 3px rgba(0,0,0,.45); }
.hero.hero-bg.dark .btn-row .btn { background: #f7f3ec; border-color: #f7f3ec; color: #2b2b2b; }
.hero.hero-bg.dark .btn-row .btn:hover { background: #fff; border-color: #fff; }
.hero.hero-bg .btn { text-shadow: none; }

/* a card title on a page with no section headings: an h2 that looks like the other card titles */
h2.as-h3 { font-size: 1.25rem; margin: 2rem 0 .5rem; }
.card h2.as-h3 { margin: .3rem 0 0; font-size: 1.15rem; }
