/*
Theme Name: The Stoic Runner
Theme URI: https://thestoicrunner.com
Author: Ole Siig Christensen
Description: A minimal, typographic theme for The Stoic Runner — running, philosophy, and the examined life.
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: stoic-runner
Tags: minimal, blog, typography, custom-logo, featured-images
*/

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

:root {
  --off-white: #F7F4F0;
  --warm-white: #FDFBF8;
  --ink: #1A1814;
  --ink-light: #4A453E;
  --ink-muted: #8A847C;
  --accent: #C4522A;
  --accent-light: #E8795A;
  --rule: #E0DCD6;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'DM Sans', system-ui, sans-serif;
  --max-width: 1200px;
  --gutter: 4rem;
}

html { scroll-behavior: smooth; }

body {
  background: var(--warm-white);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

/* ── READING PROGRESS BAR ───────────────────────────────── */
#progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 1000;
  transition: width 0.1s linear;
}

/* ── NAVIGATION ─────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem var(--gutter);
  background: rgba(253, 251, 248, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

.site-header.scrolled { border-bottom-color: var(--rule); }

.site-branding a {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}

.main-navigation ul {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.main-navigation a {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-light);
  text-decoration: none;
  transition: color 0.2s;
}

.main-navigation a:hover { color: var(--accent); }

/* ── LAYOUT ─────────────────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

section { padding: 7rem 0; }

.section-header {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.section-label {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 300;
  letter-spacing: -0.02em;
}

.section-rule {
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn-primary {
  display: inline-block;
  padding: 0.85rem 2rem;
  background: var(--ink);
  color: var(--warm-white);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
}

.btn-primary:hover { background: var(--accent); transform: translateY(-1px); }

.btn-ghost {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-light);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}

.btn-ghost:hover { color: var(--accent); border-color: var(--accent); }

.btn-accent {
  display: inline-block;
  padding: 0.85rem 2rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
}

.btn-accent:hover { background: var(--accent-light); transform: translateY(-1px); }

/* ── HERO ────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding-top: 5rem;
  overflow: hidden;
}

.hero-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6rem 5rem 6rem 8rem;
  animation: fadeUp 1s ease both;
}

.hero-eyebrow {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(3.5rem, 6vw, 6rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
}

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

.hero-desc {
  font-size: 1rem;
  color: var(--ink-light);
  line-height: 1.75;
  max-width: 38ch;
  margin-bottom: 3rem;
}

.hero-actions {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.hero-visual {
  position: relative;
  overflow: hidden;
  animation: fadeIn 1.4s ease both;
}

.hero-visual img,
.hero-img-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-img-placeholder {
  background: linear-gradient(160deg, #E8E2D9 0%, #D4C9BA 50%, #C2B49F 100%);
  display: flex;
  align-items: flex-end;
  padding: 3rem;
}

.hero-quote {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-style: italic;
  font-weight: 300;
  color: var(--ink-light);
  line-height: 1.4;
  max-width: 28ch;
  border-left: 2px solid var(--accent);
  padding-left: 1.5rem;
}

.hero-quote cite {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 0.75rem;
}

/* ── BOOK STRIP ─────────────────────────────────────────── */
.book-strip {
  background: var(--ink);
  color: var(--off-white);
  padding: 5rem 0;
}

.book-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 4rem;
  align-items: center;
}

.book-cover {
  width: 160px;
  height: 230px;
  position: relative;
  box-shadow: 8px 8px 32px rgba(0,0,0,0.4);
  flex-shrink: 0;
}

.book-cover img { width: 100%; height: 100%; object-fit: cover; }

.book-cover-placeholder {
  width: 160px;
  height: 230px;
  background: linear-gradient(145deg, #3A342C, #2A241C);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  position: relative;
  box-shadow: 8px 8px 32px rgba(0,0,0,0.4);
}

.book-cover-placeholder::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 6px;
  background: var(--accent);
}

.book-cover-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.3;
  color: rgba(255,255,255,0.9);
}

.book-cover-sub {
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-top: 0.5rem;
}

.book-tag {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 1rem;
}

.book-title {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-weight: 300;
  line-height: 1.15;
  margin-bottom: 1.25rem;
}

.book-desc {
  font-size: 0.95rem;
  color: rgba(247, 244, 240, 0.65);
  line-height: 1.75;
  max-width: 48ch;
  margin-bottom: 2rem;
}

.book-principles {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  border-left: 1px solid rgba(255,255,255,0.1);
  padding-left: 4rem;
}

.principle {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.principle-num {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 300;
  color: rgba(255,255,255,0.12);
  line-height: 1;
  min-width: 2.5rem;
}

.principle-text {
  font-size: 0.8rem;
  color: rgba(247, 244, 240, 0.5);
  line-height: 1.6;
  font-style: italic;
}

.principle-text strong {
  display: block;
  font-style: normal;
  font-weight: 500;
  color: rgba(247, 244, 240, 0.75);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

/* ── ARTICLES GRID ──────────────────────────────────────── */
.articles-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2px;
}

.article-card {
  background: var(--off-white);
  padding: 2.5rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: background 0.25s;
}

.article-card:hover { background: #EDE9E3; }

.article-card.featured {
  grid-row: span 2;
  padding: 3.5rem;
  background: var(--ink);
  color: var(--off-white);
}

.article-card.featured:hover { background: #2A2420; }

.article-tag {
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.article-card.featured .article-tag { color: var(--accent-light); }

.article-title {
  font-family: var(--font-serif);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}

.article-card.featured .article-title { font-size: 2rem; margin-bottom: 1.5rem; }
.article-card:not(.featured) .article-title { font-size: 1.3rem; }

.article-excerpt {
  font-size: 0.875rem;
  color: var(--ink-light);
  line-height: 1.7;
  flex: 1;
  margin-bottom: 1.5rem;
}

.article-card.featured .article-excerpt {
  color: rgba(247, 244, 240, 0.6);
  font-size: 0.95rem;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.article-card.featured .article-meta { border-top-color: rgba(255,255,255,0.1); }

.article-date {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.article-card.featured .article-date { color: rgba(247, 244, 240, 0.35); }

.article-read {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}

/* ── SINGLE POST ─────────────────────────────────────────── */
.post-header {
  padding: 10rem 0 5rem;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.post-category {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.post-title {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.post-byline {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.post-featured-image {
  margin-bottom: 5rem;
  max-height: 60vh;
  overflow: hidden;
}

.post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 2rem 6rem;
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--ink-light);
}

.post-content p { margin-bottom: 1.6rem; }
.post-content h2 {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 300;
  color: var(--ink);
  margin: 3rem 0 1.25rem;
}
.post-content h3 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 400;
  font-style: italic;
  color: var(--ink);
  margin: 2rem 0 1rem;
}
.post-content blockquote {
  border-left: 2px solid var(--accent);
  padding: 1rem 0 1rem 2rem;
  margin: 2.5rem 0;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-style: italic;
  color: var(--ink);
  line-height: 1.5;
}

/* ── ABOUT ──────────────────────────────────────────────── */
.about-section { background: var(--off-white); }

.about-inner {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 8rem;
  align-items: center;
}

.about-image-wrap { position: relative; }

.about-image-wrap img,
.about-img-placeholder {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
}

.about-img-placeholder {
  background: linear-gradient(170deg, #D4C9BA, #B8A99A);
  position: relative;
}

.about-image-wrap::after {
  content: '';
  position: absolute;
  bottom: -12px; right: -12px;
  width: 60%;
  height: 60%;
  border: 2px solid var(--accent);
  pointer-events: none;
  z-index: 0;
}

.about-stat {
  position: absolute;
  bottom: -1.5rem;
  left: -1.5rem;
  background: var(--warm-white);
  padding: 1.25rem 1.75rem;
  border-left: 2px solid var(--accent);
  z-index: 2;
}

.about-stat-num {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-weight: 300;
  line-height: 1;
  color: var(--ink);
}

.about-stat-label {
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 0.25rem;
}

.about-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3vw, 2.8rem);
  font-weight: 300;
  line-height: 1.15;
  margin-bottom: 1.75rem;
  letter-spacing: -0.02em;
}

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

.about-body {
  font-size: 0.95rem;
  color: var(--ink-light);
  line-height: 1.85;
  margin-bottom: 1.25rem;
}

.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
}

.tag {
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-light);
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--rule);
}

/* ── NEWSLETTER ─────────────────────────────────────────── */
.newsletter-section {
  background: var(--warm-white);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 6rem 0;
  text-align: center;
}

.newsletter-eyebrow {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.newsletter-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 1.25rem;
}

.newsletter-desc {
  font-size: 0.95rem;
  color: var(--ink-light);
  max-width: 44ch;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

.newsletter-form {
  display: flex;
  max-width: 460px;
  margin: 0 auto;
}

.newsletter-form input[type="email"] {
  flex: 1;
  padding: 0.9rem 1.25rem;
  border: 1px solid var(--rule);
  border-right: none;
  background: #fff;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}

.newsletter-form input[type="email"]:focus { border-color: var(--ink); }

.newsletter-form input[type="submit"] {
  padding: 0.9rem 1.75rem;
  background: var(--ink);
  color: var(--warm-white);
  border: none;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
}

.newsletter-form input[type="submit"]:hover { background: var(--accent); }

.substack-wrap {
  display: flex;
  justify-content: center;
  margin: 0 auto 1rem;
}

.substack-wrap iframe {
  max-width: 100%;
  filter: hue-rotate(220deg) saturate(0.35) brightness(1.08);
}

.newsletter-note {
  font-size: 0.7rem;
  color: var(--ink-muted);
  margin-top: 1rem;
}

/* ── FOOTER ─────────────────────────────────────────────── */
.site-footer {
  padding: 4rem 0 3rem;
  border-top: 1px solid var(--rule);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-logo {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  display: block;
  margin-bottom: 1rem;
}

.footer-tagline {
  font-size: 0.8rem;
  color: var(--ink-muted);
  line-height: 1.7;
  max-width: 28ch;
}

.footer-col-title {
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 1.25rem;
}

.footer-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-nav a {
  font-size: 0.82rem;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-nav a:hover { color: var(--accent); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
  font-size: 0.7rem;
  color: var(--ink-muted);
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root { --gutter: 2.5rem; }
  .book-inner { grid-template-columns: auto 1fr; }
  .book-principles { display: none; }
}

@media (max-width: 768px) {
  :root { --gutter: 1.5rem; }
  .site-header { padding: 1.25rem 1.5rem; }
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-text { padding: 7rem 1.5rem 3rem; }
  .hero-visual { height: 50vw; }
  .book-inner { grid-template-columns: 1fr; }
  .articles-grid { grid-template-columns: 1fr; }
  .article-card.featured { grid-row: span 1; }
  .about-inner { grid-template-columns: 1fr; gap: 3rem; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
