/* ============================================================
   RADICAL INTEGRITY — Ghost Theme
   Design system mirrors Off Record Strategy (offrecordstrategy.com)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,600;0,9..144,700;1,9..144,300;1,9..144,500&family=DM+Sans:ital,wght@0,300;0,400;1,300&family=Overpass+Mono:wght@400;500&display=swap');

/* ── TOKENS ── */
:root {
  --paper:       #f4f0e8;
  --paper2:      #ece7da;
  --white:       #fdfbf7;
  --ink:         #18140f;
  --ink2:        #38322a;
  --muted:       #7a7265;
  --border:      #ccc5b5;
  --navy:        #1a2f4a;
  --navy-dark:   #0f1e30;
  --navy-light:  #e6edf5;
  --gold:        #b07a14;
  --gold-light:  #f5ecd6;

  --font-serif:  'Fraunces', Georgia, serif;
  --font-sans:   'DM Sans', system-ui, sans-serif;
  --font-mono:   'Overpass Mono', 'Courier New', monospace;

  --max-width:   960px;
  --reading-width: 680px;
}

/* ── GHOST REQUIRED KG WIDTH CLASSES ── */
/* Ghost requires these classes to be present in the theme CSS */

.kg-width-wide {
  position: relative;
  width: 85vw;
  min-width: 100%;
  margin: auto calc(50% - 50vw);
  transform: translateX(calc(50vw - 50%));
}

/* Restrict wide images on large screens */
@media (min-width: 1200px) {
  .kg-width-wide {
    width: 1120px;
    margin: auto calc(50% - 560px);
    transform: none;
  }
}

.kg-width-full {
  position: relative;
  width: 100vw;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

/* ── RESET ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
}

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

a { color: inherit; }

/* ── UTILITIES ── */
.mono-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* ── NAVIGATION ── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  padding: 1.1rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-wordmark {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  align-items: center;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--ink); }

.nav-cta {
  background: var(--navy) !important;
  color: white !important;
  padding: 0.5rem 1.2rem;
  border-radius: 2px;
}
.nav-cta:hover {
  background: var(--navy-dark) !important;
  color: white !important;
}

/* ── BUTTONS ── */
.btn-primary {
  display: inline-block;
  background: var(--navy);
  color: white;
  padding: 0.85rem 2.25rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 2px;
  transition: background 0.2s;
  cursor: pointer;
  border: none;
}
.btn-primary:hover { background: var(--navy-dark); color: white; }

.btn-gold {
  display: inline-block;
  background: var(--gold);
  color: white;
  padding: 0.85rem 2.25rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 2px;
  white-space: nowrap;
  transition: background 0.2s;
}
.btn-gold:hover { background: #8a5e0a; color: white; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy);
  text-decoration: none;
  border-bottom: 1px solid var(--navy);
  padding-bottom: 0.1rem;
  transition: opacity 0.2s;
}
.text-link:hover { opacity: 0.7; }

/* ── SITE HEADER / HERO ── */
.site-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 6rem 2.5rem 5rem;
}

.site-header-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}

.site-header-kicker {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.5rem;
}

.site-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.12;
  color: var(--ink);
  margin-bottom: 1.25rem;
}

.site-header h1 em {
  font-style: italic;
  font-weight: 300;
  color: var(--navy);
}

.site-header-desc {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.85;
  max-width: 40ch;
}

.site-header-right {
  border-left: 1px solid var(--border);
  padding-left: 3.5rem;
}

.site-header-statement {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-style: italic;
  font-weight: 300;
  color: var(--ink2);
  line-height: 1.85;
  margin-bottom: 1.75rem;
}
.site-header-statement strong {
  font-weight: 600;
  font-style: normal;
  color: var(--ink);
}

/* ── POST LIST / INDEX ── */
.posts-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 5rem 2.5rem;
}

.post-feed {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
}

.post-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 2.25rem 2rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.2s;
}
.post-card:hover { border-color: var(--ink2); }

.post-card-tag {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.post-card-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
}

.post-card-excerpt {
  font-size: 0.93rem;
  color: var(--muted);
  line-height: 1.7;
  flex: 1;
}

.post-card-meta {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-top: 0.5rem;
  display: flex;
  gap: 1rem;
}

/* Featured post — spans 2 columns */
.post-card.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  padding: 3rem 2.5rem;
}

.post-card.featured .post-card-title {
  font-size: 1.65rem;
}

.post-card.featured .post-card-excerpt {
  font-size: 1rem;
  line-height: 1.8;
}

/* ── SINGLE POST ── */
.post-layout {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 5rem 2.5rem;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 5rem;
  align-items: start;
}

.post-main {}

.post-header {
  margin-bottom: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}

.post-tag-line {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.post-tag-line::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gold-light);
}

.post-title {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 1.25rem;
}

.post-title em {
  font-style: italic;
  font-weight: 300;
  color: var(--navy);
}

.post-excerpt-lead {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-style: italic;
  font-weight: 300;
  color: var(--ink2);
  line-height: 1.75;
  margin-bottom: 1.5rem;
}

.post-byline {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  display: flex;
  gap: 1.5rem;
  align-items: center;
}
.post-byline span + span::before {
  content: '·';
  margin-right: 1.5rem;
}

/* ── POST CONTENT (Ghost kg-card support) ── */
.post-content {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--ink2);
}

.post-content h2 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
  margin: 3rem 0 1rem;
  line-height: 1.2;
}

.post-content h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  margin: 2.5rem 0 0.85rem;
  line-height: 1.25;
}

.post-content h4 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 2rem 0 0.75rem;
}

.post-content p { margin-bottom: 1.4rem; }

.post-content a {
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.post-content a:hover { opacity: 0.75; }

.post-content strong { font-weight: 600; color: var(--ink); }

.post-content em { font-style: italic; }

.post-content blockquote {
  border-left: 3px solid var(--gold);
  padding: 1.25rem 0 1.25rem 2rem;
  margin: 2.5rem 0;
  color: var(--ink2);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.7;
}

.post-content ul,
.post-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.4rem;
}

.post-content ul { list-style: none; padding-left: 0; }
.post-content ul li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  padding: 0.3rem 0;
}
.post-content ul li::before {
  content: '—';
  color: var(--gold);
}

.post-content ol li { margin-bottom: 0.5rem; }

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

.post-content pre {
  background: var(--navy);
  color: #8ba8c0;
  padding: 1.5rem;
  border-radius: 3px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 2rem 0;
}

.post-content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--paper2);
  padding: 0.15em 0.4em;
  border-radius: 2px;
  color: var(--ink);
}

.post-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.post-content figure { margin: 2.5rem 0; }

.post-content figcaption {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-top: 0.75rem;
  text-align: center;
}

/* Ghost kg-cards */
.kg-image-card img { border-radius: 2px; }
.kg-gallery-card { margin: 2.5rem 0; }
.kg-gallery-container { display: flex; gap: 4px; flex-wrap: wrap; }
.kg-gallery-image img { border-radius: 2px; }

.kg-callout-card {
  background: var(--gold-light);
  border-left: 3px solid var(--gold);
  padding: 1.25rem 1.5rem;
  border-radius: 0 3px 3px 0;
  margin: 2rem 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
}
.kg-callout-emoji { font-size: 1.25rem; }
.kg-callout-text { font-size: 0.97rem; color: var(--ink2); line-height: 1.7; }

.kg-toggle-card {
  border: 1px solid var(--border);
  border-radius: 3px;
  margin: 1.5rem 0;
  overflow: hidden;
}
.kg-toggle-heading {
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 400;
  color: var(--ink);
  user-select: none;
}

/* ── POST SIDEBAR ── */
.post-sidebar {}

.sidebar-block {
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1.75rem 1.5rem;
  background: var(--white);
  margin-bottom: 1.5rem;
}

.sidebar-label {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.25rem;
}

.sidebar-bio {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.75;
}

.sidebar-ors {
  background: var(--navy);
  border-color: var(--navy);
  color: white;
}

.sidebar-ors .sidebar-label { color: #6888a8; }

.sidebar-ors-body {
  font-size: 0.88rem;
  color: #8ba8c0;
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.sidebar-ors a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
  padding-bottom: 0.1rem;
  transition: opacity 0.2s;
}
.sidebar-ors a:hover { opacity: 0.75; }

.sidebar-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sidebar-tag {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--paper2);
  padding: 0.3rem 0.75rem;
  border-radius: 2px;
  text-decoration: none;
  transition: color 0.2s;
}
.sidebar-tag:hover { color: var(--ink); }

/* No sidebar layout — for pages */
.post-layout-full {
  max-width: var(--reading-width);
  margin: 0 auto;
  padding: 5rem 2.5rem;
}

/* ── PAGINATION ── */
.pagination {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2.5rem 5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 2.5rem;
}

.pagination a {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy);
  text-decoration: none;
  border-bottom: 1px solid var(--navy);
  padding-bottom: 0.1rem;
  transition: opacity 0.2s;
}
.pagination a:hover { opacity: 0.7; }

.pagination-info {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* ── TAG / AUTHOR PAGE ── */
.archive-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 5rem 2.5rem 3rem;
  border-bottom: 1px solid var(--border);
}

.archive-kicker {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}

.archive-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.75rem;
}

.archive-desc {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.75;
  max-width: 50ch;
}

/* ── SUBSCRIBE FORM ── */
.subscribe-band {
  background: var(--paper2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.subscribe-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 2.5rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4rem;
  align-items: center;
}

.subscribe-h2 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
  margin-bottom: 0.5rem;
}
.subscribe-h2 em {
  font-style: italic;
  font-weight: 300;
  color: var(--navy);
}

.subscribe-sub {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.7;
}

.subscribe-form {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.subscribe-form input[type="email"] {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.75rem 1.25rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--ink);
  width: 240px;
  outline: none;
  transition: border-color 0.2s;
}
.subscribe-form input[type="email"]:focus {
  border-color: var(--navy);
}
.subscribe-form input[type="email"]::placeholder {
  color: var(--muted);
}

/* ── FOOTER ── */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--paper);
  padding: 1.75rem 2.5rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-brand {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.footer-links a {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--ink); }

.footer-links .accent { color: var(--gold); }

/* ── ERROR PAGE ── */
.error-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 10rem 2.5rem;
  text-align: center;
}

.error-code {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.5rem;
}

.error-title {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 1.25rem;
}

.error-body {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 2.5rem;
  line-height: 1.75;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .post-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
    padding: 4rem 2rem;
  }
  .post-sidebar { order: -1; }
}

@media (max-width: 760px) {
  .site-nav {
    padding: 1rem 1.25rem;
  }
  .nav-links a:not(.nav-cta) {
    display: none;
  }

  .site-header {
    padding: 4rem 1.25rem 3rem;
  }
  .site-header-inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .site-header-right {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--border);
    padding-top: 2.5rem;
  }

  .posts-section {
    padding: 3rem 1.25rem;
  }
  .post-feed {
    grid-template-columns: 1fr;
  }
  .post-card.featured {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .post-layout-full {
    padding: 3.5rem 1.25rem;
  }

  .archive-header {
    padding: 3.5rem 1.25rem 2.5rem;
  }

  .subscribe-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 3rem 1.25rem;
  }
  .subscribe-form {
    flex-direction: column;
  }
  .subscribe-form input[type="email"] {
    width: 100%;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .pagination {
    padding: 2rem 1.25rem 3.5rem;
  }
}
