/*
Theme Name: TGTL Night Sky — Thế Giới Tâm Linh
Theme URI: https://tgtl.danhliam.com
Author: Neo
Description: Serene night-sky spiritual design for Thế Giới Tâm Linh — a Vietnamese Catholic spiritual journal. Deep midnight blues, starlight and gold. Elegant serif headlines, glass panels, twinkling starfield hero, rotating Scripture verse, responsive with mobile drawer menu. Includes a warm "daylight" mode via the 🌙/☀️ toggle.
Version: 3.4
Text Domain: tgtl
*/

/* ══════════════════════════ DESIGN TOKENS ══════════════════════════ */
:root {
  /* Night palette */
  --night-950: #060a15;
  --night-900: #0a101f;
  --night-850: #0d1526;
  --night-800: #111a30;
  --night-700: #1a2645;
  --night-600: #263659;

  /* Gold */
  --gold: #d4af37;
  --gold-light: #e9cd74;
  --gold-deep: #a8871f;
  --gold-glow: rgba(212, 175, 55, 0.35);
  --gold-faint: rgba(212, 175, 55, 0.10);

  /* Ink (starlight ivory) */
  --ivory: #f3efe3;
  --ivory-soft: #c6c3d8;
  --muted: #8b88a6;
  --starlight: #a9b6e8;

  /* Surfaces */
  --bg: var(--night-900);
  --bg-deep: var(--night-950);
  --panel: rgba(17, 26, 48, 0.72);
  --panel-solid: #111a30;
  --panel-hover: #182341;
  --glass: rgba(255, 255, 255, 0.035);

  /* Lines */
  --hairline: rgba(212, 175, 55, 0.13);
  --hairline-strong: rgba(212, 175, 55, 0.30);

  /* Hero tokens (night) */
  --hero-bg:
    radial-gradient(1100px 520px at 82% -12%, rgba(212, 175, 55, 0.16), transparent 62%),
    radial-gradient(900px 480px at 8% 118%, rgba(70, 92, 160, 0.28), transparent 60%),
    linear-gradient(178deg, var(--night-850) 0%, var(--night-950) 100%);
  --hero-color: #fbf7ec;
  --hero-muted: rgba(246, 242, 230, 0.62);
  --hero-hairline: rgba(255, 255, 255, 0.12);
  --star: rgba(255, 255, 255, 0.5);

  /* Shape */
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 4px 18px rgba(0, 0, 0, 0.28);
  --shadow: 0 12px 44px rgba(0, 0, 0, 0.38);
  --glow-gold: 0 6px 32px rgba(212, 175, 55, 0.22);
  --transition: 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);

  /* Type */
  --serif: 'Playfair Display', 'Georgia', 'Times New Roman', serif;
  --sans: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── Daylight mode (☀️ toggle) ── */
body.day-mode {
  --bg: #faf6ec;
  --bg-deep: #f2ebd8;
  --night-950: #f2ebd8;
  --ivory: #262b3d;
  --ivory-soft: #4c526b;
  --muted: #878da6;
  --gold: #9a7b1e;
  --gold-light: #c19a2f;
  --gold-deep: #7d6216;
  --gold-glow: rgba(154, 123, 30, 0.20);
  --gold-faint: rgba(154, 123, 30, 0.10);
  --panel: rgba(255, 255, 255, 0.85);
  --panel-solid: #ffffff;
  --panel-hover: #ffffff;
  --glass: rgba(38, 43, 61, 0.03);
  --hairline: rgba(38, 43, 61, 0.13);
  --hairline-strong: rgba(154, 123, 30, 0.45);
  --hero-bg:
    radial-gradient(1100px 520px at 82% -12%, rgba(212, 175, 55, 0.22), transparent 62%),
    radial-gradient(900px 480px at 8% 118%, rgba(128, 148, 205, 0.16), transparent 60%),
    linear-gradient(178deg, #f6efdd 0%, #efe6cf 100%);
  --hero-color: #2a2f42;
  --hero-muted: rgba(42, 47, 66, 0.62);
  --hero-hairline: rgba(42, 47, 66, 0.16);
  --star: rgba(42, 47, 66, 0.22);
  --shadow-sm: 0 4px 18px rgba(80, 66, 20, 0.10);
  --shadow: 0 14px 44px rgba(80, 66, 20, 0.14);
  --glow-gold: 0 6px 26px rgba(154, 123, 30, 0.16);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ivory);
  background-color: var(--bg);
  /* Subtle all-over starfield */
  background-image:
    radial-gradient(1px 1px at 12% 22%, var(--star) 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 68%, var(--star) 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 41% 34%, var(--star) 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 78%, var(--star) 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 68% 15%, var(--star) 50%, transparent 51%),
    radial-gradient(1px 1px at 79% 55%, var(--star) 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 90% 30%, var(--star) 50%, transparent 51%),
    radial-gradient(1px 1px at 96% 82%, var(--star) 50%, transparent 51%);
  background-size: 420px 420px, 380px 380px, 460px 460px, 360px 360px, 440px 440px, 400px 400px, 480px 480px, 390px 390px;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.5s ease, color 0.5s ease;
}

a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-light); }

::selection { background: var(--gold); color: var(--night-950); }

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

.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--gold); color: var(--night-950);
  padding: 10px 18px; border-radius: 0 0 var(--radius) 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* Reveal-on-scroll (JS adds .in-view) */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in-view { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation: none !important; }
}

/* ══════════════════════════ HEADER ══════════════════════════ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 16, 31, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hairline);
  transition: box-shadow 0.3s ease, background-color 0.4s ease;
}
body.day-mode .site-header { background: rgba(250, 246, 236, 0.86); }
.site-header.is-scrolled { box-shadow: 0 6px 30px rgba(0, 0, 0, 0.35); }

.header-inner {
  display: flex; justify-content: space-between; align-items: center;
  min-height: 68px; gap: 16px;
}
.site-branding { display: flex; align-items: center; gap: 14px; padding: 8px 0; min-width: 0; }
.site-logo { display: flex; flex-shrink: 0; }
.site-logo img {
  display: block; width: 46px; height: 46px; border-radius: 50%;
  box-shadow: 0 0 0 2px var(--hairline-strong), 0 0 22px var(--gold-glow);
  transition: transform var(--transition);
}
.site-logo:hover img { transform: rotate(8deg) scale(1.04); }
.site-titles { display: flex; flex-direction: column; min-width: 0; }
.site-title {
  font-family: var(--serif); font-size: 21px; font-weight: 700;
  color: var(--gold); line-height: 1.2; letter-spacing: 0.4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.site-title:hover { color: var(--gold-light); }
.site-tagline {
  font-size: 10px; color: var(--muted); letter-spacing: 2.2px;
  text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.header-actions { display: flex; align-items: center; gap: 10px; }
.dark-toggle {
  background: var(--glass); border: 1px solid var(--hairline);
  border-radius: 999px; padding: 7px 12px; cursor: pointer;
  font-size: 15px; line-height: 1; color: var(--ivory);
  transition: var(--transition);
}
.dark-toggle:hover { border-color: var(--gold); box-shadow: var(--glow-gold); transform: translateY(-1px); }
.menu-toggle {
  display: none; background: none; border: 1px solid var(--hairline);
  border-radius: var(--radius); color: var(--gold); font-size: 20px;
  cursor: pointer; padding: 7px 12px; line-height: 1;
  transition: var(--transition);
}
.menu-toggle:hover { border-color: var(--gold); }

.main-nav ul { display: flex; gap: 2px; list-style: none; flex-wrap: wrap; }
.main-nav a {
  position: relative; display: block; color: var(--ivory-soft);
  padding: 9px 13px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500; letter-spacing: 0.3px;
  transition: color var(--transition), background var(--transition);
}
.main-nav a::after {
  content: ''; position: absolute; left: 13px; right: 13px; bottom: 4px;
  height: 1.5px; background: linear-gradient(90deg, var(--gold), transparent);
  transform: scaleX(0); transform-origin: left; transition: transform 0.3s ease;
}
.main-nav a:hover, .main-nav .current-menu-item a, .main-nav .current_page_item a {
  color: var(--gold); background: var(--gold-faint);
}
.main-nav a:hover::after, .main-nav .current-menu-item a::after, .main-nav .current_page_item a::after { transform: scaleX(1); }

/* ══════════════════════════ HERO ══════════════════════════ */
.hero {
  position: relative; color: var(--hero-color);
  background: var(--hero-bg);
  padding: 76px 0 84px; overflow: hidden;
  border-bottom: 1px solid var(--hairline);
  transition: background 0.5s ease, color 0.5s ease;
}
/* Twinkling starfield layer */
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 8% 18%, var(--star) 50%, transparent 51%),
    radial-gradient(1px 1px at 17% 62%, var(--star) 50%, transparent 51%),
    radial-gradient(2px 2px at 26% 34%, var(--star) 50%, transparent 51%),
    radial-gradient(1px 1px at 34% 84%, var(--star) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 45% 22%, var(--star) 50%, transparent 51%),
    radial-gradient(1px 1px at 52% 70%, var(--star) 50%, transparent 51%),
    radial-gradient(2px 2px at 61% 40%, var(--star) 50%, transparent 51%),
    radial-gradient(1px 1px at 70% 88%, var(--star) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 78% 16%, var(--star) 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 58%, var(--star) 50%, transparent 51%),
    radial-gradient(2px 2px at 95% 30%, var(--star) 50%, transparent 51%),
    radial-gradient(1px 1px at 14% 90%, var(--star) 50%, transparent 51%),
    radial-gradient(1px 1px at 92% 76%, var(--star) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 56% 8%, var(--star) 50%, transparent 51%),
    radial-gradient(1px 1px at 38% 52%, var(--star) 50%, transparent 51%);
  background-size: 900px 900px, 700px 700px, 800px 800px, 600px 600px;
  animation: twinkle 6s ease-in-out infinite alternate;
}
@keyframes twinkle {
  0% { opacity: 0.55; }
  50% { opacity: 1; }
  100% { opacity: 0.65; }
}
/* Moon glow */
.hero::after {
  content: ''; position: absolute; top: -140px; right: -120px;
  width: 420px; height: 420px; pointer-events: none;
  background: radial-gradient(circle, var(--gold-glow) 0%, transparent 62%);
}
body.day-mode .hero::after { opacity: 0.7; }

.hero-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.08fr 0.92fr; gap: 48px; align-items: center;
}
.hero-text { padding-right: 12px; }
.hero-overline {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; text-transform: uppercase; letter-spacing: 3.2px;
  color: var(--gold); margin-bottom: 18px; font-weight: 600;
}
.hero-overline::before {
  content: '✦'; font-size: 13px; animation: spin-slow 14s linear infinite;
}
@keyframes spin-slow { to { transform: rotate(360deg); } }
.hero-title {
  font-family: var(--serif); font-size: 44px; font-weight: 700;
  line-height: 1.14; margin-bottom: 18px; letter-spacing: 0.2px;
}
.hero-title a { color: inherit; }
.hero-title a:hover { color: var(--gold-light); }
.hero-meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--hero-muted); margin-bottom: 20px;
  letter-spacing: 0.4px;
}
.hero-meta::before {
  content: ''; width: 26px; height: 1px; background: var(--gold);
}
.hero-excerpt { font-size: 16.5px; line-height: 1.75; color: var(--hero-muted); margin-bottom: 28px; max-width: 54ch; }
.hero-cta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.btn-read {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 30px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-deep) 100%);
  color: var(--night-950); border-radius: 999px; font-weight: 700; font-size: 14px;
  letter-spacing: 0.8px; text-transform: uppercase;
  box-shadow: var(--glow-gold);
  transition: var(--transition);
}
.btn-read::after { content: '→'; transition: transform 0.25s ease; }
.btn-read:hover { color: var(--night-950); transform: translateY(-2px); box-shadow: 0 10px 36px var(--gold-glow); }
.btn-read:hover::after { transform: translateX(4px); }

.hero-verse {
  font-family: var(--serif); font-style: italic; font-size: 18px;
  color: var(--gold); margin-top: 26px; padding-top: 18px;
  border-top: 1px solid var(--hero-hairline);
  transition: opacity 0.4s ease; min-height: 1.4em;
}

.hero-image {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow), var(--glow-gold);
  border: 1px solid var(--hairline-strong);
}
.hero-image::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(6, 10, 21, 0.45) 100%);
  pointer-events: none;
}
.hero-image img { display: block; width: 100%; height: auto; }

/* ══════════════════════════ SECTIONS ══════════════════════════ */
.section { padding: 64px 0; }
.section + .section { border-top: 1px solid var(--hairline); }
.section-head { display: flex; align-items: center; gap: 16px; margin-bottom: 40px; }
.section-title {
  font-family: var(--serif); font-size: 27px; font-weight: 600;
  color: var(--ivory); line-height: 1.25; letter-spacing: 0.2px;
}
.section-title a { color: var(--ivory); }
.section-title a:hover { color: var(--gold); }
.section-ornament {
  display: inline-flex; align-items: center; gap: 8px; color: var(--gold);
  font-size: 13px; white-space: nowrap;
}
.section-ornament::before { content: '✦'; animation: spin-slow 18s linear infinite; }
.section-ornament::after {
  content: ''; width: 56px; height: 1.5px;
  background: linear-gradient(90deg, var(--gold), transparent);
}
.section-count { font-size: 13px; color: var(--muted); font-family: var(--sans); font-weight: 400; }

/* ══════════════════════════ POST GRID & CARDS ══════════════════════════ */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }

.post-card {
  background: var(--panel);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.post-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow), var(--glow-gold);
  border-color: var(--hairline-strong);
}
.post-thumb { display: block; overflow: hidden; aspect-ratio: 16/10; background: var(--night-700); }
.post-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
  filter: saturate(0.92);
}
.post-card:hover .post-thumb img { transform: scale(1.05); filter: saturate(1.05); }
.post-card-content { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.post-cats { margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.post-cats a {
  display: inline-block; font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--gold); text-decoration: none;
  padding: 3px 10px; border: 1px solid var(--hairline);
  border-radius: 999px; background: var(--gold-faint);
  transition: var(--transition);
}
.post-cats a:hover { background: var(--gold); color: var(--night-950); border-color: var(--gold); }
.post-card-title {
  font-family: var(--serif); font-size: 19px; font-weight: 600;
  line-height: 1.32; margin-bottom: 10px;
}
.post-card-title a { color: var(--ivory); }
.post-card-title a:hover { color: var(--gold); }
.post-card-meta {
  font-size: 12px; color: var(--muted); margin-bottom: 12px;
  letter-spacing: 0.3px;
}
.post-card-excerpt { font-size: 14px; color: var(--ivory-soft); line-height: 1.65; flex: 1; }
.post-card-more {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--hairline);
  font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.6px; color: var(--gold);
  display: inline-flex; align-items: center; gap: 8px;
  transition: gap 0.25s ease;
}
.post-card:hover .post-card-more { gap: 12px; }

/* ══════════════════════════ CATEGORY STRIP ══════════════════════════ */
.category-strip {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(335px, 1fr)); gap: 30px;
}
.cat-card {
  background: var(--panel);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 28px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow), var(--glow-gold);
  border-color: var(--hairline-strong);
}
.cat-card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px; padding-bottom: 16px;
  border-bottom: 1px solid var(--hairline);
}
.cat-card-title { font-family: var(--serif); font-size: 21px; font-weight: 600; }
.cat-card-title a { color: var(--ivory); }
.cat-card-title a:hover { color: var(--gold); }
.cat-card-count {
  font-size: 12px; color: var(--gold); background: var(--gold-faint);
  border: 1px solid var(--hairline); border-radius: 999px;
  padding: 2px 12px; white-space: nowrap;
}
.cat-card-list { list-style: none; }
.cat-card-list li {
  padding: 12px 0; border-bottom: 1px solid var(--hairline);
  display: flex; flex-direction: column; gap: 3px;
}
.cat-card-list li:last-child { border-bottom: none; }
.cat-card-list a { font-size: 15px; color: var(--ivory-soft); font-weight: 500; line-height: 1.4; transition: color 0.2s ease; }
.cat-card-list a:hover { color: var(--gold); }
.cat-card-list .cat-date { font-size: 11.5px; color: var(--muted); letter-spacing: 0.4px; }
.cat-card-more {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 18px;
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.6px; color: var(--gold);
  transition: gap 0.25s ease;
}
.cat-card:hover .cat-card-more { gap: 12px; }

/* ══════════════════════════ SINGLE / PAGE ══════════════════════════ */
.single-layout, .archive-layout {
  display: grid; grid-template-columns: 1fr 300px; gap: 44px;
  padding: 56px 0; align-items: start;
}
.post-full {
  background: var(--panel);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.post-header { padding: 44px 48px 28px; }
.post-header .post-cats { margin-bottom: 16px; }
.post-header .post-title {
  font-family: var(--serif); font-size: 38px; font-weight: 700;
  line-height: 1.18; color: var(--ivory); margin-bottom: 16px;
  letter-spacing: 0.2px;
}
.post-header .post-meta {
  display: flex; flex-wrap: wrap; gap: 10px 0;
  font-size: 13px; color: var(--muted);
}
.post-header .post-meta span + span {
  margin-left: 18px; padding-left: 18px; border-left: 1px solid var(--hairline);
}
.post-header .post-meta a { color: var(--gold); }
.post-featured-image {
  border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
  background: var(--night-950);
}
.post-featured-image img { display: block; width: 100%; height: auto; }
.post-body { padding: 12px 48px 48px; font-size: 17px; line-height: 1.9; color: var(--ivory); }
.post-body h2, .post-body h3, .post-body h4 {
  font-family: var(--serif); color: var(--ivory); margin: 40px 0 16px;
  line-height: 1.3; letter-spacing: 0.2px;
}
.post-body h2 { font-size: 29px; }
.post-body h3 { font-size: 23px; }
.post-body h4 { font-size: 19px; }
.post-body p { margin-bottom: 24px; }
.post-body p:first-of-type::first-letter {
  font-family: var(--serif); font-size: 60px; font-weight: 700;
  float: left; line-height: 0.78; padding-right: 12px;
  padding-top: 6px; color: var(--gold);
}
.post-body img {
  max-width: 100%; height: auto; border-radius: var(--radius);
  margin: 24px 0; box-shadow: var(--shadow-sm);
}
.post-body blockquote {
  position: relative; border: 1px solid var(--hairline);
  border-left: 3px solid var(--gold);
  margin: 32px 0; padding: 22px 28px;
  background: var(--glass); border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--serif); font-style: italic; font-size: 19px;
  color: var(--ivory-soft);
}
.post-body blockquote::before {
  content: '“'; position: absolute; top: 4px; left: 10px;
  font-family: var(--serif); font-size: 44px; color: var(--gold); opacity: 0.5;
}
.post-body a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--hairline-strong); }
.post-body a:hover { color: var(--gold-light); }
.post-body ul, .post-body ol { margin: 18px 0 18px 26px; }
.post-body li { margin-bottom: 10px; }
.post-body li::marker { color: var(--gold); }
.post-body hr { border: none; border-top: 1px solid var(--hairline); margin: 36px 0; }
.post-body table { width: 100%; border-collapse: collapse; margin: 24px 0; }
.post-body th, .post-body td { border: 1px solid var(--hairline); padding: 10px 14px; }
.post-body th { background: var(--glass); color: var(--gold); font-family: var(--serif); }
.post-body code { background: var(--glass); padding: 2px 7px; border-radius: 6px; font-size: 0.9em; }
.post-footer {
  padding: 22px 48px; border-top: 1px solid var(--hairline);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 14px;
}
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.post-tags a {
  font-size: 12px; color: var(--ivory-soft); text-decoration: none;
  padding: 5px 14px; background: var(--glass);
  border: 1px solid var(--hairline); border-radius: 999px;
  transition: var(--transition);
}
.post-tags a:hover { background: var(--gold); color: var(--night-950); border-color: var(--gold); }
.post-share { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.post-share a {
  color: var(--night-950); background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  padding: 7px 16px; border-radius: 999px; font-weight: 600; font-size: 12.5px;
  box-shadow: var(--glow-gold); transition: var(--transition);
}
.post-share a:hover { transform: translateY(-1px); box-shadow: 0 8px 26px var(--gold-glow); }

.post-nav { display: flex; gap: 20px; margin-top: 32px; }
.post-nav a {
  flex: 1; background: var(--panel); border: 1px solid var(--hairline);
  border-radius: var(--radius-lg); padding: 18px 22px;
  font-size: 13.5px; color: var(--ivory-soft); line-height: 1.5;
  transition: var(--transition);
}
.post-nav a:hover { border-color: var(--hairline-strong); box-shadow: var(--shadow-sm); color: var(--gold); }
.post-nav .nav-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 1.6px; color: var(--gold); margin-bottom: 4px; }

/* ══════════════════════════ SIDEBAR ══════════════════════════ */
.sidebar { position: sticky; top: 88px; align-self: start; display: flex; flex-direction: column; gap: 24px; }
.widget {
  background: var(--panel);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 26px;
}
.widget-title {
  font-family: var(--serif); font-size: 19px; font-weight: 600;
  color: var(--ivory); margin-bottom: 18px; padding-bottom: 14px;
  position: relative;
}
.widget-title::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  width: 44px; height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
}
.widget ul { list-style: none; }
.widget li { padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.widget li:last-child { border-bottom: none; }
.widget a { color: var(--ivory-soft); font-size: 14px; transition: color 0.2s ease; }
.widget a:hover { color: var(--gold); }
.widget .wp-block-search__button, .widget button, .widget input[type="submit"] {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: var(--night-950); border: none; border-radius: 999px;
  padding: 9px 18px; font-weight: 700; font-size: 13px; cursor: pointer;
  transition: var(--transition);
}
.widget .wp-block-search__button:hover { transform: translateY(-1px); box-shadow: var(--glow-gold); }
.widget input[type="search"], .widget input[type="text"], .widget select {
  width: 100%; padding: 10px 14px; margin-bottom: 10px;
  border: 1px solid var(--hairline); border-radius: var(--radius);
  font-family: var(--sans); font-size: 14px;
  background: var(--glass); color: var(--ivory);
}
.widget input::placeholder { color: var(--muted); }
.widget img { border-radius: var(--radius); }
.widget .wp-block-latest-posts { list-style: none; }
.widget .wp-block-latest-posts li { padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.widget .wp-block-latest-posts time { font-size: 11.5px; color: var(--muted); display: block; }

/* ══════════════════════════ ARCHIVE ══════════════════════════ */
.archive-header {
  margin-bottom: 40px; padding-bottom: 24px;
  border-bottom: 1px solid var(--hairline);
}
.archive-header .archive-kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; text-transform: uppercase; letter-spacing: 3px;
  color: var(--gold); font-weight: 600; margin-bottom: 10px;
}
.archive-header .archive-kicker::before { content: '✦'; }
.archive-title {
  font-family: var(--serif); font-size: 34px; font-weight: 700;
  color: var(--ivory); margin-bottom: 6px; letter-spacing: 0.2px;
}
.archive-description { color: var(--muted); font-size: 15px; }

/* ══════════════════════════ PAGINATION ══════════════════════════ */
.pagination { margin-top: 48px; text-align: center; }
.pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 42px; padding: 9px 16px; margin: 0 3px;
  border-radius: 999px; color: var(--ivory-soft);
  text-decoration: none; border: 1px solid var(--hairline);
  font-size: 14px; font-weight: 600; transition: var(--transition);
}
.pagination .page-numbers:hover { border-color: var(--gold); color: var(--gold); box-shadow: var(--glow-gold); }
.pagination .current {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: var(--night-950); border-color: transparent; box-shadow: var(--glow-gold);
}

/* ══════════════════════════ FOOTER ══════════════════════════ */
.site-footer {
  position: relative;
  background:
    radial-gradient(800px 400px at 85% 0%, rgba(212, 175, 55, 0.08), transparent 60%),
    var(--bg-deep);
  color: var(--ivory-soft);
  border-top: 1px solid var(--hairline-strong);
  padding: 60px 0 26px; margin-top: 64px;
  overflow: hidden;
}
.site-footer::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 10% 20%, var(--star) 50%, transparent 51%),
    radial-gradient(1px 1px at 30% 60%, var(--star) 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 55% 30%, var(--star) 50%, transparent 51%),
    radial-gradient(1px 1px at 75% 70%, var(--star) 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 92% 40%, var(--star) 50%, transparent 51%);
  background-size: 500px 500px, 420px 420px, 600px 600px, 460px 460px, 520px 520px;
}
.footer-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 44px;
}
.footer-branding h3 {
  font-family: var(--serif); color: var(--gold); font-size: 21px;
  margin-bottom: 10px; letter-spacing: 0.3px;
}
.footer-branding p { font-size: 14px; margin-bottom: 8px; color: var(--muted); line-height: 1.7; }
.footer-branding .footer-verse {
  font-family: var(--serif); font-style: italic; font-size: 15px;
  color: var(--gold-light); margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--hairline);
}
.footer-branding .footer-verse::before { content: '✦ '; opacity: 0.8; }
.footer-col h4 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 2px;
  color: var(--gold); margin-bottom: 18px; font-weight: 700;
  padding-bottom: 10px; position: relative;
}
.footer-col h4::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  width: 30px; height: 1.5px; background: var(--gold);
}
.footer-nav ul { list-style: none; }
.footer-nav li { margin-bottom: 9px; }
.footer-nav a { color: var(--ivory-soft); font-size: 14px; transition: color 0.2s ease, padding-left 0.2s ease; }
.footer-nav a:hover { color: var(--gold); padding-left: 4px; }
.footer-social { display: flex; flex-direction: column; gap: 10px; }
.footer-social a {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--ivory-soft); padding: 9px 18px;
  border: 1px solid var(--hairline); border-radius: 999px;
  font-size: 13px; font-weight: 500;
  transition: var(--transition);
}
.footer-social a::before { content: '↗'; color: var(--gold); font-size: 12px; }
.footer-social a:hover { border-color: var(--gold); color: var(--gold); box-shadow: var(--glow-gold); transform: translateY(-1px); }
.footer-bottom {
  position: relative; z-index: 1;
  margin-top: 40px; padding-top: 20px;
  border-top: 1px solid var(--hairline);
  font-size: 12px; color: var(--muted); text-align: center;
  letter-spacing: 0.4px;
}

/* ══════════════════════════ 404 & SEARCH ══════════════════════════ */
.notfound {
  text-align: center; padding: 110px 24px;
}
.notfound .nf-code {
  font-family: var(--serif); font-size: 96px; font-weight: 700;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  line-height: 1; margin-bottom: 8px;
}
.notfound h1 { font-family: var(--serif); font-size: 30px; color: var(--ivory); margin-bottom: 12px; }
.notfound p { color: var(--muted); margin-bottom: 28px; }
.notfound .btn-read { margin-top: 4px; }
.search-header { margin-bottom: 36px; }
.search-header h1 { font-family: var(--serif); font-size: 30px; color: var(--ivory); }
.search-header h1 span { color: var(--gold); font-style: italic; }
.search-empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.search-empty .btn-read { margin-top: 22px; }

/* ══════════════════════════ COMMENTS ══════════════════════════ */
.comments-area { margin-top: 40px; }
.comments-title, .comment-reply-title {
  font-family: var(--serif); font-size: 22px; color: var(--ivory);
  margin-bottom: 20px;
}
.comment-list { list-style: none; }
.comment-list .comment { margin-bottom: 20px; }
.comment-body {
  background: var(--glass); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 20px 24px;
}
.comment-author { font-weight: 600; color: var(--ivory); }
.comment-author .fn a { color: var(--gold); }
.comment-metadata { font-size: 12px; color: var(--muted); margin: 4px 0 12px; }
.comment-metadata a { color: var(--muted); }
.comment-content { font-size: 15px; color: var(--ivory-soft); }
.comment-content p { margin-bottom: 12px; }
.reply a { font-size: 12px; font-weight: 600; color: var(--gold); }
.comment-form label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"],
.comment-form textarea {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--hairline); border-radius: var(--radius);
  font-family: var(--sans); font-size: 15px;
  background: var(--glass); color: var(--ivory);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.comment-form input:focus, .comment-form textarea:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-faint);
}
.comment-form .submit {
  margin-top: 18px; padding: 12px 30px;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: var(--night-950); border: none; border-radius: 999px;
  font-weight: 700; font-size: 14px; cursor: pointer;
  box-shadow: var(--glow-gold); transition: var(--transition);
}
.comment-form .submit:hover { transform: translateY(-2px); }
.comment-respond { margin-top: 36px; }

/* ══════════════════════════ RESPONSIVE ══════════════════════════ */
@media (max-width: 1024px) {
  .container { padding: 0 20px; }
  .site-title { font-size: 18px; }
  .site-tagline { font-size: 9px; letter-spacing: 1.6px; }
  .main-nav a { padding: 8px 9px; font-size: 12px; }
  .hero { padding: 56px 0 64px; }
  .hero-inner { grid-template-columns: 1fr; gap: 32px; }
  .hero-text { padding-right: 0; }
  .hero-title { font-size: 36px; }
  .hero-image { max-width: 560px; }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .category-strip { grid-template-columns: 1fr 1fr; }
  .post-header { padding: 36px 36px 22px; }
  .post-body { padding: 8px 36px 40px; }
  .post-footer { padding: 20px 36px; }
  .single-layout, .archive-layout { gap: 32px; }
}

@media (max-width: 820px) {
  .single-layout, .archive-layout { grid-template-columns: 1fr; padding: 36px 0; }
  .sidebar { position: static; }
}

@media (max-width: 768px) {
  .container { padding: 0 18px; }
  .site-header { position: sticky; }
  .header-inner { min-height: 60px; flex-wrap: wrap; padding: 8px 0; }
  .site-branding { flex: 1; min-width: 0; }
  .menu-toggle { display: block; }
  .main-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: rgba(10, 16, 31, 0.97);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--hairline-strong);
    padding: 10px 18px 18px; z-index: 99;
    box-shadow: var(--shadow);
  }
  body.day-mode .main-nav { background: rgba(250, 246, 236, 0.98); }
  .main-nav.active { display: block; }
  .main-nav ul { flex-direction: column; gap: 2px; }
  .main-nav a { display: block; padding: 13px 14px; font-size: 15px; }
  .main-nav a::after { display: none; }

  .hero { padding: 44px 0 52px; }
  .hero-title { font-size: 29px; }
  .hero-excerpt { font-size: 15px; }
  .hero-verse { font-size: 16px; }
  .post-grid, .category-strip { grid-template-columns: 1fr; }
  .section { padding: 46px 0; }
  .section-title { font-size: 23px; }
  .section-ornament::after { width: 32px; }

  .post-header .post-title { font-size: 28px; }
  .post-header, .post-body, .post-footer { padding-left: 24px; padding-right: 24px; }
  .post-nav { flex-direction: column; }
  .archive-title { font-size: 27px; }
  .footer-inner { grid-template-columns: 1fr; gap: 34px; }
  .site-footer { padding: 44px 0 22px; margin-top: 44px; }
}

@media (max-width: 480px) {
  .site-title { font-size: 16px; }
  .site-logo img { width: 40px; height: 40px; }
  .site-tagline { display: none; }
  .hero-cta { flex-direction: column; align-items: flex-start; gap: 12px; }
  .hero-title { font-size: 26px; }
  .post-header .post-title { font-size: 25px; }
}
