:root {
  --color-scheme: dark;
  --bg-base: #060609;
  --bg-body-grad-top: rgba(230, 195, 106, 0.07);
  --bg-body-grad-bottom: rgba(20, 20, 30, 0.8);
  --glass-primary: rgba(14, 14, 20, 0.82);
  --glass-secondary: rgba(20, 20, 28, 0.88);
  --glass-nested: rgba(8, 8, 14, 0.65);
  --glass-card: rgba(18, 18, 26, 0.78);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-border-hover: rgba(255, 255, 255, 0.25);
  --glass-border-subtle: rgba(255, 255, 255, 0.07);
  --gold-primary: #e6c36a;
  --gold-secondary: #c9a44c;
  --gold-border: rgba(230, 195, 106, 0.35);
  --gold-glow: rgba(230, 195, 106, 0.18);
  --highlight-color: #e6c36a;
  --gold-on-primary: #17130a;
  --gold-button-ink: var(--gold-on-primary);
  --ui-control-radius: 15px;
  --ui-control-inner-radius: 12px;
  --ui-control-border: 1px solid rgba(255, 255, 255, 0.48);
  --ui-control-bevel: inset 0 1px 0 rgba(255, 255, 255, 0.24), inset 0 -2px 0 rgba(0, 0, 0, 0.2), 0 4px 10px rgba(0, 0, 0, 0.22);
  --ui-control-pressed: inset 0 2px 5px rgba(0, 0, 0, 0.28);
  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-heading: #ffffff;
  --font-serif: "Lora", "Noto Serif", Georgia, "Times New Roman", serif;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
  --shadow-card: 0 10px 30px -8px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--glass-border);
  --shadow-elevation: 0 20px 40px -12px rgba(0, 0, 0, 0.75);
  --transition-normal: 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  --hero-bg-overlay: linear-gradient(180deg, rgba(16, 16, 24, 0.9) 0%, rgba(6, 6, 9, 0.95) 100%);
  --history-bg: linear-gradient(180deg, #09090e 0%, #0d0d14 50%, #09090e 100%);
  --footer-bg: #040406;
  --fullscreen-bg: rgba(6, 6, 10, 0.96);
  --icon-wrap-bg: rgba(255, 255, 255, 0.05);
  --icon-wrap-border: rgba(255, 255, 255, 0.1);
  --history-statue-filter: none;
}

/* Section Colors (CPH 1:1 Palette) */
:root {
  --color-10-commandments: #009464;
  --color-creed: #efaf38;
  --color-lords-prayer: #f17742;
  --color-baptism: #d04d6d;
  --color-confession: #cd71cb;
  --color-altar: #9357c9;
  --color-daily-prayers: #6373ce;
  --color-table-of-duties: #0058bc;
  --color-questions-answers: #1ca1e0;
  --color-preface: #93a9c5;
  --color-introduction: #8fa655;
  --color-appendix: #d14742;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg-base);
  color: var(--text-main);
  font-family: var(--font-serif);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  background-color: var(--bg-base);
  background-image: 
    radial-gradient(ellipse at 50% 0%, var(--bg-body-grad-top) 0%, transparent 60%),
    radial-gradient(circle at 100% 100%, var(--bg-body-grad-bottom) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.75;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a {
  color: var(--gold-primary);
  text-decoration: none;
  transition: color var(--transition-normal), border-color var(--transition-normal);
}

a:hover {
  color: #fff;
}

/* ==========================================================================
   Site Header (Landing Page)
   ========================================================================== */

header.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.75rem;
  background: var(--glass-primary);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-main);
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.site-logo img, .site-logo svg {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.site-logo svg path {
  fill: #ffffff;
  transition: fill var(--transition-normal);
}

.site-logo .site-logo-accent {
  color: var(--gold-primary);
}

nav.site-nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  align-items: center;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
}

nav.site-nav a {
  color: var(--text-secondary);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
}

nav.site-nav a:hover {
  color: var(--gold-primary);
}

nav.site-nav a.nav-external {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--gold-border);
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-pill);
  color: var(--gold-primary);
  background: rgba(230, 195, 106, 0.08);
}

nav.site-nav a.nav-external:hover {
  background: var(--gold-primary);
  color: #0c0a06;
}

/* ==========================================================================
   Hero Section (1:1 with CPH)
   ========================================================================== */

section.hero {
  position: relative;
  text-align: center;
  padding: 4.5rem 1.5rem 3.5rem;
  background: var(--hero-bg-overlay),
              url("/img/hero-bg.jpg") center/cover no-repeat;
  border-bottom: 1px solid var(--glass-border);
}

.hero-content {
  max-width: 900px;
  margin: 0 auto 3rem;
}

.hero-subtitle-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: rgba(230, 195, 106, 0.12);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-pill);
  color: var(--gold-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-heading);
  margin-bottom: 1.2rem;
  letter-spacing: -0.01em;
}

.hero h2 {
  font-family: var(--font-sans);
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  font-weight: 400;
  color: var(--text-secondary);
  max-width: 750px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ==========================================================================
   Chief Parts Grid (1:1 with CPH Cards)
   ========================================================================== */

.chief-parts-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1rem;
}

.chief-parts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.chief-part-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2.2rem 1.5rem 1.8rem;
  background: var(--glass-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
  color: var(--text-main);
  text-decoration: none;
  overflow: hidden;
}

.chief-part-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--card-accent, var(--gold-primary));
  opacity: 0.85;
  transition: height var(--transition-normal), opacity var(--transition-normal);
}

.chief-part-card:hover {
  transform: translateY(-6px);
  border-color: var(--card-accent, var(--gold-primary));
  box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.8), 0 0 20px -5px var(--card-accent-glow, var(--gold-glow));
}

.chief-part-card:hover::before {
  height: 6px;
  opacity: 1;
}

.chief-part-icon-wrap {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.4rem;
  background: var(--icon-wrap-bg);
  border: 1px solid var(--icon-wrap-border);
  box-shadow: inset 0 0 15px rgba(0,0,0,0.06);
  transition: transform var(--transition-normal), background var(--transition-normal);
}

.chief-part-card:hover .chief-part-icon-wrap {
  transform: scale(1.08);
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--card-accent, var(--gold-primary));
}

.chief-part-icon-wrap img, .chief-part-icon-wrap svg {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.chief-part-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-heading);
  margin-bottom: 0.5rem;
}

.chief-part-card p.part-desc {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 0.25rem;
}

/* ==========================================================================
   History Section (Luther Márton & 1529)
   ========================================================================== */

section.history {
  position: relative;
  padding: 5rem 1.5rem;
  background: var(--history-bg);
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
  overflow: hidden;
}

/* ==========================================================================
   Full Table of Contents Section (Displayed Smaller Underneath)
   ========================================================================== */

.full-toc-section {
  max-width: 1240px;
  margin: 3.5rem auto 4.5rem;
  padding: 0 1rem;
}

.full-toc-header {
  text-align: center;
  margin-bottom: 2.2rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--glass-border);
}

.full-toc-header h2 {
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.full-toc-header p {
  font-family: var(--font-sans);
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 600px;
  margin: 0 auto;
}

.full-toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.9rem;
}

.toc-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1.1rem;
  background: var(--glass-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-main);
  transition: transform var(--transition-normal), border-color var(--transition-normal), background var(--transition-normal), box-shadow var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.toc-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: var(--card-accent, var(--gold-primary));
  opacity: 0.7;
  transition: opacity var(--transition-normal), width var(--transition-normal);
}

.toc-card:hover {
  transform: translateY(-2px);
  border-color: var(--card-accent, var(--gold-border));
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.45);
}

.toc-card:hover::before {
  width: 4px;
  opacity: 1;
}

.toc-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--icon-wrap-bg);
  border: 1px solid var(--icon-wrap-border);
  transition: transform var(--transition-normal);
}

.toc-card:hover .toc-card-icon {
  transform: scale(1.08);
}

.toc-card-icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.toc-card-body {
  flex: 1;
  min-width: 0;
}

.toc-card-num {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--card-accent, var(--gold-primary));
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 0.15rem;
}

.toc-card-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  line-height: 1.3;
}

.toc-card-desc {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  margin-top: 0.1rem;
}

/* Light mode overrides for TOC */
[data-theme="light"] .toc-card {
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(28, 25, 23, 0.12) !important;
  box-shadow: 0 4px 14px rgba(60, 45, 20, 0.06) !important;
}

[data-theme="light"] .toc-card:hover {
  background: #ffffff !important;
  border-color: var(--card-accent, #996515) !important;
  box-shadow: 0 8px 22px rgba(60, 45, 20, 0.12) !important;
}

[data-theme="light"] .toc-card-title {
  color: #1c1917 !important;
}

[data-theme="light"] .toc-card-desc {
  color: #57534e !important;
}

[data-theme="light"] .full-toc-header h2 {
  color: #1c1917 !important;
}

[data-theme="light"] .full-toc-header p {
  color: #57534e !important;
}

/* ==========================================================================
   Content Pages (1:1 CPH Content Structure)
   ========================================================================== */

/* Top bar for inner content pages */
.content-header-bar {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 58px;
  display: flex;
  align-items: center;
  background: var(--header-bg, #009464);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  transition: background 0.3s ease;
}

.content-header-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.menu-trigger-btn {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
  transition: background var(--transition-normal), transform var(--transition-normal);
}

.menu-trigger-btn:hover {
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
}

.menu-trigger-btn svg {
  width: 20px;
  height: 20px;
}

.content-header-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 700;
  font-family: var(--font-serif);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.content-header-title img, .content-header-title svg {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.content-header-home {
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.content-header-home:hover {
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
}

/* Above Fold Banner (CPH 1:1) */
.above-fold {
  position: relative;
  background: var(--header-bg, #009464);
  padding: 3.5rem 1.5rem 3rem;
  text-align: center;
  color: #ffffff;
  box-shadow: inset 0 -20px 30px -10px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.above-fold::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.18) 0%, rgba(0, 0, 0, 0.35) 100%);
  pointer-events: none;
}

.above-fold-inner {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: 0 auto;
}

.above-fold-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.18);
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.above-fold-icon img, .above-fold-icon svg {
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.above-fold h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.above-fold p.part-number {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.9;
}

/* Reading Content View */
main.reading-layout {
  flex: 1;
  padding: 3rem 1.5rem 5rem;
}

.reading-container {
  max-width: 820px;
  margin: 0 auto;
  background: var(--glass-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 3.5rem 3rem;
  box-shadow: var(--shadow-card);
}

.catechism-household-preface {
  text-align: center;
  font-size: 1.25rem;
  font-style: italic;
  color: var(--gold-primary);
  padding-bottom: 2.2rem;
  margin-bottom: 2.8rem;
  border-bottom: 1px solid var(--glass-border);
  line-height: 1.6;
}

/* Typography in Reading View */
.reading-container h2 {
  font-size: 1.85rem;
  color: var(--text-heading);
  margin-top: 2.8rem;
  margin-bottom: 1.2rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--glass-border-subtle);
}

.reading-container h3 {
  font-size: 1.45rem;
  color: var(--gold-primary);
  margin-top: 2.2rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.reading-container h4 {
  font-size: 1.15rem;
  font-family: var(--font-sans);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-top: 2.4rem;
  margin-bottom: 0.5rem;
}

.reading-container p {
  font-size: 1.18rem;
  line-height: 1.85;
  color: var(--text-secondary);
  margin-bottom: 1.4rem;
}

.reading-container p strong {
  color: var(--text-heading);
  font-weight: 700;
}

.reading-container em {
  font-style: italic;
}

/* Catechism Q&A Block */
.kate-qa-block {
  margin: 1.8rem 0 2.2rem;
  padding: 1.5rem 1.8rem;
  background: var(--glass-nested);
  border-left: 3px solid var(--card-accent, var(--gold-primary));
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.kate-qa-block .kate-q {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-style: italic;
  font-weight: 700;
  color: var(--gold-primary);
  margin-bottom: 0.75rem;
}

.kate-qa-block .kate-a {
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--text-main);
  margin-bottom: 0;
}

/* Scripture citation box */
.scripture-quote {
  margin: 1.8rem 0;
  padding: 1.25rem 1.6rem;
  background: rgba(230, 195, 106, 0.05);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  line-height: 1.75;
  color: var(--text-main);
}

.scripture-quote .scripture-ref {
  display: block;
  text-align: right;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold-primary);
  margin-top: 0.5rem;
}

/* Bottom Navigation */
.bottom-chapter-nav {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.chapter-nav-btn {
  display: inline-flex;
  flex-direction: column;
  padding: 1rem 1.4rem;
  background: var(--glass-nested);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  min-width: 200px;
  transition: all var(--transition-normal);
}

.chapter-nav-btn:hover {
  border-color: var(--gold-primary);
  background: rgba(230, 195, 106, 0.08);
  transform: translateY(-2px);
  color: #fff;
}

.chapter-nav-btn .nav-direction {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gold-primary);
  margin-bottom: 0.25rem;
}

.chapter-nav-btn.next {
  text-align: right;
  margin-left: auto;
}

/* ==========================================================================
   Fullscreen Overlay Menu (1:1 with CPH)
   ========================================================================== */

menu.fullscreen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: var(--fullscreen-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 2.5rem 1.5rem 4rem;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-20px);
  transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s ease;
}

menu.fullscreen.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.fullscreen-header {
  max-width: 960px;
  margin: 0 auto 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 1.5rem;
}

.fullscreen-title-wrap h2 {
  font-size: 1.8rem;
  color: var(--text-heading);
  margin-bottom: 0.25rem;
}

.fullscreen-title-wrap p {
  font-size: 1.05rem;
  font-style: italic;
  color: var(--gold-primary);
}

.fullscreen-close-btn {
  background: var(--icon-wrap-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition-normal), transform var(--transition-normal);
}

.fullscreen-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.08);
}

.fullscreen-links-grid {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.2rem;
}

.fullscreen-link-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  transition: all var(--transition-normal);
}

.fullscreen-link-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--gold-primary);
  transform: translateX(4px);
  color: #fff;
}

.fullscreen-link-item img, .fullscreen-link-item svg {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.fullscreen-link-item span {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
}

.fullscreen-footer {
  max-width: 960px;
  margin: 3rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 1rem;
}

.fullscreen-footer a {
  color: var(--gold-primary);
}

/* ==========================================================================
   Site Footer
   ========================================================================== */

footer.site-footer {
  background: var(--footer-bg);
  border-top: 1px solid var(--glass-border);
  padding: 3.5rem 1.5rem 2.5rem;
  margin-top: auto;
  font-family: var(--font-sans);
  color: var(--text-muted);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-brand h3 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--text-heading);
  margin-bottom: 0.4rem;
}

.footer-brand p {
  font-size: 0.9rem;
  max-width: 420px;
  line-height: 1.6;
}

.footer-nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  flex-wrap: wrap;
}

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

.footer-nav a:hover {
  color: var(--gold-primary);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--glass-border-subtle);
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom a {
  color: var(--gold-primary);
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 768px) {
  header.site-header {
    padding: 0.75rem 1rem;
  }
  nav.site-nav {
    display: none;
  }
  section.hero {
    padding: 3rem 1rem 2.5rem;
  }
  .chief-parts-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  .chief-part-card {
    padding: 1.5rem 1rem 1.2rem;
  }
  .chief-part-icon-wrap {
    width: 70px;
    height: 70px;
    margin-bottom: 1rem;
  }
  .chief-part-icon-wrap img {
    width: 42px;
    height: 42px;
  }
  .chief-part-card h3 {
    font-size: 1.05rem;
  }
  .history-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .reading-container {
    padding: 2.2rem 1.4rem;
  }
  .above-fold {
    padding: 2.5rem 1rem 2rem;
  }
  .above-fold-icon {
    width: 56px;
    height: 56px;
  }
  .above-fold-icon img {
    width: 32px;
    height: 32px;
  }
  .bottom-chapter-nav {
    flex-direction: column;
  }
  .chapter-nav-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .chief-parts-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Neutral Dark / Light Mode Switcher (Harmonized with kate.hitvallasos.hu)
   ========================================================================== */

.theme-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-pill);
  padding: 3px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
  user-select: none;
  -webkit-user-select: none;
  transition: background var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
  flex-shrink: 0;
  vertical-align: middle;
}

.theme-switch:hover {
  border-color: rgba(255, 255, 255, 0.25);
}

.theme-slider {
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform 0.24s cubic-bezier(0.2, 0.9, 0.3, 1), background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  pointer-events: none;
  z-index: 1;
}

.theme-switch[data-theme="dark"] .theme-slider {
  transform: translateX(100%);
}

.theme-switch[data-theme="light"] .theme-slider {
  transform: translateX(0);
}

.theme-btn {
  position: relative;
  z-index: 2;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.38rem 0.68rem;
  color: rgba(255, 255, 255, 0.45);
  border-radius: var(--radius-pill);
  transition: color 0.2s ease, transform 0.15s ease;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.theme-btn:active {
  transform: scale(0.96);
}

.theme-btn svg {
  display: block;
  stroke: currentColor;
  transition: stroke 0.2s ease, transform 0.2s ease;
}

.theme-btn:hover {
  color: rgba(255, 255, 255, 0.9);
}

.theme-btn.is-active {
  color: #ffffff !important;
  text-shadow: none;
}

.theme-btn.is-active svg {
  stroke: #ffffff !important;
}

/* ==========================================================================
   LIGHT MODE THEME SYSTEM (Hitvallásos Alabaster & Milk Glass)
   ========================================================================== */

/* Active via data-theme="light" OR automatic prefers-color-scheme */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .site-logo svg path {
    fill: #000000;
  }
  :root:not([data-theme="dark"]) {
    --color-scheme: light;
    --bg-base: #f5f2eb;
    --bg-body-grad-top: rgba(153, 101, 21, 0.05);
    --bg-body-grad-bottom: rgba(240, 234, 222, 0.9);
    --glass-primary: rgba(255, 255, 255, 0.88);
    --glass-secondary: rgba(253, 250, 245, 0.94);
    --glass-nested: rgba(244, 238, 226, 0.82);
    --glass-card: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(28, 25, 23, 0.14);
    --glass-border-hover: rgba(28, 25, 23, 0.28);
    --glass-border-subtle: rgba(28, 25, 23, 0.08);
    --gold-primary: #996515;
    --gold-secondary: #80530f;
    --gold-border: rgba(153, 101, 21, 0.35);
    --gold-glow: rgba(153, 101, 21, 0.15);
    --highlight-color: #996515;
    --gold-on-primary: #ffffff;
    --gold-button-ink: var(--gold-on-primary);
    --ui-control-bevel: inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 -2px 0 rgba(62, 38, 8, 0.24), 0 3px 8px rgba(60, 45, 20, 0.18);
    --ui-control-pressed: inset 0 2px 5px rgba(62, 38, 8, 0.24);
    --text-main: #1c1917;
    --text-secondary: #44403c;
    --text-muted: #57534e;
    --text-heading: #1c1917;
    --shadow-card: 0 10px 30px -8px rgba(60, 45, 20, 0.12), 0 0 0 1px var(--glass-border);
    --shadow-elevation: 0 20px 40px -12px rgba(60, 45, 20, 0.18);
    --hero-bg-overlay: linear-gradient(180deg, rgba(245, 242, 235, 0.92) 0%, rgba(238, 232, 220, 0.96) 100%);
    --history-bg: linear-gradient(180deg, #f0eae0 0%, #f6f3ec 50%, #f0eae0 100%);
    --footer-bg: #ece6da;
    --fullscreen-bg: rgba(250, 248, 244, 0.98);
    --icon-wrap-bg: rgba(0, 0, 0, 0.04);
    --icon-wrap-border: rgba(0, 0, 0, 0.08);
    --history-statue-filter: invert(0.85);
  }
}

html[data-theme="light"],
body[data-theme="light"] {
  --color-scheme: light;
  --bg-base: #f5f2eb;
  --bg-body-grad-top: rgba(153, 101, 21, 0.05);
  --bg-body-grad-bottom: rgba(240, 234, 222, 0.9);
  --glass-primary: rgba(255, 255, 255, 0.88);
  --glass-secondary: rgba(253, 250, 245, 0.94);
  --glass-nested: rgba(244, 238, 226, 0.82);
  --glass-card: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(28, 25, 23, 0.14);
  --glass-border-hover: rgba(28, 25, 23, 0.28);
  --glass-border-subtle: rgba(28, 25, 23, 0.08);
  --gold-primary: #996515;
  --gold-secondary: #80530f;
  --gold-border: rgba(153, 101, 21, 0.35);
  --gold-glow: rgba(153, 101, 21, 0.15);
  --highlight-color: #996515;
  --gold-on-primary: #ffffff;
  --gold-button-ink: var(--gold-on-primary);
  --ui-control-bevel: inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 -2px 0 rgba(62, 38, 8, 0.24), 0 3px 8px rgba(60, 45, 20, 0.18);
  --ui-control-pressed: inset 0 2px 5px rgba(62, 38, 8, 0.24);
  --text-main: #1c1917;
  --text-secondary: #44403c;
  --text-muted: #57534e;
  --text-heading: #1c1917;
  --shadow-card: 0 10px 30px -8px rgba(60, 45, 20, 0.12), 0 0 0 1px var(--glass-border);
  --shadow-elevation: 0 20px 40px -12px rgba(60, 45, 20, 0.18);
  --hero-bg-overlay: linear-gradient(180deg, rgba(245, 242, 235, 0.92) 0%, rgba(238, 232, 220, 0.96) 100%);
  --history-bg: linear-gradient(180deg, #f0eae0 0%, #f6f3ec 50%, #f0eae0 100%);
  --footer-bg: #ece6da;
  --fullscreen-bg: rgba(250, 248, 244, 0.98);
  --icon-wrap-bg: rgba(0, 0, 0, 0.04);
  --icon-wrap-border: rgba(0, 0, 0, 0.08);
  --history-statue-filter: invert(0.85);
}

/* Light Theme Component Overrides */
[data-theme="light"] body {
  background-color: #f5f2eb !important;
  color: #1c1917 !important;
}

[data-theme="light"] .theme-switch {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(28, 25, 23, 0.12);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .theme-switch:hover {
  border-color: rgba(28, 25, 23, 0.22);
}

[data-theme="light"] .theme-slider {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 6px rgba(60, 45, 20, 0.12), 0 1px 2px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .theme-btn {
  color: #78716c;
}

[data-theme="light"] .theme-btn:hover {
  color: #1c1917;
}

[data-theme="light"] .theme-btn.is-active {
  color: #1c1917 !important;
}

[data-theme="light"] .theme-btn.is-active svg {
  stroke: #1c1917 !important;
}

/* Neutral appearance inside colored content headers (.content-header-bar) */
.content-header-bar .theme-switch {
  background: rgba(0, 0, 0, 0.22) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25) !important;
}

.content-header-bar .theme-switch:hover {
  border-color: rgba(255, 255, 255, 0.35) !important;
}

.content-header-bar .theme-slider {
  background: rgba(255, 255, 255, 0.24) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

.content-header-bar .theme-btn {
  color: rgba(255, 255, 255, 0.55) !important;
}

.content-header-bar .theme-btn:hover {
  color: rgba(255, 255, 255, 0.92) !important;
}

.content-header-bar .theme-btn.is-active {
  color: #ffffff !important;
}

.content-header-bar .theme-btn.is-active svg {
  stroke: #ffffff !important;
}

[data-theme="light"] .reading-container {
  background: rgba(255, 255, 255, 0.94) !important;
  border-color: rgba(28, 25, 23, 0.14) !important;
  box-shadow: 0 10px 30px -8px rgba(60, 45, 20, 0.12), 0 0 0 1px rgba(28, 25, 23, 0.14) !important;
}

[data-theme="light"] .reading-container h2 {
  color: #1c1917 !important;
}

[data-theme="light"] .reading-container p,
[data-theme="light"] .reading-container li {
  color: #44403c !important;
}

[data-theme="light"] .kate-qa-block {
  border-bottom-color: rgba(28, 25, 23, 0.1) !important;
}

[data-theme="light"] .kate-a {
  color: #1c1917 !important;
}

[data-theme="light"] .scripture-quote {
  background: rgba(244, 238, 226, 0.85) !important;
  border-left-color: #996515 !important;
  color: #44403c !important;
}

[data-theme="light"] .hero h1 {
  color: #1c1917 !important;
}

[data-theme="light"] .hero h2 {
  color: #44403c !important;
}

[data-theme="light"] .chief-part-card {
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(28, 25, 23, 0.14) !important;
  box-shadow: 0 10px 30px -8px rgba(60, 45, 20, 0.12), 0 0 0 1px rgba(28, 25, 23, 0.14) !important;
  color: #1c1917 !important;
}

[data-theme="light"] .chief-part-card h3 {
  color: #1c1917 !important;
}

[data-theme="light"] .chief-part-card .part-desc {
  color: #44403c !important;
}

[data-theme="light"] .chief-part-icon-wrap {
  background: rgba(0, 0, 0, 0.04) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .history-text h2 {
  color: #1c1917 !important;
}

[data-theme="light"] .history-text p {
  color: #44403c !important;
}

[data-theme="light"] .resource-card {
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(28, 25, 23, 0.14) !important;
}

[data-theme="light"] .resource-card h3 {
  color: #1c1917 !important;
}

[data-theme="light"] .resource-card p {
  color: #44403c !important;
}

[data-theme="light"] .site-header {
  background: rgba(255, 255, 255, 0.92) !important;
  border-bottom-color: rgba(28, 25, 23, 0.14) !important;
}

[data-theme="light"] .site-logo span {
  color: #1c1917 !important;
}

[data-theme="light"] .site-logo svg path {
  fill: #000000 !important;
}

[data-theme="light"] .site-nav a {
  color: #44403c !important;
}

[data-theme="light"] .site-nav a:hover {
  color: #996515 !important;
}

[data-theme="light"] .site-footer {
  background: #ece6da !important;
  border-top-color: rgba(28, 25, 23, 0.14) !important;
}

[data-theme="light"] .site-footer h3 {
  color: #1c1917 !important;
}

[data-theme="light"] .site-footer p {
  color: #57534e !important;
}

[data-theme="light"] .footer-nav a {
  color: #57534e !important;
}

[data-theme="light"] .footer-bottom {
  color: #78716c !important;
  border-top-color: rgba(28, 25, 23, 0.1) !important;
}

[data-theme="light"] menu.fullscreen {
  background: rgba(250, 248, 244, 0.98) !important;
}

[data-theme="light"] .fullscreen-header h2 {
  color: #1c1917 !important;
}

[data-theme="light"] .fullscreen-header p {
  color: #57534e !important;
}

[data-theme="light"] .fullscreen-close-btn {
  background: rgba(0, 0, 0, 0.06) !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  color: #1c1917 !important;
}

[data-theme="light"] .fullscreen-link-item {
  background: rgba(255, 255, 255, 0.9) !important;
  border-color: rgba(28, 25, 23, 0.12) !important;
}

[data-theme="light"] .fullscreen-link-item span {
  color: #1c1917 !important;
}

[data-theme="light"] .fullscreen-footer {
  color: #78716c !important;
  border-top-color: rgba(28, 25, 23, 0.1) !important;
}

[data-theme="light"] .fullscreen-footer a {
  color: #57534e !important;
}

/* ==========================================================================
   Main page symbolic icons: black in light mode for appropriate contrast
   (NOT in the menu or colored headers on individual pages)
   ========================================================================== */
[data-theme="light"] .chief-part-icon-wrap img,
[data-theme="light"] .chief-part-icon-wrap svg,
[data-theme="light"] .toc-card-icon img,
[data-theme="light"] .toc-card-icon svg {
  filter: brightness(0) !important;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .chief-part-icon-wrap img,
  :root:not([data-theme="dark"]) .chief-part-icon-wrap svg,
  :root:not([data-theme="dark"]) .toc-card-icon img,
  :root:not([data-theme="dark"]) .toc-card-icon svg {
    filter: brightness(0) !important;
  }
}

/* Explicitly preserve pristine white icons in menu and colored chapter headers */
.fullscreen-link-icon img,
.fullscreen-link-icon svg,
.content-header-title img,
.content-header-title svg,
.above-fold-icon img,
.above-fold-icon svg,
[data-theme="light"] .fullscreen-link-icon img,
[data-theme="light"] .fullscreen-link-icon svg,
[data-theme="light"] .content-header-title img,
[data-theme="light"] .content-header-title svg,
[data-theme="light"] .above-fold-icon img,
[data-theme="light"] .above-fold-icon svg {
  filter: none !important;
}

/* ==========================================================================
   Info Card Above Main Sections
   ========================================================================== */
.main-info-card-container {
  max-width: 920px;
  margin: 0 auto 2.5rem;
  padding: 0 1.25rem;
  width: 100%;
}

.main-info-card {
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
  padding: 1.15rem 1.4rem;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(230, 195, 106, 0.28);
  border-left: 4px solid var(--gold-primary);
  border-radius: var(--radius-md);
  text-align: left;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.info-card-icon {
  flex-shrink: 0;
  color: var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.15rem;
}

.info-card-body {
  flex: 1;
}

.info-card-body p {
  margin: 0 !important;
  font-size: 0.94rem !important;
  line-height: 1.65 !important;
  color: var(--text-secondary) !important;
}

.info-card-body a {
  color: var(--gold-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.info-card-body a:hover {
  color: var(--text-heading);
}

/* Light mode styling */
[data-theme="light"] .main-info-card {
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(28, 25, 23, 0.14) !important;
  border-left-color: #996515 !important;
  box-shadow: 0 4px 16px rgba(60, 45, 20, 0.06) !important;
}

[data-theme="light"] .info-card-icon {
  color: #000000 !important;
}

[data-theme="light"] .info-card-body p {
  color: #33302c !important;
}

[data-theme="light"] .info-card-body a {
  color: #80530e !important;
}

[data-theme="light"] .info-card-body a:hover {
  color: #000000 !important;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .main-info-card {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(28, 25, 23, 0.14);
    border-left-color: #996515;
    box-shadow: 0 4px 16px rgba(60, 45, 20, 0.06);
  }
  :root:not([data-theme="dark"]) .info-card-icon {
    color: #000000;
  }
  :root:not([data-theme="dark"]) .info-card-body p {
    color: #33302c;
  }
  :root:not([data-theme="dark"]) .info-card-body a {
    color: #80530e;
  }
  :root:not([data-theme="dark"]) .info-card-body a:hover {
    color: #000000;
  }
}

/* ==========================================================================
   Centered Viewport Anchor Margins
   ========================================================================== */
#fo-reszek {
  scroll-margin-top: calc(50vh - 280px);
}

#teljes-tartalom {
  scroll-margin-top: 85px;
}

@media (max-width: 768px) {
  #fo-reszek {
    scroll-margin-top: 85px;
  }
}
