/*
Theme Name: Beyond Bankruptcy
Description: Calm, mobile-first theme for the Beyond Bankruptcy directory and resource site. Presentation only — all data and behaviour live in the Beyond Bankruptcy plugin.
Version: 0.1.1
Requires at least: 6.5
Requires PHP: 8.1
Text Domain: beyond-bankruptcy
*/

/* Beyond Bankruptcy — design prototype
   Palette: warm neutrals, deep teal anchor, terracotta accent.
   No gavels, no scales, no navy-and-gold. Calm is the differentiation. */

:root {
  --sand:      #faf7f2;
  --sand-2:    #f3ede4;
  --sand-3:    #e9e0d3;
  --line:      #ddd2c2;
  --ink:       #1c2521;
  --body:      #33403a;
  --muted:     #5f6d65;

  --teal-900:  #10352f;
  --teal-800:  #164740;
  --teal-700:  #1c5b52;
  --teal-600:  #237268;
  --teal-500:  #2f8b7e;
  --teal-100:  #dbeae6;

  --clay:      #b8552f;
  --clay-dark: #9a441f;
  --clay-100:  #f7e6dc;
  --amber:     #d08a2c;

  --radius:    14px;
  --radius-lg: 22px;
  --shadow:    0 1px 2px rgba(28,37,33,.06), 0 8px 24px rgba(28,37,33,.06);
  --shadow-lg: 0 2px 4px rgba(28,37,33,.06), 0 18px 48px rgba(28,37,33,.10);

  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --wrap: 1120px;
}

/* Alternate brand palette — burgundy in place of teal (sand and clay unchanged).
   Activated by data-palette="burgundy" on <html>, via the admin palette switcher
   in functions.php. Everything reads the --teal-* vars, so overriding them here
   recolours the whole site — public pages and the advertiser portal alike. */
:root[data-palette="burgundy"] {
  --teal-900:  #39101d;
  --teal-800:  #5d1a2c;
  --teal-700:  #76233a;
  --teal-600:  #8f2c45;
  --teal-500:  #aa3d54;
  --teal-100:  #f4dde2;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--sand);
  color: var(--body);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--ink);
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin: 0 0 .5em;
  font-weight: 600;
}
h1 { font-size: clamp(2.1rem, 1.4rem + 2.6vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.3rem); }
h3 { font-size: 1.3rem; }
p  { margin: 0 0 1.1em; max-width: 68ch; }

a { color: var(--teal-700); text-underline-offset: 3px; }
a:hover { color: var(--clay-dark); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }

.skip {
  position: absolute; left: -9999px; top: 0; background: var(--teal-800); color: #fff;
  padding: 12px 20px; z-index: 100; border-radius: 0 0 var(--radius) 0;
}
.skip:focus { left: 0; }

:focus-visible { outline: 3px solid var(--teal-500); outline-offset: 3px; border-radius: 6px; }

/* ---------- header ---------- */
.site-header {
  background: var(--sand);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  display: flex; align-items: center; gap: 28px;
  min-height: 76px;
}
.logo {
  font-family: var(--serif); font-size: 1.32rem; font-weight: 600;
  color: var(--teal-800); text-decoration: none; letter-spacing: -.015em;
  display: flex; align-items: center; gap: 11px; flex-shrink: 0;
}
.logo .mark { flex-shrink: 0; }
.logo b { font-weight: 600; color: var(--clay); }

.site-nav { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.site-nav a {
  color: var(--body); text-decoration: none; font-size: .98rem;
  padding: 9px 14px; border-radius: 999px; font-weight: 500;
}
.site-nav a:hover { background: var(--sand-2); color: var(--teal-800); }
.site-nav a.cta {
  background: var(--teal-800); color: #fff;
}
.site-nav a.cta:hover { background: var(--teal-700); color: #fff; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: inherit; font-weight: 600; font-size: 1.02rem;
  padding: 15px 28px; border-radius: 999px; border: 1.5px solid transparent;
  text-decoration: none; cursor: pointer; transition: background .15s, color .15s, border-color .15s;
  min-height: 52px;
}
.btn-primary { background: var(--clay); color: #fff; }
.btn-primary:hover { background: var(--clay-dark); color: #fff; }
.btn-teal { background: var(--teal-800); color: #fff; }
.btn-teal:hover { background: var(--teal-700); color: #fff; }
.btn-ghost { border-color: var(--line); color: var(--teal-800); background: transparent; }
.btn-ghost:hover { border-color: var(--teal-700); background: var(--sand-2); color: var(--teal-800); }
.btn-block { width: 100%; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, #fdf9f3 0%, var(--sand-2) 62%, var(--sand) 100%);
  padding: 68px 0 0;
}
.hero-horizon { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; display: block; }
.hero-inner { position: relative; z-index: 2; }
.hero h1 { max-width: 16ch; margin-bottom: .32em; }
.hero .lede {
  font-size: clamp(1.1rem, 1rem + .5vw, 1.32rem); color: var(--body);
  max-width: 54ch; margin-bottom: 0;
}
.eyebrow {
  display: inline-block; font-size: .82rem; font-weight: 700; letter-spacing: .11em;
  text-transform: uppercase; color: var(--teal-600); margin-bottom: 18px;
}

/* ---------- the one question ---------- */
.doorway { position: relative; z-index: 2; padding: 52px 0 76px; }
.doorway h2 {
  font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); margin-bottom: .15em;
}
.doorway .sub { color: var(--muted); font-size: 1.02rem; margin-bottom: 26px; }
.door-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
}
.door {
  display: flex; align-items: center; gap: 16px;
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius-lg);
  padding: 22px 24px; text-decoration: none; color: var(--ink);
  font-size: 1.08rem; font-weight: 500; line-height: 1.35;
  box-shadow: var(--shadow); transition: border-color .15s, transform .15s, box-shadow .15s;
  min-height: 96px;
}
.door:hover {
  border-color: var(--teal-500); transform: translateY(-2px);
  box-shadow: var(--shadow-lg); color: var(--ink);
}
.door .ico {
  flex-shrink: 0; width: 46px; height: 46px; border-radius: 50%;
  background: var(--teal-100); display: grid; place-items: center; color: var(--teal-700);
}
.door.quiet { background: transparent; box-shadow: none; border-style: dashed; }

/* ---------- sections ---------- */
section { padding: 76px 0; }
.section-tint { background: var(--sand-2); }
.section-deep { background: var(--teal-900); color: #cfe0db; }
.section-deep h2, .section-deep h3 { color: #fff; }
.section-deep a { color: #fff; }

.section-head { max-width: 62ch; margin-bottom: 40px; }
.section-head p { color: var(--muted); font-size: 1.08rem; margin-bottom: 0; }
.section-deep .section-head p { color: #b3c9c3; }

.cols-3 { display: grid; gap: 26px; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.cols-2 { display: grid; gap: 34px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.pillar h3 { display: flex; align-items: center; gap: 12px; margin-bottom: .45em; }
.pillar .ico {
  width: 42px; height: 42px; border-radius: 12px; background: var(--clay-100);
  display: grid; place-items: center; color: var(--clay); flex-shrink: 0;
}
.pillar p { color: var(--muted); font-size: 1rem; margin-bottom: 0; }

/* ---------- cards ---------- */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow);
}
.card h3 { margin-bottom: .35em; }
.card p { font-size: .98rem; color: var(--muted); }

.tag {
  display: inline-block; font-size: .74rem; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; padding: 5px 11px; border-radius: 999px;
  background: var(--teal-100); color: var(--teal-800); margin-bottom: 12px;
}
.tag.clay { background: var(--clay-100); color: var(--clay-dark); }
.tag.sand { background: var(--sand-3); color: var(--body); }

/* ---------- states ---------- */
.state-grid {
  display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  margin-top: 8px;
}
.state-grid a {
  padding: 11px 14px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; text-decoration: none; color: var(--body); font-size: .96rem;
}
.state-grid a:hover { border-color: var(--teal-500); color: var(--teal-800); background: #fff; }

/* ---------- provider listings ---------- */
.listing-layout { display: grid; gap: 40px; grid-template-columns: 268px 1fr; align-items: start; }
@media (max-width: 900px) { .listing-layout { grid-template-columns: 1fr; } }

.filters { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; position: sticky; top: 96px; }
.filters h3 { font-size: 1.05rem; margin-bottom: .8em; }
.filter-group { margin-bottom: 22px; }
.filter-group:last-child { margin-bottom: 0; }
.filter-group h4 {
  font-family: var(--sans); font-size: .78rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px; font-weight: 700;
}
.filter-group label {
  display: flex; align-items: flex-start; gap: 10px; font-size: .95rem;
  padding: 5px 0; cursor: pointer; color: var(--body);
}
.filter-group input { margin-top: 5px; accent-color: var(--teal-700); width: 17px; height: 17px; }

.provider {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; margin-bottom: 16px; display: grid; gap: 20px;
  grid-template-columns: 84px 1fr; align-items: start;
}
.provider.featured {
  border: 2px solid var(--teal-600); box-shadow: var(--shadow-lg);
  grid-template-columns: 108px 1fr;
}
@media (max-width: 620px) { .provider, .provider.featured { grid-template-columns: 1fr; } }

.avatar {
  width: 84px; height: 84px; border-radius: 50%; background: var(--sand-3);
  display: grid; place-items: center; font-family: var(--serif); font-size: 1.5rem;
  color: var(--teal-800); font-weight: 600; overflow: hidden;
}
.provider.featured .avatar { width: 108px; height: 108px; font-size: 1.9rem; }

.provider h3 { margin-bottom: .12em; font-size: 1.22rem; }
.provider .firm { color: var(--muted); font-size: .96rem; margin: 0 0 10px; }
.provider .bio { font-size: .97rem; margin-bottom: 14px; }
.badges { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.badge {
  font-size: .82rem; padding: 5px 12px; border-radius: 999px;
  background: var(--sand-2); color: var(--body); border: 1px solid var(--line);
}
.badge.good { background: var(--teal-100); border-color: #bcd8d1; color: var(--teal-800); }
.provider-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.provider-actions .btn { padding: 11px 20px; font-size: .95rem; min-height: 44px; }

.ad-label {
  font-size: .72rem; letter-spacing: .09em; text-transform: uppercase; font-weight: 700;
  color: var(--muted); display: flex; align-items: center; gap: 7px; margin-bottom: 10px;
}
.ad-label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }

/* ---------- fact box ---------- */
.factbox {
  background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--teal-600);
  border-radius: var(--radius); padding: 26px 28px; margin-bottom: 32px;
}
.factbox h3 { margin-bottom: .6em; }
.factbox dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px 30px; margin: 0 0 18px; }
.factbox dt { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 3px; }
.factbox dd { margin: 0; font-size: 1rem; color: var(--ink); }
.verified { font-size: .87rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; margin: 0; }

.placeholder {
  background: #fff5d6; border-bottom: 2px dotted var(--amber); padding: 1px 5px;
  border-radius: 3px; font-size: .95em; color: #6b4c08;
}

/* ---------- pricing ---------- */
.price-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.price {
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius-lg);
  padding: 32px; position: relative;
}
.price.hero-price { border: 2.5px solid var(--clay); box-shadow: var(--shadow-lg); }
.price .ribbon {
  position: absolute; top: -14px; left: 32px; background: var(--clay); color: #fff;
  font-size: .78rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  padding: 6px 15px; border-radius: 999px;
}
.price h3 { font-size: 1.35rem; margin-bottom: .2em; }
.price .sub { color: var(--muted); font-size: .95rem; margin-bottom: 20px; }
.amount { font-family: var(--serif); font-size: 3rem; color: var(--ink); line-height: 1; }
.amount small { font-family: var(--sans); font-size: .95rem; color: var(--muted); font-weight: 500; }
.alt-price { font-size: .95rem; color: var(--muted); margin: 8px 0 22px; }
.price ul { list-style: none; padding: 0; margin: 0 0 26px; }
.price li { padding: 8px 0 8px 30px; position: relative; font-size: .98rem; }
.price li::before {
  content: "✓"; position: absolute; left: 0; top: 8px; color: var(--teal-600); font-weight: 700;
}

/* ---------- inventory table ---------- */
.inventory { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.inventory th, .inventory td { text-align: left; padding: 15px 20px; border-bottom: 1px solid var(--line); font-size: .98rem; }
.inventory th { background: var(--sand-2); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.inventory tr:last-child td { border-bottom: none; }
.slots { font-weight: 600; }
.slots.low { color: var(--clay-dark); }
.slots.none { color: var(--muted); font-weight: 500; }

/* ---------- steps ---------- */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; display: grid; gap: 18px; }
.steps li {
  counter-increment: s; padding-left: 62px; position: relative; min-height: 44px;
}
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: -2px;
  width: 42px; height: 42px; border-radius: 50%; background: var(--teal-800); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 1.05rem;
}
.steps strong { color: var(--ink); display: block; font-size: 1.06rem; }
.steps span { color: var(--muted); font-size: .97rem; }

/* ---------- forms ---------- */
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; }
.field { margin-bottom: 20px; }
.field label { display: block; font-weight: 600; font-size: .96rem; margin-bottom: 7px; color: var(--ink); }
.field .hint { font-size: .88rem; color: var(--muted); font-weight: 400; margin-top: 3px; }
.field input[type=text], .field input[type=email], .field input[type=tel], .field textarea, .field select {
  width: 100%; font: inherit; font-size: 1rem; padding: 13px 15px;
  border: 1.5px solid var(--line); border-radius: 10px; background: var(--sand);
  color: var(--ink); min-height: 50px;
}
.field textarea { min-height: 120px; resize: vertical; }
.consent {
  display: flex; gap: 12px; align-items: flex-start; background: var(--sand-2);
  border-radius: 10px; padding: 16px; font-size: .93rem; color: var(--body); margin-bottom: 22px;
}
.consent input { margin-top: 4px; width: 19px; height: 19px; accent-color: var(--teal-700); flex-shrink: 0; }

/* ---------- breadcrumb ---------- */
.crumb { font-size: .93rem; color: var(--muted); padding: 22px 0 0; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--teal-700); }

/* ---------- disclaimers ---------- */
.disclaimer {
  background: var(--sand-2); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 18px 22px; font-size: .92rem; color: var(--muted); margin: 26px 0 0;
}
.disclaimer strong { color: var(--body); }
.disclaimer p { margin: 0; max-width: none; }

/* ---------- crisis band ---------- */
.crisis {
  background: var(--clay-100); border-top: 1px solid #e8cdbc; padding: 24px 0;
  font-size: 1rem; color: #6d3419;
}
.crisis .wrap { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.crisis strong { color: #5a2b14; }
.crisis .ico { flex-shrink: 0; color: var(--clay); }
.crisis p { margin: 0; max-width: none; }

/* ---------- footer ---------- */
.site-footer { background: var(--teal-900); color: #a9c2bc; padding: 60px 0 32px; font-size: .95rem; }
.site-footer h4 { color: #fff; font-family: var(--sans); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 14px; }
.site-footer a { color: #d3e3df; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; gap: 34px; grid-template-columns: 1.6fr 1fr 1fr 1fr; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { padding: 5px 0; }
.footer-logo { font-family: var(--serif); font-size: 1.3rem; color: #fff; margin-bottom: 12px; display: block; }
.footer-legal {
  margin-top: 40px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.13);
  font-size: .87rem; color: #8fa8a2; line-height: 1.6;
}
.footer-legal p { max-width: none; margin-bottom: .7em; }

/* ---------- prototype banner ---------- */
.proto-bar {
  background: var(--ink); color: #f0e6d6; font-size: .86rem; padding: 9px 0;
  text-align: center; letter-spacing: .01em;
}
.proto-bar b { color: var(--amber); }
.proto-bar a { color: #f0e6d6; }

@media (max-width: 700px) {
  body { font-size: 17px; }
  section { padding: 56px 0; }
  .hero { padding-top: 44px; }
  .site-nav a { padding: 8px 10px; font-size: .92rem; }
  .header-inner { gap: 12px; min-height: 66px; flex-wrap: wrap; padding: 10px 0; }
}
