/* ==========================================================
   SANCTUARY 2.0 — COMPONENTS
   Botões, badges, cards, pills, search, modais, toasts, forms
   ========================================================== */

/* ===== BOTÕES REVERENTES ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-6);
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: all var(--t-fast);
  position: relative;
  overflow: hidden;
  min-height: 44px;
}

.btn--gold {
  background: var(--grad-dourado);
  color: white;
  box-shadow: 0 6px 20px var(--halo-gold);
}

.btn--gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(212, 175, 55, 0.5);
  color: white;
}

.btn--gold:active { transform: translateY(0); }

.btn--pulse {
  animation: pulseGold 2.4s ease-in-out infinite;
}

.btn--ghost {
  background: transparent;
  color: var(--text-main);
  border: 1.5px solid var(--border);
}

.btn--ghost:hover {
  border-color: var(--gold-sacred);
  color: var(--gold-sacred);
  background: var(--halo-gold-soft);
}

.btn--sm {
  padding: var(--s-2) var(--s-4);
  font-size: 0.85rem;
  min-height: 36px;
}

/* Efeito shine no botão dourado */
.btn--gold::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  transition: left 0.6s ease;
}

.btn--gold:hover::after { left: 150%; }

/* ===== FILTER PILLS (Pílulas de Intenção) ===== */
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  justify-content: center;
  margin-bottom: var(--s-6);
  padding: var(--s-3) 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-pill);
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--t-fast);
  min-height: 40px;
}

.pill:hover {
  border-color: var(--gold-sacred);
  color: var(--gold-sacred);
  transform: translateY(-2px);
}

.pill.is-active {
  background: var(--grad-dourado);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 14px var(--halo-gold);
}

.pill i { font-size: 0.85em; }

/* ===== SEARCH BAR ===== */
.search-bar {
  position: relative;
  max-width: 600px;
  margin: 0 auto var(--s-7);
}

.search-bar i {
  position: absolute;
  left: var(--s-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
}

.search-bar input {
  width: 100%;
  padding: var(--s-4) var(--s-5) var(--s-4) calc(var(--s-4) + 28px);
  border: 1.5px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 1rem;
  transition: all var(--t-fast);
  min-height: 48px;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--gold-sacred);
  box-shadow: 0 0 0 4px var(--halo-gold-soft);
}

.search-bar input::placeholder {
  color: var(--text-light);
}

/* ===== PRAYER CARDS ===== */
.prayer-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  position: relative;
  overflow: visible; /* Não cortar ícones nem botoes de ação */
  transition: all var(--t-normal);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  min-height: 220px;
}

.prayer-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad-dourado);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-smooth);
}

.prayer-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-island);
  border-color: var(--gold-sacred);
}

.prayer-card:hover::before { transform: scaleX(1); }

.prayer-card--featured {
  background: var(--grad-amanhecer);
  border: none;
  box-shadow: var(--shadow-glow-gold);
  animation: breathe 4s ease-in-out infinite;
  min-height: 440px;
  height: auto;
  overflow: hidden; /* Só o featured usa hidden para efeitos visuais */
}

.prayer-card--featured::after {
  content: '✦';
  position: absolute;
  top: var(--s-4); right: var(--s-5);
  font-size: 2.5rem;
  color: var(--gold-sacred);
  opacity: 0.3;
  animation: float 5s ease-in-out infinite;
}

.prayer-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-2);
}

.prayer-card__tag,
.prayer-card__cat {
  display: inline-block;
  padding: var(--s-1) var(--s-3);
  border-radius: var(--r-pill);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: var(--font-cinzel);
}

.prayer-card__tag {
  background: var(--halo-gold);
  color: var(--bronze-deep);
}

.prayer-card__cat {
  background: rgba(212, 175, 55, 0.1);
  color: var(--gold-sacred);
}

.prayer-card--featured .prayer-card__tag {
  background: var(--grad-dourado);
  color: white;
}

.prayer-card__title {
  font-family: var(--font-title);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.prayer-card--featured .prayer-card__title {
  font-size: clamp(1.4rem, 2.5vw, 1.75rem);
  margin-top: var(--s-2);
}

.prayer-card__text {
  font-family: var(--font-prayer);
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.7;
  color: var(--text-muted);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.prayer-card--featured .prayer-card__text {
  font-size: clamp(1.1rem, 1.8vw, 1.3rem);
  -webkit-line-clamp: 12;
  line-clamp: 12;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prayer-card__actions {
  display: flex;
  gap: var(--s-2);
  margin-top: var(--s-2);
  padding-top: var(--s-3);
  border-top: 1px solid var(--border);
  position: relative; /* Garantir z-index acima do ::before */
  z-index: 1;
  flex-wrap: wrap;
}

.prayer-card__actions .icon-btn {
  width: 38px; height: 38px;
  font-size: 0.95rem;
  flex-shrink: 0;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: calc(var(--s-6) + var(--tabbar-h) + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text-main);
  color: var(--bg-card);
  padding: var(--s-3) var(--s-5);
  border-radius: var(--r-pill);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: var(--z-toast);
  opacity: 0;
  pointer-events: none;
  transition: all var(--t-normal);
  max-width: 90vw;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast--gold { background: var(--grad-dourado); color: white; }

/* ===== MODAIS ===== */
.prayer-modal,
.fav-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--s-4);
}

.prayer-modal.is-open,
.fav-modal.is-open { display: flex; }

.prayer-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(12px);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.prayer-modal__panel,
.fav-modal__panel {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--r-island);
  padding: var(--s-7) var(--s-6);
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

.prayer-modal__close {
  position: absolute;
  top: var(--s-4); right: var(--s-4);
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--bg-site);
  color: var(--text-main);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  transition: all var(--t-fast);
}

.prayer-modal__close:hover {
  background: var(--gold-sacred);
  color: white;
  transform: rotate(90deg);
}

.prayer-modal__cat {
  display: inline-block;
  padding: var(--s-1) var(--s-3);
  border-radius: var(--r-pill);
  background: var(--halo-gold);
  color: var(--bronze-deep);
  font-family: var(--font-cinzel);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: var(--s-3);
}

.prayer-modal__title {
  font-family: var(--font-title);
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  margin-bottom: var(--s-5);
  color: var(--text-main);
}

.prayer-modal__text {
  font-family: var(--font-prayer);
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  line-height: 1.8;
  color: var(--text-main);
  text-align: center;
  padding: var(--s-5) 0;
}

.prayer-modal__actions {
  display: flex;
  justify-content: center;
  gap: var(--s-3);
  margin-top: var(--s-5);
  padding-top: var(--s-5);
  border-top: 1px solid var(--border);
}

.fav-list {
  list-style: none;
  margin-top: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.fav-list li {
  padding: var(--s-3) var(--s-4);
  background: var(--bg-site);
  border-radius: var(--r-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-3);
}

.fav-list li button {
  background: transparent;
  color: var(--text-light);
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.fav-list li button:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* ===== FORMULÁRIO PEDIDOS ===== */
.prayer-form {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  max-width: 600px;
  margin: 0 auto var(--s-5);
}

.prayer-form textarea {
  width: 100%;
  padding: var(--s-4);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  color: var(--text-main);
  font-family: var(--font-prayer);
  font-size: 1.15rem;
  resize: vertical;
  min-height: 100px;
  transition: all var(--t-fast);
}

.prayer-form textarea:focus {
  outline: none;
  border-color: var(--gold-sacred);
  box-shadow: 0 0 0 4px var(--halo-gold-soft);
}

.prayer-form button { align-self: flex-end; }

.prayer-list {
  list-style: none;
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.prayer-list li {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold-sacred);
  border-radius: var(--r-md);
  padding: var(--s-4);
  font-family: var(--font-prayer);
  font-size: 1.1rem;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--s-3);
  animation: fadeUp 0.4s ease;
}

.prayer-list li button {
  background: transparent;
  color: var(--text-light);
  width: 32px; height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}

.prayer-list li button:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* ===== BOTÃO VOLTAR AO TOPO ===== */
.back-to-top {
  position: fixed;
  bottom: calc(var(--s-5) + var(--tabbar-h) + var(--safe-bottom));
  right: var(--s-5);
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--grad-dourado);
  color: white;
  font-size: 1rem;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-glow-gold);
  z-index: calc(var(--z-fab) - 1);
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: all var(--t-normal);
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

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

@media (min-width: 1200px) {
  .back-to-top {
    bottom: var(--s-5);
    right: var(--s-5);
  }
}

/* ==========================================================
   SANCTUARY 2.0 — SEARCH MODAL (nº 10)
   ========================================================== */
.search-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 1rem 1rem;
  opacity: 0;
  transition: opacity .25s ease;
}
.search-modal.is-open { display: flex; opacity: 1; }
.search-modal__backdrop {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at top, rgba(9,13,22,.65), rgba(9,13,22,.92));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.search-modal__panel {
  position: relative;
  width: 100%; max-width: 720px;
  background: var(--white-pearl, #FAF8F5);
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(9,13,22,.35), 0 0 0 1px rgba(212,175,55,.2);
  overflow: hidden;
  transform: translateY(-10px);
  transition: transform .3s cubic-bezier(.2,.7,.3,1.1);
  max-height: 80vh;
  display: flex; flex-direction: column;
}
.search-modal.is-open .search-modal__panel { transform: translateY(0); }
[data-theme="dark"] .search-modal__panel { background: #0F172A; color: #F4F4F6; }
.search-modal__head {
  display: flex; align-items: center; gap: .75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(212,175,55,.18);
}
.search-modal__head i { color: #D4AF37; font-size: 1.1rem; }
.search-modal__head input {
  flex: 1; border: none; background: transparent;
  font: 500 1.05rem/1.4 "Plus Jakarta Sans", system-ui, sans-serif;
  color: inherit; outline: none;
}
.search-modal__hint {
  margin: 0; padding: .55rem 1.25rem;
  font-size: .8rem; color: rgba(15,23,42,.55);
  border-bottom: 1px dashed rgba(212,175,55,.15);
}
.search-modal__hint kbd {
  background: rgba(212,175,55,.12); color: #8B6914;
  padding: 1px 6px; border-radius: 4px; font: 600 .75rem monospace;
  border: 1px solid rgba(212,175,55,.3);
}
.search-modal__body {
  overflow-y: auto; padding: .75rem 1rem 1rem;
  flex: 1;
}
.search-empty {
  text-align: center; padding: 2.5rem 1rem;
  color: rgba(15,23,42,.55);
}
.search-empty i { font-size: 2rem; color: #D4AF37; margin-bottom: .5rem; }
.search-empty p { margin: .25rem 0; }
.search-empty__hint { font-size: .85rem; }
.search-results { list-style: none; margin: 0; padding: 0; }
.search-result {
  padding: .85rem 1rem; margin: .25rem 0;
  border-radius: 14px; cursor: pointer;
  background: rgba(255,255,255,.5);
  border: 1px solid transparent;
  transition: background .2s, border-color .2s, transform .2s;
}
.search-result:hover, .search-result:focus {
  background: rgba(212,175,55,.08);
  border-color: rgba(212,175,55,.35);
  transform: translateX(2px);
  outline: none;
}
.search-result__head {
  display: flex; justify-content: space-between; align-items: baseline; gap: .75rem;
}
.search-result__head h4 {
  margin: 0; font: 600 1rem "Playfair Display", serif;
  color: #0F172A;
}
[data-theme="dark"] .search-result__head h4 { color: #FAF8F5; }
.search-result__head h4 mark, .search-result p mark {
  background: linear-gradient(180deg, transparent 55%, rgba(244,196,48,.55) 55%);
  color: inherit; padding: 0 1px; border-radius: 2px;
}
.search-result__cat {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .04em;
  color: #8B6914; font-weight: 600;
}
.search-result p {
  margin: .35rem 0; font-size: .9rem; line-height: 1.45;
  color: rgba(15,23,42,.72);
}
[data-theme="dark"] .search-result p { color: rgba(244,244,246,.75); }
.search-result__meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .78rem; color: rgba(15,23,42,.5);
  margin-top: .4rem;
}
.search-result__open { color: #D4AF37; font-weight: 600; }
.search-result__open i { margin-left: .25rem; transition: transform .2s; }
.search-result:hover .search-result__open i { transform: translateX(3px); }
.search-pager {
  display: flex; justify-content: space-between; align-items: center;
  padding: .85rem .5rem 0; gap: .75rem; flex-wrap: wrap;
  font-size: .85rem; color: rgba(15,23,42,.6);
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
@media (max-width: 600px) {
  .search-modal { padding: 2vh .5rem .5rem; }
  .search-modal__panel { border-radius: 18px; max-height: 90vh; }
  .search-modal__head { padding: .85rem 1rem; }
  .search-modal__head input { font-size: 1rem; }
}

/* ===== ACESSIBILIDADE & FOCO VISÍVEL ===== */
:focus-visible {
  outline: 3px solid var(--gold-sacred, #D4AF37) !important;
  outline-offset: 3px !important;
}

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== TABELA DE CONCILIAÇÃO EVANGELÍSTICA ===== */
.table-responsive-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  margin: var(--s-5) 0;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.synoptic-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 650px;
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.synoptic-table th,
.synoptic-table td {
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.synoptic-table th {
  background: var(--bg-elevated);
  font-family: var(--font-cinzel);
  color: var(--gold-sacred);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 2;
}

/* MODO 2: FOCO EM TEXTO (Empilhado para Celular) */
.view-mode-focus .synoptic-table,
.view-mode-focus .synoptic-table tbody,
.view-mode-focus .synoptic-table tr,
.view-mode-focus .synoptic-table td {
  display: block;
  width: 100%;
  min-width: 0;
  border-right: none;
}

.view-mode-focus .synoptic-table thead {
  display: none;
}

.view-mode-focus .synoptic-table tr {
  margin-bottom: var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-3);
  background: var(--bg-card);
}

.view-mode-focus .synoptic-table td::before {
  content: attr(data-label);
  display: block;
  font-family: var(--font-cinzel);
  font-size: 0.8rem;
  color: var(--gold-sacred);
  font-weight: 700;
  margin-bottom: var(--s-1);
}
