/* Fonts loaded via <link> in base.njk (Bunny Fonts — GDPR-compliant) */

/* ===== VARIABLES (Light Mode) ===== */
:root {
  --parchment: #F0EBE0;
  --paper:     #FAF7F2;
  --ink:       #1C1714;
  --mid:       #6B6158;
  --gold:      #B8832A;
  --gold-lt:   #D4A843;
  --rust:      #7A2024;
  --rule:      #D8CFBE;
  --dark:      #1C1714;
  --dark-mid:  #2D2720;
  --dark-text: #F0EBE0;
  --dark-muted:#B4A898;

  --font-display: 'Cinzel', 'Georgia', serif;
  --font-body:    'EB Garamond', 'Georgia', serif;

  --max-w:      1100px;
  --content-w:  740px;
  --gap:        2rem;
  --section-v:  5rem;
}

/* ===== DARK MODE ===== */
[data-theme="dark"] {
  --parchment: #141210;
  --paper:     #1E1B17;
  --ink:       #E8E0D4;
  --mid:       #9A8E80;
  --rule:      #3A3530;
  --dark:      #0E0D0B;
  --dark-mid:  #1A1714;
  --dark-text: #E8E0D4;
  --dark-muted:#9A8E80;
}

[data-theme="dark"] .titan-card {
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

[data-theme="dark"] .titan-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

[data-theme="dark"] .titan-card-photo-placeholder {
  color: rgba(255,255,255,0.15);
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group textarea {
  background: var(--dark-mid);
  color: var(--ink);
  border-color: var(--rule);
}

/* Theme toggle icon visibility */
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-lt); text-decoration: underline; }
button { cursor: pointer; }

/* ===== ACCESSIBILITY ===== */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 999;
  padding: 0.5rem 1rem;
  background: var(--gold);
  color: var(--dark);
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 0 0 3px 3px;
}

.skip-link:focus { top: 0; }

/* ===== SUP (prevent flex-item splitting) ===== */
sup {
  font-size: 0.55em;
  vertical-align: super;
  line-height: 0;
  font-weight: inherit;
  display: inline;
  position: relative;
  top: -0.3em;
}

/* ===== BASE ===== */
html { font-size: 18px; scroll-behavior: smooth; scroll-margin-top: 5rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

body {
  font-family: var(--font-body);
  font-size: 1.1rem;
  line-height: 1.75;
  color: var(--ink);
  background: var(--parchment);
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
}

h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); margin-top: 2.5rem; margin-bottom: 0.75rem; }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); margin-top: 2rem; margin-bottom: 0.5rem; }

p { margin-bottom: 1.25rem; }
p:last-child { margin-bottom: 0; }

blockquote {
  border-left: 3px solid var(--gold);
  margin: 2rem 0;
  padding: 0.75rem 1.5rem;
  color: var(--mid);
  font-style: italic;
  font-size: 1.15rem;
}

hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 3rem 0;
}

ul, ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

li { margin-bottom: 0.35rem; }

code {
  font-size: 0.88em;
  background: var(--paper);
  padding: 0.15em 0.35em;
  border-radius: 2px;
  border: 1px solid var(--rule);
}

/* ===== LAYOUT ===== */
.inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

main { min-height: 60vh; }

/* ===== HEADER ===== */
.site-header {
  background: var(--dark);
  border-bottom: 2px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 64px;
}

.site-logo {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--dark-text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
}

.site-logo:hover { color: var(--gold-lt); text-decoration: none; }

/* Inline nav links (desktop) */
.site-nav { margin-left: auto; }

.site-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 0.25rem;
}

.site-nav a {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dark-muted);
  padding: 0.4rem 0.7rem;
  border-radius: 2px;
  transition: color 0.15s, background 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--gold-lt);
  background: rgba(255,255,255,0.06);
  text-decoration: none;
}

/* Header action buttons (search, theme, hamburger) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.header-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  color: var(--dark-muted);
  border-radius: 2px;
  transition: color 0.15s, background 0.15s;
}

.header-btn:hover {
  color: var(--gold-lt);
  background: rgba(255,255,255,0.06);
}

/* Hamburger lines */
.nav-toggle {
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* ===== NAV OVERLAY ===== */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
}

.nav-overlay.is-open { display: block; }

/* ===== NAV PANEL (slide-in from right) ===== */
.nav-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  max-width: 85vw;
  background: var(--dark);
  border-left: 2px solid var(--gold);
  z-index: 300;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.nav-panel.is-open { transform: translateX(0); }

.nav-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.nav-panel-title {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dark-muted);
}

.nav-panel-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  color: var(--dark-muted);
  border-radius: 2px;
  transition: color 0.15s;
}

.nav-panel-close:hover { color: var(--gold-lt); }

/* Panel nav links */
.nav-panel-links {
  list-style: none;
  padding: 0.75rem 0;
  margin: 0;
}

.nav-panel-links li a {
  display: block;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dark-muted);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.nav-panel-links li a:hover {
  color: var(--gold-lt);
  background: rgba(255,255,255,0.04);
  text-decoration: none;
}

.nav-panel-links li a[aria-current="page"] {
  color: var(--gold-lt);
  border-left: 2px solid var(--gold);
}

.nav-panel-rule {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin: 0.5rem 1.5rem;
}

.nav-panel-contact {
  padding: 1rem 1.5rem;
}

.nav-panel-contact-label {
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dark-muted);
  margin-bottom: 0.4rem;
}

.nav-panel-contact a {
  font-size: 0.92rem;
  color: var(--gold);
}

.nav-panel-contact a:hover { color: var(--gold-lt); text-decoration: none; }

/* Translate dropdown in nav panel */
.nav-panel-translate {
  padding: 0 1.5rem 0.75rem;
}

.gtranslate-select {
  width: 100%;
  padding: 0.5rem 0.7rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--dark-text);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 2px;
  cursor: pointer;
  appearance: auto;
}

.gtranslate-select:focus {
  outline: none;
  border-color: var(--gold);
}

.gtranslate-select option {
  background: var(--dark-mid);
  color: var(--dark-text);
}

/* Hide Google Translate bar */
.goog-te-banner-frame { display: none !important; }
body { top: 0 !important; }
.skiptranslate { display: none !important; }

.nav-panel-legal {
  padding: 0.75rem 1.5rem;
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.nav-panel-legal a {
  font-family: var(--font-display);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
}

.nav-panel-legal a:hover { color: var(--gold-lt); text-decoration: none; }

/* ===== SEARCH OVERLAY ===== */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 400;
  padding: 10vh 1.5rem 2rem;
  overflow-y: auto;
}

.search-overlay.is-open { display: block; }

.search-overlay-inner {
  max-width: 600px;
  margin: 0 auto;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--paper);
  border: 2px solid var(--gold);
  border-radius: 3px;
  padding: 0.75rem 1rem;
}

.search-bar-icon {
  flex-shrink: 0;
  color: var(--mid);
}

.search-bar input {
  flex: 1;
  border: none;
  background: none;
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--ink);
  outline: none;
}

.search-bar input::placeholder { color: var(--mid); }

.search-close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  color: var(--mid);
  border-radius: 2px;
}

.search-close:hover { color: var(--gold); }

/* Search results */
.search-results {
  margin-top: 1rem;
}

.search-result {
  display: block;
  padding: 1rem 1.25rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
  margin-bottom: 0.5rem;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s;
}

.search-result:hover {
  border-color: var(--gold);
  text-decoration: none;
  color: var(--ink);
}

.search-result-type {
  font-family: var(--font-display);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.25rem;
}

.search-result-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.2rem;
}

.search-result-desc {
  font-size: 0.88rem;
  color: var(--mid);
  line-height: 1.5;
}

.search-no-results {
  text-align: center;
  padding: 2rem;
  color: var(--dark-muted);
  font-style: italic;
}

/* ===== PAGE HERO ===== */
.page-hero {
  background: var(--dark-mid);
  padding: 4rem 1.5rem;
  text-align: center;
}

.page-hero-inner {
  max-width: var(--content-w);
  margin: 0 auto;
}

.page-hero h1 {
  font-family: var(--font-display);
  color: var(--dark-text);
  margin-bottom: 0.75rem;
}

.page-hero .sub {
  color: var(--dark-muted);
  font-size: 1.1rem;
  font-style: italic;
}

/* ===== HOME PAGE ===== */
.home-hero {
  background: var(--dark);
  padding: 6rem 1.5rem 5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.home-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(184,131,42,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.home-hero-inner {
  max-width: 720px;
  margin: 0 auto;
  position: relative;
}

.home-hero-rule {
  width: 3rem;
  height: 2px;
  background: var(--gold);
  margin: 1.5rem auto;
}

.home-hero h1 {
  font-family: var(--font-display);
  color: var(--dark-text);
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: 0.03em;
  margin-bottom: 0;
}

.home-hero p {
  color: var(--dark-muted);
  font-size: 1.2rem;
  font-style: italic;
  margin-bottom: 0;
}

.home-hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2.5rem;
}

.btn {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.75rem 1.75rem;
  border-radius: 2px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  display: inline-block;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gold);
  color: #1C1714;
}

.btn-primary:hover {
  background: var(--gold-lt);
  color: #1C1714;
  text-decoration: none;
}

.btn-outline {
  border: 1px solid rgba(255,255,255,0.25);
  color: var(--dark-muted);
}

.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold-lt);
  text-decoration: none;
}

/* Home sections */
.home-section {
  padding: var(--section-v) 1.5rem;
}

.home-section:nth-child(even) { background: var(--paper); }

.section-header {
  max-width: var(--max-w);
  margin: 0 auto 2.5rem;
  text-align: center;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mid);
  margin: 0 0 0.5rem;
}

.section-header-rule {
  width: 2.5rem;
  height: 2px;
  background: var(--gold);
  margin: 0 auto;
}

.section-more {
  max-width: var(--max-w);
  margin: 2rem auto 0;
}

.section-more a {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ===== TITAN CARDS (grid) ===== */
.titans-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

.titan-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
}

.titan-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  border-color: var(--gold);
}

.titan-card a { text-decoration: none; color: inherit; }

.titan-card-photo {
  width: 100%;
  aspect-ratio: 3/2;
  overflow: hidden;
  background: var(--dark-mid);
  display: flex;
  align-items: center;
  justify-content: center;
}

.titan-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.titan-card-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: rgba(255,255,255,0.2);
  font-family: var(--font-display);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.titan-card-photo-placeholder svg { opacity: 0.15; }

.titan-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.titan-card-era {
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.35rem;
}

.titan-card-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.2rem;
  line-height: 1.2;
}

.titan-card-dates {
  font-size: 0.88rem;
  color: var(--mid);
  margin-bottom: 0.75rem;
  font-style: italic;
}

.titan-card-summary {
  font-size: 0.92rem;
  color: var(--mid);
  line-height: 1.55;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1rem;
}

.titan-card-link {
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: auto;
}

.titan-card:hover .titan-card-link { color: var(--gold-lt); }

/* ===== INDIVIDUAL TITAN PAGE ===== */
.titan-header {
  background: var(--dark);
  padding: 4rem 1.5rem;
  border-bottom: 2px solid var(--gold);
}

.titan-header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  gap: 3rem;
  align-items: flex-start;
}

.titan-portrait {
  flex-shrink: 0;
  width: 240px;
}

.titan-portrait img {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.1);
}

.titan-portrait figcaption {
  font-size: 0.78rem;
  color: var(--dark-muted);
  margin-top: 0.5rem;
  font-style: italic;
  line-height: 1.4;
}

.titan-meta {
  flex: 1;
  min-width: 0;
}

.era-badge {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--gold);
  padding: 0.2rem 0.6rem;
  border-radius: 2px;
  margin-bottom: 0.75rem;
}

.titan-name {
  color: var(--dark-text);
  font-size: clamp(1.8rem, 4vw, 3rem);
  margin-bottom: 0.5rem;
}

.titan-dates {
  color: var(--dark-muted);
  font-style: italic;
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.titan-category {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dark-muted);
  margin-bottom: 1rem;
}

.titan-summary {
  color: var(--dark-muted);
  font-size: 1.1rem;
  font-style: italic;
  line-height: 1.65;
  max-width: 56ch;
  margin-bottom: 0;
}

.titan-reading-time {
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dark-muted);
  margin-top: 0.75rem;
}

/* Titan two-column layout (body + TOC) */
.titan-content-wrap {
  max-width: calc(var(--content-w) + 220px + 3rem);
  margin: 0 auto;
  padding: 4rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 3rem;
  align-items: start;
}

.titan-body {
  min-width: 0;
  max-width: var(--content-w);
}

.titan-footer {
  max-width: calc(var(--content-w) + 220px + 3rem);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
  border-top: 1px solid var(--rule);
  padding-top: 2rem;
}

/* ===== BLOG ===== */
.post-list {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.post-list-item {
  padding: 2rem 0;
  border-bottom: 1px solid var(--rule);
}

.post-list-item:first-child { border-top: 1px solid var(--rule); }

.post-list-meta {
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 0.4rem;
}

.post-list-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

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

.post-list-excerpt {
  color: var(--mid);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 65ch;
}

/* Post page */
.post-header { text-align: center; }

.post-meta {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dark-muted);
  margin-top: 0.75rem;
}

.post-body {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.post-footer {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
  border-top: 1px solid var(--rule);
  padding-top: 2rem;
}

/* Blog pagination */
.pagination {
  max-width: var(--max-w);
  margin: 3rem auto 0;
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.pagination a, .pagination span {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.5rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--mid);
}

.pagination a:hover {
  border-color: var(--gold);
  color: var(--gold);
  text-decoration: none;
}

.pagination .current {
  background: var(--gold);
  color: #1C1714;
  border-color: var(--gold);
}

/* ===== CONTENT STYLES (shared for post & titan body) ===== */
.content h2 { color: var(--ink); }
.content h3 { color: var(--mid); }
.content a { color: var(--gold); }
.content a:hover { color: var(--gold-lt); }

/* ===== LINKS PAGE ===== */
.links-page,
.readings-page {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.resource-category { margin-bottom: 3rem; }

.resource-category h2 {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.resource-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.resource-item-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}

.resource-item-author {
  font-size: 0.9rem;
  color: var(--mid);
  font-style: italic;
  margin-bottom: 0.3rem;
}

.resource-item-notes {
  font-size: 0.95rem;
  color: var(--mid);
  line-height: 1.6;
}

/* ===== SISTER SITES ===== */
.sister-sites-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.sister-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1.5rem;
  transition: border-color 0.15s;
}

.sister-card:hover { border-color: var(--gold); }

.sister-card-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.sister-card-title a { color: var(--ink); }
.sister-card-title a:hover { color: var(--gold); text-decoration: none; }

.sister-card-desc { font-size: 0.95rem; color: var(--mid); line-height: 1.6; }

.sister-sites-empty {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 4rem 1.5rem;
  color: var(--mid);
  font-style: italic;
}

/* ===== CONTACT PAGE ===== */
.contact-page {
  max-width: 580px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.contact-page p { margin-bottom: 2rem; color: var(--mid); }

.form-group { margin-bottom: 1.5rem; }

.form-group label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 2px;
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.form-group textarea { resize: vertical; min-height: 140px; }

.form-submit {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--gold);
  color: #1C1714;
  border: none;
  padding: 0.8rem 2rem;
  border-radius: 2px;
  transition: background 0.15s;
}

.form-submit:hover { background: var(--gold-lt); }

.form-note {
  font-size: 0.85rem;
  color: var(--mid);
  margin-top: 1rem;
  font-style: italic;
}

/* ===== LEGAL PAGES ===== */
.legal-page {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.legal-page h2 {
  font-size: 1.2rem;
  margin-top: 2.5rem;
  margin-bottom: 0.5rem;
}

.legal-page p,
.legal-page li {
  color: var(--mid);
  font-size: 1rem;
}

.legal-page a { color: var(--gold); }

/* ===== BACK LINK ===== */
.back-link {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mid);
}

.back-link:hover { color: var(--gold); text-decoration: none; }

/* ===== FOOTER ===== */
.site-footer {
  background: var(--dark);
  border-top: 2px solid var(--gold);
  padding: 3rem 1.5rem;
  text-align: center;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.footer-tagline {
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dark-text);
  margin: 0;
}

.footer-note {
  font-size: 0.85rem;
  color: var(--dark-muted);
  font-style: italic;
  margin: 0;
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-nav a {
  font-family: var(--font-display);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dark-muted);
}

.footer-nav a:hover { color: var(--gold-lt); text-decoration: none; }

.footer-nav--secondary { margin-top: 0.25rem; }

.footer-nav--secondary a {
  font-size: 0.58rem;
  color: rgba(255,255,255,0.3);
}

.footer-copy {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.25);
  margin: 0;
}

.footer-credit {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.2);
  margin: 0;
}

.footer-credit a { color: rgba(255,255,255,0.35); }
.footer-credit a:hover { color: var(--gold-lt); text-decoration: none; }

/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: var(--dark);
  color: var(--dark-muted);
  border: 1px solid var(--rule);
  border-radius: 2px;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 90;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}

.back-to-top.is-visible { display: flex; }
.back-to-top:hover { background: var(--gold); color: #1C1714; border-color: var(--gold); }

/* ===== RECENT POSTS (home) ===== */
.recent-posts {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.recent-post-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
}

.recent-post-item:first-child { border-top: 1px solid var(--rule); }

.recent-post-date {
  font-family: var(--font-display);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 0.3rem;
}

.recent-post-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
}

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

/* ===== FEATURED TITANS (home) ===== */
.featured-titans {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}

/* ===== TITANS INDEX PAGE ===== */
.titans-page {
  padding: var(--section-v) 1.5rem;
}

.titans-page-header {
  max-width: var(--max-w);
  margin: 0 auto 3rem;
}

.titans-count {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mid);
  margin-top: 0.5rem;
}

/* ===== READING PROGRESS BAR ===== */
.reading-progress {
  position: fixed;
  top: 64px;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--gold);
  z-index: 99;
  transition: width 0.1s linear;
}

/* ===== BREADCRUMBS ===== */
.breadcrumbs {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1rem 1.5rem 0;
}

.breadcrumbs ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 0;
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.breadcrumbs li { margin-bottom: 0; }

.breadcrumbs li + li::before {
  content: "/";
  margin: 0 0.5rem;
  color: var(--mid);
}

.breadcrumbs a { color: var(--mid); }
.breadcrumbs a:hover { color: var(--gold); text-decoration: none; }
.breadcrumbs [aria-current] { color: var(--ink); }

/* ===== TABLE OF CONTENTS (sidebar) ===== */
.toc-sidebar {
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.toc-title {
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 0.75rem;
}

.toc-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 1px solid var(--rule);
}

.toc-nav-list li {
  margin-bottom: 0;
}

.toc-nav-list a {
  display: block;
  padding: 0.3rem 0 0.3rem 0.75rem;
  font-size: 0.82rem;
  color: var(--mid);
  text-decoration: none;
  line-height: 1.4;
  border-left: 2px solid transparent;
  margin-left: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.toc-nav-list a:hover { color: var(--gold); text-decoration: none; }

.toc-nav-list a.is-active {
  color: var(--gold);
  border-left-color: var(--gold);
}

.toc-nav-list .toc-h3 { padding-left: 1.25rem; font-size: 0.78rem; }

/* ===== SHARE BUTTONS ===== */
.share-buttons {
  max-width: calc(var(--content-w) + 220px + 3rem);
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.share-label {
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid);
  margin-right: 0.25rem;
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 2px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--mid);
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
  cursor: pointer;
}

.share-btn:hover {
  color: var(--gold);
  border-color: var(--gold);
  text-decoration: none;
}

.copy-link-btn .icon-check { display: none; }
.copy-link-btn.copied .icon-link { display: none; }
.copy-link-btn.copied .icon-check { display: block; color: var(--gold); }

/* ===== RELATED TITANS ===== */
.related-section {
  background: var(--paper);
  padding: 3rem 1.5rem;
  border-top: 1px solid var(--rule);
}

.related-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.related-heading {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid);
  margin: 0 0 1.5rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.related-card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  background: var(--parchment);
  border: 1px solid var(--rule);
  border-radius: 3px;
  text-decoration: none;
  transition: border-color 0.15s;
}

.related-card:hover { border-color: var(--gold); text-decoration: none; }

.related-card-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.2rem;
}

.related-card-dates {
  font-size: 0.85rem;
  color: var(--mid);
  font-style: italic;
}

/* ===== PREV / NEXT ===== */
.prev-next {
  border-top: 1px solid var(--rule);
  padding: 2rem 1.5rem;
}

.prev-next-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.prev-next-link {
  text-decoration: none;
  padding: 1rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  transition: border-color 0.15s;
}

.prev-next-link:hover { border-color: var(--gold); text-decoration: none; }

.prev-next-link--next { text-align: right; }

.prev-next-label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 0.3rem;
}

.prev-next-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}

/* ===== ERA FILTER (titans index) ===== */
.filter-bar {
  max-width: var(--max-w);
  margin: 0 auto 2rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--paper);
  color: var(--mid);
  cursor: pointer;
  transition: all 0.15s;
}

.filter-btn:hover { border-color: var(--gold); color: var(--gold); }

.filter-btn.is-active {
  background: var(--gold);
  color: #1C1714;
  border-color: var(--gold);
}

/* ===== TIMELINE PAGE ===== */
.timeline-page {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--rule);
}

.timeline-item {
  position: relative;
  padding-bottom: 2.5rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 0.5rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--parchment);
  margin-left: -4px;
}

.timeline-date {
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.25rem;
}

.timeline-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.timeline-name a { color: var(--ink); }
.timeline-name a:hover { color: var(--gold); text-decoration: none; }

.timeline-era {
  font-size: 0.85rem;
  color: var(--mid);
  font-style: italic;
  margin-bottom: 0.3rem;
}

.timeline-summary {
  font-size: 0.92rem;
  color: var(--mid);
  line-height: 1.55;
}

/* ===== ABOUT PAGE ===== */
.about-page {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.about-page h2 {
  margin-top: 2.5rem;
}

/* ===== 404 PAGE ===== */
.page-404 {
  text-align: center;
  padding: 6rem 1.5rem;
}

.page-404 h1 {
  font-size: clamp(4rem, 10vw, 8rem);
  color: var(--rule);
  margin-bottom: 1rem;
  line-height: 1;
}

.page-404 p {
  font-size: 1.15rem;
  color: var(--mid);
  max-width: 40ch;
  margin: 0 auto 2rem;
}

/* ===== PRINT ===== */
@media print {
  .site-header,
  .nav-panel,
  .nav-overlay,
  .search-overlay,
  .back-to-top,
  .reading-progress,
  .share-buttons,
  .filter-bar,
  .breadcrumbs,
  .toc-sidebar,
  .related-section,
  .prev-next,
  .site-footer,
  .titan-footer,
  .post-footer,
  .skip-link { display: none !important; }

  body {
    color: #000;
    background: #fff;
    font-size: 11pt;
    line-height: 1.6;
  }

  a { color: #000; text-decoration: underline; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #666; }
  a[href^="/"]::after { content: " ({{ site.url }}" attr(href) ")"; }
  a[href^="#"]::after { content: ""; }

  .titan-header { background: none; border: none; padding: 2rem 0; }
  .titan-name, .page-hero h1 { color: #000; }
  .titan-dates, .titan-category, .titan-summary { color: #333; }

  .titan-content-wrap { display: block; padding: 2rem 0; }
  .titan-body { max-width: 100%; }

  h1, h2, h3 { page-break-after: avoid; }
  img { max-width: 300px; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  :root { --section-v: 3rem; }

  .site-nav { display: none; }

  .titan-content-wrap {
    grid-template-columns: 1fr;
    padding: 2rem 1.5rem;
  }

  .toc-sidebar {
    position: static;
    order: -1;
    border: 1px solid var(--rule);
    border-radius: 3px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
  }

  .prev-next-inner { grid-template-columns: 1fr; gap: 1rem; }
  .prev-next-link--next { text-align: left; }

  .titan-header-inner {
    flex-direction: column;
    gap: 1.5rem;
  }

  .titan-portrait { width: 180px; }
  .titan-name { font-size: 1.8rem; }
  .home-hero { padding: 4rem 1.5rem 3rem; }

  .titans-grid,
  .featured-titans {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

@media (max-width: 480px) {
  .titans-grid,
  .featured-titans {
    grid-template-columns: 1fr 1fr;
  }

  .home-hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .footer-nav { gap: 1rem; }

  .site-logo { font-size: 0.85rem; }
}
