/* ═══════════════════════════════════════════════════════════════════════════
   CyborgCamp — Static Site Styles
   Typeface: Space Grotesk (Google Fonts)
   Palette: sage green, forest, warm white, ink-black
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Tokens ────────────────────────────────────────────────────────────── */
:root {
  /* Greens */
  --bg-topo:       #7aaa89;   /* topographic background */
  --nav-green:     #446e56;   /* navigation bar */
  --nav-green-dk:  #2d5440;   /* nav hover */
  --accent:        #2d6843;   /* links, buttons */
  --accent-hover:  #1a4429;   /* link hover */
  --border-green:  #b8d9c0;   /* subtle borders */
  --tag-bg:        #d4ecda;   /* tag chips */
  --tag-text:      #2a5c3a;   /* tag text */

  /* Surfaces */
  --surface:       #ffffff;   /* main content area */
  --surface-side:  #f2f8f4;   /* sidebar */
  --surface-foot:  #3a5c49;   /* footer */

  /* Text */
  --ink:           #182820;   /* body text */
  --ink-mid:       #3d5748;   /* secondary text */
  --ink-mute:      #6b8878;   /* dates, meta */

  /* Type */
  --font: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Layout */
  --max-w:         1080px;
  --sidebar-w:     256px;
  --gap:           36px;
  --radius:        6px;
}

/* ── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
img, svg { display: block; max-width: 100%; }
ul { list-style: none; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

/* ── Topographic background ─────────────────────────────────────────────
   Overlapping elliptical gradients simulate contour lines —
   the same organic, landscape-mapped feeling as the original site.      */
body {
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--bg-topo);
  min-height: 100vh;
}

.topo-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: var(--bg-topo);
  background-image:
    repeating-radial-gradient(ellipse at 18% 38%, transparent 0, transparent 46px, rgba(45, 90, 55, 0.28) 47px, transparent 48px),
    repeating-radial-gradient(ellipse at 72% 68%, transparent 0, transparent 34px, rgba(45, 90, 55, 0.22) 35px, transparent 36px),
    repeating-radial-gradient(ellipse at 44% 12%, transparent 0, transparent 58px, rgba(45, 90, 55, 0.20) 59px, transparent 60px),
    repeating-radial-gradient(ellipse at 82% 22%, transparent 0, transparent 40px, rgba(45, 90, 55, 0.24) 41px, transparent 42px),
    repeating-radial-gradient(ellipse at 30% 80%, transparent 0, transparent 52px, rgba(45, 90, 55, 0.18) 53px, transparent 54px),
    repeating-radial-gradient(ellipse at 60% 45%, transparent 0, transparent 28px, rgba(45, 90, 55, 0.16) 29px, transparent 30px);
}

/* ── Page shell ─────────────────────────────────────────────────────────── */
.page-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--surface);
  border-bottom: 2px solid var(--border-green);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 18px 20px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 18px;
  text-decoration: none;
  color: inherit;
}

.logo-mark {
  width: 46px;
  height: auto;
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.logo-name {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink);
  line-height: 1;
}

.logo-space {
  display: inline-block;
  width: 0.35em;
}

/* Header image variant (when header_image is set in site.yaml) */
.site-logo--image {
  display: block;
  padding: 0;
}

.header-img {
  display: block;
  max-height: 120px;   /* adjust to taste */
  width: auto;
  max-width: 100%;
}

.logo-tagline {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--ink-mute);
  letter-spacing: 0.01em;
}

/* ── Navigation ──────────────────────────────────────────────────────────── */
.site-nav {
  background: var(--nav-green);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-wrap: wrap;
}

.nav-link {
  display: block;
  color: #e8f2ec;
  text-decoration: none;
  padding: 10px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: background 0.15s;
}

.nav-link:hover,
.nav-link.is-active {
  background: var(--nav-green-dk);
  color: #ffffff;
}

/* ── Body layout ─────────────────────────────────────────────────────────── */
.body-wrap {
  flex: 1;
  padding: 28px 20px;
}

.body-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr var(--sidebar-w);
  gap: var(--gap);
  align-items: start;
}

/* ── Main content column ─────────────────────────────────────────────────── */
.main-col {
  background: var(--surface);
  padding: 28px 32px 36px;
  border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* ── Sidebar column ──────────────────────────────────────────────────────── */
.sidebar-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.widget {
  background: var(--surface-side);
  border: 1px solid var(--border-green);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.widget-heading {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mid);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-green);
}

.widget-body {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--ink-mid);
  margin-bottom: 10px;
}

.widget-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.widget-link:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}

.sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  line-height: 1.4;
}

.sidebar-link:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}

.sidebar-date {
  font-size: 0.72rem;
  color: var(--ink-mute);
}

/* ── Post list (homepage) ────────────────────────────────────────────────── */
.post-featured {
  padding-bottom: 24px;
}

.post-card {
  padding: 24px 0;
}

.post-header {
  margin-bottom: 10px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.post-date {
  font-size: 0.78rem;
  color: var(--ink-mute);
  font-weight: 500;
}

.post-byline {
  font-size: 0.78rem;
  color: var(--ink-mute);
}

.post-byline::before {
  content: "·";
  margin-right: 10px;
  opacity: 0.5;
}

.post-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0;
}

.post-title a {
  color: var(--ink);
  text-decoration: none;
}

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

.featured-title {
  font-size: 1.5rem;
}

.post-excerpt {
  font-size: 0.93rem;
  line-height: 1.7;
  color: var(--ink-mid);
  margin: 10px 0 14px;
  max-width: 60ch;
}

.post-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

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

.archive-nudge {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-green);
  font-size: 0.875rem;
}

.archive-nudge a {
  font-weight: 600;
  text-decoration: none;
}

.archive-nudge a:hover {
  text-decoration: underline;
}

/* ── Tags ─────────────────────────────────────────────────────────────────── */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: 0.03em;
}

.tag-sm {
  font-size: 0.65rem;
  padding: 2px 7px;
}

.read-more {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  margin-left: auto;
}

.read-more:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}

/* ── Single post ─────────────────────────────────────────────────────────── */
.single-post-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-green);
}

.single-title {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
  margin: 10px 0 14px;
}

/* ── Post body (rendered markdown) ──────────────────────────────────────── */
.post-body {
  font-size: 0.97rem;
  line-height: 1.78;
  color: var(--ink);
  max-width: 68ch;
}

.post-body h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 2em 0 0.6em;
  color: var(--ink);
}

.post-body h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 1.75em 0 0.5em;
  color: var(--ink);
}

.post-body p {
  margin-bottom: 1.2em;
}

.post-body ul, .post-body ol {
  padding-left: 1.5em;
  margin-bottom: 1.2em;
  list-style: revert;
}

.post-body li {
  margin-bottom: 0.4em;
}

.post-body a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-body img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1.5em 0;
  border: 1px solid var(--border-green);
}

.post-body .image-caption {
  font-size: 0.78rem;
  color: var(--ink-mute);
  text-align: center;
  margin-top: -1em;
  margin-bottom: 1.5em;
}

.post-body blockquote {
  border-left: 3px solid var(--border-green);
  padding-left: 1em;
  margin: 1.5em 0;
  color: var(--ink-mid);
  font-style: italic;
}

.post-body code {
  font-size: 0.88em;
  background: #f0f7f2;
  padding: 2px 5px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
}

/* ── Video embeds ─────────────────────────────────────────────────────────── */
.video-embed {
  margin: 1.8em 0;
  background: #111;
  border-radius: 4px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.video-embed iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: none;
}

/* ── Post navigation ─────────────────────────────────────────────────────── */
.post-nav {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-green);
}

.post-nav-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.post-nav-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  max-width: 45%;
}

.next-post { text-align: right; margin-left: auto; }

.nav-direction {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-mute);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-post-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.35;
}

.post-nav-link:hover .nav-post-title {
  text-decoration: underline;
  color: var(--accent-hover);
}

/* ── Page header (archive, about, history) ───────────────────────────────── */
.page-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-green);
}

.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.page-subtitle {
  font-size: 0.9rem;
  color: var(--ink-mid);
}

/* ── Archive ─────────────────────────────────────────────────────────────── */
.archive-year {
  margin-bottom: 32px;
}

.archive-year-heading {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-mute);
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-green);
}

.archive-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.archive-entry {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid #eef4f0;
  flex-wrap: wrap;
}

.archive-date {
  font-size: 0.78rem;
  color: var(--ink-mute);
  min-width: 110px;
  flex-shrink: 0;
}

.archive-title {
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  flex: 1;
}

.archive-title:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}

.inline-tags {
  flex-shrink: 0;
}

/* ── Prose pages (about, history) ────────────────────────────────────────── */
.prose {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--ink);
  max-width: 64ch;
}

.prose h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 2em 0 0.6em;
  color: var(--ink);
}

.prose h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 1.5em 0 0.4em;
}

.prose p {
  margin-bottom: 1.1em;
}

.prose ul {
  padding-left: 1.5em;
  list-style: disc;
  margin-bottom: 1.2em;
}

.prose li {
  margin-bottom: 0.4em;
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Timeline (history page) ─────────────────────────────────────────────── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-entry {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-green);
}

.timeline-entry:last-child {
  border-bottom: none;
}

.timeline-year {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-mute);
  padding-top: 4px;
  letter-spacing: 0.04em;
}

.timeline-content h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--ink);
}

.timeline-content p {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--ink-mid);
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty-state {
  color: var(--ink-mute);
  font-size: 0.9rem;
  padding: 24px 0;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--surface-foot);
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 20px;
  font-size: 0.8rem;
  color: #a8c8b4;
  text-align: center;
  letter-spacing: 0.02em;
}

.footer-inner a {
  color: #c8e4d0;
  text-decoration: none;
}

.footer-inner a:hover {
  text-decoration: underline;
  color: #ffffff;
}

.footer-mark {
  margin-right: 8px;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .body-inner {
    grid-template-columns: 1fr;
  }

  .sidebar-col {
    /* On mobile, sidebar goes below main content */
    order: 2;
  }

  .main-col {
    padding: 20px 18px 28px;
  }

  .logo-name {
    font-size: 1.2rem;
  }

  .logo-tagline {
    display: none;
  }

  .single-title {
    font-size: 1.4rem;
  }

  .post-nav-inner {
    flex-direction: column;
  }

  .next-post {
    text-align: left;
    margin-left: 0;
  }

  .timeline-entry {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .archive-entry {
    flex-direction: column;
    gap: 4px;
  }

  .archive-date {
    min-width: unset;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

@media print {
  .topo-canvas, .site-nav, .sidebar-col, .site-footer, .post-nav { display: none; }
  .body-inner { grid-template-columns: 1fr; }
  .main-col { box-shadow: none; border: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Video Archive page
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Year filter bar ─────────────────────────────────────────────────────── */
.year-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.filter-btn {
  background: var(--surface);
  border: 1px solid var(--border-green);
  color: var(--ink-mid);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.filter-btn:hover {
  background: var(--tag-bg);
  border-color: var(--accent);
  color: var(--accent);
}

.filter-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Video grid ──────────────────────────────────────────────────────────── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

/* ── Video card ──────────────────────────────────────────────────────────── */
.vcard {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border-green);
  border-radius: var(--radius);
  overflow: hidden;
}

/* Thumbnail area — fixed 16:9 ratio */
.vcard-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #1a2d21;
  overflow: hidden;
}

.vcard-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}

.vcard-thumb:hover .vcard-img {
  transform: scale(1.03);
}

/* Fallback div when thumbnail 404s */
.vcard-img-fallback {
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  background: #2d4a38;
}

/* Play button overlay */
.vcard-play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}

.vcard-thumb:hover .vcard-play-btn {
  opacity: 1;
}

/* Card info area */
.vcard-info {
  padding: 12px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.vcard-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.vcard-event {
  font-size: 0.72rem;
  color: var(--ink-mute);
}

.vcard-title {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}

.vcard-desc {
  font-size: 0.78rem;
  color: var(--ink-mid);
  line-height: 1.55;
  margin: 0;
}

/* Sidebar year buttons */
.sidebar-year-btn {
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.sidebar-year-btn:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}

.year-count {
  color: var(--ink-mute);
  font-weight: 400;
}

.video-empty-msg {
  color: var(--ink-mute);
  font-size: 0.9rem;
  padding: 20px 0;
}

/* Responsive: 1 column on narrow screens */
@media (max-width: 580px) {
  .video-grid {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   About page
   ═══════════════════════════════════════════════════════════════════════════ */

/* Three-pillar grid */
.about-pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 28px 0 32px;
}

.pillar {
  background: var(--surface-side);
  border: 1px solid var(--border-green);
  border-radius: var(--radius);
  padding: 20px 22px;
}

.pillar-heading {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
}

.pillar p {
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--ink-mid);
  margin: 0;
}

/* Chris Dancy quote */
.about-quote {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 20px;
  margin: 20px 0 28px;
}

.about-quote p {
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--ink-mid);
  font-style: italic;
  margin-bottom: 0.75em;
}

.about-quote cite {
  display: block;
  font-size: 0.8rem;
  font-style: normal;
  font-weight: 600;
  color: var(--ink-mute);
  margin-top: 12px;
}

/* Past CyborgCamps timeline */
.about-timeline {
  margin: 0 0 32px;
  border-top: 1px solid var(--border-green);
}

.at-entry {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-green);
}

.at-year {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-mute);
  padding-top: 2px;
  letter-spacing: 0.04em;
}

.at-events ul {
  list-style: disc;
  padding-left: 1.2em;
  margin: 0;
}

.at-events li {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--ink-mid);
  margin-bottom: 6px;
}

/* Responsive */
@media (max-width: 640px) {
  .about-pillars {
    grid-template-columns: 1fr;
  }

  .at-entry {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* About page photos */
.about-photo {
  margin: 24px 0;
}

.about-photo img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border-green);
  display: block;
}

.about-photo figcaption {
  font-size: 0.78rem;
  color: var(--ink-mute);
  margin-top: 8px;
  padding-left: 2px;
}

/* If the image file isn't there yet, show a labelled placeholder */
.about-photo.photo-missing {
  background: var(--surface-side);
  border: 1px dashed var(--border-green);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-mute);
  font-size: 0.82rem;
}
