/* ============================================================
   Article Reader — in-app full-screen view for /vida articles
   Loads via /api/vida/article?slug=X, renders title + image + body
   without leaving the app
   ============================================================ */

.ar-screen {
  position: fixed;
  inset: 0;
  z-index: 235;
  background: var(--app-cream-1, #faf3e3);
  color: var(--app-text, #1f2d3d);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.ar-screen.open { display: flex; animation: arFade 0.3s ease-out; }
@keyframes arFade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ar-top {
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(250,243,227,0.98) 0%, rgba(250,243,227,0.7) 100%);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(8px);
}
.ar-close, .ar-share {
  background: var(--app-card, #fff);
  border: 1px solid var(--app-border, #e8dfc8);
  color: var(--app-text-strong, #0d2846);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ar-share { font-weight: 700; }

.ar-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Clear the persistent bottom tab bar so content never hides behind it. */
  padding: 0 0 calc(76px + env(safe-area-inset-bottom, 0px));
}

.ar-hero {
  width: 100%;
  height: 220px;
  background: linear-gradient(135deg, var(--ink-navy-2, #123c68), var(--ink-navy-3, #1f4c84));
  background-size: cover;
  background-position: center;
  position: relative;
}
.ar-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(13,40,70,0.55) 100%);
}

.ar-meta {
  padding: 18px 20px 6px;
}
.ar-category {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--app-gold-deep, #b87f1c);
  margin-bottom: 8px;
}
.ar-title {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--app-text-strong, #0d2846);
  margin: 0 0 10px;
}
.ar-byline {
  font-size: 0.82rem;
  color: var(--app-muted, #8a7e64);
  margin: 0 0 16px;
}
.ar-byline strong { color: var(--app-text, #1f2d3d); }

.ar-content {
  padding: 6px 22px 24px;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--app-text, #1f2d3d);
}
.ar-content p { margin: 0 0 14px; }
.ar-content h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--app-text-strong);
  margin: 24px 0 10px;
  letter-spacing: -0.01em;
}
.ar-content h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--app-text-strong);
  margin: 20px 0 8px;
}
.ar-content ul, .ar-content ol {
  margin: 0 0 14px;
  padding-left: 22px;
}
.ar-content li { margin-bottom: 6px; }
.ar-content blockquote {
  border-left: 3px solid var(--app-gold, #d9a028);
  padding: 6px 16px;
  margin: 16px 0;
  background: rgba(217,160,40,0.06);
  font-style: italic;
  color: var(--app-text-strong);
  border-radius: 0 8px 8px 0;
}
.ar-content a {
  color: var(--app-navy-3, #1f4c84);
  text-decoration: underline;
  text-decoration-color: rgba(31,76,132,0.35);
}
.ar-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 12px 0;
}
.ar-content strong { color: var(--app-text-strong); font-weight: 700; }

.ar-loading {
  padding: 80px 24px;
  text-align: center;
  color: var(--app-muted);
}
.ar-loading .spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--app-border);
  border-top-color: var(--app-navy-2);
  border-radius: 50%;
  margin: 0 auto 14px;
  animation: arSpin 0.9s linear infinite;
}
@keyframes arSpin { to { transform: rotate(360deg); } }

.ar-error {
  padding: 60px 24px;
  text-align: center;
  color: var(--app-muted);
}
.ar-error .icon { font-size: 2.4rem; opacity: 0.55; margin-bottom: 12px; }
.ar-error h3 { color: var(--app-text-strong); margin: 0 0 6px; }

.ar-footer-cta {
  margin: 24px 22px 0;
  padding: 16px 18px;
  background: var(--app-card-soft, #fffdf7);
  border: 1px solid var(--app-border-soft, #f0e6d0);
  border-radius: 14px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--app-text);
  line-height: 1.5;
}
.ar-footer-cta strong { color: var(--app-text-strong); }

/* ============================================================
   Church detail — sections inside the .ar-screen pattern
   ============================================================ */
.cd-section {
  margin: 14px 16px 0;
  padding: 16px 18px 18px;
  background: var(--app-card, #fff);
  border: 1px solid var(--app-border-soft, #f0e6d0);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(13,40,70,0.04);
}
.cd-section__h {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--app-text-strong, #0d2846);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}
.cd-prose {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--app-text, #1f2d3d);
}
.cd-map {
  margin: 0 -2px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--app-border, #e8dfc8);
  background: var(--app-cream-1, #faf3e3);
}
.cd-map iframe {
  width: 100%;
  height: 220px;
  border: 0;
  display: block;
}
.cd-contact-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
/* 📝 Private note (Premium) */
.cd-note-input {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  padding: 11px 12px;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--app-text, #1f2d3d);
  background: var(--app-cream-1, #faf3e3);
  border: 1px solid var(--app-border, #e8dfc8);
  border-radius: 10px;
  box-sizing: border-box;
}
.cd-note-input:focus {
  outline: none;
  border-color: var(--app-gold-deep, #b8860b);
  background: #fff;
}
.cd-note-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}
.cd-note-hint {
  font-size: 0.76rem;
  color: var(--app-muted, #6b7785);
}
.cd-note-foot .btn { padding: 8px 16px; font-size: 0.85rem; }
.cd-note-locked { cursor: pointer; }
.cd-note-locked:active { transform: scale(0.995); }
.cd-contact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--app-cream-1, #faf3e3);
  border-radius: 10px;
  color: var(--app-text, #1f2d3d);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.15s ease;
}
.cd-contact:hover { background: var(--app-cream-2, #f5ebd4); }
.cd-contact > span:first-child { font-size: 1.05rem; }

.cd-edit-cta {
  margin: 22px 16px 0;
  padding: 18px 20px;
  background: linear-gradient(135deg, var(--app-cream-1, #faf3e3) 0%, var(--app-cream-2, #f5ebd4) 100%);
  border: 1px solid var(--app-border, #e8dfc8);
  border-radius: 14px;
  text-align: left;
}
.cd-edit-cta__title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--app-text-strong, #0d2846);
  margin-bottom: 6px;
}
.cd-edit-cta__body {
  margin: 0 0 4px;
  font-size: 0.87rem;
  line-height: 1.5;
  color: var(--app-text, #1f2d3d);
}

/* ============================================================
   Bible reader — book picker + chapter picker
   ============================================================ */
.bible-picker, .bible-chapters, .bible-reading { padding: 0; }
.bible-picker__meta { padding: 18px 22px 8px; }
.bible-section-h {
  margin: 18px 22px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--app-muted, #8a7e64);
}
/* Full-width section banner: fixed height so every section is identical;
   the section artwork sits behind a navy gradient with the title overlaid. */
.bible-section { margin-bottom: 4px; }
.bible-section-banner {
  position: relative;
  height: 96px;
  margin: 16px 16px 12px;
  border-radius: 16px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  box-shadow: 0 4px 14px rgba(13, 40, 70, 0.18);
}
.bible-section-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(13, 40, 70, 0.05) 0%, rgba(13, 40, 70, 0.74) 100%);
}
.bible-section-banner__txt {
  position: relative;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bible-section-banner__title {
  color: #fff;
  font-weight: 800;
  font-size: 1.14rem;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.55);
}
.bible-section-banner__count {
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.72rem;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}
.bible-book-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 0 16px 6px;
}

/* Chapter audiobook bar (Premium). Sits above the verses in the reading view. */
.bible-audio-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 16px 16px;
  padding: 10px 14px;
  background: var(--app-card-soft, #fffdf7);
  border: 1px solid var(--app-border-soft, #f0e6d0);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(13, 40, 70, 0.06);
}
.bible-audio-bar__ic { font-size: 1.2rem; flex: 0 0 auto; }
.bible-audio-bar audio { flex: 1 1 auto; height: 38px; width: 100%; }
.bible-audio-bar--locked {
  cursor: pointer;
  border-color: var(--app-gold, #d4a942);
  background: linear-gradient(180deg, rgba(217, 160, 40, 0.08), rgba(217, 160, 40, 0.03));
}
.bible-audio-bar--locked:active { transform: scale(0.99); }
.bible-audio-bar__tx { display: flex; flex-direction: column; line-height: 1.25; flex: 1 1 auto; }
.bible-audio-bar__tx strong { font-size: 0.92rem; color: var(--app-text-strong, #0d2846); font-weight: 700; }
.bible-audio-bar__tx small { font-size: 0.74rem; color: var(--app-gold-deep, #b8801c); font-weight: 600; }
.bible-audio-bar__lock { font-size: 1rem; flex: 0 0 auto; opacity: 0.8; }
/* Inline chapter mini-player: round play/pause + close (×). */
.bible-audio-bar__toggle {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; border: none;
  background: var(--app-gold, #d4a942); color: #1a1206; font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-family: inherit;
}
.bible-audio-bar__toggle:active { transform: scale(0.94); }
.bible-audio-bar__tx small { color: var(--app-muted, #8a7e64); font-size: 0.74rem; font-weight: 500; }
.bible-audio-bar__x {
  flex: 0 0 auto; margin-left: auto; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--app-border-soft, #f0e6d0); background: transparent;
  color: var(--app-muted, #8a7e64); font-size: 0.9rem; cursor: pointer; font-family: inherit;
}
.bible-audio-bar--player {
  flex-direction: column; align-items: stretch; gap: 8px;
  /* Stay pinned at the top while the karaoke text scrolls underneath. */
  position: sticky; top: 0; z-index: 4;
  box-shadow: 0 4px 12px rgba(13,40,70,0.10);
}
.bible-audio-bar__main { display: flex; align-items: center; gap: 12px; }
.bible-audio-bar__seek { display: flex; align-items: center; gap: 10px; }
.bible-audio-bar__range { flex: 1 1 auto; min-width: 0; height: 4px; accent-color: var(--app-gold, #d4a942); cursor: pointer; }
.bible-audio-bar__t { flex: 0 0 auto; min-width: 32px; font-size: 0.7rem; font-weight: 600; color: var(--app-muted, #8a7e64); }
.bible-audio-bar__t:last-child { text-align: right; }
@media (min-width: 540px) { .bible-book-grid { grid-template-columns: repeat(3, 1fr); } }
.bible-book-tile {
  background: var(--app-card, #fff);
  border: 1px solid var(--app-border-soft, #f0e6d0);
  border-radius: 12px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  display: flex; flex-direction: column; gap: 4px;
}
.bible-book-tile:active { transform: scale(0.98); }
.bible-book-tile:hover { border-color: var(--app-gold); box-shadow: 0 3px 12px rgba(217,160,40,0.15); }
.bible-book-tile__name { font-weight: 700; color: var(--app-text-strong, #0d2846); font-size: 0.92rem; }
.bible-book-tile__chs { font-size: 0.72rem; color: var(--app-muted, #8a7e64); }

.bible-back {
  margin: 14px 16px 4px;
  background: transparent;
  border: 2px solid var(--app-border, #e8dfc8);
  padding: 8px 14px;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--app-text, #1f2d3d);
  cursor: pointer;
}
/* Bible has no top bar — the screen background (navy in dark mode) reaches the top.
   bibleBody clears the status bar; the version pill floats top-right on the same
   row as the "← Libros/Capítulos" back button, matching its outline. */
#bibleBody { position: relative; padding-top: env(safe-area-inset-top, 0px); }
.bible-version-btn {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  right: 16px;
  z-index: 6;
  background: transparent;
  border: 2px solid var(--app-border, #e8dfc8);
  padding: 8px 14px;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--app-text-strong, #0d2846);
  cursor: pointer;
}
/* Reading view brings its own ↓ Offline top-right control → hide the pill there. */
#bibleBody.reading-active .bible-version-btn { display: none; }
.bible-chapters__h {
  margin: 12px 22px 12px;
  font-size: 1.25rem;
  color: var(--app-text-strong, #0d2846);
  letter-spacing: -0.01em;
}
.bible-chapter-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  padding: 0 16px 24px;
}
@media (min-width: 540px) { .bible-chapter-grid { grid-template-columns: repeat(10, 1fr); } }
.bible-chapter-tile {
  background: var(--app-card, #fff);
  border: 1px solid var(--app-border-soft, #f0e6d0);
  border-radius: 10px;
  padding: 12px 0;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--app-text-strong, #0d2846);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.bible-chapter-tile:active { transform: scale(0.95); }
.bible-chapter-tile:hover { border-color: var(--app-gold); color: var(--app-gold-deep); }

/* Bible karaoke: the verse being narrated. */
[data-bible-verse].bible-verse--active {
  background: rgba(217,160,40,0.16) !important;
  border-radius: 8px;
  box-shadow: inset 3px 0 0 var(--app-gold, #d4a942);
  transition: background 0.2s ease;
}
