/* ===========================
   Base reset & typography
=========================== */
*,*::before,*::after { box-sizing: border-box; }
html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #1a1a1a;
  background: #fff;
  line-height: 1.65;
  margin: 0;
  padding: 0;
  font-feature-settings: "kern" 1, "liga" 1;
}

/* Accent color used site-wide: deep editorial burgundy */
:root {
  --accent: #7c1d3b;
  --accent-soft: #a8425e;
  --ink: #0f0f0f;
  --muted: #6b6b6b;
  --border: #e5e3dd;
  --soft-bg: #fafaf7;
}

/* ===========================
   Header
=========================== */
.site-header {
  border-bottom: 1px solid var(--border);
  background: #fff;
  position: relative;
  padding: 18px 22px 16px;
}
.site-header::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--accent);
  width: 60px;
  margin: 0 auto;
}
.header-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 18px;
}
/* Brand link in header (wraps logo image) */
.site-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border: none;
}
.site-logo {
  display: block;
  height: 44px;
  width: auto;
  max-width: 100%;
  transition: opacity 0.15s ease;
}
.site-brand:hover .site-logo { opacity: 0.85; }
.primary-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  font-size: 0.9rem;
  font-weight: 500;
}
.primary-nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 4px 0;
  position: relative;
  transition: color 0.15s ease;
}
.primary-nav a:hover { color: var(--accent); }
.primary-nav a.current {
  color: var(--accent);
  font-weight: 700;
}
.primary-nav a.current::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--accent);
}

/* ===========================
   Main content area
=========================== */
main {
  max-width: 760px;
  margin: 0 auto;
  padding: 36px 22px 60px;
}

article {
  counter-reset: section;
}

/* ===========================
   Headings
=========================== */
h1 {
  font-size: 2.2rem;
  line-height: 1.18;
  margin: 0 0 14px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--ink);
}
h2 {
  font-size: 1.45rem;
  line-height: 1.3;
  margin: 48px 0 14px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
  position: relative;
}
/* Auto-numbered article sections — magazine style */
article > h2 {
  counter-increment: section;
}
article > h2::before {
  content: counter(section, decimal-leading-zero);
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 6px;
  font-feature-settings: "tnum" 1;
}
h3 {
  font-size: 1.1rem;
  margin: 26px 0 10px;
  font-weight: 700;
  color: var(--ink);
}

/* ===========================
   Paragraphs & inline
=========================== */
p { margin: 0 0 16px; }
strong { font-weight: 700; color: var(--ink); }
em { color: #2a2a2a; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.12s ease, text-decoration-color 0.12s ease;
  text-decoration-color: rgba(124, 29, 59, 0.4);
}
a:hover {
  color: var(--accent-soft);
  text-decoration-color: var(--accent-soft);
}

/* ===========================
   Lists with refined markers
=========================== */
ul, ol { margin: 0 0 18px 0; padding-left: 0; list-style: none; }
li {
  margin: 0 0 8px;
  padding-left: 22px;
  position: relative;
}
ul > li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.65em;
  width: 6px;
  height: 1.5px;
  background: var(--accent);
}
ol {
  counter-reset: ol-counter;
}
ol > li {
  counter-increment: ol-counter;
}
ol > li::before {
  content: counter(ol-counter) ".";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.88em;
  font-feature-settings: "tnum" 1;
}

/* Nested lists inherit but smaller markers */
li ul, li ol { margin-top: 6px; margin-bottom: 0; }

/* ===========================
   Horizontal rule — refined
=========================== */
hr {
  border: 0;
  height: 1px;
  background: var(--border);
  margin: 44px auto;
  width: 80px;
  position: relative;
}
hr::after {
  content: "§";
  position: absolute;
  top: -0.7em;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  padding: 0 8px;
  color: var(--accent);
  font-size: 0.85rem;
  font-style: italic;
}

/* ===========================
   Meta line under H1
=========================== */
.meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.meta a { color: var(--accent); }
.meta .dot {
  display: inline-block;
  margin: 0 8px;
  color: var(--border);
}

/* ===========================
   Lede paragraph with drop cap
=========================== */
.lede {
  font-size: 1.18rem;
  line-height: 1.55;
  color: #2a2a2a;
  margin-bottom: 28px;
  font-weight: 400;
}
.lede::first-letter {
  font-size: 3.4rem;
  font-weight: 700;
  float: left;
  line-height: 0.9;
  margin: 6px 10px 0 0;
  color: var(--accent);
  font-feature-settings: "kern" 1;
}

/* ===========================
   Breadcrumb
=========================== */
.breadcrumb {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 22px;
  letter-spacing: 0.02em;
}
.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.12s ease, border-color 0.12s ease;
}
.breadcrumb a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.breadcrumb .sep {
  margin: 0 8px;
  color: var(--border);
}

/* ===========================
   TOC details/summary
=========================== */
details.toc {
  margin: 28px 0 32px;
  border: 1px solid var(--border);
  padding: 16px 20px;
  background: var(--soft-bg);
  position: relative;
}
details.toc::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
}
details.toc summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.92rem;
  list-style: none;
  position: relative;
  padding-right: 24px;
  user-select: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
}
details.toc summary::-webkit-details-marker { display: none; }
details.toc summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: -2px;
  transition: transform 0.2s ease;
  font-size: 1.2rem;
  color: var(--accent);
  font-weight: 400;
  line-height: 1;
}
details.toc[open] summary::after { transform: rotate(45deg); }
details.toc ol {
  margin: 16px 0 4px;
  padding-left: 0;
  counter-reset: toc-counter;
}
details.toc ol li {
  margin: 6px 0;
  padding-left: 32px;
  position: relative;
  counter-increment: toc-counter;
}
details.toc ol li::before {
  content: counter(toc-counter, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
}
details.toc ol a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
details.toc ol a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ===========================
   Table — refined
=========================== */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 22px 0 28px;
  font-size: 0.92rem;
}
caption {
  caption-side: top;
  text-align: left;
  font-weight: 700;
  margin-bottom: 12px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
thead th {
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  padding: 11px 13px;
  text-align: left;
  vertical-align: top;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  border: none;
}
thead th:first-child { border-top-left-radius: 2px; }
thead th:last-child { border-top-right-radius: 2px; }
tbody td {
  border-bottom: 1px solid var(--border);
  padding: 12px 13px;
  text-align: left;
  vertical-align: top;
}
tbody tr {
  transition: background-color 0.12s ease;
}
tbody tr:hover { background: var(--soft-bg); }
tbody tr:last-child td { border-bottom: 1px solid var(--ink); }
tbody td:first-child { font-weight: 600; color: var(--ink); }

/* ===========================
   FAQ definition list
=========================== */
.faq dt {
  font-weight: 700;
  margin-top: 22px;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 1.02rem;
  padding-left: 22px;
  position: relative;
}
.faq dt::before {
  content: "Q.";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}
.faq dd {
  margin: 0 0 10px 22px;
  color: #2a2a2a;
}

/* ===========================
   Author bio box
=========================== */
.author-bio {
  background: var(--soft-bg);
  border-left: 3px solid var(--accent);
  padding: 18px 22px;
  margin: 22px 0;
  position: relative;
}
.author-bio p { margin: 0; }

/* ===========================
   Related pages box
=========================== */
.related {
  background: var(--soft-bg);
  border: 1px solid var(--border);
  padding: 18px 22px;
  margin: 36px 0 4px;
  font-size: 0.94rem;
  position: relative;
}
.related::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
}
.related strong {
  display: block;
  margin-bottom: 8px;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}
.related a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.12s ease, color 0.12s ease;
}
.related a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ===========================
   Footer (multi-column)
=========================== */
.site-footer {
  margin-top: 72px;
  border-top: 1px solid var(--border);
  background: var(--soft-bg);
  padding: 40px 22px 32px;
  font-size: 0.9rem;
  color: var(--muted);
  position: relative;
}
.site-footer::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -1px;
  height: 2px;
  background: var(--accent);
  width: 60px;
  margin: 0 auto;
}
.footer-inner {
  max-width: 800px;
  margin: 0 auto;
}
.footer-columns {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 32px;
}
.footer-col h4 {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 12px;
}
.footer-col ul { margin: 0; padding: 0; }
.footer-col li {
  margin: 0 0 7px;
  padding: 0;
  list-style: none;
}
.footer-col li::before { content: none; }
.footer-col a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.88rem;
  border-bottom: 1px solid transparent;
  transition: border-color 0.12s ease, color 0.12s ease;
}
.footer-col a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.footer-brand img.footer-logo {
  display: block;
  height: 40px;
  width: auto;
  margin-bottom: 10px;
}
.footer-tagline {
  font-size: 0.84rem;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.5;
}
.footer-meta {
  margin: 0;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ===========================
   Mobile
=========================== */
@media (max-width: 720px) {
  .footer-columns {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
}
@media (max-width: 540px) {
  html { font-size: 16px; }
  main { padding: 26px 16px 50px; }
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.25rem; margin-top: 36px; }
  .lede { font-size: 1.08rem; }
  .lede::first-letter { font-size: 2.8rem; }
  table { font-size: 0.84rem; }
  thead th { padding: 8px 9px; font-size: 0.8rem; }
  tbody td { padding: 9px 9px; }
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .site-logo { height: 38px; }
  .primary-nav { width: 100%; gap: 4px 16px; font-size: 0.86rem; }
  .footer-columns { grid-template-columns: 1fr 1fr; gap: 22px; }
  .footer-meta { flex-direction: column; }
}
