/* ==========================================================================
   Masters of the Spirit World — Modern Celestial Static Website Stylesheet
   Palette inspired by the original planetary aurora artwork:
   Deep Cosmic Sapphire, Starlight Cyan, Electric Royal Blue, Aurora Magenta & Emerald
   ========================================================================== */

:root {
  --bg-void: #050816;
  --bg-cosmos: #090e26;
  --bg-nebula: #101942;
  --bg-surface: rgba(15, 24, 62, 0.82);
  --bg-card: rgba(17, 27, 68, 0.85);
  --bg-card-hover: rgba(24, 38, 92, 0.95);
  --bg-glass: rgba(10, 16, 44, 0.78);
  --bg-question: linear-gradient(135deg, rgba(37, 99, 235, 0.20) 0%, rgba(56, 189, 248, 0.10) 100%);
  --bg-answer: linear-gradient(135deg, rgba(139, 92, 246, 0.13) 0%, rgba(30, 58, 138, 0.18) 100%);
  --bg-note: rgba(16, 185, 129, 0.10);

  --text-bright: #ffffff;
  --text-primary: #eef2ff;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --accent-cyan: #38bdf8;
  --accent-blue: #3b82f6;
  --accent-royal: #4a84e5;
  --accent-indigo: #6366f1;
  --accent-violet: #a855f7;
  --accent-magenta: #ec4899;
  --accent-emerald: #10b981;
  --accent-gold: #fde047;

  --border-subtle: rgba(148, 163, 184, 0.16);
  --border-glow: rgba(56, 189, 248, 0.42);
  --border-aurora: rgba(168, 85, 247, 0.45);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --radius-pill: 9999px;

  --shadow-card: 0 18px 45px -12px rgba(2, 5, 18, 0.82), 0 0 1px 1px rgba(148, 163, 184, 0.12);
  --shadow-card-hover: 0 26px 60px -12px rgba(3, 7, 26, 0.95), 0 0 32px -4px rgba(56, 189, 248, 0.28), 0 0 1px 1px rgba(56, 189, 248, 0.45);
  --shadow-glow-magenta: 0 0 35px -5px rgba(236, 72, 153, 0.32);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --transition-smooth: all 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-void);
  background-image:
    radial-gradient(circle at 15% 15%, rgba(168, 85, 247, 0.16) 0%, transparent 40%),
    radial-gradient(circle at 85% 10%, rgba(56, 189, 248, 0.18) 0%, transparent 42%),
    radial-gradient(circle at 50% 55%, rgba(37, 99, 235, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 20% 85%, rgba(16, 185, 129, 0.09) 0%, transparent 40%),
    linear-gradient(180deg, #050816 0%, #09102d 45%, #070b20 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Subtle Twinkling Starlight Backdrop */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 10% 20%, rgba(255, 255, 255, 0.65) 50%, transparent 100%),
    radial-gradient(1px 1px at 28% 65%, rgba(125, 211, 252, 0.6) 50%, transparent 100%),
    radial-gradient(2px 2px at 46% 12%, rgba(240, 171, 252, 0.55) 50%, transparent 100%),
    radial-gradient(1.5px 1.5px at 68% 42%, rgba(255, 255, 255, 0.5) 50%, transparent 100%),
    radial-gradient(1px 1px at 82% 78%, rgba(56, 189, 248, 0.65) 50%, transparent 100%),
    radial-gradient(1.5px 1.5px at 91% 25%, rgba(255, 255, 255, 0.6) 50%, transparent 100%),
    radial-gradient(1px 1px at 15% 88%, rgba(167, 243, 208, 0.5) 50%, transparent 100%),
    radial-gradient(2px 2px at 58% 82%, rgba(192, 132, 252, 0.5) 50%, transparent 100%);
  background-size: 550px 550px;
  animation: cosmicDrift 90s linear infinite;
  opacity: 0.65;
}

@keyframes cosmicDrift {
  0% { background-position: 0 0; }
  100% { background-position: 550px 550px; }
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.75; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.04); }
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: var(--transition-smooth);
}

a:hover {
  color: #bae6fd;
}

/* ==========================================================================
   Sticky Glassmorphic Top Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(6, 10, 29, 0.85);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(56, 189, 248, 0.18);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
}

.nav-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--text-bright);
  font-weight: 700;
  text-decoration: none;
}

.brand-orb {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #38bdf8 35%, #4f46e5 70%, #a855f7 100%);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.7), 0 0 35px rgba(168, 85, 247, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  animation: pulseGlow 5s ease-in-out infinite;
}

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

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.22rem;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, #ffffff 0%, #bae6fd 55%, #e9d5ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-cyan);
  opacity: 0.9;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-link {
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-pill);
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-bright);
  background: rgba(56, 189, 248, 0.14);
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.3);
}

/* Categories Dropdown in Header */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  width: 320px;
  background: rgba(10, 16, 45, 0.97);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-md);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 25px rgba(56, 189, 248, 0.2);
  padding: 0.65rem;
  display: none;
  grid-template-columns: 1fr;
  gap: 0.25rem;
  z-index: 1100;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
  display: grid;
}

.nav-dropdown::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 0.6rem;
}

.dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.88rem;
  transition: var(--transition-smooth);
}

.dropdown-item:hover {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.18), rgba(168, 85, 247, 0.18));
  color: #ffffff;
  transform: translateX(4px);
}

.dropdown-count {
  font-size: 0.74rem;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-pill);
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  font-weight: 600;
}

.nav-search-btn {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.35), rgba(168, 85, 247, 0.35));
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: var(--text-bright);
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}

.nav-search-btn:hover {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.6), rgba(168, 85, 247, 0.6));
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}

.mobile-menu-toggle {
  display: none;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--text-bright);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  font-size: 1.25rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   Hero Section (Home & Category Pages)
   ========================================================================== */
.hero-section {
  position: relative;
  min-height: 540px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 1.5rem 4.5rem;
  overflow: hidden;
  border-bottom: 1px solid rgba(56, 189, 248, 0.22);
}

.hero-section.category-hero {
  min-height: 400px;
  padding: 4rem 1.5rem 3.5rem;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  z-index: 1;
  transform: scale(1.03);
  transition: transform 8s ease-out;
}

.hero-section:hover .hero-bg {
  transform: scale(1.07);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(5, 8, 22, 0.55) 0%, rgba(7, 12, 34, 0.68) 55%, #050816 100%),
    radial-gradient(circle at center, rgba(14, 23, 56, 0.25) 0%, rgba(5, 8, 22, 0.8) 100%);
}

.hero-content {
  position: relative;
  z-index: 3;
  max-width: 960px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.15rem;
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 62, 0.78);
  border: 1px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.25);
  color: #e0f2fe;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(10px);
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.35rem, 5vw, 4.1rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.1rem;
  background: linear-gradient(135deg, #ffffff 0%, #e0f2fe 45%, #c4b5fd 80%, #f5d0fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 12px 35px rgba(0, 0, 0, 0.6);
}

.hero-subtitle {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: #e2e8f0;
  max-width: 780px;
  margin: 0 auto 2.2rem;
  font-weight: 400;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

/* Global Search Box in Hero */
.hero-search-wrapper {
  max-width: 720px;
  margin: 0 auto;
  position: relative;
}

.hero-search-box {
  display: flex;
  align-items: center;
  background: rgba(10, 17, 46, 0.88);
  border: 1.5px solid rgba(56, 189, 248, 0.5);
  border-radius: var(--radius-pill);
  padding: 0.45rem 0.55rem 0.45rem 1.5rem;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.65), 0 0 30px rgba(56, 189, 248, 0.25);
  backdrop-filter: blur(16px);
  transition: var(--transition-smooth);
}

.hero-search-box:focus-within {
  border-color: var(--accent-violet);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.8), 0 0 35px rgba(168, 85, 247, 0.45);
  transform: translateY(-2px);
}

.hero-search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-bright);
  font-size: 1.02rem;
  outline: none;
  padding: 0.6rem 0.5rem;
}

.hero-search-input::placeholder {
  color: var(--text-muted);
}

.hero-search-btn {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 55%, #db2777 100%);
  color: #ffffff;
  border: none;
  padding: 0.78rem 1.65rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  white-space: nowrap;
}

.hero-search-btn:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 22px rgba(219, 39, 119, 0.5);
}

/* Quick Stats Bar */
.stats-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem 2.5rem;
  margin-top: 2.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.92rem;
  color: #e2e8f0;
}

.stat-pill strong {
  color: var(--accent-cyan);
  font-size: 1.15rem;
}

/* ==========================================================================
   Main Layout Containers & Section Headings
   ========================================================================== */
.container {
  max-width: 1340px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 2;
}

.section {
  padding: 4.5rem 0;
}

.section-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 3.25rem;
}

.section-eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-cyan);
  margin-bottom: 0.6rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.85rem, 3.5vw, 2.75rem);
  color: var(--text-bright);
  margin-bottom: 0.85rem;
  line-height: 1.22;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

/* ==========================================================================
   Category Cards Grid (Home Page)
   ========================================================================== */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 2rem;
}

.category-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(56, 189, 248, 0.2);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.35s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  backdrop-filter: blur(12px);
  transform: translateZ(0);
  backface-visibility: hidden;
}

.category-card:hover {
  transform: translate3d(0, -8px, 0);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(168, 85, 247, 0.55);
}

.category-card-media {
  display: block;
  flex-shrink: 0;
  position: relative;
  height: 205px;
  overflow: hidden;
  background: transparent;
  -webkit-mask-image: linear-gradient(180deg, #000000 0%, #000000 76%, rgba(0, 0, 0, 0) 97%, rgba(0, 0, 0, 0) 100%);
  mask-image: linear-gradient(180deg, #000000 0%, #000000 76%, rgba(0, 0, 0, 0) 97%, rgba(0, 0, 0, 0) 100%);
}

.category-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  -webkit-mask-image: linear-gradient(180deg, #000000 0%, #000000 72%, rgba(0, 0, 0, 0) 92%, rgba(0, 0, 0, 0) 100%);
  mask-image: linear-gradient(180deg, #000000 0%, #000000 72%, rgba(0, 0, 0, 0) 92%, rgba(0, 0, 0, 0) 100%);
}

.category-card:hover .category-card-media img {
  transform: scale(1.08);
}

.category-count-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  background: rgba(8, 13, 38, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #e0f2fe;
  padding: 0.32rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
}

.category-card-body {
  padding: 0.35rem 1.75rem 1.65rem;
  margin-top: -0.45rem;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.category-card-title {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  color: var(--text-bright);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.category-card-tagline {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  flex: 1;
}

.subtheme-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.4rem;
}

.subtheme-pill-mini {
  display: inline-flex;
  align-items: center;
  font-size: 0.74rem;
  padding: 0.24rem 0.65rem;
  border-radius: var(--radius-pill);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.22);
  color: #bae6fd;
  text-decoration: none;
  transition: var(--transition-smooth);
  cursor: pointer;
}

.subtheme-pill-mini:hover {
  background: rgba(56, 189, 248, 0.24);
  border-color: var(--accent-cyan);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.25);
}

.category-card-cta {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  color: var(--accent-cyan);
  font-weight: 600;
  font-size: 0.92rem;
}

.category-card:hover .category-card-cta {
  color: #f0abfc;
}

/* ==========================================================================
   About This Website & Heritage Banner
   ========================================================================== */
.about-showcase {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 2.25rem;
  background: linear-gradient(135deg, rgba(17, 29, 74, 0.9) 0%, rgba(28, 20, 68, 0.9) 100%);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: var(--radius-xl);
  padding: 2.75rem;
  box-shadow: var(--shadow-card), var(--shadow-glow-magenta);
  align-items: center;
}

.about-showcase h2 {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--text-bright);
  margin-bottom: 1rem;
}

.about-showcase p {
  color: var(--text-primary);
  font-size: 1.04rem;
  margin-bottom: 1.15rem;
  line-height: 1.8;
}

.channellers-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.channeller-badge {
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 0.4rem 0.95rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  color: #e0f2fe;
}

.heritage-cards-col {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.mini-feature-card {
  background: rgba(9, 15, 42, 0.78);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.4rem;
  transition: var(--transition-smooth);
}

.mini-feature-card:hover {
  transform: translateX(6px);
  border-color: var(--accent-cyan);
  background: rgba(16, 26, 68, 0.92);
}

.mini-feature-card h3 {
  font-size: 1.08rem;
  color: var(--text-bright);
  margin-bottom: 0.35rem;
}

.mini-feature-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 0;
  line-height: 1.5;
}

/* ==========================================================================
   Category Page Filter & Thematic Sub-Group Bar
   ========================================================================== */
.category-controls-bar {
  background: rgba(11, 18, 48, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: -2.2rem auto 2.75rem;
  position: relative;
  z-index: 10;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(16px);
}

.controls-top-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.local-search-box {
  flex: 1;
  min-width: 260px;
  display: flex;
  align-items: center;
  background: rgba(5, 9, 26, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-pill);
  padding: 0.55rem 1.15rem;
}

.local-search-box input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-bright);
  font-size: 0.95rem;
  outline: none;
  margin-left: 0.5rem;
}

.control-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.btn-control {
  background: rgba(30, 41, 99, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: var(--text-primary);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-control:hover, .btn-control.active {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  border-color: var(--accent-cyan);
  color: #ffffff;
}

.subtheme-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.subtheme-tab {
  background: rgba(15, 24, 62, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.24);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.subtheme-tab:hover {
  border-color: var(--accent-cyan);
  color: var(--text-bright);
  transform: translateY(-2px);
}

.subtheme-tab.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.85), rgba(147, 51, 234, 0.85));
  border-color: #bae6fd;
  color: #ffffff;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.35);
}

.subtheme-tab-count {
  background: rgba(0, 0, 0, 0.35);
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
}

/* ==========================================================================
   Thematic Sub-Section Headers & Q&A Cards
   ========================================================================== */
.thematic-cluster-section,
section[id^="dir-"] {
  margin-bottom: 4rem;
  scroll-margin-top: 95px;
}

.cluster-header {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.22) 0%, rgba(168, 85, 247, 0.14) 60%, transparent 100%);
  border-left: 4px solid var(--accent-cyan);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.25rem 1.75rem;
  margin-bottom: 1.75rem;
}

.cluster-title {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  color: var(--text-bright);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.cluster-count {
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  border-left: 2px solid rgba(56, 189, 248, 0.35);
  padding-left: 0.75rem;
  user-select: none;
}

.cluster-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.qa-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.qa-card {
  background: var(--bg-card);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: var(--transition-smooth);
  position: relative;
}

.qa-card:hover {
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: var(--shadow-card-hover);
}

.qa-card-header {
  padding: 1.5rem 2rem 1.15rem;
  background: linear-gradient(180deg, rgba(24, 38, 94, 0.55) 0%, rgba(15, 24, 62, 0.2) 100%);
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  cursor: pointer;
}

.qa-meta-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.78rem;
}

.badge-theme {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #bae6fd;
  padding: 0.2rem 0.75rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
}

.badge-subtheme {
  background: rgba(168, 85, 247, 0.16);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #e9d5ff;
  padding: 0.2rem 0.75rem;
  border-radius: var(--radius-pill);
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition-smooth);
}

.badge-subtheme:hover {
  background: rgba(168, 85, 247, 0.3);
  border-color: #d8b4fe;
  color: #ffffff;
}

.badge-questioner {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.32);
  color: #a7f3d0;
  padding: 0.2rem 0.75rem;
  border-radius: var(--radius-pill);
}

.badge-type-msg {
  background: rgba(250, 204, 21, 0.15);
  border: 1px solid rgba(250, 204, 21, 0.4);
  color: #fef08a;
  padding: 0.2rem 0.75rem;
  border-radius: var(--radius-pill);
}

.qa-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.qa-card-title {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  color: var(--text-bright);
  line-height: 1.3;
}

.qa-card-title a {
  color: inherit;
}

.qa-card-title a:hover {
  color: var(--accent-cyan);
}

.qa-toggle-btn {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--accent-cyan);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.qa-card.collapsed .qa-card-body {
  display: none;
}

.qa-card.collapsed .qa-toggle-btn {
  transform: rotate(-90deg);
}

.qa-card-body {
  padding: 1.65rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  font-size: 1.05rem;
  line-height: 1.8;
}

.qa-question-block {
  background: var(--bg-question);
  border-left: 4px solid var(--accent-cyan);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.25rem 1.5rem;
}

.qa-answer-block {
  background: var(--bg-answer);
  border-left: 4px solid var(--accent-violet);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.35rem 1.6rem;
}

.qa-note-block {
  background: var(--bg-note);
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.25rem;
  font-size: 0.92rem;
  color: #d1fae5;
}

.qa-block-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.qa-question-block .qa-block-label {
  color: var(--accent-cyan);
}

.qa-answer-block .qa-block-label {
  color: #d8b4fe;
}

.qa-block-content p,
.message-body p {
  margin-bottom: 1.05rem;
  color: var(--text-primary);
}

.qa-block-content p:last-child,
.message-body p:last-child {
  margin-bottom: 0;
}

.qa-block-content ol,
.qa-block-content ul,
.message-body ol,
.message-body ul {
  margin: 0.85rem 0 1.1rem 1.6rem;
  color: var(--text-primary);
}

.qa-block-content li,
.message-body li {
  margin-bottom: 0.5rem;
}

.qa-card-footer {
  padding: 0.95rem 2rem;
  background: rgba(6, 10, 28, 0.6);
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.qa-ref-date {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.qa-footer-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.qa-permalink-btn {
  color: var(--accent-cyan);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.qa-permalink-btn:hover {
  color: #f0abfc;
}

/* ==========================================================================
   Breadcrumbs & Standalone Post Navigation
   ========================================================================== */
.breadcrumb-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.breadcrumb-nav a {
  color: var(--accent-cyan);
}

.post-Adjacent-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.adjacent-card {
  background: var(--bg-card);
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: var(--transition-smooth);
}

.adjacent-card:hover {
  border-color: var(--accent-violet);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

.adjacent-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.adjacent-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--text-bright);
}

/* ==========================================================================
   Global Search Overlay Modal
   ========================================================================== */
.search-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(3, 6, 20, 0.86);
  backdrop-filter: blur(14px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 4rem 1.25rem 2rem;
  overflow-y: auto;
}

.search-modal-backdrop.open {
  display: flex;
}

.search-modal {
  width: 100%;
  max-width: 880px;
  background: rgba(12, 20, 54, 0.98);
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9), 0 0 40px rgba(56, 189, 248, 0.28);
  overflow: hidden;
}

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

.search-modal-input {
  flex: 1;
  background: rgba(5, 8, 22, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: var(--radius-pill);
  padding: 0.75rem 1.25rem;
  color: var(--text-bright);
  font-size: 1rem;
  outline: none;
}

.search-modal-close {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fecaca;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-weight: 600;
}

.search-modal-results {
  max-height: 68vh;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.search-result-item {
  background: rgba(18, 29, 74, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.35rem;
  transition: var(--transition-smooth);
  display: block;
}

.search-result-item:hover {
  border-color: var(--accent-cyan);
  background: rgba(26, 42, 102, 0.95);
  transform: translateX(4px);
}

.search-result-title {
  font-family: var(--font-serif);
  font-size: 1.18rem;
  color: var(--text-bright);
  margin-bottom: 0.35rem;
}

.search-result-excerpt {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ==========================================================================
   Footer & Back-to-Top
   ========================================================================== */
.site-footer {
  background: rgba(4, 7, 20, 0.95);
  border-top: 1px solid rgba(56, 189, 248, 0.2);
  padding: 4rem 0 2.5rem;
  margin-top: 4rem;
  position: relative;
  z-index: 2;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.75rem;
}

.footer-col h4 {
  font-family: var(--font-serif);
  color: var(--text-bright);
  font-size: 1.18rem;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1rem;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--accent-cyan);
}

.footer-bottom {
  padding-top: 1.75rem;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.back-to-top {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  z-index: 900;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #9333ea);
  border: 1px solid rgba(186, 230, 253, 0.5);
  color: #ffffff;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 20px rgba(56, 189, 248, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  transform: translateY(-4px) scale(1.06);
}

/* ==========================================================================
   Responsive Design (Tablet & Mobile)
   ========================================================================== */
@media (max-width: 1024px) {
  .about-showcase {
    grid-template-columns: 1fr;
    padding: 2rem;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: inline-flex;
  }
  .main-nav {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    background: rgba(6, 10, 30, 0.98);
    border-bottom: 1px solid rgba(56, 189, 248, 0.3);
    padding: 1.25rem;
    flex-direction: column;
    align-items: stretch;
    display: none;
    max-height: calc(100vh - 68px);
    overflow-y: auto;
  }
  .main-nav.open {
    display: flex;
  }
  .nav-dropdown-menu {
    position: static;
    width: 100%;
    display: grid;
    margin-top: 0.5rem;
    box-shadow: none;
  }
  .categories-grid {
    grid-template-columns: 1fr;
  }
  .hero-section {
    min-height: 440px;
    padding: 3.5rem 1.15rem 3rem;
  }
  .hero-search-box {
    flex-direction: column;
    border-radius: var(--radius-md);
    padding: 0.75rem;
    gap: 0.65rem;
  }
  .hero-search-input, .hero-search-btn {
    width: 100%;
  }
  .qa-card-header, .qa-card-body, .qa-card-footer {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
  .post-Adjacent-nav {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}
