/* ============================================================
   TERMINAL-HYBRID THEME — Mono Chrome + Serif Prose
   
   Design DNA:
   - Mono for all UI chrome (nav, labels, dates, tags, sidebar)
   - Serif for body prose and headlines (reading surface)
   - Three-column layout: gutter | spine (~720px) | sidebar
   - Accent blue terminal style, with bento-inspired accent cards
   
   Status: Primary theme. Grid and editorial are legacy references.
   ============================================================ */

/* ── RESET / BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

/* ============================================================
   TERMINAL-HYBRID LIGHT
   ============================================================ */
[data-theme="terminal-hybrid"][data-scheme="light"] {
  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  --bg-primary: #D8D6D1;
  --bg-hero-card: #DEDDD8;
  --bg-surface: #EFEDEC;
  --bg-muted: #D6D4CF;
  --bg-code: #D6D4CF;

  --text-primary: #1C1C1E;
  --text-secondary: #4A4A4C;
  --text-tertiary: #626267;

  --accent: #0066CC;
  --accent-hover: #0052A3;
  --accent-muted: rgba(0,102,204,0.06);

  --border: #B9B9B9;
  --radius: 4px;
}

/* ============================================================
   TERMINAL-HYBRID DARK
   ============================================================ */
[data-theme="terminal-hybrid"][data-scheme="dark"] {
  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  --bg-primary: #0D0D0F;
  --bg-hero-card: #1C1C20;
  --bg-muted: #1C1C20;
  --bg-code: #1C1C20;

  --text-primary: #E8E6E3;
  --text-secondary: #9B9A97;
  --text-tertiary: #888785;

  --accent: #4DA6FF;
  --accent-hover: #6DB8FF;
  --accent-muted: rgba(77,166,255,0.08);

  --border: #2A2A2D;
  --radius: 4px;
}

/* ============================================================
   SHARED BASE (all themes)
   ============================================================ */
body {
  font-family: var(--font-serif);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ============================================================
   THEME TOGGLE — inline with header bar
   ============================================================ */
.theme-toggle {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.25rem 0.6rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--accent);
  cursor: pointer;
  transition: all 0.2s ease;
}
.theme-toggle:hover {
  background: var(--accent-muted);
}

/* ============================================================
   TOP BAR — terminal prompt navigation
   ============================================================ */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 2rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.3s ease;
}



.top-bar nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}
.top-bar nav .toggle-wrap {
  margin-left: 0.5rem;
  padding-left: 1.5rem;
  border-left: 1px solid var(--border);
}
.top-bar nav a {
  color: var(--text-tertiary);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  transition: color 0.2s ease;
}
.top-bar nav a:hover,
.top-bar nav a.active {
  color: var(--accent);
}

/* ============================================================
   LAYOUT — single-column content spine
   ============================================================ */
.page-layout {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 960px;
  margin: 0 auto;
}

.main-content {
  min-height: 100vh;
  background: var(--bg-primary);
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  padding: 2rem;
}

/* ============================================================
   HERO — bento-style full-width card with terminal prompt
   ============================================================ */
.hero-section {
  border-bottom: 1px solid var(--border);
  padding-bottom: 2rem;
}

.hero-card {
  background: var(--bg-hero-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.hero-card-inner {
  padding: 2rem 2.5rem;
}

.hero-card-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-tertiary);
  margin-bottom: 0.5rem;
}

.hero-card-subtitle {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 48ch;
  padding-top: 0.5rem;
}

.hero-card-tags {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-tertiary);
  margin-top: 0.5rem;
}

/* ============================================================
   ARTICLE LIST — terminal numbered rows with serif titles
   ============================================================ */
.section-header {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  padding: 1.5rem 0 1rem;
  border-bottom: 1px solid var(--border);
}

.article-list {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.article-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: start;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: all 0.15s ease;
}
.article-row:first-child { border-top: 1px solid var(--border); }

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

.row-body { min-width: 0; }

.row-date {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-tertiary);
  margin-bottom: 0.35rem;
}

.row-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
  transition: color 0.15s ease;
}

.row-summary {
  font-family: var(--font-serif);
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-top: 0.4rem;
}

.row-tags {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-tertiary);
  margin-top: 0.5rem;
}

/* ============================================================
   SIDEBAR — terminal style chrome
   ============================================================ */
.sidebar-block {
  margin-bottom: 2rem;
}

.sidebar-connect p {
  margin-top: 0.5rem;
}

.sidebar-block h3 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-tertiary);
  margin-bottom: 0.75rem;
}

.sidebar-block {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 1rem 0;
}
.mini-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.2s ease;
}

[data-theme="terminal-hybrid"][data-scheme="dark"] .mini-tag {
  background: var(--bg-muted);
  color: var(--text-secondary);
}
.mini-tag:hover,
.mini-tag:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}
.mini-tag:focus-visible {
  box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px var(--accent);
}
.mini-tag.active {
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================================
   FOOTER — two-column layout: copyright + privacy left, connect right
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-tertiary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
}


.site-footer-right {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.site-footer-left {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* ── MOBILE SPACING — tighter gaps below 600px ── */
@media (max-width: 600px) {
  .top-bar nav {
    gap: 1rem;
  }
  .top-bar nav .toggle-wrap {
    margin-left: 0.25rem;
    padding-left: 0.75rem;
  }
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .site-footer-left,
  .site-footer-right {
    gap: 0.35rem;
  }
}

/* ============================================================
   RESPONSIVE — adjust padding below 960px
   ============================================================ */
@media (max-width: 960px) {
  .main-content {
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 768px) {
  .top-bar { padding: 0.6rem 1rem; font-size: 0.72rem; }
  .main-content { padding: 1.5rem 1rem; }
  

  
  .row-title { font-size: 1.05rem !important; }
}

/* ============================================================
   VALUE LIST — We Value section
   ============================================================ */
.value-list {
  padding: 1rem 0;
}

.value-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}
.value-item:first-child {
  border-top: 1px solid var(--border);
}

.value-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  margin-bottom: 0.35rem;
}

.value-desc {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ── SECTION INTRO — prose description below section headers ── */
.section-intro {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-top: 0.35rem;
  padding-bottom: 0.5rem;
}

/* ── SECTION CONTENT — container mirroring value-list pattern ── */
.section-content {
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ── SECTION LINK — call-to-action link below section intros ── */
.section-link {
  font-family: var(--font-serif);
  font-size: 1rem;
  display: inline-block;
  margin-top: 0.35rem;
  padding-bottom: 0.5rem;
}

/* ============================================================
   REDUCED MOTION — honor user motion preferences (Finding #9)
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   ARTICLE BODY — prose typography for compiled Pandoc output
   
   Covers all standard Markdown-derived HTML elements alongside
   the terminal-hybrid theme's color tokens. No page-specific
   stylesheets needed for correct rendering (REQ-003).
   ============================================================ */

/* ── Headings ── */
.article-body {
  padding-top: 2rem;
}

.article-body h1,
.article-body h2,
.article-body h3 {
  font-family: var(--font-serif);
  color: var(--text-primary);
  margin-top: 1.5em;
  margin-bottom: 0.75em;
  line-height: 1.3;
}

.article-body h1 { font-size: 1.8rem; letter-spacing: -0.02em; }
.article-body h2 { font-size: 1.4rem; letter-spacing: -0.01em; }
.article-body h3 { font-size: 1.15rem; }

.article-body h4,
.article-body h5,
.article-body h6 {
  font-family: var(--font-serif);
  color: var(--text-secondary);
  margin-top: 1em;
  margin-bottom: 0.5em;
  line-height: 1.3;
}

.article-body h4 { font-size: 1.05rem; }
.article-body h5 { font-size: 1rem; }
.article-body h6 { font-size: 0.92rem; }

/* ── Paragraphs & prose ── */
.article-body p {
  margin-bottom: 1.25em;
  line-height: 1.7;
}

.article-body strong { font-weight: 600; }
.article-body em { font-style: italic; }

/* ============================================================
   GLOBAL LINKS — theme-aware, consistent across the entire site
   ============================================================ */
a:not(.top-bar nav a) {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 2px;
}
a:not(.top-bar nav a):hover {
  color: var(--accent-hover);
  text-decoration-color: var(--accent-hover);
}
a:not(.top-bar nav a):visited {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--border);
}
a:not(.top-bar nav a):visited:hover {
  color: var(--accent-hover);
  text-decoration-color: var(--accent-hover);
}
a:not(.top-bar nav a):active {
  color: var(--accent-hover);
}


/* ── Lists ── */
.article-body ul,
.article-body ol {
  margin-bottom: 1.25em;
  padding-left: 1.75em;
}

.article-body li {
  margin-bottom: 0.4em;
  line-height: 1.6;
}

.article-body ul > li::marker {
  color: var(--accent);
}

.article-body ol {
  counter-reset: list-item;
}
.article-body ol > li {
  counter-increment: list-item;
}

/* ── Code ── */
.article-body code,
.article-body pre {
  font-family: var(--font-mono);
  background: var(--bg-code);
  border-radius: var(--radius);
}

.article-body code {
  font-size: 0.88em;
  padding: 0.15em 0.4em;
}

.article-body pre {
  margin-bottom: 1.25em;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.6;
}

.article-body pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

/* ── Blockquotes ── */
.article-body blockquote {
  margin-bottom: 1.25em;
  border-left: 3px solid var(--accent);
  padding: 0.5em 1em;
  color: var(--text-secondary);
  font-style: italic;
}

.article-body blockquote p:last-child {
  margin-bottom: 0;
}

/* ── Tables ── */
.article-body table {
  width: 100%;
  margin-bottom: 1.25em;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.article-body th,
.article-body td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.article-body th {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.article-body td {
  color: var(--text-primary);
}

/* ── Horizontal rules ── */
.article-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5em 0;
}

/* ── Images ── */
.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin-bottom: 1.25em;
}

/* ── Article Wrapper — centered spine without grid ── */
.article-wrapper {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem;
}

/* ============================================================
   CONTACT PAGE — value-list with aligned bullets
   ============================================================ */
.value-list ul {
  list-style-position: inside;
  padding: 0;
  margin: 0;
}

.value-list ul li::marker {
  color: var(--text-secondary);
}
