/* ==========================================================================
   Catolica Quest — Design System (Light + Dark)
   Antique-wallpaper aesthetic, content-first, contemplative
   ========================================================================== */

:root {
  --bg: #f4ecdc;
  --bg-soft: #ebe1cb;
  --paper: #fbf6ec;
  --surface: rgba(251,246,236,0.78);
  --surface-raised: rgba(255,251,242,0.94);
  --text: #2b1f12;
  --text-muted: #6e5b41;
  --accent: #7a3a1a;          /* burgundy ink */
  --accent-light: #a04d23;
  --accent-bg: rgba(122,58,26,0.08);
  --gold: #b18a3a;
  --gold-soft: #d6b46a;
  --gold-bg: rgba(177,138,58,0.12);
  --rule: rgba(80,55,25,0.16);
  --rule-strong: rgba(80,55,25,0.28);
  --shadow-sm: 0 6px 18px rgba(67,42,16,0.08), 0 1px 0 rgba(255,255,255,0.6) inset;
  --shadow-md: 0 14px 40px rgba(67,42,16,0.12), 0 1px 0 rgba(255,255,255,0.65) inset;
  --shadow-lg: 0 28px 80px rgba(40,22,4,0.18);
  --radius: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --t: 200ms ease;
  --font-ui: 'DM Sans', system-ui, sans-serif;
  --font-serif: 'Lora', Georgia, serif;
  --font-brand: 'Fraunces', Georgia, serif;
  --header-bg: rgba(244,236,220,0.82);
  --header-rule: rgba(80,55,25,0.14);
  --wallpaper: url('../assets/wallpaper-light.svg');
  --wallpaper-tint: radial-gradient(circle at 18% 12%, rgba(255,243,214,0.10), transparent 60%),
                    radial-gradient(circle at 82% 88%, rgba(190,140,60,0.04), transparent 60%);
  --logo-filter: drop-shadow(0 6px 16px rgba(40,22,4,0.18));
  --logo-filter-large: drop-shadow(0 18px 36px rgba(40,22,4,0.22));
}

[data-theme="dark"] {
  --bg: #14110b;
  --bg-soft: #1d1810;
  --paper: #1d1812;
  --surface: rgba(33,26,18,0.74);
  --surface-raised: rgba(40,32,21,0.94);
  --text: #f1e6d0;
  --text-muted: #b9a787;
  --accent: #e6a86b;
  --accent-light: #f3c089;
  --accent-bg: rgba(230,168,107,0.12);
  --gold: #e4bd6c;
  --gold-soft: #f1d287;
  --gold-bg: rgba(228,189,108,0.14);
  --rule: rgba(255,228,180,0.10);
  --rule-strong: rgba(255,228,180,0.18);
  --shadow-sm: 0 6px 20px rgba(0,0,0,0.35), 0 1px 0 rgba(255,228,180,0.04) inset;
  --shadow-md: 0 16px 44px rgba(0,0,0,0.45), 0 1px 0 rgba(255,228,180,0.05) inset;
  --shadow-lg: 0 30px 90px rgba(0,0,0,0.55);
  --header-bg: rgba(20,17,11,0.82);
  --header-rule: rgba(255,228,180,0.08);
  --wallpaper: url('../assets/wallpaper-dark.svg');
  --wallpaper-tint: radial-gradient(circle at 18% 12%, rgba(255,210,140,0.06), transparent 50%),
                    radial-gradient(circle at 82% 88%, rgba(120,70,20,0.10), transparent 45%);
  /* Logo PNG colorida vira silhueta branca no escuro */
  --logo-filter: brightness(0) invert(1) drop-shadow(0 6px 16px rgba(0,0,0,0.45));
  --logo-filter-large: brightness(0) invert(1) drop-shadow(0 18px 36px rgba(0,0,0,0.55));
}

/* --- Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--text);
  background: transparent;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--t), color var(--t);
  min-height: 100vh;
}
html {
  background-color: var(--bg);
  background-image: var(--wallpaper);
  background-repeat: repeat;
  background-size: 320px 320px;
  background-position: 0 0;
  background-attachment: fixed;
}
a { color: var(--accent); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--accent-light); }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; font-family: inherit; }
h1, h2, h3, h4, h5, h6 { margin: 0; line-height: 1.25; }
p { margin: 0; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

body.site-ready { overflow-x: hidden; }

/* --- Loader -------------------------------------------------------------- */
.site-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(255,226,163,0.20), transparent 30%),
    linear-gradient(135deg, #14110b 0%, #2a1f12 50%, #5a3617 100%);
  transition: opacity 0.7s ease, visibility 0.7s ease;
}
.site-loader-glow {
  position: absolute;
  width: min(88vw, 980px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,225,170,0.22), rgba(255,225,170,0.04) 38%, transparent 70%);
  filter: blur(20px);
  animation: loaderPulse 3s ease-in-out infinite;
}
.site-loader-inner { position: relative; z-index: 1; text-align: center; color: #fdf3e0; padding: 2rem; }
.site-loader-logo-wrap {
  width: min(38vw, 240px);
  min-width: 160px;
  margin: 0 auto 1.25rem;
}
.site-loader-logo { width: 100%; filter: drop-shadow(0 14px 30px rgba(255,200,120,0.32)); }
.site-loader-kicker {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.34em;
  color: rgba(255,236,200,0.74);
  margin-bottom: 0.4rem;
}
.site-loader-title {
  font-family: var(--font-brand);
  font-size: clamp(2rem, 5vw, 4.4rem);
  letter-spacing: -0.04em;
  text-shadow: 0 10px 40px rgba(0,0,0,0.4);
}
body.site-ready .site-loader { opacity: 0; visibility: hidden; pointer-events: none; }
@keyframes loaderPulse { 0%,100%{transform:scale(0.96);opacity:0.85;} 50%{transform:scale(1.04);opacity:1;} }

/* --- Nav loader (cobre tela durante carregamentos) ---------------------- */
.nav-loader {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    var(--wallpaper-tint),
    var(--wallpaper) repeat,
    var(--bg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 280ms ease, visibility 280ms ease;
}
.nav-loader.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.nav-loader-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  text-align: center;
  padding: 2rem;
}
.nav-loader-logo {
  width: clamp(120px, 18vw, 180px);
  filter: var(--logo-filter-large);
  animation: navLoaderFloat 2.4s ease-in-out infinite;
}
.nav-loader-ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid var(--gold-bg);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
.nav-loader-text {
  font-family: var(--font-brand);
  font-size: 1.05rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}
@keyframes navLoaderFloat {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-6px); }
}

/* --- Header (sliding) ---------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--header-rule);
  box-shadow: 0 8px 32px rgba(40,22,4,0.06);
  transform: translateY(0);
  transition: transform 360ms cubic-bezier(0.22,1,0.36,1), background var(--t), border-color var(--t);
}
body.header-hidden .site-header { transform: translateY(-110%); }

/* offset content for fixed header when visible */
body:not(.header-hidden) main,
body:not(.header-hidden) #hero-section { /* hero hidden anyway in non-home */ }

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.55rem;
  letter-spacing: -0.03em;
  transition: opacity var(--t);
}
.header-brand:hover { opacity: 0.78; color: var(--text); }
.header-brand-text { line-height: 1; }
.header-brand-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  filter: var(--logo-filter);
  transition: filter var(--t);
}

.header-nav { display: flex; align-items: center; gap: 0.5rem; }

.header-search-btn,
.header-back-btn,
#theme-toggle {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface-raised);
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
  transition: all var(--t);
}
.header-search-btn:hover,
.header-back-btn:hover,
#theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.header-search-btn svg,
.header-back-btn svg,
#theme-toggle svg { width: 18px; height: 18px; }

.header-back-btn { display: none; }
.header-back-btn.visible { display: inline-flex; }

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

/* --- Floating theme toggle (visible while header hidden) ----------------- */
.floating-theme-toggle {
  position: fixed;
  top: 1.1rem;
  right: 1.25rem;
  z-index: 90;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
  transition: opacity 280ms ease, transform 280ms ease, color var(--t), border-color var(--t);
  opacity: 0;
  transform: scale(0.85);
  pointer-events: none;
}
body.header-hidden .floating-theme-toggle {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}
.floating-theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.floating-theme-toggle svg { width: 20px; height: 20px; }
.floating-theme-toggle .icon-sun { display: block; }
.floating-theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .floating-theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .floating-theme-toggle .icon-moon { display: block; }

/* --- Recomendações flutuantes (listas verticais nas laterais) ------------ */
.rec-rail {
  position: fixed;
  top: 50%;
  z-index: 85;
  width: clamp(220px, 19vw, 270px);
  max-height: calc(100vh - 7rem);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 0.25rem;
  overflow-y: auto;
  scrollbar-width: thin;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-50%) translateX(-6px);
  transition: opacity 320ms ease, transform 320ms ease;
}
.rec-rail::-webkit-scrollbar { width: 6px; }
.rec-rail::-webkit-scrollbar-thumb { background: var(--rule-strong); border-radius: 3px; }
.rec-rail--left  { left: 1rem; }
.rec-rail--right {
  right: 1rem;
  transform: translateY(-50%) translateX(6px);
}

body.header-hidden .rec-rail {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
  pointer-events: auto;
}

.rec-chip {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--rule-strong);
  border-radius: 14px;
  background: var(--surface-raised);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  font-family: var(--font-ui);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--t), box-shadow var(--t), color var(--t), transform var(--t);
}
.rec-chip:hover {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateX(2px);
}
.rec-rail--right .rec-chip:hover { transform: translateX(-2px); }

.rec-chip-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--gold-bg);
  color: var(--gold);
  border: 1px solid var(--rule);
}
.rec-chip-icon svg { width: 17px; height: 17px; }

.rec-chip-body {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-width: 0;
  flex: 1;
}
.rec-chip-eyebrow {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  font-weight: 700;
}
.rec-chip-title {
  font-family: var(--font-brand);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rec-chip-text {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 1180px) {
  .rec-rail { width: clamp(180px, 22vw, 220px); }
  .rec-chip-title { font-size: 0.88rem; }
  .rec-chip-text { -webkit-line-clamp: 1; }
}
@media (max-width: 900px) {
  .rec-rail { display: none !important; }
}

/* --- Hero ---------------------------------------------------------------- */
.hero {
  position: relative;
  padding: 4.5rem 1.25rem 4rem;
  isolation: isolate;
}

/* Decorative ornaments above and below hero, drawn in CSS */
.hero::before,
.hero::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, 86%);
  height: 22px;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, var(--gold) 0 2px, transparent 3px) center / 18px 18px repeat-x;
  opacity: 0.32;
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}
.hero::before { top: 0; }
.hero::after { bottom: 0; }

.hero-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 2rem 2.4rem;
  align-items: center;
}

.hero-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.4rem;
}

.hero-logo {
  width: clamp(170px, 24vw, 260px);
  filter: var(--logo-filter-large);
  transition: filter var(--t);
}

.hero-text { text-align: left; }

.hero h1 {
  font-family: var(--font-brand);
  font-size: clamp(2.6rem, 6vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  margin-bottom: 0.6rem;
  color: var(--text);
  line-height: 0.98;
}

.hero-subtitle {
  display: inline-block;
  max-width: 56ch;
  font-size: 1.05rem;
  color: #fdf3e0;
  line-height: 1.7;
  font-family: var(--font-serif);
  font-style: italic;
  background: #2b1f12;
  padding: 0.85rem 1.15rem;
  border-radius: 10px;
  border: 1px solid rgba(255,228,180,0.18);
  box-shadow: 0 10px 28px rgba(40,22,4,0.22);
}
[data-theme="dark"] .hero-subtitle {
  color: #fdf3e0;
  background: #0f0c07;
  border-color: rgba(255,228,180,0.16);
}

/* Hero search spans both columns under hero-main + hero-prayer */
.hero-search {
  position: relative;
  grid-column: 1 / -1;
  max-width: 760px;
  margin: 1rem auto 0;
  width: 100%;
}
.hero-search input {
  width: 100%;
  height: 60px;
  padding: 0 3.4rem 0 1.4rem;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font-ui);
  box-shadow: var(--shadow-md);
  outline: none;
  transition: box-shadow var(--t), border-color var(--t);
}
.hero-search input::placeholder { color: var(--text-muted); }
.hero-search input:focus { border-color: var(--accent); box-shadow: 0 22px 56px rgba(40,22,4,0.18); }
.hero-search-icon {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  pointer-events: none;
}
.hero-search-icon svg { width: 22px; height: 22px; }

/* Random prayer card -- antique inscribed plaque */
.hero-prayer {
  position: relative;
  padding: 1.6rem 1.6rem 1.4rem;
  border: 1px solid var(--rule-strong);
  border-radius: 18px;
  background:
    linear-gradient(180deg, var(--paper), var(--surface-raised));
  box-shadow: var(--shadow-md);
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  overflow: hidden;
}
.hero-prayer::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px dashed var(--rule);
  border-radius: 13px;
  pointer-events: none;
}
.hero-prayer-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--gold);
}
.hero-prayer-eyebrow svg { width: 16px; height: 16px; }
.hero-prayer-title {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  color: var(--text);
}
.hero-prayer-text {
  font-family: var(--font-serif);
  font-size: 0.96rem;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.hero-prayer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.4rem;
}
.hero-prayer-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 38px;
  padding: 0 1rem;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 600;
  font-family: var(--font-ui);
  transition: all var(--t);
}
.hero-prayer-btn svg { width: 14px; height: 14px; }
.hero-prayer-btn:hover { border-color: var(--accent); color: var(--accent); }
.hero-prayer-open {
  background: var(--accent);
  color: #fdf3e0;
  border-color: var(--accent);
}
.hero-prayer-open:hover { background: var(--accent-light); border-color: var(--accent-light); color: #fdf3e0; }

/* --- Sections heading on home ------------------------------------------- */
.sections-heading-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 3rem 0 1.4rem;
}
.sections-heading {
  font-family: var(--font-brand);
  font-size: 1.95rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  white-space: nowrap;
}
.sections-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--rule-strong), transparent);
}
.sections-rule-end {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.8;
}

/* --- Section cards (home grid) ----------------------------------------- */
.section-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  padding-bottom: 3rem;
}

.section-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.4rem 1.35rem 1.5rem;
  background: linear-gradient(180deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
  transition: all var(--t);
  text-decoration: none;
  color: var(--text);
  overflow: hidden;
}
.section-card::after {
  content: '';
  position: absolute;
  left: 1.35rem;
  right: 1.35rem;
  bottom: 0.7rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.5;
}
.section-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--rule-strong);
  color: var(--text);
}

.section-card-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  flex-shrink: 0;
  margin-bottom: 0.3rem;
}
.section-card-icon svg { width: 24px; height: 24px; }

.section-card-title {
  font-family: var(--font-brand);
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Accent palettes */
.accent-gold .section-card-icon    { background: var(--gold-bg); color: var(--gold); }
.accent-rose .section-card-icon    { background: rgba(190,51,68,0.10); color: #b53349; }
.accent-violet .section-card-icon  { background: rgba(106,68,160,0.10); color: #6a44a0; }
.accent-emerald .section-card-icon { background: rgba(40,120,90,0.10); color: #2c7c5b; }
.accent-amber .section-card-icon   { background: rgba(195,135,30,0.12); color: #b58028; }
.accent-blue .section-card-icon    { background: rgba(40,90,150,0.10); color: #2e5e9e; }
.accent-ruby .section-card-icon    { background: rgba(170,30,50,0.10); color: #aa1e32; }
.accent-teal .section-card-icon    { background: rgba(20,130,120,0.10); color: #128279; }
.accent-indigo .section-card-icon  { background: rgba(70,80,160,0.10); color: #4a55a8; }
.accent-sky .section-card-icon     { background: rgba(40,120,170,0.10); color: #2c80b0; }

[data-theme="dark"] .accent-gold .section-card-icon    { background: rgba(228,189,108,0.14); color: #e4bd6c; }
[data-theme="dark"] .accent-rose .section-card-icon    { background: rgba(244,143,160,0.14); color: #f48fa0; }
[data-theme="dark"] .accent-violet .section-card-icon  { background: rgba(186,153,224,0.14); color: #ba99e0; }
[data-theme="dark"] .accent-emerald .section-card-icon { background: rgba(120,210,170,0.14); color: #78d2aa; }
[data-theme="dark"] .accent-amber .section-card-icon   { background: rgba(243,200,110,0.14); color: #f3c86e; }
[data-theme="dark"] .accent-blue .section-card-icon    { background: rgba(140,180,234,0.14); color: #8cb4ea; }
[data-theme="dark"] .accent-ruby .section-card-icon    { background: rgba(244,140,150,0.14); color: #f48c96; }
[data-theme="dark"] .accent-teal .section-card-icon    { background: rgba(120,210,200,0.14); color: #78d2c8; }
[data-theme="dark"] .accent-indigo .section-card-icon  { background: rgba(160,170,234,0.14); color: #a0aaea; }
[data-theme="dark"] .accent-sky .section-card-icon     { background: rgba(120,194,234,0.14); color: #78c2ea; }

/* --- Breadcrumbs -------------------------------------------------------- */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 1.4rem 0 0.4rem;
  font-size: 0.84rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { color: var(--rule-strong); user-select: none; }
.breadcrumbs .current { color: var(--text); font-weight: 600; }

/* --- Section view: header (per-section) -------------------------------- */
.section-shell {
  position: relative;
  margin: 0.4rem 0 1.4rem;
  padding: 1.6rem 1.6rem 1.4rem;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, var(--paper), var(--surface-raised));
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.section-shell::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--wallpaper);
  background-size: 280px 280px;
  opacity: 0.18;
  mix-blend-mode: multiply;
  pointer-events: none;
}
[data-theme="dark"] .section-shell::before { mix-blend-mode: screen; opacity: 0.22; }

.section-hero-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.8rem;
}
.section-hero-icon {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-raised);
  border: 1px solid var(--rule);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.section-hero-icon svg { width: 28px; height: 28px; }
.section-shell h2 {
  font-family: var(--font-brand);
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
  position: relative;
}
.section-shell p.section-subheading {
  position: relative;
  color: var(--text-muted);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  margin-top: 0.2rem;
}

/* Controls */
.controls-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1rem 0 1.2rem;
}
.control-select {
  flex: 1;
  min-width: 180px;
  position: relative;
}
.control-select label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.control-select select {
  width: 100%;
  height: 44px;
  padding: 0 2rem 0 0.95rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface-raised);
  color: var(--text);
  font-size: 0.92rem;
  font-family: var(--font-ui);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color var(--t);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236e5b41' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
}
[data-theme="dark"] .control-select select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23b9a787' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
.control-select select:focus { outline: none; border-color: var(--accent); }

/* --- Generic content list (cards) -------------------------------------- */
.content-items { display: grid; gap: 0.75rem; }
.content-item {
  padding: 1rem 1.2rem;
  background: linear-gradient(180deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
  transition: all var(--t);
  cursor: pointer;
}
.content-item:hover { border-color: var(--rule-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.content-item-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.02rem;
  margin-bottom: 0.3rem;
  color: var(--text);
}
.content-item-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
}
.content-item.expanded { cursor: default; }
.content-item.expanded .content-item-meta {
  -webkit-line-clamp: unset;
  overflow: visible;
}

/* --- Per-section custom layouts ---------------------------------------- */

/* PRAYER (oracoes / novenas / terco): scriptural plaque */
.prayer-board {
  position: relative;
  padding: 2.2rem 1.6rem 2rem;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, var(--paper), var(--surface-raised));
  border: 1px solid var(--rule-strong);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.prayer-board::before {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px dashed var(--rule);
  border-radius: 22px;
  pointer-events: none;
}
.prayer-board-eyebrow {
  text-align: center;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  color: var(--gold);
  margin-bottom: 0.4rem;
}
.prayer-board-title {
  text-align: center;
  font-family: var(--font-brand);
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
  letter-spacing: -0.03em;
  margin-bottom: 0.4rem;
  color: var(--text);
}
.prayer-board-rule {
  margin: 0.5rem auto 1.4rem;
  width: 80px;
  height: 14px;
  background: radial-gradient(circle at 50% 50%, var(--gold) 0 2px, transparent 3px) center / 14px 14px repeat-x;
  opacity: 0.55;
}
.prayer-board-section {
  margin: 0 auto 1.6rem;
  max-width: 720px;
}
.prayer-board-section:last-child { margin-bottom: 0; }
.prayer-board-section-label {
  text-align: center;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent);
  margin-bottom: 0.7rem;
  position: relative;
}
.prayer-board-section-label::before,
.prayer-board-section-label::after {
  content: '';
  display: inline-block;
  width: 36px;
  height: 1px;
  background: var(--rule-strong);
  vertical-align: middle;
  margin: 0 0.6rem;
}
.prayer-board-text {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  line-height: 1.85;
  color: var(--text);
  text-align: center;
  white-space: pre-wrap;
}
.prayer-board-text:first-letter {
  font-family: var(--font-brand);
  font-size: 2.6em;
  float: left;
  line-height: 0.86;
  margin: 0.18em 0.16em 0 0;
  color: var(--accent);
  font-weight: 700;
}

/* BIBLE: verse columns */
.verse-list {
  display: grid;
  gap: 0.4rem;
  padding: 1rem;
  background: linear-gradient(180deg, var(--paper), var(--surface-raised));
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.verse-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 0.85rem;
  padding: 0.45rem 0.6rem;
  align-items: baseline;
  border-bottom: 1px dotted var(--rule);
}
.verse-item:last-child { border-bottom: none; }
.verse-number {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--accent);
  text-align: right;
}
.verse-text {
  font-family: var(--font-serif);
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--text);
}

/* CATECISMO: Q&A */
.qa-list { display: grid; gap: 0.85rem; }
.qa-item {
  padding: 1.25rem 1.4rem 1.1rem;
  background: linear-gradient(180deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.qa-item-q {
  display: flex;
  gap: 0.8rem;
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.08rem;
  color: var(--text);
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}
.qa-item-q::before {
  content: 'P.';
  color: var(--accent);
  font-family: var(--font-brand);
  flex-shrink: 0;
}
.qa-item-a {
  display: flex;
  gap: 0.8rem;
  font-family: var(--font-serif);
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
}
.qa-item-a::before {
  content: 'R.';
  color: var(--gold);
  font-family: var(--font-brand);
  font-weight: 700;
  flex-shrink: 0;
}

/* CATECISMO: única janela com vários parágrafos */
.catechism-window {
  background: linear-gradient(180deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.6rem 1.8rem;
}
.catechism-window-body {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 0.4rem;
}
.catechism-window-body::-webkit-scrollbar { width: 8px; }
.catechism-window-body::-webkit-scrollbar-track { background: transparent; }
.catechism-window-body::-webkit-scrollbar-thumb {
  background: rgba(180, 140, 60, 0.45);
  border-radius: 999px;
}
.catechism-paragraph {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 1rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px dashed var(--rule);
}
.catechism-paragraph:last-child { border-bottom: none; padding-bottom: 0; }
.catechism-paragraph-num {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
  letter-spacing: -0.02em;
  text-align: right;
  padding-top: 0.15rem;
  border-right: 2px solid var(--gold);
  padding-right: 0.7rem;
}
.catechism-paragraph-text {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
  white-space: pre-wrap;
}

/* CATECISMO: busca por número de parágrafo */
.catecismo-search {
  flex: 1 1 100%;
  width: 100%;
  margin: 0.4rem 0 0.8rem;
  padding: 1.1rem 1.4rem 1rem;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(190, 150, 70, 0.10), rgba(190, 150, 70, 0.02) 60%),
    linear-gradient(180deg, var(--surface-raised), var(--surface));
  border: 1px solid rgba(190, 150, 70, 0.35);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .04), inset 0 0 0 1px rgba(255, 255, 255, .02);
}
.catecismo-search form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.catecismo-search-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.catecismo-search-row {
  display: flex;
  gap: 0.7rem;
  align-items: stretch;
  flex-wrap: wrap;
  width: 100%;
}
.catecismo-search-input-wrap {
  flex: 1 1 0;
  min-width: 220px;
  position: relative;
  display: flex;
}
.catecismo-search input[type="number"] {
  flex: 1 1 auto;
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1.5px solid var(--rule);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font-sans);
  transition: border-color .2s, box-shadow .2s, background .2s;
  -moz-appearance: textfield;
}
.catecismo-search input[type="number"]::-webkit-outer-spin-button,
.catecismo-search input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.catecismo-search input[type="number"]:hover {
  border-color: rgba(190, 150, 70, 0.55);
}
.catecismo-search input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-raised);
  box-shadow: 0 0 0 4px rgba(190, 150, 70, 0.16);
}
.catecismo-go-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0 1.4rem;
  min-height: 46px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  color: #fff;
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(180, 140, 60, 0.30), inset 0 1px 0 rgba(255,255,255,.18);
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
  white-space: nowrap;
}
.catecismo-go-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(180, 140, 60, 0.36), inset 0 1px 0 rgba(255,255,255,.22);
  filter: brightness(1.04);
}
.catecismo-go-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(180, 140, 60, 0.28), inset 0 1px 0 rgba(255,255,255,.18);
}
.catecismo-go-btn svg { flex-shrink: 0; }
.catecismo-back-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(190, 150, 70, 0.4);
  background: transparent;
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.catecismo-back-btn:hover {
  background: rgba(190, 150, 70, 0.10);
  border-color: rgba(190, 150, 70, 0.7);
}
@media (max-width: 540px) {
  .catecismo-go-btn { width: 100%; }
}

/* CALENDÁRIO LITÚRGICO */
.liturgy-calendar {
  background: linear-gradient(180deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.2rem;
}
.liturgy-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.liturgy-calendar-head { margin-bottom: 6px; }
.liturgy-cal-weekday {
  text-align: center;
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--gold);
  padding: 0.4rem 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.liturgy-cal-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  min-height: 78px;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
  overflow: hidden;
}
.liturgy-cal-cell:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
}
.liturgy-cal-empty {
  background: transparent;
  border: 1px dashed var(--rule);
  cursor: default;
  pointer-events: none;
}
.liturgy-cal-day {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.liturgy-cal-cel {
  font-size: 0.72rem;
  line-height: 1.25;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.liturgy-cal-special {
  background: linear-gradient(180deg, rgba(190,150,70,0.10), var(--surface));
  border-color: rgba(190,150,70,0.45);
}
.liturgy-cal-special .liturgy-cal-day { color: var(--accent); }
@media (max-width: 640px) {
  .liturgy-cal-cell { min-height: 64px; padding: 0.35rem; }
  .liturgy-cal-day { font-size: 0.85rem; }
  .liturgy-cal-cel { font-size: 0.62rem; -webkit-line-clamp: 2; }
}

/* SAINT: portrait + biography */
.saint-card {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 1.6rem;
  padding: 1.4rem;
  background: linear-gradient(180deg, var(--paper), var(--surface-raised));
  border: 1px solid var(--rule);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  align-items: start;
}
.saint-portrait {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--rule-strong);
  background: var(--surface);
  aspect-ratio: 3/4;
}
.saint-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.saint-portrait-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1rem 0.9rem 0.7rem;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.7));
  color: #fff;
}
.saint-portrait-overlay-title { font-family: var(--font-serif); font-weight: 700; font-size: 1rem; }
.saint-portrait-overlay-ref { font-size: 0.8rem; opacity: 0.85; }
.saint-body { display: flex; flex-direction: column; gap: 0.85rem; }
.saint-name {
  font-family: var(--font-brand);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.03em;
  color: var(--text);
}
.saint-desc {
  font-family: var(--font-serif);
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--text);
  white-space: pre-wrap;
}

/* MESSAGE (mensagens_catolicas): card grid */
.messages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.message-card {
  padding: 1.4rem 1.3rem;
  background: linear-gradient(180deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--t);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  position: relative;
  overflow: hidden;
}
.message-card::before {
  content: '“';
  position: absolute;
  top: -22px;
  right: 4px;
  font-family: var(--font-brand);
  font-size: 6rem;
  color: var(--gold);
  opacity: 0.18;
  line-height: 1;
  pointer-events: none;
}
.message-card:hover { border-color: var(--rule-strong); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.message-card-title {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}
.message-card-text {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* DICTIONARY entries */
.dict-list { display: grid; gap: 0.55rem; }
.dict-item {
  padding: 0.95rem 1.2rem;
  background: linear-gradient(180deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--t);
}
.dict-item:hover { border-color: var(--rule-strong); transform: translateX(2px); }
.dict-item-term {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--accent);
  margin-bottom: 0.2rem;
  letter-spacing: -0.01em;
}
.dict-item-def {
  font-family: var(--font-serif);
  font-size: 0.94rem;
  line-height: 1.65;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* LITURGIA / CALENDARIO entries */
.reading-card {
  padding: 1.4rem 1.5rem;
  background: linear-gradient(180deg, var(--paper), var(--surface-raised));
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 0.85rem;
}
.reading-card-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 0.4rem;
}
.reading-card-title {
  font-family: var(--font-brand);
  font-size: 1.2rem;
  margin-bottom: 0.6rem;
  color: var(--text);
}
.reading-card-text {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text);
  white-space: pre-wrap;
}

/* --- Bible chapter grid ------------------------------------------------ */
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 0.4rem;
  margin: 0.4rem 0 1.2rem;
  padding: 0.85rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}
.chapter-btn {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 600;
  font-family: var(--font-ui);
  transition: all var(--t);
}
.chapter-btn:hover { border-color: var(--accent); color: var(--accent); }
.chapter-btn.active { background: var(--accent); color: #fdf3e0; border-color: var(--accent); }

/* --- Letters grid ------------------------------------------------------ */
.letters-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.4rem 0 1.2rem;
  padding: 0.85rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}
.letter-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--text);
  font-family: var(--font-brand);
  font-size: 0.95rem;
  font-weight: 700;
  transition: all var(--t);
}
.letter-btn:hover { border-color: var(--accent); color: var(--accent); }
.letter-btn.active { background: var(--accent); color: #fdf3e0; border-color: var(--accent); }

/* --- Image display ----------------------------------------------------- */
.image-display {
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--rule);
  margin-bottom: 1.25rem;
  position: relative;
  box-shadow: var(--shadow-md);
}
.image-display img {
  width: 100%;
  max-height: 480px;
  object-fit: contain;
  background: var(--surface);
}
.image-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 1.5rem 1.25rem 1.25rem;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.7));
  color: #fff;
}
.image-overlay-title { font-family: var(--font-serif); font-weight: 700; font-size: 1.1rem; text-shadow: 0 1px 4px rgba(0,0,0,0.4); }
.image-overlay-ref { font-size: 0.82rem; opacity: 0.85; margin-top: 0.3rem; }

/* --- Audio player ------------------------------------------------------ */
.audio-card {
  padding: 1rem 1.2rem;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, var(--paper), var(--surface-raised));
  border: 1px solid var(--rule);
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.audio-card-icon {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--gold-bg);
  color: var(--gold);
  flex-shrink: 0;
}
.audio-card-icon svg { width: 18px; height: 18px; }
.audio-card-body { flex: 1; min-width: 0; }
.audio-card-title { font-weight: 700; font-size: 0.85rem; color: var(--text); margin-bottom: 0.25rem; }
.audio-card audio { width: 100%; height: 36px; }

/* --- Pagination -------------------------------------------------------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.6rem 0 2.2rem;
}
.pagination-btn {
  height: 42px;
  padding: 0 1.4rem;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-family: var(--font-ui);
  transition: all var(--t);
}
.pagination-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination-info { font-size: 0.84rem; color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.pagination { flex-wrap: wrap; }

/* --- Drawer ------------------------------------------------------------ */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,15,8,0.42);
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  backdrop-filter: blur(2px);
}
.drawer-overlay.open { opacity: 1; pointer-events: all; }
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(560px, 92vw);
  background:
    linear-gradient(180deg, var(--paper), var(--surface-raised));
  z-index: 501;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.22,1,0.36,1);
  display: flex;
  flex-direction: column;
  box-shadow: -22px 0 60px rgba(20,12,4,0.32);
  border-left: 1px solid var(--rule-strong);
}
.drawer-overlay.open .drawer { transform: translateX(0); }
.drawer-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: var(--surface);
}
.drawer-header h3 { font-family: var(--font-brand); font-size: 1.18rem; font-weight: 700; }
.drawer-close {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface-raised);
  color: var(--text-muted);
  transition: all var(--t);
}
.drawer-close:hover { color: var(--accent); border-color: var(--accent); }
.drawer-close svg { width: 18px; height: 18px; }
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}
.drawer-body .prayer-board { background: transparent; border: none; box-shadow: none; padding: 0; }
.drawer-body .prayer-board::before { display: none; }

/* --- Search view ------------------------------------------------------- */
.search-container { padding: 1.5rem 0; }
.search-bar { position: relative; margin-bottom: 1.5rem; }
.search-bar input {
  width: 100%;
  height: 52px;
  padding: 0 3rem 0 1.25rem;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--text);
  font-size: 0.98rem;
  font-family: var(--font-ui);
  outline: none;
  transition: border-color var(--t);
  box-shadow: var(--shadow-sm);
}
.search-bar input:focus { border-color: var(--accent); }
.search-bar-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  pointer-events: none;
}
.search-bar-icon svg { width: 20px; height: 20px; }
.search-results-info { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 1rem; }

/* --- Spinner ----------------------------------------------------------- */
.spinner {
  display: flex;
  justify-content: center;
  padding: 3rem;
}
.spinner::after {
  content: '';
  width: 44px;
  height: 44px;
  border: 3px solid var(--gold-bg);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Error / empty states --------------------------------------------- */
.error-state { text-align: center; padding: 3rem 1.5rem; }
.error-state-icon { color: var(--accent); margin-bottom: 1rem; }
.error-state-icon svg { width: 48px; height: 48px; }
.error-state h3 { font-family: var(--font-serif); font-size: 1.3rem; margin-bottom: 0.5rem; }
.error-state p { color: var(--text-muted); margin-bottom: 1.25rem; }
.error-retry-btn {
  height: 42px;
  padding: 0 1.5rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: #fdf3e0;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--font-ui);
  transition: opacity var(--t);
}
.error-retry-btn:hover { opacity: 0.88; }

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
  font-style: italic;
  font-family: var(--font-serif);
}

/* --- Action button ----------------------------------------------------- */
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 42px;
  padding: 0 1.25rem;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--font-ui);
  transition: all var(--t);
}
.action-btn:hover { border-color: var(--accent); color: var(--accent); }
.action-btn svg { width: 16px; height: 16px; }

/* --- Responsive -------------------------------------------------------- */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; gap: 1.6rem; }
  .hero-main { align-items: center; text-align: center; }
  .hero-text { text-align: center; }
  .hero-subtitle { margin: 0 auto; }
  .saint-card { grid-template-columns: 1fr; }
  .saint-portrait { aspect-ratio: 4/3; max-width: 400px; margin: 0 auto; }
}

@media (max-width: 768px) {
  .hero { padding: 3rem 1rem 2.5rem; }
  .hero h1 { font-size: clamp(2.2rem, 8vw, 3rem); }
  .section-cards { grid-template-columns: 1fr; }
  .controls-row { flex-direction: column; }
  .control-select { min-width: 100%; }
  .header-inner { height: 68px; }
  .header-brand-logo { width: 50px; height: 50px; }
  .prayer-board { padding: 1.6rem 1rem 1.4rem; }
  .prayer-board-text { font-size: 1rem; }
  .messages-grid { grid-template-columns: 1fr; }
  .floating-theme-toggle { width: 44px; height: 44px; top: 0.9rem; right: 0.9rem; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 2rem; }
  .hero-subtitle { font-size: 0.95rem; }
  .header-inner { height: 60px; }
  .header-brand { font-size: 1.18rem; gap: 0.6rem; }
  .header-brand-logo { width: 42px; height: 42px; }
  .section-shell { padding: 1.2rem 1rem 1.1rem; }
  .section-hero-icon { width: 50px; height: 50px; }
}

/* --- Scrollbar --------------------------------------------------------- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rule-strong); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

::selection { background: var(--accent); color: #fdf3e0; }

/* --- Print ------------------------------------------------------------ */
@media print {
  .site-header,
  .site-footer,
  .drawer-overlay,
  .floating-theme-toggle,
  #theme-toggle,
  .header-search-btn,
  .header-back-btn { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ============================================================
   Prayer / Novena / Ter\u00e7o — list grid + modal window
   ============================================================ */
.prayer-list-grid-wrapper {
  margin-top: 1.5rem;
}
.prayer-list-grid-title {
  font-family: var(--font-serif, 'Cormorant Garamond', serif);
  font-size: 1.4rem;
  color: var(--accent);
  margin: 0 0 1rem;
  letter-spacing: 0.01em;
}
.prayer-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.prayer-list-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-align: left;
  background: linear-gradient(135deg,
    rgba(255,255,255,0.85) 0%,
    rgba(251,246,236,0.95) 100%);
  border: 1px solid rgba(177,138,58,0.25);
  border-radius: 16px;
  padding: 0.95rem 1.1rem;
  cursor: pointer;
  font: inherit;
  color: var(--text, #2a1f12);
  box-shadow: 0 6px 18px rgba(122,58,26,0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  position: relative;
  overflow: hidden;
}
.prayer-list-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: 0 12px 28px rgba(122,58,26,0.14);
}
.prayer-list-card:active {
  transform: translateY(0);
}
.prayer-list-card-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--gold-bg);
  color: var(--accent);
}
.prayer-list-card-icon svg {
  width: 22px;
  height: 22px;
}
.prayer-list-card-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.prayer-list-card-title {
  font-family: var(--font-serif, 'Cormorant Garamond', serif);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prayer-list-card-sub {
  font-size: 0.78rem;
  color: var(--text-muted, #6b5a47);
  margin-top: 2px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.prayer-list-card-arrow {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--gold);
  background: rgba(177,138,58,0.08);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.prayer-list-card:hover .prayer-list-card-arrow {
  transform: translateX(2px);
  background: var(--gold);
  color: #fff;
}

/* Modal overlay */
body.prayer-modal-open {
  overflow: hidden;
}
.prayer-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 14, 8, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
  animation: prayerModalFade 0.2s ease;
}
@keyframes prayerModalFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.prayer-modal {
  width: min(820px, 100%);
  max-height: calc(100vh - 3rem);
  background: var(--paper);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(177,138,58,0.3);
  animation: prayerModalScale 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes prayerModalScale {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.prayer-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.4rem;
  border-bottom: 1px solid rgba(177,138,58,0.25);
  background: linear-gradient(180deg, rgba(255,255,255,0.6) 0%, transparent 100%);
}
.prayer-modal-title {
  margin: 0;
  font-family: var(--font-serif, 'Cormorant Garamond', serif);
  font-size: 1.35rem;
  color: var(--accent);
  line-height: 1.2;
  flex: 1 1 auto;
  min-width: 0;
}
.prayer-modal-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(122,58,26,0.2);
  background: rgba(255,255,255,0.8);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.prayer-modal-close:hover {
  background: var(--accent);
  color: #fff;
  transform: rotate(90deg);
}
.prayer-modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1.25rem 1.4rem;
}
.prayer-modal-body .prayer-board {
  margin: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}
.prayer-modal-loading {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted, #6b5a47);
}
.prayer-modal-loading .loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(177,138,58,0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  margin: 0 auto 0.75rem;
  animation: prayerSpin 0.9s linear infinite;
}
@keyframes prayerSpin {
  to { transform: rotate(360deg); }
}
.prayer-modal-footer {
  flex: 0 0 auto;
  padding: 0.85rem 1.4rem 1.1rem;
  border-top: 1px solid rgba(177,138,58,0.2);
  display: flex;
  justify-content: flex-end;
  background: linear-gradient(0deg, rgba(255,255,255,0.6) 0%, transparent 100%);
}
.prayer-modal-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  border: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(122,58,26,0.25);
  transition: background 0.15s ease, transform 0.15s ease;
}
.prayer-modal-back:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
}

/* Dark mode adjustments */
[data-theme="dark"] .prayer-list-card,
.theme-dark .prayer-list-card {
  background: linear-gradient(135deg, rgba(40,30,18,0.85), rgba(30,22,14,0.95));
  border-color: rgba(177,138,58,0.3);
  color: var(--text, #f1e7d4);
}
[data-theme="dark"] .prayer-list-card-title,
.theme-dark .prayer-list-card-title {
  color: var(--gold-soft, #d6b46a);
}
[data-theme="dark"] .prayer-modal,
.theme-dark .prayer-modal {
  background: #1c1610;
  border-color: rgba(177,138,58,0.35);
}
[data-theme="dark"] .prayer-modal-close,
.theme-dark .prayer-modal-close {
  background: rgba(255,255,255,0.06);
  color: var(--gold-soft, #d6b46a);
  border-color: rgba(177,138,58,0.3);
}

@media (max-width: 640px) {
  .prayer-modal-overlay { padding: 0; }
  .prayer-modal {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
}
