*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #fafaf9;
  --bg-card: #ffffff;
  --border: #e7e5e4;
  --text: #1c1917;
  --text-muted: #78716c;
  --primary: #b45309;
  --primary-fg: #ffffff;
  --primary-light: #fef3c7;
  --amber-50: #fffbeb;
  --amber-100: #fef3c7;
  --amber-200: #fde68a;
  --amber-700: #b45309;
  --amber-800: #92400e;
  --amber-900: #78350f;
  --radius: 0.75rem;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}
[data-theme="dark"] {
  --bg: #1c1917;
  --bg-card: #292524;
  --border: #44403c;
  --text: #fafaf9;
  --text-muted: #a8a29e;
  --primary: #f59e0b;
  --primary-fg: #1c1917;
  --primary-light: #422006;
  --amber-50: #1c1917;
  --amber-100: #292524;
  --amber-900: #fef3c7;
}
html { min-height: 100%; overflow-x: hidden; overflow-x: clip; }
body {
  min-height: 100%;
  overflow-x: hidden;
  /* clip (e não hidden) para o body não virar contêiner de rolagem e o sticky da barra de capítulos funcionar */
  overflow-x: clip;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  transition: background 0.3s, color 0.3s;
}
body, button, .navbar, .page, .tradition-card, .book-card, .reader-header, .reader-sidebar, .reader-nav, .donation-section, .about-card { caret-color: transparent; }
input, textarea, select, [contenteditable="true"] { caret-color: auto; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

.navbar {
  position: sticky; top: 0; z-index: 50;
  width: 100%;
  background: rgba(255,255,255,0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  transition: background 0.3s;
}
[data-theme="dark"] .navbar { background: rgba(28,25,23,0.95); }
.navbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.navbar-left { display: flex; align-items: center; gap: 0.75rem; }
.hamburger {
  display: none;
  flex-direction: column; gap: 5px;
  width: 36px; height: 36px;
  align-items: center; justify-content: center;
  border-radius: 0.5rem;
  color: var(--text-muted);
  transition: background 0.2s;
}
.hamburger:hover { background: var(--border); }
.hamburger span { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; }
.navbar-logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.1rem; color: var(--primary); cursor: pointer; }
.navbar-logo svg { width: 24px; height: 24px; }
.navbar-links { display: flex; align-items: center; gap: 0.25rem; }
.nav-link { padding: 0.375rem 0.75rem; border-radius: 0.5rem; font-size: 0.875rem; font-weight: 500; color: var(--text-muted); transition: color 0.2s, background 0.2s; }
.nav-link:hover, .nav-link.active { color: var(--text); background: var(--border); }
.navbar-actions { display: flex; align-items: center; gap: 0.5rem; }
.btn-icon { width: 36px; height: 36px; border-radius: 0.5rem; display: flex; align-items: center; justify-content: center; color: var(--text-muted); transition: background 0.2s, color 0.2s; }
.btn-icon:hover { background: var(--border); color: var(--text); }
.btn-icon svg { width: 20px; height: 20px; }
.mobile-menu { display: none; flex-direction: column; border-top: 1px solid var(--border); padding: 0.75rem 1rem; }
.mobile-menu.open { display: flex; }
.mobile-nav-link { padding: 0.75rem 0; font-size: 1rem; font-weight: 500; color: var(--text-muted); border-bottom: 1px solid var(--border); text-align: left; display: flex; align-items: center; gap: 0.5rem; }
.mobile-nav-link:last-child { border-bottom: none; }
.mobile-nav-link:hover { color: var(--text); }

.app { min-height: 100vh; display: flex; flex-direction: column; }
.content { flex: 1; max-width: 1280px; margin: 0 auto; padding: 1.5rem 1rem; width: 100%; min-width: 0; }
.page { display: none; min-width: 0; }
.page.active { display: block; }

.hero { text-align: center; padding: 3rem 1rem 2.5rem; }
.hero-badge { display: inline-flex; align-items: center; gap: 0.5rem; background: var(--primary-light); color: var(--primary); padding: 0.35rem 1rem; border-radius: 9999px; font-size: 0.8rem; font-weight: 600; margin-bottom: 1.5rem; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; line-height: 1.1; margin-bottom: 1rem; background: linear-gradient(135deg, var(--primary), #d97706); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero p { font-size: 1.1rem; color: var(--text-muted); max-width: 520px; margin: 0 auto 2rem; }
.hero-quote { background: var(--amber-50); border-left: 4px solid var(--primary); border-radius: 0 0.5rem 0.5rem 0; padding: 1rem 1.25rem; margin: 0 auto 2.5rem; max-width: 600px; text-align: left; font-style: italic; color: var(--text-muted); font-size: 0.95rem; }
[data-theme="dark"] .hero-quote { background: #292524; }
.hero-quote-source { display: block; margin-top: 0.4rem; font-style: normal; font-size: 0.8rem; }
.hero-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.btn-primary { display: inline-flex; align-items: center; gap: 0.5rem; background: var(--primary); color: #fff; padding: 0.625rem 1.5rem; border-radius: 0.5rem; font-weight: 600; font-size: 0.95rem; transition: background 0.2s, transform 0.1s; }
.btn-primary:hover { background: var(--amber-800); transform: translateY(-1px); }
.btn-secondary { display: inline-flex; align-items: center; gap: 0.5rem; background: var(--bg-card); color: var(--text); border: 1px solid var(--border); padding: 0.625rem 1.5rem; border-radius: 0.5rem; font-weight: 600; font-size: 0.95rem; transition: background 0.2s, transform 0.1s; }
.btn-secondary:hover { background: var(--border); transform: translateY(-1px); }

.section-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.25rem; display: flex; align-items: center; gap: 0.5rem; }
.traditions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin-bottom: 2.5rem; }
.tradition-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: box-shadow 0.2s, transform 0.2s; box-shadow: var(--shadow); }
.tradition-card.is-empty { opacity: 0.6; }
.tradition-card.is-empty:hover { opacity: 0.85; }
.traditions-group-title { grid-column: 1 / -1; margin: 1rem 0 -0.25rem; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }
.traditions-group-title:first-child { margin-top: 0; }
.tradition-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.tradition-card-icon { width: 100%; height: 120px; display: flex; align-items: center; justify-content: center; font-size: 3rem; background: linear-gradient(135deg, var(--primary-light), var(--amber-50)); }
[data-theme="dark"] .tradition-card-icon { background: linear-gradient(135deg, #292524, #1c1917); }
.tradition-card-body { padding: 1rem; }
.tradition-card-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.tradition-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.tradition-card-title { font-weight: 700; font-size: 1rem; }
.tradition-card-badge { margin-left: auto; background: var(--primary-light); color: var(--primary); font-size: 0.7rem; font-weight: 600; padding: 0.2rem 0.5rem; border-radius: 9999px; }
.tradition-card-desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }
.tradition-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.tradition-card-count { font-size: 0.8rem; color: var(--text-muted); }

.donation-section { background: linear-gradient(135deg, var(--amber-100), var(--amber-50)); border: 1px solid var(--amber-200); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 2rem; }
[data-theme="dark"] .donation-section { background: linear-gradient(135deg, #292524, #1c1917); border-color: #44403c; }
.pix-box { display: inline-flex; align-items: center; gap: 0.5rem; background: #fff; border-radius: 0.5rem; padding: 0.5rem 1rem; box-shadow: var(--shadow); flex-wrap: wrap; }
[data-theme="dark"] .pix-box { background: #292524; }
.pix-key { font-family: 'Courier New', monospace; font-size: 0.85rem; background: var(--amber-100); padding: 0.2rem 0.5rem; border-radius: 0.3rem; color: var(--amber-900); }
.btn-copy { font-size: 0.8rem; padding: 0.25rem 0.6rem; border-radius: 0.35rem; background: var(--primary); color: #fff; transition: background 0.2s; }
.btn-copy:hover { background: var(--amber-800); }

.books-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.btn-back { display: flex; align-items: center; gap: 0.35rem; padding: 0.4rem 0.8rem; border-radius: 0.5rem; border: 1px solid var(--border); font-size: 0.85rem; color: var(--text-muted); background: var(--bg-card); transition: background 0.2s; }
.btn-back:hover { background: var(--border); color: var(--text); }
.books-page-title { font-size: 1.5rem; font-weight: 700; }
.books-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 0.75rem; min-width: 0; }
.books-list.is-grouped { display: block; }
.apocrypha-section .books-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 240px)); justify-content: start; }
.book-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; cursor: pointer; transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 0.45rem; }
.book-card:hover { box-shadow: var(--shadow-lg); border-color: var(--primary); transform: translateY(-1px); }
.book-card-title { font-weight: 600; font-size: 1rem; line-height: 1.3; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.25rem 0.5rem; }
.book-card-overline { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--primary); }
.book-card-tag { font-size: 0.68rem; font-weight: 600; color: var(--text-muted); border: 1px solid var(--border); border-radius: 9999px; padding: 0.05rem 0.45rem; }
.book-card-excerpt { margin: 0; font-size: 0.83rem; line-height: 1.5; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book-card-meta { margin-top: auto; padding-top: 0.5rem; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 0.75rem; color: var(--text-muted); border-top: 1px solid var(--border); }
.book-card-langs { display: inline-flex; gap: 0.25rem; }
.book-card-langs span { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.04em; padding: 0.05rem 0.35rem; border-radius: 0.3rem; background: var(--primary-light); color: var(--primary); }
.books-group-title { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 0.6rem; margin: 1.25rem 0 0.1rem; font-size: 0.95rem; font-weight: 700; }
.books-group-title:first-child { margin-top: 0; }
.books-group-title span { font-size: 0.75rem; font-weight: 500; color: var(--text-muted); }
.books-group-more { grid-column: 1 / -1; justify-self: start; padding: 0.45rem 1rem; border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--primary); font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; }
.books-group-more:hover { background: var(--bg-card-hover, rgba(255, 255, 255, 0.05)); }
.canon-selector { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.canon-label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.canon-option { display: inline-flex; align-items: baseline; gap: 0.4rem; padding: 0.45rem 0.9rem; border: 1px solid var(--border); border-radius: 9999px; background: var(--bg-card); color: var(--text); font-size: 0.88rem; font-weight: 600; transition: border-color 0.15s, background 0.15s; }
.canon-option small { font-weight: 400; color: var(--text-muted); font-size: 0.75rem; }
.canon-option:hover { border-color: var(--primary); }
.canon-option.active { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }
.canon-option.active small { color: inherit; opacity: 0.85; }
.book-card-sub { font-size: 0.8rem; color: var(--text-muted); }
.book-card-badge { display: inline-block; font-size: 0.7rem; background: var(--primary-light); color: var(--primary); padding: 0.15rem 0.5rem; border-radius: 9999px; font-weight: 600; }
.book-card-theme { background: transparent; border: 1px solid currentColor; }

.books-language-selector { background: var(--amber-50); border: 1px solid var(--amber-200); border-radius: var(--radius); padding: 1rem; margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
[data-theme="dark"] .books-language-selector { background: #292524; border-color: #44403c; }
.books-language-selector label { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.books-language-selector select { flex: 1; min-width: min(220px, 100%); max-width: 420px; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 0.4rem; background: var(--bg-card); color: var(--text); font-size: 0.9rem; cursor: pointer; }

.reader-layout { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 1rem; min-height: 60vh; min-width: 0; max-width: 100%; }
.reader-layout.no-sidebar { grid-template-columns: minmax(0, 1fr); }
.hidden { display: none !important; }
.reader-sidebar { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); height: fit-content; position: sticky; top: 70px; max-height: calc(100vh - 100px); overflow-y: auto; min-width: 0; }
.reader-sidebar-header { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 0.9rem; display: flex; align-items: center; justify-content: space-between; }
.reader-sidebar-toggle { font-size: 0.75rem; color: var(--primary); background: var(--primary-light); padding: 0.25rem 0.5rem; border-radius: 0.3rem; cursor: pointer; }
.reader-sidebar-toggle:hover { background: var(--primary); color: white; }
.reader-sidebar-list { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.reader-sidebar-list.open { max-height: 60vh; overflow-y: auto; }
.chapter-item { padding: 0.6rem 1rem; font-size: 0.875rem; cursor: pointer; transition: background 0.15s; border-bottom: 1px solid var(--border); }
.chapter-item:last-child { border-bottom: none; }
.chapter-item:hover { background: var(--border); }
.chapter-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }

.reader-main { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; min-width: 0; max-width: 100%; overflow-wrap: break-word; }
.reader-header { margin-bottom: 1.5rem; border-bottom: 1px solid var(--border); padding-bottom: 1rem; }
.reader-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.25rem; }
.reader-subtitle { font-size: 0.9rem; color: var(--text-muted); }

.translation-selector-wrapper { position: sticky; top: 70px; z-index: 40; margin-bottom: 1rem; transition: opacity 0.18s ease, transform 0.18s ease; }
.translation-selector-wrapper.reader-controls-hidden { opacity: 0; pointer-events: none; transform: translateY(-12px); }
.translation-selector { display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1rem; background: var(--amber-50); border: 1px solid var(--amber-200); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
[data-theme="dark"] .translation-selector { background: #292524; border-color: #44403c; }
.translation-selector label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.translation-selector select { flex: 1; min-width: 0; max-width: 100%; padding: 0.4rem 0.75rem; border: 1px solid var(--border); border-radius: 0.4rem; background: var(--bg-card); color: var(--text); font-size: 0.85rem; cursor: pointer; }

.verse { display: flex; gap: 0.75rem; margin-bottom: 1rem; line-height: 1.7; padding: 0.5rem; border-radius: 0.5rem; transition: background 0.2s; cursor: pointer; user-select: text; }
.verse:hover { background: var(--amber-50); }
[data-theme="dark"] .verse:hover { background: #292524; }
.verse.selected { background: var(--primary-light); border-left: 3px solid var(--primary); }
.verse-num { font-size: 0.8rem; font-weight: 600; color: var(--primary); min-width: 28px; flex-shrink: 0; padding-top: 0.2rem; }
.verse-text { font-size: 0.95rem; min-width: 0; overflow-wrap: anywhere; white-space: pre-line; }
.verse-text.arabic { flex: 1; font-family: 'Scheherazade New', 'Amiri', 'Traditional Arabic', serif; font-size: 1.4rem; line-height: 2; direction: rtl; text-align: right; }
.verse-text.hebrew { flex: 1; font-family: 'SBL Hebrew', 'Ezra SIL', 'Taamey Frank CLM', 'Frank Ruehl CLM', 'David', 'Times New Roman', serif; font-size: 1.35rem; line-height: 1.9; direction: rtl; text-align: right; white-space: pre-line; }
/* Botão flutuante para copiar versículos selecionados */
.floating-copy-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 100;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  display: none;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.floating-copy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}
.floating-copy-btn:active {
  transform: translateY(0);
}

.apocrypha-search { margin-bottom: 1.25rem; }
.apocrypha-search input {
  width: 100%;
  max-width: 400px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.95rem;
}
.apocrypha-search input:focus {
  outline: none;
  border-color: var(--primary);
}
.apocrypha-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.apocrypha-category-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 2rem;
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}
.apocrypha-category-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.apocrypha-category-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.apocrypha-section {
  margin-bottom: 2rem;
  grid-column: 1 / -1;
}
.apocrypha-section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.reader-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.reader-nav button { display: flex; align-items: center; gap: 0.35rem; padding: 0.5rem 1rem; border-radius: 0.5rem; border: 1px solid var(--border); font-size: 0.85rem; color: var(--text-muted); background: var(--bg-card); transition: background 0.2s; }
.reader-nav button:hover { background: var(--border); color: var(--text); }
.reader-nav button:disabled, .floating-reader-nav button:disabled { opacity: 0.28; cursor: default; pointer-events: none; }
.reader-nav button.reader-control-unavailable { visibility: hidden; pointer-events: none; }
.floating-reader-nav button.reader-control-unavailable { display: none; }
.reader-nav-page { font-size: 0.85rem; color: var(--text-muted); }

.floating-reader-nav {
  position: fixed;
  inset: auto 0 1.1rem 0;
  z-index: 95;
  display: none;
  pointer-events: none;
}
.floating-reader-nav.visible { display: block; }
.floating-reader-nav button {
  position: fixed;
  bottom: 1.1rem;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1.5px solid color-mix(in srgb, var(--primary) 70%, transparent);
  background: color-mix(in srgb, var(--bg-card) 96%, transparent);
  color: var(--primary);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  font-size: 1.6rem;
  line-height: 1;
  pointer-events: auto;
}
.floating-reader-nav button:hover { border-color: var(--primary); background: var(--primary); color: var(--primary-fg); }
.floating-reader-nav button:first-child { left: 0.65rem; }
.floating-reader-nav button:last-child { right: 0.65rem; }

.loading { display: flex; align-items: center; justify-content: center; padding: 3rem; color: var(--text-muted); }
.loading-spinner { width: 24px; height: 24px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; margin-right: 0.75rem; }
@keyframes spin { to { transform: rotate(360deg); } }

.error-message { text-align: center; padding: 2rem; color: var(--text-muted); }

.store-header { text-align: center; margin-bottom: 1.5rem; }
.store-header h1 { font-size: 1.8rem; font-weight: 800; margin-bottom: 0.5rem; }
.store-cta { max-width: 760px; margin: 0 auto; background: linear-gradient(135deg, var(--amber-100), var(--amber-50)); border: 1px solid var(--amber-200); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); text-align: center; }
[data-theme="dark"] .store-cta { background: linear-gradient(135deg, #292524, #1c1917); border-color: #44403c; }
.store-cta h2 { font-size: 1.7rem; margin-bottom: 0.75rem; }
.store-cta p { color: var(--text-muted); margin-bottom: 1.25rem; }
.store-cta .btn-primary { justify-content: center; }
.store-link-note { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.85rem; }
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.product-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); transition: box-shadow 0.2s, transform 0.2s; display: flex; flex-direction: column; }
.product-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.product-icon { width: 48px; height: 48px; background: var(--primary-light); border-radius: 0.5rem; display: flex; align-items: center; justify-content: center; color: var(--primary); font-size: 1.5rem; }
.product-card:hover .product-icon { background: var(--primary); color: #fff; }
.product-category { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.25rem; }
.product-name { font-weight: 700; font-size: 0.95rem; margin-bottom: 0.5rem; }
.product-desc { font-size: 0.8rem; color: var(--text-muted); flex: 1; line-height: 1.5; margin-bottom: 0.75rem; }
.product-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.product-price { font-weight: 700; font-size: 1.1rem; color: var(--primary); }
.btn-cart { background: var(--primary); color: #fff; padding: 0.4rem 0.75rem; border-radius: 0.4rem; font-size: 0.8rem; font-weight: 600; transition: background 0.2s; }
.btn-cart:hover { background: var(--amber-800); }

.about-wrapper { max-width: 700px; margin: 0 auto; }
.about-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.about-card h2 { display: flex; align-items: center; gap: 0.75rem; line-height: 1.2; }
.about-card h2 svg { flex: 0 0 auto; }
.footer { text-align: center; padding: 1.5rem 1rem; border-top: 1px solid var(--border); font-size: 0.8rem; color: var(--text-muted); margin-top: 2rem; }

.search-overlay { display: none; position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,0.5); align-items: flex-start; justify-content: center; padding-top: 5rem; }
.search-overlay.open { display: flex; }
.search-modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); width: 90%; max-width: 600px; max-height: 80vh; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.search-input-wrap { display: flex; align-items: center; gap: 0.5rem; padding: 1rem; border-bottom: 1px solid var(--border); }
.search-input { flex: 1; border: none; background: none; font-size: 1rem; color: var(--text); outline: none; }
.search-results { overflow-y: auto; padding: 0.75rem; }
.search-result-item { padding: 0.75rem; border-radius: 0.5rem; cursor: pointer; transition: background 0.15s; margin-bottom: 0.35rem; }
.search-result-item:hover { background: var(--border); }
.search-result-ref { font-size: 0.75rem; font-weight: 700; color: var(--primary); margin-bottom: 0.2rem; }
.search-result-text { font-size: 0.875rem; line-height: 1.5; color: var(--text); }
.search-empty { text-align: center; padding: 2.5rem 1rem; color: var(--text-muted); }

.theme-dropdown, .translate-dropdown { position: relative; }
.theme-menu, .translate-menu { display: none; position: absolute; top: 100%; right: 0; margin-top: 0.5rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 0.75rem; padding: 0.5rem; min-width: 150px; box-shadow: var(--shadow-lg); z-index: 100; }
.theme-menu.open, .translate-menu.open { display: block; }
.theme-option, .translate-option { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem; border-radius: 0.35rem; font-size: 0.875rem; color: var(--text); cursor: pointer; transition: background 0.15s; }
.theme-option:hover, .translate-option:hover { background: var(--border); }
.theme-option.active, .translate-option.active { background: var(--primary-light); color: var(--primary); }
.translate-btn { position: relative; }
.translate-btn::after { content: '?'; position: absolute; right: -1px; top: -1px; width: 14px; height: 14px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 0.65rem; font-weight: 700; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--bg); }
.translate-menu { width: min(340px, calc(100vw - 2rem)); padding: 0.75rem; }
.translate-menu-header { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.75rem; }
.translate-menu-header strong { font-size: 0.92rem; }
.translate-current { font-size: 0.78rem; color: var(--text-muted); }
.translate-search { width: 100%; border: 1px solid var(--border); border-radius: 0.55rem; background: var(--bg); color: var(--text); padding: 0.7rem 0.85rem; font-size: 0.9rem; margin-bottom: 0.75rem; }
.translate-search:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(180,83,9,0.12); }
.translate-list { max-height: min(360px, 55vh); overflow-y: auto; display: flex; flex-direction: column; gap: 0.2rem; margin-bottom: 0.65rem; }
.translate-option { width: 100%; justify-content: space-between; text-align: left; }
.translate-option small { color: var(--text-muted); font-size: 0.72rem; }
.translate-empty { text-align: center; color: var(--text-muted); font-size: 0.86rem; padding: 0.85rem 0.5rem; }
.translate-group { padding: 0.6rem 0.75rem 0.3rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.translate-note { display: flex; gap: 0.5rem; align-items: flex-start; border-top: 1px solid var(--border); padding-top: 0.65rem; color: var(--text-muted); font-size: 0.76rem; line-height: 1.45; }
.translate-note strong { color: var(--text); font-size: 0.78rem; }
.google-translate-host, .skiptranslate, .goog-te-banner-frame, .goog-logo-link { display: none !important; }
body { top: 0 !important; }

.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 999; display: flex; flex-direction: column; gap: 0.5rem; }
.toast { background: var(--text); color: var(--bg); padding: 0.75rem 1.25rem; border-radius: 0.5rem; font-size: 0.875rem; font-weight: 500; box-shadow: var(--shadow-lg); animation: slideInRight 0.3s ease; }
.btn-install-top { display: none; align-items: center; gap: 0.45rem; background: var(--primary-light); color: var(--primary); padding: 0.55rem 0.9rem; border-radius: 0.5rem; font-size: 0.85rem; font-weight: 700; border: 1px solid var(--amber-200); }
.btn-install-top.visible { display: inline-flex; }
.btn-install-top:hover { background: var(--primary); color: #fff; }
@keyframes slideInRight { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

@media (max-width: 768px) {
  .navbar-links { display: none; }
  .hamburger { display: flex; }
  .reader-layout { grid-template-columns: 1fr; }
  .reader-sidebar { position: static; max-height: none; }
  .traditions-grid { grid-template-columns: 1fr 1fr; }
  .translation-selector-wrapper { top: 60px; }
  .books-language-selector { align-items: stretch; }
  .translation-selector { align-items: stretch; flex-direction: column; }
  .btn-install-top span { display: none; }
}
@media (max-width: 480px) {
  .traditions-grid { grid-template-columns: 1fr; }
  .products-grid { grid-template-columns: 1fr 1fr; }
}
  
  .tradition-summary-card{display:grid;gap:.65rem;background:var(--bg-card);border:1px solid var(--border);border-radius:18px;padding:1rem 1.1rem;margin-bottom:1rem;box-shadow:var(--shadow)}
  .tradition-summary-head{display:flex;justify-content:space-between;gap:.75rem;align-items:flex-start;flex-wrap:wrap}
  .tradition-summary-card h3{font-size:1rem;margin:0}
  .tradition-summary-card p{margin:0;color:var(--text-muted);line-height:1.6}
  .summary-meta{display:flex;gap:.5rem;flex-wrap:wrap}
  .summary-pill,.language-badge,.reader-tab{display:inline-flex;align-items:center;gap:.35rem;border-radius:999px;padding:.34rem .7rem;font-size:.8rem;font-weight:700}
  .summary-pill{background:rgba(180,83,9,.12);color:var(--primary)}
  .language-badge{background:rgba(59,130,246,.12);color:#1d4ed8;border:1px solid rgba(59,130,246,.18)}
  .book-card-badges{display:flex;gap:.4rem;flex-wrap:wrap;margin-top:.35rem}
  .reader-badges{display:flex;gap:.45rem;flex-wrap:wrap;margin-bottom:.75rem}
  .reader-tabs{display:flex;gap:.55rem;flex-wrap:wrap;margin:0 0 1rem}
  .reader-tab{border:1px solid var(--border);background:var(--bg-card);color:var(--text-muted);cursor:pointer}
  .reader-tab.active{background:var(--primary);color:#fff;border-color:var(--primary)}
  .activation-panel{background:var(--bg-card);border:1px solid var(--border);border-radius:18px;padding:1rem 1.1rem;margin-bottom:1rem;box-shadow:var(--shadow)}
  .activation-panel h3{margin:0 0 .65rem;font-size:1rem}
  .activation-panel p{margin:0;color:var(--text-muted);line-height:1.75;white-space:pre-line}
  .activation-images{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:.75rem;margin-top:1rem}
  .activation-images img{width:100%;height:180px;object-fit:cover;border-radius:14px;border:1px solid var(--border);background:#fff}
  .reader-downloads{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;margin:0 0 1rem}
  .reader-downloads .download-label{font-size:.85rem;color:var(--text-muted);font-weight:600}
  .download-link{display:inline-flex;align-items:center;gap:.35rem;padding:.4rem .75rem;border:1px solid var(--border);border-radius:9999px;background:var(--bg-card);font-size:.85rem;font-weight:600;color:var(--primary);transition:background .15s,border-color .15s}
  .download-link:hover{background:var(--primary-light);border-color:var(--primary)}
  .download-link small{font-weight:400;color:var(--text-muted)}
  .version-credits{display:grid;grid-template-columns:max-content 1fr;gap:.35rem 1rem;margin:1rem 0 0;padding-top:.85rem;border-top:1px solid var(--border);font-size:.85rem}
  .version-credits dt{color:var(--text-muted);font-weight:600}
  .version-credits dd{margin:0;overflow-wrap:anywhere}
  .version-credits a{color:var(--primary);text-decoration:underline}
  .version-notice{margin:.75rem 0 0 !important;font-size:.8rem;color:var(--text-muted);line-height:1.5}
  .reader-inline-prologue{display:grid;gap:1rem;background:linear-gradient(180deg,rgba(180,83,9,.08),rgba(180,83,9,.02));border:1px solid rgba(180,83,9,.18);border-radius:20px;padding:1.15rem 1.1rem;margin-bottom:1rem;box-shadow:var(--shadow)}
  .reader-inline-prologue .activation-images{margin-top:0}
  .reader-inline-prologue h3{margin:0;text-align:center;font-size:1.05rem;color:var(--text)}
  .reader-inline-prologue .reader-prologue-text{max-width:780px;margin:0 auto;text-align:center;color:var(--text-muted)}
  .reader-inline-prologue-actions{display:flex;justify-content:center;flex-wrap:wrap;gap:.75rem}
  .reader-inline-prologue-note{font-size:.82rem;color:var(--text-muted);text-align:center;margin:-.25rem 0 0}
  .footer-links{display:flex;gap:.9rem;justify-content:center;flex-wrap:wrap;margin-top:.6rem}
  .footer-links a{color:inherit;text-decoration:none;border-bottom:1px dashed currentColor;padding-bottom:.08rem}

/* Página inicial "Portais": frase de um livro no topo e cards na cor de cada tradição */
.portal-hero { display: grid; grid-template-columns: 1.25fr 1fr; gap: 2.5rem; align-items: end; padding: 3rem 0 2.25rem; }
.portal-quote { margin: 0; }
.portal-quote blockquote { margin: 0; font-family: 'Cormorant Garamond', Georgia, serif; font-style: italic; font-weight: 500; font-size: clamp(2rem, 4.4vw, 3.4rem); line-height: 1.12; color: var(--text); }
.portal-quote blockquote.is-long { font-size: clamp(1.7rem, 3.3vw, 2.6rem); }
.portal-quote figcaption { display: flex; align-items: center; gap: 0.9rem; margin-top: 1.1rem; }
.portal-quote figcaption a { font-family: 'Cinzel', Georgia, serif; font-size: 0.85rem; letter-spacing: 0.1em; color: var(--primary); text-decoration: none; }
.portal-quote figcaption a:hover { text-decoration: underline; }
.portal-intro p { color: var(--text-muted); font-size: 1.05rem; line-height: 1.6; margin: 0 0 1.1rem; }
.portal-search { display: flex; align-items: center; gap: 0.6rem; width: 100%; padding: 0.95rem 1.1rem; border: 1px solid var(--border); border-radius: 0.9rem; background: var(--bg-card); color: var(--text-muted); font-size: 0.95rem; text-align: left; cursor: text; }
.portal-search:hover { border-color: var(--primary); }
.portal-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tradition-card.portal-card { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 200px; padding: 1.5rem 1.35rem 1.3rem; border: 0; border-radius: 1.1rem; background: var(--portal); color: #f6efe4; overflow: hidden; box-shadow: none; }
.tradition-card.portal-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25); }
.portal-card.is-wide { grid-column: span 2; }
.portal-symbol { position: absolute; right: -0.4rem; top: -1.4rem; font-size: 8.5rem; line-height: 1; opacity: 0.16; pointer-events: none; font-family: 'Segoe UI Symbol', 'Noto Sans Symbols', serif; }
.portal-title { font-family: 'Cinzel', Georgia, serif; font-weight: 600; font-size: 1.25rem; letter-spacing: 0.03em; margin: 0 0 0.35rem; }
.portal-desc { margin: 0 0 0.85rem; font-size: 0.86rem; line-height: 1.5; opacity: 0.85; }
.portal-meta { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.8; }
@media (max-width: 820px) {
  .portal-hero { grid-template-columns: 1fr; gap: 1.5rem; padding-top: 1.75rem; }
  .portal-card.is-wide { grid-column: auto; }
}
.search-modes { display: flex; gap: 0.4rem; padding: 0.6rem 1rem 0; }
.search-mode { padding: 0.4rem 0.9rem; border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--text-muted); font-size: 0.85rem; font-weight: 600; cursor: pointer; }
.search-mode.active { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }
.search-status { font-size: 0.78rem; color: var(--text-muted); padding: 0.1rem 0.75rem 0.6rem; }
.search-result-text mark { background: var(--primary-light); color: inherit; padding: 0 0.1rem; border-radius: 0.2rem; }
.search-result-item > strong { display: block; font-size: 0.95rem; }
.search-result-item > span { display: block; margin-top: 0.15rem; font-size: 0.8rem; color: var(--text-muted); }

/* Páginas internas "Portais": faixa da tradição, cards de livros e leitor em tipografia de livro.
   --portal é a cor da tradição aberta (definida em books.js ao abrir a tradição). */
.books-header .books-page-title { display: none; }
#books-tradition-summary.tradition-summary-card { position: relative; overflow: hidden; display: block; background: var(--portal, #3a3025); color: #f6efe4; border: 0; border-radius: 1.4rem; padding: 2.4rem 2.2rem 2rem; margin-bottom: 1.5rem; box-shadow: none; }
#books-tradition-summary .portal-symbol { right: 1rem; top: -2.6rem; font-size: 15rem; opacity: 0.13; }
.portal-banner-title { position: relative; font-family: 'Cinzel', Georgia, serif; font-weight: 600; font-size: clamp(1.9rem, 4.5vw, 3rem); letter-spacing: 0.03em; margin: 0 0 0.6rem; }
#books-tradition-summary p { position: relative; max-width: 46rem; margin: 0; color: #f6efe4; opacity: 0.88; font-size: 1rem; line-height: 1.65; }
.apocrypha-category-btn { background: transparent; color: var(--text-muted); }
.apocrypha-category-btn:hover { background: transparent; color: var(--text); border-color: var(--portal, var(--primary)); }
.apocrypha-category-btn.active { background: var(--portal, var(--primary)); border-color: var(--portal, var(--primary)); color: #f6efe4; }
.canon-option.active { background: var(--portal, var(--primary)); border-color: var(--portal, var(--primary)); color: #f6efe4; }
.books-group-title { font-family: 'Cinzel', Georgia, serif; font-weight: 600; font-size: 0.9rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--primary); margin-top: 1.75rem; }
.books-group-title::after { content: ''; flex: 1; height: 1px; background: var(--border); align-self: center; }
.book-card { position: relative; overflow: hidden; border-radius: 1rem; padding: 1.1rem 1.15rem 1rem 1.35rem; box-shadow: none; }
.book-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--portal, var(--primary)); }
.book-card:hover { box-shadow: none; transform: translateY(-3px); border-color: var(--primary); }
.book-card-title { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 600; font-size: 1.35rem; line-height: 1.15; }
.book-card-overline { letter-spacing: 0.12em; }
.book-card-langs span { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }

/* Leitor */
.reader-main { border-radius: 1.2rem; padding: 2rem clamp(1rem, 4vw, 3rem); }
.reader-header { text-align: center; padding-bottom: 1.4rem; }
.reader-title { font-family: 'Cinzel', Georgia, serif; font-weight: 600; font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: 0.03em; }
.reader-subtitle { font-family: 'Cormorant Garamond', Georgia, serif; font-style: italic; font-size: 1.15rem; }
.reader-sidebar { border-radius: 1rem; }
.reader-sidebar-header { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 1.15rem; }
.reader-sidebar-toggle { font-family: 'Inter', system-ui, sans-serif; white-space: nowrap; }
.chapter-item.active { background: transparent; color: var(--primary); box-shadow: inset 3px 0 0 var(--portal, var(--primary)); }
.translation-selector { background: var(--bg-card); border-radius: 0.9rem; }
[data-theme="dark"] .translation-selector { background: var(--bg-card); }
#verses-container { max-width: 44rem; margin: 0 auto; }
.verse { gap: 0.6rem; margin-bottom: 0.7rem; line-height: 1.75; }
.verse-num { font-family: 'Inter', system-ui, sans-serif; font-size: 0.72rem; padding-top: 0.45rem; text-align: right; min-width: 26px; }
.verse-text:not(.arabic):not(.hebrew) { font-family: 'EB Garamond', Georgia, serif; font-size: 1.22rem; }
.reader-nav button { font-family: 'Cinzel', Georgia, serif; letter-spacing: 0.06em; }

/* Sobre e Loja */
.about-card { border-radius: 1.2rem; box-shadow: none; }
.about-card h2 { font-family: 'Cinzel', Georgia, serif; font-weight: 600; letter-spacing: 0.03em; }
.store-cta, [data-theme="dark"] .store-cta { position: relative; overflow: hidden; background: #3a2a1c; color: #f6efe4; border: 0; border-radius: 1.4rem; box-shadow: none; }
.store-cta h2 { font-family: 'Cinzel', Georgia, serif; font-weight: 600; letter-spacing: 0.03em; }
.store-cta p, .store-cta .store-link-note { color: #f6efe4; opacity: 0.85; }
@media (max-width: 640px) {
  #books-tradition-summary.tradition-summary-card { padding: 1.8rem 1.3rem 1.5rem; }
  #books-tradition-summary .portal-symbol { font-size: 10rem; }
  .verse-text:not(.arabic):not(.hebrew) { font-size: 1.12rem; }
}

/* Logo: códice com fita e estrela (icons/logo.svg) + nome em Cinzel */
.navbar-logo { gap: 0.55rem; white-space: nowrap; }
.navbar-logo svg { width: 30px; height: 30px; flex: 0 0 auto; }
.navbar-logo span { font-family: 'Cinzel', Georgia, serif; font-weight: 600; font-size: 1.15rem; letter-spacing: 0.1em; text-transform: uppercase; }
@media (max-width: 420px) { .navbar-logo span { font-size: 0.98rem; letter-spacing: 0.06em; } .navbar-logo svg { width: 26px; height: 26px; } }

/* Filtros de categoria em grade alinhada, com a contagem de livros */
.apocrypha-search input { width: 100%; max-width: none; }
.apocrypha-categories { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.5rem; margin-bottom: 1.5rem; }
.apocrypha-category-btn { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.65rem 0.95rem; border-radius: 0.8rem; text-align: left; line-height: 1.25; }
.apocrypha-category-btn .category-count { flex: 0 0 auto; min-width: 1.6rem; padding: 0.05rem 0.4rem; border-radius: 999px; background: var(--border); color: var(--text-muted); font-size: 0.72rem; font-weight: 600; text-align: center; }
.apocrypha-category-btn.active .category-count { background: rgba(255, 255, 255, 0.2); color: #f6efe4; }
.canon-selector { margin-bottom: 1rem; }
@media (max-width: 640px) {
  .apocrypha-categories { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.4rem; }
  .apocrypha-category-btn { padding: 0.55rem 0.7rem; font-size: 0.8rem; }
}

/* Downloads discretos: links pequenos, sem caixa, ao lado do rótulo */
.reader-downloads { gap: 0.35rem 0.75rem; margin: 0 0 0.9rem; justify-content: center; }
.reader-downloads .download-label { font-size: 0.75rem; font-weight: 500; }
.download-link { padding: 0.15rem 0.1rem; border: 0; border-radius: 0.3rem; background: transparent; font-size: 0.75rem; font-weight: 600; gap: 0.25rem; opacity: 0.85; }
.download-link:hover { background: transparent; opacity: 1; text-decoration: underline; }
.download-link small { font-size: 0.7rem; }

/* Sobre: cartão "Fontes e créditos" (montado em general.js a partir dos livros) */
.about-sources h3 { font-family: 'Cinzel', Georgia, serif; font-size: 0.95rem; letter-spacing: 0.08em; color: var(--primary); margin: 1.4rem 0 0.6rem; }
.about-sources ul { margin: 0; padding-left: 1.1rem; }
.about-sources li { margin: 0 0 0.45rem; line-height: 1.45; font-size: 0.9rem; }
.about-sources a { color: var(--primary); }
.sources-sites { columns: 2; column-gap: 1.5rem; }
.sources-summary { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.8rem; }
.sources-count { color: var(--text-muted); font-size: 0.8rem; }
.sources-detail { color: var(--text-muted); font-size: 0.82rem; }
.sources-traditions details { border-top: 1px solid var(--border); padding: 0.55rem 0; }
.sources-traditions details:last-child { border-bottom: 1px solid var(--border); }
.sources-traditions summary { cursor: pointer; font-weight: 600; }
.sources-traditions details ul { margin-top: 0.6rem; }
@media (max-width: 640px) { .sources-sites { columns: 1; } }
