/*
Theme Name: Dispatches from the Field
Theme URI: https://kwami.me
Author: Walter Kwami
Author URI: https://kwami.me
Description: A custom theme for long-form analysis on governance, security, finance, and systems. Clean serif typography with Playfair Display and Source Serif 4.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dispatches
Tags: blog, one-column, custom-header, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ═══════════════════════════════════════════════════════════
   DISPATCHES FROM THE FIELD — COMPLETE DESIGN SYSTEM
   ═══════════════════════════════════════════════════════════ */

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

:root {
  --ink:        #000000;
  --ink-soft:   #000000;
  --ink-muted:  #666666;
  --cream:      #f7f3ee;
  --cream-dark: #ede7de;
  --cream-mid:  #f0ebe4;
  --accent:     #8b3a1c;
  --accent-dim: rgba(139,58,28,0.08);
  --rule:       #c9b8a8;
  --gold:       #b8902a;
  --gold-dim:   rgba(184,144,42,0.12);
}

html { scroll-behavior: smooth; }

body {
  background-color: var(--cream);
  color: var(--ink);
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 300;
  font-size: 18px;
  line-height: 1.8;
  min-height: 100vh;
}

/* ── MASTHEAD ── */
.masthead {
  background: var(--ink);
  padding: 0;
  position: relative;
  overflow: hidden;
}

.masthead::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent, transparent 39px,
    rgba(255,255,255,0.025) 39px, rgba(255,255,255,0.025) 40px
  );
  pointer-events: none;
}

.masthead-rule-top {
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold) 20%, var(--gold) 80%, transparent);
}

.masthead-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 3.5rem 2rem 3rem;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 2rem;
}

.masthead-left { }

.blog-eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
  font-family: 'Source Serif 4', serif;
  display: block;
  margin-bottom: 0.9rem;
  opacity: 0;
  animation: fadeUp 0.7s ease forwards 0.1s;
}

.blog-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 900;
  color: var(--cream);
  line-height: 1.05;
  letter-spacing: -0.01em;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.2s;
}

.blog-title a {
  color: inherit;
  text-decoration: none;
}

.blog-title em {
  color: var(--gold);
  font-style: italic;
  font-weight: 400;
}

.blog-byline {
  margin-top: 1.2rem;
  font-size: 0.85rem;
  color: #8a7e74;
  letter-spacing: 0.08em;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.4s;
}

.blog-byline a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid rgba(184,144,42,0.3);
  transition: border-color 0.2s;
}
.blog-byline a:hover { border-color: var(--gold); }

.masthead-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.5s;
}

.masthead-nav a {
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #8a7e74;
  text-decoration: none;
  transition: color 0.2s;
  white-space: nowrap;
}
.masthead-nav a:hover { color: var(--gold); }

.masthead-rule-bottom {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--rule) 20%, var(--rule) 80%, transparent);
  opacity: 0.4;
}

/* ── INTRO BAND ── */
.intro-band {
  background: var(--cream-dark);
  border-bottom: 1px solid var(--rule);
  padding: 2rem 2rem;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.6s;
}

.intro-inner {
  max-width: 760px;
  margin: 0 auto;
}

.intro-inner p {
  font-style: italic;
  color: var(--ink-muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* ── MAIN LAYOUT ── */
.site-body {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem 6rem;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 4rem;
  align-items: start;
}

/* ── POST CARD (Homepage) ── */
.post-card {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 0;
  margin-bottom: 0;
  border-bottom: 1px solid var(--rule);
  transition: background 0.2s;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards;
  animation-delay: calc(0.7s + var(--stagger, 0) * 0.1s);
}

.post-card:last-child { border-bottom: none; }
.post-card:hover { background: var(--cream-mid); }

.post-card-date {
  padding: 1.4rem 1rem 1.4rem 0;
  border-right: 1px solid var(--rule);
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  padding-top: 1.6rem;
  gap: 0.2rem;
  flex-shrink: 0;
}

.date-month {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: 'Source Serif 4', serif;
  display: block;
}

.date-year {
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  font-family: 'Source Serif 4', serif;
  display: block;
}

.post-card-body {
  padding: 1.4rem 0 1.4rem 1.4rem;
}

.post-tag {
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  font-family: 'Source Serif 4', serif;
  display: block;
  margin-bottom: 0.4rem;
}

.post-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 0.5rem;
  text-decoration: none;
  display: block;
  transition: color 0.2s;
}

.post-title:hover { color: var(--accent); }

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

.post-excerpt {
  font-size: 0.9rem;
  color: var(--ink-muted);
  line-height: 1.6;
  margin-bottom: 0.8rem;
}

.post-read {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  font-family: 'Source Serif 4', serif;
  border-bottom: 1px solid rgba(139,58,28,0.3);
  transition: border-color 0.2s;
  display: inline-block;
}
.post-read:hover { border-color: var(--accent); }

/* ── SINGLE POST STYLES ── */
.single-header {
  background-color: var(--ink);
  color: var(--cream);
  padding: 3rem 2rem 2.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.single-header::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(255,255,255,0.03) 39px, rgba(255,255,255,0.03) 40px);
  pointer-events: none;
}

.blog-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.8rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
  opacity: 0;
  animation: fadeUp 0.7s ease forwards 0.1s;
}

.blog-name a { color: inherit; text-decoration: none; }
.blog-name a:hover { text-decoration: underline; text-underline-offset: 3px; }

.header-rule {
  width: 40px;
  height: 1px;
  background: var(--gold);
  margin: 1rem auto;
  opacity: 0;
  animation: fadeUp 0.7s ease forwards 0.3s;
}

.header-nav {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #8a7e74;
  margin-bottom: 0.6rem;
  opacity: 0;
  animation: fadeUp 0.7s ease forwards 0.4s;
}

.header-nav a {
  color: #8a7e74;
  text-decoration: none;
  transition: color 0.2s;
}

.header-nav a:hover { color: var(--gold); }

.post-date-single {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #8a7e74;
  opacity: 0;
  animation: fadeUp 0.7s ease forwards 0.5s;
}

.title-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 4rem 2rem 0;
  opacity: 0;
  animation: fadeUp 0.9s ease forwards 0.3s;
}

.entry-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 1.5rem;
}

.entry-title em {
  color: var(--accent);
  font-style: italic;
}

.subtitle {
  font-style: italic;
  font-size: 1.1rem;
  color: var(--ink-muted);
  border-left: 3px solid var(--accent);
  padding-left: 1.2rem;
  margin-bottom: 3rem;
  line-height: 1.6;
}

.title-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3rem;
}

.title-divider::before,
.title-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.title-divider span {
  font-family: 'Playfair Display', serif;
  color: var(--accent);
  font-size: 1.2rem;
}

.entry-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 2rem 6rem;
  opacity: 0;
  animation: fadeUp 0.9s ease forwards 0.6s;
}

.entry-content p {
  margin-bottom: 1.6rem;
  color: var(--ink-soft);
  font-size: 19px;
  line-height: 1.85;
}

.entry-content p:first-of-type::first-letter {
  font-family: 'Playfair Display', serif;
  font-size: 4.5rem;
  font-weight: 700;
  float: left;
  line-height: 0.8;
  margin: 0.1em 0.1em 0 0;
  color: var(--accent);
  padding-top: 0.05em;
}

.entry-content h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--ink);
  margin: 3.5rem 0 1.5rem;
  line-height: 1.3;
}

.entry-content h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  margin: 2.5rem 0 1rem;
}

.entry-content blockquote {
  margin: 3rem -1.5rem;
  padding: 2rem 2.5rem;
  background: var(--cream-dark);
  border-top: 2px solid var(--accent);
  border-bottom: 1px solid var(--rule);
  position: relative;
}

.entry-content blockquote::before {
  content: '\201C';
  font-family: 'Playfair Display', serif;
  font-size: 5rem;
  color: var(--rule);
  position: absolute;
  top: -0.3rem;
  left: 1rem;
  line-height: 1;
}

.entry-content blockquote p {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--ink);
  padding-left: 1.5rem;
  margin: 0;
}

.entry-content blockquote p::first-letter {
  all: unset;
}

.entry-content ul,
.entry-content ol {
  margin: 1.5rem 0 1.5rem 2rem;
  color: var(--ink-soft);
}

.entry-content li {
  margin-bottom: 0.8rem;
  line-height: 1.7;
}

.entry-content a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(139,58,28,0.3);
  transition: border-color 0.2s;
}

.entry-content a:hover {
  border-color: var(--accent);
}

/* ── SIDEBAR ── */
.sidebar {
  margin-top: 4rem;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.9s;
}

.sidebar-widget {
  margin-bottom: 2.5rem;
}

.sidebar-heading {
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: 'Source Serif 4', serif;
  display: block;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--rule);
}

.about-widget p {
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.65;
  margin-bottom: 0.8rem;
}

.about-widget p:last-child { margin: 0; }

.about-widget a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(139,58,28,0.3);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  transition: border-color 0.2s;
}

.about-widget a:hover { border-color: var(--accent); }

.recent-list {
  list-style: none;
}

.recent-list li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule);
}

.recent-list li:last-child { border-bottom: none; }

.recent-list a {
  font-size: 0.88rem;
  color: var(--ink-soft);
  text-decoration: none;
  font-family: 'Playfair Display', serif;
  line-height: 1.3;
  display: block;
  transition: color 0.2s;
}

.recent-list a:hover { color: var(--accent); }

.recent-cat {
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  font-family: 'Source Serif 4', serif;
  display: block;
  margin-top: 0.15rem;
}

/* ── FOOTER ── */
.site-footer {
  text-align: center;
  padding: 2.5rem 2rem;
  background: var(--ink);
  color: #8a7e74;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  margin-top: 2rem;
}

.site-footer span {
  color: var(--gold);
  font-family: 'Playfair Display', serif;
  font-style: italic;
}

.site-footer a {
  color: #8a7e74;
  text-decoration: none;
  border-bottom: 1px solid rgba(138,126,116,0.3);
  transition: color 0.2s;
}

.site-footer a:hover { color: var(--gold); }

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── RESPONSIVE ── */
@media (max-width: 780px) {
  .masthead-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .masthead-nav { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .site-body { grid-template-columns: 1fr; gap: 0; }
  .sidebar { margin-top: 3rem; border-top: 1px solid var(--rule); padding-top: 3rem; }
  .post-card { grid-template-columns: 55px 1fr; }
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  .entry-content p { font-size: 17px; }
  .post-card { grid-template-columns: 1fr; }
  .post-card-date { display: none; }
  .entry-content p:first-of-type::first-letter { font-size: 3.5rem; }
  .entry-content blockquote { margin: 2rem 0; }
}
