/* PlannerGrid — editorial, paper-inspired design system */
:root {
  --ink: #14213d;
  --ink-soft: #2b3556;
  --paper: #f7f1e6;
  --paper-warm: #efe6d3;
  --cream: #fbf6ec;
  --terra: #c0593a;
  --terra-deep: #9c3f25;
  --sage: #7e9c7a;
  --rule: #d9cdb6;
  --muted: #6b6552;
  --shadow: 0 1px 0 rgba(20,33,61,0.04), 0 8px 24px -12px rgba(20,33,61,0.18);
  --serif: "Source Serif 4", "Source Serif Pro", "Iowan Old Style", "Apple Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", "Helvetica Neue", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--terra-deep); text-decoration: none; border-bottom: 1px solid rgba(192,89,58,0.25); transition: border-color .15s ease, color .15s ease; }
a:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* Layout primitives */
.container { width: min(1180px, 100% - 2.5rem); margin-inline: auto; }
.narrow { width: min(720px, 100% - 2.5rem); margin-inline: auto; }

/* Top bar */
.topbar {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.topbar .container { display: flex; justify-content: space-between; padding: 8px 0; gap: 1rem; flex-wrap: wrap; }
.topbar .meta { text-transform: uppercase; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--cream);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(140%) blur(6px);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; gap: 1rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; border: none; }
.brand:hover { border: none; }
.brand-mark {
  width: 36px; height: 36px;
  display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr);
  gap: 2px; padding: 4px; background: var(--ink); border-radius: 6px;
}
.brand-mark span { background: var(--paper); border-radius: 1px; }
.brand-mark span.accent { background: var(--terra); }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 22px; letter-spacing: -0.01em; color: var(--ink); }
.brand-tag { font-family: var(--sans); font-size: 11px; text-transform: uppercase; letter-spacing: 0.18em; color: var(--muted); margin-top: 2px; }

.primary-nav { display: flex; gap: 1.5rem; font-family: var(--sans); font-size: 14px; }
.primary-nav a { color: var(--ink); border: none; padding: 4px 0; position: relative; }
.primary-nav a:hover { color: var(--terra-deep); }
.primary-nav a.active::after { content:""; position:absolute; left:0; right:0; bottom:-22px; height:2px; background:var(--terra); }

.nav-toggle { display: none; background: none; border: 1px solid var(--rule); border-radius: 4px; padding: 6px 10px; font-family: var(--sans); font-size: 13px; cursor: pointer; color: var(--ink); }

/* Hero */
.hero {
  position: relative;
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--rule);
  background:
    radial-gradient(1200px 600px at 100% -20%, rgba(192,89,58,0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(126,156,122,0.10), transparent 60%),
    var(--cream);
  overflow: hidden;
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 3rem; align-items: center; }
.hero-eyebrow { font-family: var(--sans); font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--terra-deep); margin: 0 0 1rem; }
.hero h1 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  line-height: 1.05; letter-spacing: -0.02em; margin: 0 0 1.2rem;
}
.hero h1 em { font-style: italic; color: var(--terra-deep); font-weight: 500; }
.hero p.lede { font-size: 1.15rem; color: var(--ink-soft); margin: 0 0 2rem; max-width: 32rem; }
.hero-cta { display: flex; gap: .85rem; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 12px 22px; font-family: var(--sans); font-size: 14px;
  letter-spacing: 0.04em; text-transform: uppercase; border-radius: 2px;
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { background: var(--terra-deep); border-color: var(--terra-deep); color: var(--paper); transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }
.hero-figure { position: relative; }
.hero-figure img { border-radius: 4px; box-shadow: var(--shadow); border: 1px solid var(--rule); }
.hero-stats {
  position: absolute; bottom: -28px; left: -28px;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 4px; padding: 18px 22px;
  font-family: var(--sans); box-shadow: var(--shadow);
}
.hero-stats .num { font-family: var(--serif); font-size: 1.8rem; color: var(--ink); font-weight: 600; }
.hero-stats .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 0.18em; color: var(--muted); }

/* Section heading */
.section { padding: 4rem 0; border-bottom: 1px solid var(--rule); }
.section.alt { background: var(--paper); }
.section-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 2rem; gap: 1.5rem; flex-wrap: wrap; }
.section-head h2 {
  font-family: var(--serif); font-weight: 600; font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0; letter-spacing: -0.01em;
}
.section-head .kicker { font-family: var(--sans); font-size: 12px; text-transform: uppercase; letter-spacing: 0.2em; color: var(--terra-deep); margin-bottom: 6px; }
.section-head .more { font-family: var(--sans); font-size: 14px; }

/* Card grid */
.grid { display: grid; gap: 1.5rem; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  display: flex; flex-direction: column;
  background: var(--cream);
  border: 1px solid var(--rule); border-radius: 4px;
  padding: 1.5rem 1.5rem 1.25rem;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  position: relative;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--ink); }
.card .tag { font-family: var(--sans); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--terra-deep); margin-bottom: .6rem; }
.card h3 { font-family: var(--serif); font-weight: 600; font-size: 1.2rem; line-height: 1.25; margin: 0 0 .6rem; letter-spacing: -0.01em; }
.card h3 a { color: var(--ink); border: none; }
.card h3 a:hover { color: var(--terra-deep); }
.card p { margin: 0 0 1rem; color: var(--ink-soft); font-size: .98rem; line-height: 1.55; }
.card .meta { font-family: var(--sans); font-size: 12px; color: var(--muted); margin-top: auto; display: flex; gap: 1rem; flex-wrap: wrap; }
.card .meta span::before { content: "·"; margin-right: .5rem; color: var(--rule); }
.card .meta span:first-child::before { content: ""; margin: 0; }

/* Category strip */
.cat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.cat-tile {
  border: 1px solid var(--rule); background: var(--cream); padding: 1.25rem;
  border-radius: 4px; transition: all .15s ease;
}
.cat-tile:hover { border-color: var(--ink); }
.cat-tile a { color: var(--ink); border: none; }
.cat-tile .num { font-family: var(--serif); font-size: 2rem; font-weight: 600; color: var(--terra-deep); line-height: 1; }
.cat-tile .nm { font-family: var(--serif); font-size: 1.05rem; margin-top: .25rem; }
.cat-tile .desc { font-family: var(--sans); font-size: 12px; color: var(--muted); margin-top: .25rem; line-height: 1.5; }

/* Article (entry page) */
.entry-head { padding: 3rem 0 1.5rem; border-bottom: 1px solid var(--rule); }
.crumbs { font-family: var(--sans); font-size: 12px; text-transform: uppercase; letter-spacing: 0.18em; color: var(--muted); margin-bottom: 1.25rem; }
.crumbs a { color: var(--muted); border: none; }
.crumbs a:hover { color: var(--terra-deep); }
.entry-head h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(1.9rem, 4vw, 2.8rem); margin: 0 0 1rem; letter-spacing: -0.015em; line-height: 1.1; }
.entry-head .deck { font-size: 1.15rem; color: var(--ink-soft); margin: 0 0 1.5rem; max-width: 48rem; }
.entry-meta { display: flex; gap: 1.5rem; font-family: var(--sans); font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.entry-meta strong { color: var(--ink); font-weight: 500; }

.entry-layout { display: grid; grid-template-columns: 1fr 280px; gap: 3rem; padding: 2.5rem 0 4rem; }
.entry-body h2 { font-family: var(--serif); font-size: 1.55rem; font-weight: 600; margin: 2.4rem 0 .8rem; letter-spacing: -0.01em; }
.entry-body h2:first-child { margin-top: 0; }
.entry-body h3 { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; margin: 1.6rem 0 .5rem; }
.entry-body p { margin: 0 0 1.1rem; }
.entry-body ul, .entry-body ol { padding-left: 1.3rem; margin: 0 0 1.2rem; }
.entry-body li { margin-bottom: .35rem; }
.entry-body blockquote {
  border-left: 3px solid var(--terra);
  background: var(--paper);
  padding: 1rem 1.25rem; margin: 1.5rem 0;
  font-style: italic; color: var(--ink-soft);
}
.entry-body .pullquote { font-family: var(--serif); font-size: 1.35rem; line-height: 1.45; color: var(--ink); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 1.5rem 0; margin: 2rem 0; font-style: italic; }
.entry-body table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 14px; margin: 1rem 0 1.5rem; }
.entry-body th, .entry-body td { padding: .6rem .75rem; border-bottom: 1px solid var(--rule); text-align: left; }
.entry-body th { background: var(--paper); font-weight: 600; }

.sidebar { font-family: var(--sans); font-size: 14px; }
.side-card { border: 1px solid var(--rule); border-radius: 4px; padding: 1.1rem 1.25rem; margin-bottom: 1.25rem; background: var(--paper); }
.side-card h4 { font-family: var(--sans); font-size: 11px; text-transform: uppercase; letter-spacing: 0.18em; color: var(--terra-deep); margin: 0 0 .75rem; }
.side-card ul { list-style: none; padding: 0; margin: 0; }
.side-card li { margin-bottom: .55rem; line-height: 1.4; }
.side-card a { color: var(--ink); border-bottom: 1px solid transparent; }
.side-card a:hover { border-color: var(--terra-deep); color: var(--terra-deep); }

/* Adsense placeholders */
.ad-slot {
  border: 1px dashed var(--rule); padding: .75rem 1rem; text-align: center;
  font-family: var(--mono); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.15em;
  background: rgba(217,205,182,0.18); border-radius: 3px; margin: 1.25rem 0;
}

/* Print box */
.print-cta {
  background: var(--ink); color: var(--paper);
  padding: 1.5rem 1.75rem; border-radius: 4px; margin: 1.5rem 0;
  display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap;
}
.print-cta strong { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; }
.print-cta p { margin: .25rem 0 0; font-family: var(--sans); font-size: 14px; opacity: .85; }
.print-cta .btn { background: var(--terra); border-color: var(--terra); }
.print-cta .btn:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }

/* Tag chips */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 0; }
.chip { font-family: var(--sans); font-size: 12px; padding: 4px 10px; border: 1px solid var(--rule); border-radius: 999px; color: var(--ink-soft); background: var(--cream); }
.chip a { color: inherit; border: none; }

/* Footer */
.site-footer {
  background: var(--ink); color: var(--paper);
  padding: 3.5rem 0 1.5rem; margin-top: 0;
  font-family: var(--sans); font-size: 14px;
}
.site-footer a { color: var(--paper); border-bottom: 1px solid rgba(247,241,230,0.25); }
.site-footer a:hover { color: var(--terra); border-bottom-color: var(--terra); }
.foot-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 2.5rem; margin-bottom: 2.5rem; }
.foot-grid h5 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.2em; color: var(--terra); margin: 0 0 1rem; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; }
.foot-grid li { margin-bottom: .6rem; }
.foot-bar { border-top: 1px solid rgba(247,241,230,0.18); padding-top: 1.5rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: 12px; color: rgba(247,241,230,0.7); }

/* Pagination */
.pager { display: flex; gap: .4rem; justify-content: center; margin-top: 2rem; font-family: var(--sans); font-size: 14px; flex-wrap: wrap; }
.pager a, .pager span {
  display: inline-block; padding: 8px 13px; border: 1px solid var(--rule); border-radius: 3px;
  color: var(--ink); background: var(--cream);
}
.pager a { border-bottom: 1px solid var(--rule); }
.pager a:hover { border-color: var(--ink); background: var(--paper); }
.pager .current { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pager .gap { border: none; background: transparent; color: var(--muted); }

/* Mobile */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero { padding: 2.5rem 0 2rem; }
  .hero-stats { position: static; margin-top: 1rem; display: inline-block; }
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .cat-strip { grid-template-columns: repeat(2, 1fr); }
  .entry-layout { grid-template-columns: 1fr; gap: 2rem; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .primary-nav { display: none; }
  .primary-nav.open { display: flex; flex-direction: column; width: 100%; padding-top: 1rem; }
  .nav-toggle { display: inline-block; }
  .site-header .container { position: relative; }
}

@media (max-width: 540px) {
  body { font-size: 17px; }
  .grid.cols-3, .grid.cols-4, .grid.cols-2 { grid-template-columns: 1fr; }
  .cat-strip { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .section { padding: 2.5rem 0; }
  .container, .narrow { width: calc(100% - 2rem); }
  .hero h1 { font-size: 2.1rem; }
  .entry-head h1 { font-size: 1.7rem; }
  .topbar { font-size: 11px; }
  .topbar .container { gap: .5rem; }
  .print-cta { padding: 1.1rem 1.2rem; }
}

/* Print */
@media print {
  .site-header, .site-footer, .topbar, .ad-slot, .sidebar, .hero-cta, .nav-toggle { display: none !important; }
  body { background: white; color: black; font-size: 12pt; }
  .entry-layout { grid-template-columns: 1fr; padding: 0; }
  a { color: black; border: none; }
}
