/* ==========================================================================
   Tyler Ziegler // Noctuary & Personal Musings
   Dark Gothic Theme - Atmospheric, Ornate, & Literary
   ========================================================================== */

:root {
  /* Dark Gothic Palette */
  --bg-void: #060608;
  --bg-primary: #0a0a0e;
  --bg-secondary: #101017;
  --bg-surface: #161620;
  --bg-card: rgba(16, 16, 23, 0.85);
  --bg-glass: rgba(10, 10, 14, 0.92);

  /* Gothic Accents: Crimson, Antique Gold, Candle Amber */
  --crimson: #be123c;
  --crimson-dark: #881337;
  --crimson-glow: rgba(190, 18, 60, 0.35);
  
  --gold: #c5a059;
  --gold-light: #e6cb91;
  --gold-dim: #785f2e;
  --gold-glow: rgba(197, 160, 89, 0.25);
  
  --candle: #f59e0b;
  --candle-glow: rgba(245, 158, 11, 0.2);

  /* Typography: Parchment, Bone, Ash */
  --text-parchment: #f3efe6;
  --text-primary: #ece5d8;
  --text-secondary: #beb4a2;
  --text-muted: #7a7364;

  /* Borders & Ornaments */
  --border-subtle: rgba(197, 160, 89, 0.12);
  --border-ornate: rgba(197, 160, 89, 0.35);
  --border-crimson: rgba(190, 18, 60, 0.3);

  /* Typography Families */
  --font-display: 'Cinzel', serif;
  --font-ornate: 'Cinzel Decorative', 'Cinzel', serif;
  --font-prose: 'Cormorant Garamond', Georgia, serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing */
  --max-width: 1140px;
  --max-prose: 70ch;
  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 12px;

  --transition-smooth: 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Base Reset & Atmosphere */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 17px;
  scroll-behavior: smooth;
  background-color: var(--bg-void);
  color: var(--text-primary);
}

body {
  font-family: var(--font-prose);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.8;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(136, 19, 55, 0.15), transparent 70%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(197, 160, 89, 0.05), transparent 70%),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.008) 1px, transparent 1px),
    linear-gradient(to right, rgba(255, 255, 255, 0.008) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 48px 48px, 48px 48px;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all var(--transition-smooth);
}

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

.skip-link {
  position: absolute;
  top: -100px;
  left: 20px;
  background: var(--gold);
  color: var(--bg-void);
  padding: 8px 16px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  z-index: 9999;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 10px; }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   Atmospheric Gothic Top Banner / Horizon Ribbon
   ========================================================================== */
.telemetry-bar {
  background: linear-gradient(180deg, #050507 0%, #0a0a0f 100%);
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.45rem 1.5rem;
  position: relative;
  z-index: 50;
}

.telemetry-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.telemetry-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-beacon {
  width: 6px;
  height: 6px;
  background-color: var(--crimson);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--crimson);
  display: inline-block;
  animation: candleFlicker 3s infinite ease-in-out;
}

@keyframes candleFlicker {
  0%, 100% { opacity: 0.9; transform: scale(1); filter: drop-shadow(0 0 6px var(--crimson)); }
  35% { opacity: 0.5; transform: scale(0.85); filter: drop-shadow(0 0 2px var(--crimson)); }
  70% { opacity: 1; transform: scale(1.1); filter: drop-shadow(0 0 8px var(--crimson)); }
}

.telemetry-label {
  color: var(--gold-dim);
}

.telemetry-value {
  color: var(--text-secondary);
}

.highlight-cyan {
  color: var(--gold-light) !important;
}

.highlight-green {
  color: var(--crimson) !important;
}

.telemetry-divider {
  color: var(--gold-dim);
  opacity: 0.4;
  display: none;
}
@media (min-width: 768px) {
  .telemetry-divider { display: inline; }
}

/* ==========================================================================
   Header & Gothic Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  transition: all var(--transition-smooth);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo-wrap {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 10px var(--gold-glow));
  transition: transform 0.4s ease, filter 0.4s ease;
}

.brand-link:hover .brand-logo-wrap {
  transform: rotate(5deg) scale(1.04);
  filter: drop-shadow(0 0 14px var(--crimson-glow));
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  color: var(--text-parchment);
  line-height: 1.1;
  text-transform: uppercase;
}

.brand-role {
  font-family: var(--font-display);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  color: var(--gold);
  text-transform: uppercase;
}

.desktop-nav {
  display: none;
}
@media (min-width: 860px) {
  .desktop-nav { display: block; }
}

.nav-list {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 2rem;
}

.nav-link {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  position: relative;
  padding: 0.4rem 0;
}

.nav-link:hover,
.nav-link.active {
  color: var(--gold-light);
}

.nav-link.active::after {
  content: '❦';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: var(--crimson);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* Gothic Search Trigger Button */
.search-trigger-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all var(--transition-smooth);
}

.search-trigger-btn:hover {
  border-color: var(--border-ornate);
  color: var(--gold-light);
  box-shadow: 0 0 12px var(--gold-glow);
}

.nav-icon {
  width: 14px;
  height: 14px;
  color: var(--gold);
}

.kbd-shortcut {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  background: var(--bg-void);
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  padding: 0.1rem 0.35rem;
  color: var(--text-muted);
}

.theme-toggle-btn {
  display: none; /* In true pure dark gothic theme, always dark atmospheric */
}

/* Mobile Drawer */
.mobile-menu-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
}
@media (min-width: 860px) {
  .mobile-menu-btn { display: none; }
}

.hamburger-bar {
  width: 100%;
  height: 2px;
  background-color: var(--text-primary);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.mobile-menu-btn.active .hamburger-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-menu-btn.active .hamburger-bar:nth-child(2) { opacity: 0; }
.mobile-menu-btn.active .hamburger-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-drawer {
  display: none;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-ornate);
  padding: 2rem 1.5rem;
}
.mobile-drawer.active { display: block; }

.mobile-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.mobile-nav-link {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-parchment);
  display: block;
}
.mobile-nav-link:hover { color: var(--gold); }

/* Reading Progress Bar (Crimson Candle Thread) */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg, var(--crimson), var(--gold));
  box-shadow: 0 0 8px var(--crimson-glow);
  z-index: 100;
  transition: width 0.1s ease-out;
}

/* ==========================================================================
   Homepage - Gothic Sanctuary Hero Section
   ========================================================================== */
.hero-section {
  padding: 4.5rem 0 3.5rem 0;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3.5rem;
  align-items: center;
}
@media (min-width: 960px) {
  .hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(136, 19, 55, 0.2);
  border: 1px solid var(--border-crimson);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.95rem;
  margin-bottom: 1.75rem;
}

.hero-badge-text {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-light);
}

.hero-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--text-parchment);
  margin-bottom: 1.35rem;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}
@media (min-width: 768px) {
  .hero-title { font-size: 3.4rem; }
}

.gradient-text {
  background: linear-gradient(135deg, var(--text-parchment) 0%, var(--gold-light) 60%, var(--crimson) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.25rem;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 2.25rem;
  max-width: 58ch;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 2.75rem;
}

/* Gothic Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.8rem 1.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-smooth);
}

.btn-primary {
  background: linear-gradient(135deg, #1f121a 0%, #3b0717 50%, #1f121a 100%);
  color: var(--text-parchment);
  border: 1px solid var(--border-crimson);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5), inset 0 0 12px rgba(190, 18, 60, 0.25);
}

.btn-primary:hover {
  border-color: var(--crimson);
  box-shadow: 0 6px 24px var(--crimson-glow), inset 0 0 16px rgba(190, 18, 60, 0.4);
  transform: translateY(-2px);
  color: #ffffff;
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  border-color: var(--border-ornate);
  color: var(--gold-light);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-ornate);
  padding: 0.85rem 2rem;
}
.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold-light);
  box-shadow: 0 0 16px var(--gold-glow);
}

/* Ornate Stats / Credo Row */
.hero-stats-row {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border-subtle);
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.05em;
}

.stat-label {
  font-family: var(--font-display);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.stat-divider {
  color: var(--gold-dim);
  opacity: 0.4;
  font-size: 0.85rem;
}

/* Gothic Study Visual Frame */
.tech-hud-frame {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border-ornate);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7), 0 0 24px rgba(197, 160, 89, 0.1);
}

.hud-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--gold);
  border-style: solid;
  pointer-events: none;
}
.hud-top-left { top: -2px; left: -2px; border-width: 2px 0 0 2px; }
.hud-top-right { top: -2px; right: -2px; border-width: 2px 2px 0 0; }
.hud-bottom-left { bottom: -2px; left: -2px; border-width: 0 0 2px 2px; }
.hud-bottom-right { bottom: -2px; right: -2px; border-width: 0 2px 2px 0; }

.hud-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  padding: 0.4rem 0.5rem 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  text-transform: uppercase;
}

.hud-title {
  color: var(--gold-light);
}

.hud-code {
  color: var(--crimson);
}

.hud-image-wrapper {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 0.75rem 0;
  border: 1px solid var(--border-subtle);
}

.hud-hero-img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  filter: contrast(1.05) brightness(0.92);
  transition: transform 0.6s ease, filter 0.6s ease;
}

.hud-image-wrapper:hover .hud-hero-img {
  transform: scale(1.02);
  filter: contrast(1.1) brightness(0.98);
}

.hud-overlay-tag {
  position: absolute;
  bottom: 14px;
  left: 14px;
  background: rgba(6, 6, 8, 0.9);
  border: 1px solid var(--border-ornate);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--text-parchment);
  text-transform: uppercase;
}

.overlay-icon {
  color: var(--crimson);
}

.hud-footer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding: 0.5rem 0.25rem 0.25rem 0.25rem;
}

.hud-metric {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-family: var(--font-display);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.metric-val {
  font-family: var(--font-prose);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ==========================================================================
   Section Headers & Gothic Pillars
   ========================================================================== */
.section-header {
  margin-bottom: 2.25rem;
  text-align: center;
}

.section-tag {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: 0.5rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-parchment);
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '❖';
  display: block;
  font-size: 0.85rem;
  color: var(--crimson);
  margin-top: 0.35rem;
}

/* Disciplines / Folios Grid */
.disciplines-section {
  padding: 3.5rem 0;
}

.disciplines-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 640px) {
  .disciplines-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .disciplines-grid { grid-template-columns: repeat(3, 1fr); }
  .disciplines-grid > .discipline-card:nth-child(4) { grid-column: span 1; }
  .disciplines-grid > .discipline-card:nth-child(5) { grid-column: span 2; }
}

.discipline-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: all var(--transition-smooth);
}

.discipline-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-ornate);
  background: var(--bg-surface);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 20px var(--gold-glow);
}

.discipline-icon-box {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  filter: sepia(0.4);
}

.discipline-tag {
  font-family: var(--font-display);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}

.discipline-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-parchment);
  margin-bottom: 0.65rem;
}

.discipline-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.discipline-arrow {
  align-self: flex-end;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--gold);
  transition: transform 0.2s ease;
}
.discipline-card:hover .discipline-arrow { transform: translateX(5px); color: var(--crimson); }

/* ==========================================================================
   Featured Spotlight
   ========================================================================== */
.featured-spotlight-section {
  padding: 2.5rem 0;
}

.spotlight-card {
  background: linear-gradient(135deg, #111019 0%, #17111b 100%);
  border: 1px solid var(--border-ornate);
  border-radius: var(--radius-md);
  padding: 2rem;
  position: relative;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
}

.spotlight-badge-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.spotlight-badge {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  background: rgba(190, 18, 60, 0.2);
  border: 1px solid var(--border-crimson);
  color: #fb7185;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.spotlight-cat {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--gold);
  text-transform: uppercase;
}

.spotlight-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
}
@media (min-width: 860px) {
  .spotlight-grid { grid-template-columns: 1fr 1.15fr; }
}

.spotlight-media {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.spotlight-img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.spotlight-card:hover .spotlight-img { transform: scale(1.03); }

.spotlight-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  text-transform: uppercase;
}

.spotlight-title {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-parchment);
  margin-bottom: 1.1rem;
}
.spotlight-title a:hover { color: var(--gold-light); }

.spotlight-excerpt {
  color: var(--text-secondary);
  font-size: 1.15rem;
  line-height: 1.7;
  margin-bottom: 1.75rem;
}

/* ==========================================================================
   Chronicles & Journal Post Feed
   ========================================================================== */
.recent-posts-section {
  padding: 3.5rem 0;
}

.posts-feed-header {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}
@media (min-width: 860px) {
  .posts-feed-header {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

.filter-button-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-btn, .filter-pill {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-smooth);
}

.filter-btn:hover, .filter-pill:hover {
  border-color: var(--border-ornate);
  color: var(--gold-light);
}

.filter-btn.active, .filter-pill.active {
  background: rgba(197, 160, 89, 0.12);
  border-color: var(--gold);
  color: var(--gold-light);
  box-shadow: 0 0 12px var(--gold-glow);
}

.posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 640px) {
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .posts-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Post Card Component */
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-smooth);
}

.post-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-ornate);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 20px var(--gold-glow);
}

.card-media-wrapper {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/10;
  border-bottom: 1px solid var(--border-subtle);
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  filter: contrast(1.05);
}
.post-card:hover .card-image { transform: scale(1.04); }

.card-top-header {
  padding: 1.5rem 1.5rem 0 1.5rem;
}

.card-category-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  font-family: var(--font-display);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  background: rgba(6, 6, 8, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  color: var(--gold);
}

.card-top-header .card-category-badge {
  position: static;
  display: inline-block;
}

.card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
  text-transform: uppercase;
}

.meta-icon {
  width: 12px;
  height: 12px;
  color: var(--gold);
  margin-right: 3px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.75rem;
  color: var(--text-parchment);
}
.card-title a:hover { color: var(--gold-light); }

.card-summary {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.85rem;
}

.card-tags {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.tag-pill {
  font-family: var(--font-prose);
  font-size: 0.85rem;
  font-style: italic;
  color: var(--text-muted);
  background: var(--bg-surface);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}
.tag-pill:hover { color: var(--gold); border-color: var(--border-ornate); }

.card-read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gold);
  text-transform: uppercase;
}
.arrow-icon { width: 14px; height: 14px; transition: transform 0.2s ease; }
.card-read-more:hover .arrow-icon { transform: translateX(4px); color: var(--crimson); }

.view-all-row {
  margin-top: 3rem;
  display: flex;
  justify-content: center;
}

/* ==========================================================================
   Single Post & Literary Essay Layout
   ========================================================================== */
.single-article {
  padding: 3.5rem 1.5rem;
}

.breadcrumbs-list {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  text-transform: uppercase;
}
.breadcrumb-item:hover { color: var(--gold); }

.article-header {
  margin-bottom: 3rem;
  text-align: center;
}

.article-badge-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.category-pill {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-ornate);
  color: var(--gold-light);
}

.dispatch-id-pill {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  background: var(--bg-void);
  border: 1px solid var(--border-subtle);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
}

.article-title {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.02em;
  color: var(--text-parchment);
  margin-bottom: 1.25rem;
  max-width: 850px;
  margin-left: auto;
  margin-right: auto;
}
@media (min-width: 768px) {
  .article-title { font-size: 3.4rem; }
}

.article-lead {
  font-size: 1.35rem;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.75rem;
  max-width: 70ch;
  margin-left: auto;
  margin-right: auto;
}

.article-meta-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  flex-wrap: wrap;
  padding: 1rem 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 2.5rem;
  text-transform: uppercase;
}

.article-hero-media {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-ornate);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  margin-bottom: 3rem;
}

.article-hero-img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
}

.hero-caption {
  font-family: var(--font-prose);
  font-size: 0.95rem;
  font-style: italic;
  color: var(--text-muted);
  text-align: center;
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
}

.article-layout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3.5rem;
}
@media (min-width: 960px) {
  .article-layout-grid {
    grid-template-columns: minmax(0, 1fr) 260px;
  }
}

/* Prose Typography & Gothic Drop Caps */
.article-prose {
  font-size: 1.25rem;
  line-height: 1.9;
  color: var(--text-primary);
  max-width: var(--max-prose);
}

/* Beautiful Ornate Gothic Drop Cap on first letter */
.article-prose > p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-size: 4rem;
  float: left;
  line-height: 0.85;
  padding-right: 0.2em;
  padding-top: 0.1em;
  color: var(--gold-light);
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
}

.article-prose p {
  margin-bottom: 1.75rem;
}

.article-prose h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-parchment);
  margin: 3.25rem 0 1.25rem 0;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}

.article-prose h2::before {
  content: '❦ ';
  color: var(--crimson);
  font-size: 1.5rem;
  vertical-align: middle;
}

.article-prose h3 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--gold-light);
  margin: 2.25rem 0 1rem 0;
}

.article-prose blockquote {
  border-left: 3px solid var(--crimson);
  background: linear-gradient(90deg, rgba(136, 19, 55, 0.15) 0%, transparent 100%);
  padding: 1.25rem 1.75rem;
  margin: 2rem 0;
  font-style: italic;
  font-size: 1.35rem;
  color: var(--text-parchment);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.article-prose ul, .article-prose ol {
  margin-bottom: 1.75rem;
  padding-left: 2rem;
}

.article-prose li {
  margin-bottom: 0.65rem;
}

.article-prose hr {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-ornate), transparent);
  margin: 3rem 0;
  text-align: center;
}

.article-prose hr::after {
  content: '❦ ⚜ ❦';
  font-size: 0.85rem;
  color: var(--gold);
  position: relative;
  top: -0.7em;
  background: var(--bg-primary);
  padding: 0 1rem;
}

/* Callouts in Dark Gothic Style */
.callout-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  margin: 2rem 0;
}

.callout-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.callout-title {
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-light);
}

.callout-warning { border-left-color: var(--candle); }
.callout-danger { border-left-color: var(--crimson); }

.callout-content {
  font-size: 1.15rem;
  color: var(--text-secondary);
}

/* Table of Contents */
.toc-sidebar {
  position: sticky;
  top: 96px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.toc-header {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--gold);
  text-transform: uppercase;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.toc-body ul {
  list-style: none;
  font-size: 1.05rem;
}
.toc-body li { margin-bottom: 0.5rem; }
.toc-body a { color: var(--text-secondary); }
.toc-body a:hover, .toc-body a.active { color: var(--gold-light); padding-left: 4px; }

/* Author Signature Box */
.author-profile-box {
  background: linear-gradient(135deg, #111018 0%, #17111b 100%);
  border: 1px solid var(--border-ornate);
  border-radius: var(--radius-md);
  padding: 2rem;
  margin-top: 3.5rem;
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.author-avatar {
  border-radius: 50%;
  border: 2px solid var(--gold);
  padding: 4px;
  background: var(--bg-void);
}

.author-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-parchment);
}

.author-role-badge {
  font-family: var(--font-display);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  color: var(--gold);
  text-transform: uppercase;
}

.author-bio-text {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* ==========================================================================
   Search Modal (Gothic Grimwood)
   ========================================================================== */
.search-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 6, 0.85);
  backdrop-filter: blur(16px);
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 5rem 1rem;
}
.search-modal-backdrop.active { display: flex; }

.search-modal-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-ornate);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 650px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.9), 0 0 24px var(--gold-glow);
  overflow: hidden;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  gap: 1rem;
}

.search-input {
  background: transparent;
  border: none;
  color: var(--text-parchment);
  font-family: var(--font-prose);
  font-size: 1.35rem;
  width: 100%;
  outline: none;
}

.search-input::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.search-close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
}

.esc-badge {
  font-family: var(--font-display);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
}

.search-results-list {
  max-height: 380px;
  overflow-y: auto;
  padding: 1rem;
}

.search-result-item {
  display: block;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.search-result-item:hover, .search-result-item.selected {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
}

.result-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-parchment);
}

.result-category {
  font-family: var(--font-display);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--gold);
  text-transform: uppercase;
}

.result-snippet {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 0.25rem;
}

/* ==========================================================================
   Site Footer
   ========================================================================== */
.site-footer {
  background: #040406;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
  padding: 4.5rem 0 2.5rem 0;
  position: relative;
}

.site-footer::before {
  content: '❦';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: #040406;
  padding: 0 1rem;
  color: var(--gold);
  font-size: 1rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  margin-bottom: 3.5rem;
}
@media (min-width: 640px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .footer-grid { grid-template-columns: 1.8fr 1fr 1fr 1.2fr; }
}

.footer-brand-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-parchment);
  text-transform: uppercase;
}

.footer-bio {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 1rem 0 1.25rem 0;
}

.footer-col-title {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  font-size: 1.05rem;
  color: var(--text-secondary);
}
.footer-links a:hover { color: var(--gold-light); }

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.75rem;
}

.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: column;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
}
@media (min-width: 768px) {
  .footer-bottom-inner { flex-direction: row; }
}
