/* ==========================================================================
   Franchisor Database — design system
   A franchise-buyer's journal. Business-almanac feel: aged ledger paper,
   brass/gold foil accent, deep forest ink — a trade publication, not a SaaS
   landing page. Signature: the "deal sheet" — a compact Item-7-style line
   table (Category / Read Time / Level), modeled directly on the Initial
   Investment tables in a real Franchise Disclosure Document.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Spectral:wght@500;600;700&family=Public+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;700&display=swap');

:root {
  --ledger: #f6f0de;
  --panel: #fffcf3;
  --paper-line: #e3d9bc;
  --ink: #1b2b24;
  --ink-muted: #6e6656;

  --gold: #a9782f;
  --gold-deep: #8a6224;
  --forest: #2f4a3c;
  --rust: #8b4a32;
  --slate: #35495c;
  --burgundy: #6b2737;

  --font-display: 'Spectral', Georgia, serif;
  --font-body: 'Public Sans', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --container: 1180px;
  --radius: 2px;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--ledger);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 3px; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 1.5rem; }

/* ---------- masthead header ---------- */

.site-header { background: var(--ledger); border-top: 3px solid var(--ink); border-bottom: 1px solid var(--gold); }

.masthead-rule {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-deep);
  text-align: center;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--paper-line);
}

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 0;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
}

.nav-toggle {
  display: none;
  background: var(--ledger);
  border: 1px solid var(--ink);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 0.45rem 0.7rem;
  font-size: 1rem;
  cursor: pointer;
}

.site-nav ul { list-style: none; display: flex; gap: 1.8rem; margin: 0; padding: 0; }

.site-nav a {
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  border-bottom: 2px solid transparent;
  padding-bottom: 0.3rem;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { border-color: var(--gold); color: var(--gold-deep); }

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; align-items: center; gap: 0.4rem; }
  .site-nav { display: none; width: 100%; padding-bottom: 1.1rem; }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0.9rem; }
  .site-header__bar { flex-wrap: wrap; }
}

/* ---------- hero ---------- */

.hero { padding: 4rem 0 4.2rem; }
.hero__inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 3rem; }
.hero__copy { max-width: 34rem; }

.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 0 0 1.1rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 3.8vw, 3.1rem);
  line-height: 1.14;
  letter-spacing: -0.01em;
  margin: 0 0 1.3rem;
}
.hero h1 em { font-style: italic; color: var(--gold-deep); }

.hero p.lede { font-size: 1.12rem; color: var(--ink-muted); margin: 0 0 2rem; max-width: 42ch; }

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-body); font-weight: 700; font-size: 0.94rem;
  padding: 0.8rem 1.4rem; border-radius: var(--radius);
  text-decoration: none; border: 1px solid var(--ink); cursor: pointer;
}
.btn--solid { background: var(--ink); color: var(--ledger); }
.btn--solid:hover { background: var(--forest); border-color: var(--forest); }
.btn--outline { background: transparent; color: var(--ink); }
.btn--outline:hover { border-color: var(--gold-deep); color: var(--gold-deep); }

@media (max-width: 900px) { .hero__inner { flex-direction: column; } }

/* ---------- deal sheet (signature component) ---------- */

.deal-sheet {
  background: var(--panel);
  border: 1px solid var(--ink);
  width: 300px;
  flex-shrink: 0;
}
.deal-sheet__head {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--panel);
  background: var(--ink);
  padding: 0.55rem 0.9rem;
}
.deal-sheet__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.65rem 0.9rem;
  border-top: 1px solid var(--paper-line);
  font-size: 0.9rem;
}
.deal-sheet__row span:first-child {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.deal-sheet__row span:last-child { font-family: var(--font-mono); font-weight: 700; text-align: right; }
.deal-sheet__row--accent { border-top: 2px solid var(--gold); }

/* ---------- index table (signature listing component) ----------
   Replaces a card grid with a dense franchise-directory / index-listing
   table — the format this content actually resembles (a franchise
   directory or financial index), not a magazine card layout. */

.index-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  margin: 0 0 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
}
.index-legend a { display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none; color: var(--ink-muted); }
.index-legend a:hover { color: var(--ink); }
.index-legend .sw { width: 9px; height: 9px; border-radius: 1px; flex-shrink: 0; }

.index-table-wrap { overflow-x: auto; border: 1px solid var(--ink); }

.index-table { width: 100%; border-collapse: collapse; min-width: 640px; }

.index-table thead th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--panel);
  background: var(--ink);
  padding: 0.75rem 1rem;
  font-weight: 500;
}
.index-table thead th.num { text-align: right; }

.index-table tbody tr { border-bottom: 1px solid var(--paper-line); }
.index-table tbody tr:nth-child(even) { background: var(--panel); }
.index-table tbody tr:hover { background: #f1e9d2; }

.index-table td { padding: 0.95rem 1rem; vertical-align: top; }

.index-table .idx-cat { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-muted); white-space: nowrap; }
.index-table .idx-cat .sw { width: 9px; height: 9px; border-radius: 1px; flex-shrink: 0; }

.index-table .idx-title a { font-family: var(--font-display); font-weight: 700; font-size: 1.06rem; color: var(--ink); text-decoration: none; }
.index-table .idx-title a:hover { color: var(--gold-deep); }
.index-table .idx-desc { color: var(--ink-muted); font-size: 0.86rem; margin: 0.3rem 0 0; max-width: 46ch; }

.index-table .idx-level, .index-table .idx-time { font-family: var(--font-mono); font-size: 0.82rem; color: var(--ink-muted); white-space: nowrap; text-align: right; }

.sw-buying { background: var(--forest); }
.sw-costs { background: var(--gold); }
.sw-industries { background: var(--rust); }
.sw-agreements { background: var(--slate); }
.sw-success { background: var(--burgundy); }
.issue-card__sheet .deal-sheet__row + .deal-sheet__row { border-top: 1px dashed var(--paper-line); }

/* category colors */
.bg-buying { background: var(--forest); }
.bg-costs { background: var(--gold); }
.bg-industries { background: var(--rust); }
.bg-agreements { background: var(--slate); }
.bg-success { background: var(--burgundy); }

/* .tag text is small (0.66rem) and needs 4.5:1 contrast — --gold alone only
   reaches 3.88:1 with white text, so darken it for this specific badge. */
.tag.bg-costs { background: #8a6224; }

.tag {
  display: inline-flex; align-items: center; font-family: var(--font-mono);
  font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.35rem 0.65rem; border-radius: 2px; color: #fff;
}

/* ---------- sections ---------- */

.section { padding: 4rem 0; }
.section--panel { background: var(--panel); border-top: 1px solid var(--paper-line); border-bottom: 1px solid var(--paper-line); }
.section__head { max-width: 62ch; margin: 0 0 2.2rem; }
.section__eyebrow { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-deep); margin: 0 0 0.6rem; }
.section__head h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.6rem, 2.4vw, 2.2rem); margin: 0 0 0.7rem; }
.section__head p { color: var(--ink-muted); margin: 0; font-size: 1.02rem; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1.1rem; }
.cat-tile { display: block; text-decoration: none; color: #fff; border-radius: var(--radius); padding: 1.5rem 1.3rem; min-height: 118px; transition: transform 0.15s ease; }
.cat-tile:hover { transform: translateY(-3px); }
.cat-tile h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; margin: 0 0 0.4rem; }
.cat-tile p { margin: 0; font-size: 0.85rem; opacity: 0.92; }

/* ---------- footer ---------- */

.site-footer { background: var(--ledger); border-top: 3px solid var(--ink); padding: 3rem 0 2.2rem; margin-top: 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem; }
.footer-grid h4 { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-deep); margin: 0 0 1rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.footer-grid a { text-decoration: none; color: var(--ink); font-size: 0.92rem; }
.footer-grid a:hover { color: var(--gold-deep); }
.site-footer .wordmark { margin-bottom: 0.8rem; display: inline-block; }
.site-footer p.tagline { max-width: 34ch; font-size: 0.92rem; color: var(--ink-muted); }
.footer-bottom { border-top: 1px solid var(--paper-line); margin-top: 2.4rem; padding-top: 1.3rem; font-size: 0.82rem; color: var(--ink-muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }

@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- article prose ---------- */

.article-head { padding: 2.8rem 0 2.4rem; border-bottom: 1px solid var(--paper-line); }
.breadcrumb { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.04em; color: var(--ink-muted); text-decoration: none; display: inline-block; margin-bottom: 1.2rem; }
.breadcrumb:hover { color: var(--gold-deep); }
.article-head h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.85rem, 3.2vw, 2.6rem); line-height: 1.18; max-width: 26ch; margin: 0 0 1.4rem; }

.prose { max-width: 68ch; margin: 0 auto; padding: 3rem 1.5rem 2rem; }
.prose h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.48rem; margin: 2.3rem 0 1rem; }
.prose h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.18rem; margin: 1.8rem 0 0.8rem; }
.prose p { margin: 0 0 1.2rem; font-size: 1.05rem; }
.prose ul, .prose ol { margin: 0 0 1.2rem; padding-left: 1.3rem; }
.prose li { margin-bottom: 0.5rem; }
.prose a { color: var(--gold-deep); text-decoration-thickness: 1.5px; }

.note { background: var(--panel); border: 1px solid var(--ink); border-left: 4px solid var(--gold); border-radius: var(--radius); padding: 1.2rem 1.3rem; margin: 1.8rem 0; font-size: 0.96rem; }
.note strong.note__label { display: block; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-deep); margin-bottom: 0.5rem; }

.article-footer { max-width: 68ch; margin: 0 auto; padding: 1.5rem 1.5rem 4rem; border-top: 1px dashed var(--paper-line); }
.affiliate-note { font-size: 0.85rem; color: var(--ink-muted); font-style: italic; }

/* ---------- static pages ---------- */

.page-head { padding: 3rem 0 2.8rem; border-bottom: 1px solid var(--paper-line); }
.page-head h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.95rem, 3.2vw, 2.5rem); margin: 0; }
.page-head p { color: var(--ink-muted); margin: 0.8rem 0 0; max-width: 52ch; }

.about-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 3rem; align-items: start; }
.stat-plate { background: var(--panel); border: 1px solid var(--ink); border-radius: var(--radius); padding: 1.4rem; }
.stat-plate h4 { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-deep); margin: 0 0 0.9rem; }
.stat-row { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px dashed var(--paper-line); font-size: 0.92rem; }
.stat-row:last-child { border-bottom: none; }
.stat-row span:last-child { font-family: var(--font-mono); color: var(--ink-muted); }

@media (max-width: 780px) { .about-grid { grid-template-columns: 1fr; } }
