/*
Theme Name: Ledgerism Publication
Theme URI: https://ledgerism.net
Author: The Ledgerism Brief
Description: D2 Modern Fintech Editorial. Off-white #FAFAFA, deep teal #0F5257, soft ochre #D4A24C. Tiempos serif headlines, Soehne/Inter sans body, JetBrains Mono numerals. Editorial-illustration heroes, never stock photos.
Version: 1.0
*/

/* ============================================================
   D2 DESIGN TOKENS
   ============================================================ */
:root {
  /* Background */
  --bg-page: #FAFAFA;
  --bg-card: #FFFFFF;
  --bg-callout: #F4F1EA;
  --bg-code: #F4F4F0;

  /* Text */
  --text-primary: #1B2520;
  --text-secondary: #4A5256;
  --text-muted: #737B7F;
  --text-inverse: #FAFAFA;

  /* Accent */
  --accent-primary: #0F5257;
  --accent-hover: #0A3D40;
  --accent-secondary: #D4A24C;
  --accent-alert: #B81E2D;

  /* Rule */
  --rule-default: #E5E5E0;
  --rule-strong: #1B2520;

  /* Font stacks */
  --font-display: "Tiempos Headline", "GT Sectra", "Source Serif 4", Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Inter", "Soehne", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", "SF Mono", Menlo, monospace;

  /* Spacing scale (8px base) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;

  /* Layout */
  --content-max: 720px;
  --content-col: 680px;
  --gutter: 24px;
}

/* ============================================================
   RESET + BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 17px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--accent-primary);
  text-decoration: none;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  border-bottom: 1px solid var(--accent-primary);
  transition: color 0.15s, border-color 0.15s;
}
a:hover { color: var(--accent-hover); border-color: var(--accent-hover); }

p, ul, ol { margin: 0 0 var(--sp-4) 0; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: var(--sp-7) 0 var(--sp-4);
  color: var(--text-primary);
}
h1 { font-size: 56px; line-height: 1.1; letter-spacing: -0.02em; margin-top: var(--sp-6); }
h2 { font-size: 32px; margin-top: var(--sp-8); }
h3 { font-size: 22px; letter-spacing: -0.005em; }
h4 { font-size: 18px; font-family: var(--font-body); font-weight: 600; }

@media (max-width: 720px) {
  h1 { font-size: 38px; line-height: 1.15; letter-spacing: -0.015em; }
  h2 { font-size: 26px; line-height: 1.25; letter-spacing: -0.01em; }
}

.kicker {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-primary);
  margin: 0 0 var(--sp-3) 0;
}

.lede {
  font-size: 21px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: var(--sp-5);
}

code, .mono, .num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
code {
  background: var(--bg-code);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.92em;
}

/* ============================================================
   LAYOUT WRAPPERS
   ============================================================ */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.container-wide {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ============================================================
   SITE HEADER
   ============================================================ */
.site-header {
  background: var(--bg-page);
  border-bottom: 1px solid var(--rule-default);
  padding: var(--sp-4) 0;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  color: var(--text-primary);
  border: none;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.brand:hover { color: var(--text-primary); border: none; }
.brand__mark {
  width: 28px;
  height: 28px;
  background: var(--accent-primary);
  position: relative;
  flex-shrink: 0;
}
.brand__mark::after {
  content: "";
  position: absolute;
  inset: 4px;
  background: var(--bg-page);
  clip-path: polygon(0 100%, 50% 0, 100% 100%);
}
.site-nav {
  display: flex;
  gap: var(--sp-5);
  font-size: 15px;
  font-weight: 500;
}
.site-nav a {
  color: var(--text-primary);
  border: none;
}
.site-nav a:hover { color: var(--accent-primary); border: none; }

@media (max-width: 900px) {
  .site-nav { display: none; }
}

/* ============================================================
   ARTICLE / POST
   ============================================================ */
.post {
  max-width: var(--content-col);
  margin: var(--sp-7) auto var(--sp-9);
  padding: 0 var(--gutter);
}
.post__byline {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: 14px;
  color: var(--text-secondary);
  margin: var(--sp-5) 0 var(--sp-3);
}
.post__byline-photo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-callout);
  flex-shrink: 0;
}
.post__byline-meta { line-height: 1.4; }
.post__byline strong { color: var(--text-primary); font-weight: 600; }
.post__dates {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: var(--sp-5);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   COMPONENT: KEY TAKEAWAYS
   ============================================================ */
.takeaways {
  background: var(--bg-callout);
  border: 1px solid var(--rule-default);
  border-left: 4px solid var(--accent-primary);
  padding: var(--sp-5) var(--sp-5);
  margin: var(--sp-6) 0;
  border-radius: 4px;
}
.takeaways__label {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-primary);
  margin: 0 0 var(--sp-3);
}
.takeaways ul { margin: 0; padding-left: var(--sp-5); }
.takeaways li { margin-bottom: var(--sp-2); }

/* ============================================================
   COMPONENT: COMPARISON TABLE
   ============================================================ */
.table-wrap {
  overflow-x: auto;
  margin: var(--sp-5) 0;
  border: 1px solid var(--rule-default);
  border-radius: 4px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
th, td {
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  border-bottom: 1px solid var(--rule-default);
}
th {
  background: var(--accent-primary);
  color: var(--text-inverse);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
tbody tr:nth-child(even) { background: var(--bg-callout); }
td.num, th.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ============================================================
   COMPONENT: FEATURED CPA PARTNER CARD
   ============================================================ */
.partner-card {
  background: var(--bg-card);
  border: 1px solid var(--rule-default);
  border-radius: 4px;
  padding: var(--sp-5);
  margin: var(--sp-6) 0;
  position: relative;
}
.partner-card__ribbon {
  display: inline-block;
  background: var(--accent-secondary);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 2px;
  margin-bottom: var(--sp-3);
}
.partner-card h3 { margin: 0 0 var(--sp-2); font-size: 20px; }
.partner-card p { font-size: 15px; color: var(--text-secondary); margin: 0 0 var(--sp-3); }

/* ============================================================
   COMPONENT: BOTTOM LINE
   ============================================================ */
.bottom-line {
  background: var(--bg-card);
  border-top: 3px solid var(--accent-primary);
  border-bottom: 1px solid var(--rule-default);
  padding: var(--sp-6) 0;
  margin: var(--sp-7) 0 var(--sp-5);
}
.bottom-line__label {
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-primary);
  margin: 0 0 var(--sp-3);
}

/* ============================================================
   COMPONENT: FAQ
   ============================================================ */
.faq dt {
  font-weight: 600;
  font-size: 19px;
  font-family: var(--font-display);
  margin-top: var(--sp-5);
  margin-bottom: var(--sp-2);
}
.faq dd {
  margin: 0 0 var(--sp-4);
  font-size: 17px;
  color: var(--text-secondary);
}

/* ============================================================
   COMPONENT: METHODOLOGY FOOTER
   ============================================================ */
.methodology {
  background: var(--bg-callout);
  border: 1px solid var(--rule-default);
  padding: var(--sp-5);
  margin: var(--sp-7) 0 var(--sp-5);
  font-size: 14px;
  color: var(--text-secondary);
  border-radius: 4px;
}
.methodology h4 {
  margin: 0 0 var(--sp-3);
  color: var(--accent-primary);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-body);
}

/* ============================================================
   HOMEPAGE: HERO
   ============================================================ */
.hero {
  background: var(--bg-page);
  padding: var(--sp-9) 0 var(--sp-8);
  border-bottom: 1px solid var(--rule-default);
}
.hero__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--sp-8);
  align-items: center;
}
.hero__title {
  font-size: 64px;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: var(--sp-3) 0 var(--sp-4);
}
.hero__subhead {
  font-size: 19px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0 0 var(--sp-5);
  max-width: 560px;
}
.hero__byline {
  font-size: 14px;
  color: var(--text-muted);
}
.hero__visual {
  background: var(--bg-callout);
  border: 1px solid var(--rule-default);
  aspect-ratio: 4 / 3;
  border-radius: 4px;
  overflow: hidden;
}
.hero__visual img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 900px) {
  .hero { padding: var(--sp-7) 0 var(--sp-6); }
  .hero__inner { grid-template-columns: 1fr; gap: var(--sp-5); }
  .hero__title { font-size: 40px; }
}

/* ============================================================
   HOMEPAGE: SECTIONS
   ============================================================ */
.section {
  padding: var(--sp-8) 0;
  border-bottom: 1px solid var(--rule-default);
}
.section__label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-primary);
  margin: 0 0 var(--sp-3);
}
.section__title {
  font-size: 36px;
  margin: 0 0 var(--sp-6);
}

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--sp-5);
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--rule-default);
  border-radius: 4px;
  padding: var(--sp-5);
  transition: border-color 0.15s, transform 0.15s;
  border-bottom-color: var(--rule-default);
}
.card:hover { border-color: var(--accent-primary); transform: translateY(-2px); }
.card a {
  color: var(--text-primary);
  border: none;
}
.card a:hover { color: var(--accent-primary); border: none; }
.card__category {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-primary);
  margin: 0 0 var(--sp-2);
}
.card__title {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.25;
  margin: 0 0 var(--sp-3);
}
.card__blurb {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0;
}

/* Pillar grid (7 desks) */
.pillar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-4);
}
.pillar {
  background: var(--bg-card);
  border: 1px solid var(--rule-default);
  padding: var(--sp-5);
  text-align: left;
  border-radius: 4px;
  transition: border-color 0.15s;
}
.pillar a { color: var(--text-primary); border: none; }
.pillar:hover { border-color: var(--accent-primary); }
.pillar__name {
  font-family: var(--font-display);
  font-size: 20px;
  margin: 0 0 var(--sp-2);
}
.pillar__desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* Newsletter band */
.newsletter {
  background: var(--text-primary);
  color: var(--text-inverse);
  padding: var(--sp-7) 0;
  border-bottom: none;
}
.newsletter__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
}
.newsletter h2 {
  font-size: 28px;
  margin: 0 0 var(--sp-2);
  color: var(--text-inverse);
}
.newsletter p {
  margin: 0;
  color: rgba(250, 250, 250, 0.75);
  font-size: 15px;
}
.newsletter form { display: flex; gap: var(--sp-3); }
.newsletter input {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: var(--sp-3) var(--sp-4);
  color: var(--text-inverse);
  font-family: var(--font-body);
  font-size: 15px;
  min-width: 280px;
  border-radius: 3px;
}
.newsletter input::placeholder { color: rgba(250, 250, 250, 0.5); }
.newsletter button {
  background: var(--accent-secondary);
  color: var(--text-primary);
  border: none;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: var(--sp-3) var(--sp-5);
  cursor: pointer;
  border-radius: 3px;
  font-family: var(--font-body);
}

@media (max-width: 720px) {
  .newsletter__inner { flex-direction: column; align-items: flex-start; }
  .newsletter form { width: 100%; flex-direction: column; }
  .newsletter input { min-width: 0; width: 100%; }
}

/* ============================================================
   SITE FOOTER
   ============================================================ */
.site-footer {
  background: var(--text-primary);
  color: rgba(250, 250, 250, 0.7);
  padding: var(--sp-8) 0 var(--sp-5);
  font-size: 14px;
}
.site-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr);
  gap: var(--sp-6);
}
.site-footer h4 {
  color: var(--text-inverse);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 var(--sp-3);
  font-family: var(--font-body);
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: var(--sp-2); }
.site-footer a {
  color: rgba(250, 250, 250, 0.7);
  border: none;
}
.site-footer a:hover { color: var(--accent-secondary); }
.site-footer__brand {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-inverse);
  margin-bottom: var(--sp-3);
  display: block;
}
.site-footer__tagline {
  font-size: 14px;
  color: rgba(250, 250, 250, 0.6);
  line-height: 1.55;
  margin-bottom: var(--sp-4);
}
.site-footer__legal {
  border-top: 1px solid rgba(250, 250, 250, 0.1);
  padding-top: var(--sp-4);
  margin-top: var(--sp-6);
  font-size: 12px;
  color: rgba(250, 250, 250, 0.5);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-3);
}
.site-footer__attribution {
  border-top: 1px dashed rgba(250, 250, 250, 0.15);
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  font-size: 11px;
  color: rgba(250, 250, 250, 0.4);
  text-align: center;
}

@media (max-width: 900px) {
  .site-footer__inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
  .site-footer__inner { grid-template-columns: 1fr; }
}

/* ============================================================
   UTILITY
   ============================================================ */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
