/* ============================================
   DEVOCIONALES CRISTIANOS — ESTILOS GLOBALES
   Mobile-first · Elegant · Warm
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;1,400&family=Lato:wght@300;400;700&display=swap');

/* ── Variables ──────────────────────────────── */
:root {
  --gold:       #C9A84C;
  --gold-light: #F0D98C;
  --gold-dark:  #8B6914;
  --cream:      #FDF8F0;
  --cream-dark: #F5EDD8;
  --brown:      #5C3D1E;
  --brown-light:#8B6038;
  --text:       #2C1A0E;
  --text-muted: #7A5C3A;
  --text-light: #A68B5B;
  --white:      #FFFFFF;
  --border:     rgba(201,168,76,0.25);
  --border-mid: rgba(201,168,76,0.45);
  --shadow-sm:  0 2px 12px rgba(92,61,30,0.08);
  --shadow-md:  0 6px 28px rgba(92,61,30,0.13);
  --shadow-lg:  0 16px 48px rgba(92,61,30,0.16);
  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --radius-xl:  28px;
  --font-head:  'Playfair Display', Georgia, serif;
  --font-body:  'Lato', system-ui, sans-serif;
  --nav-h:      64px;
  --player-h:   80px;
}

/* ── Reset ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text);
  background: var(--cream);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--font-body); border: none; background: none; }
input, textarea, select { font-family: var(--font-body); }

/* ── Tipografía ─────────────────────────────── */
h1,h2,h3,h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.3; color: var(--brown); }
h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 4vw, 2rem); }
h3 { font-size: clamp(1.1rem, 3vw, 1.4rem); }
p  { line-height: 1.75; color: var(--text-muted); }

/* ── Navegación ─────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(253,248,240,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-size: 1.2rem; color: var(--brown);
}
.nav-logo .cross { font-size: 1.4rem; color: var(--gold); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--brown); font-size: 1.1rem;
  transition: background 0.2s, color 0.2s;
}
.nav-btn:hover, .nav-btn.active { background: var(--cream-dark); color: var(--gold-dark); }

/* ── Barra de búsqueda ──────────────────────── */
.search-bar {
  position: fixed; top: var(--nav-h); left: 0; right: 0; z-index: 99;
  background: var(--cream);
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  transform: translateY(-110%);
  transition: transform 0.3s ease;
}
.search-bar.visible { transform: translateY(0); }
.search-input-wrap {
  display: flex; align-items: center; gap: 10px;
  background: var(--white); border: 1.5px solid var(--border-mid);
  border-radius: var(--radius-xl); padding: 10px 16px;
}
.search-input-wrap svg { color: var(--text-light); flex-shrink: 0; }
.search-input-wrap input {
  flex: 1; border: none; outline: none; background: none;
  font-size: 15px; color: var(--text);
}
.search-input-wrap input::placeholder { color: var(--text-light); }

/* ── Layout principal ───────────────────────── */
.main { padding-top: var(--nav-h); min-height: 100vh; }
.container { max-width: 420px; margin: 0 auto; padding: 0 16px; }

/* ── Hero / Banner ──────────────────────────── */
.hero {
  background: linear-gradient(160deg, var(--brown) 0%, #3d220e 100%);
  padding: 40px 20px 32px;
  position: relative; overflow: hidden;
  text-align: center;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23C9A84C' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-cross {
  font-size: 2.4rem; color: var(--gold); margin-bottom: 12px;
  display: block; animation: float 3s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.hero h1 { color: var(--white); font-size: 1.6rem; margin-bottom: 8px; position: relative; }
.hero p  { color: rgba(255,255,255,0.7); font-size: 0.9rem; position: relative; }
.hero-verse {
  margin-top: 20px; padding: 12px 16px;
  background: rgba(201,168,76,0.15);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  text-align: left; position: relative;
}
.hero-verse p { color: rgba(255,255,255,0.85); font-size: 0.85rem; font-style: italic; }
.hero-verse span { color: var(--gold-light); font-size: 0.78rem; display: block; margin-top: 4px; }

/* ── Filtros de categorías ──────────────────── */
.filter-scroll {
  display: flex; gap: 8px; padding: 16px 16px;
  overflow-x: auto; scrollbar-width: none;
}
.filter-scroll::-webkit-scrollbar { display: none; }
.filter-chip {
  flex-shrink: 0; padding: 7px 16px;
  border-radius: var(--radius-xl); font-size: 0.82rem; font-weight: 700;
  border: 1.5px solid var(--border-mid);
  background: var(--white); color: var(--text-muted);
  transition: all 0.2s; white-space: nowrap;
}
.filter-chip.active {
  background: var(--brown); color: var(--gold-light);
  border-color: var(--brown);
}
.filter-chip:hover:not(.active) { border-color: var(--gold); color: var(--brown); }

/* ── Tarjetas de devocional ─────────────────── */
.section-title {
  font-family: var(--font-head); font-size: 1.1rem; color: var(--brown);
  padding: 0 16px 12px; display: flex; align-items: center; gap: 8px;
}
.section-title::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

.cards-list { padding: 0 16px; display: flex; flex-direction: column; gap: 16px; }

.card {
  background: var(--white); border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden; transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.card:active { transform: scale(0.98); }
.card:hover  { box-shadow: var(--shadow-md); }

.card-image {
  width: 100%; height: 160px; object-fit: cover;
  background: linear-gradient(135deg, var(--cream-dark), var(--border));
}
.card-image-placeholder {
  width: 100%; height: 120px;
  background: linear-gradient(135deg, var(--cream-dark) 0%, var(--border) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; color: var(--gold);
}
.card-body { padding: 16px; }
.card-meta {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.card-cat {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 3px 8px; border-radius: 20px;
  background: var(--cream-dark); color: var(--brown-light);
}
.card-type-badge {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.72rem; color: var(--text-light);
}
.card-type-badge svg { width: 13px; height: 13px; }
.card-title {
  font-family: var(--font-head); font-size: 1rem; color: var(--brown);
  margin-bottom: 6px; line-height: 1.35;
}
.card-summary { font-size: 0.84rem; color: var(--text-muted); line-height: 1.55; }
.card-verse {
  margin-top: 10px; padding: 8px 12px;
  background: var(--cream); border-left: 2px solid var(--gold);
  border-radius: 0 6px 6px 0;
  font-size: 0.8rem; font-style: italic; color: var(--text-light);
}
.card-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-top: 1px solid var(--border);
}
.card-foot-date { font-size: 0.75rem; color: var(--text-light); }
.card-fav-btn {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-light); font-size: 1rem;
  transition: color 0.2s, background 0.2s;
}
.card-fav-btn.active { color: #e84393; }
.card-fav-btn:hover { background: var(--cream-dark); }

/* ── Destacado horizontal ────────────────────── */
.featured-scroll {
  display: flex; gap: 12px; padding: 0 16px;
  overflow-x: auto; scrollbar-width: none;
}
.featured-scroll::-webkit-scrollbar { display: none; }
.featured-card {
  flex-shrink: 0; width: 260px;
  background: var(--white); border-radius: var(--radius-lg);
  border: 1px solid var(--border); overflow: hidden; cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.featured-card:active { transform: scale(0.97); }
.featured-card-img {
  width: 100%; height: 130px; object-fit: cover;
  background: linear-gradient(135deg, var(--brown), var(--gold-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem;
}
.featured-card-body { padding: 12px; }
.featured-card-title {
  font-family: var(--font-head); font-size: 0.9rem; color: var(--brown);
  line-height: 1.3; margin-bottom: 4px;
}
.featured-card-ref { font-size: 0.75rem; color: var(--gold-dark); }

/* ── Vista detalle ──────────────────────────── */
.detail-view {
  position: fixed; inset: 0; z-index: 200;
  background: var(--cream);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.detail-view.open { transform: translateX(0); }

.detail-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: rgba(253,248,240,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.detail-back {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--brown); font-size: 1.1rem;
  transition: background 0.2s;
  flex-shrink: 0;
}
.detail-back:hover { background: var(--cream-dark); }
.detail-header-title {
  font-family: var(--font-head); font-size: 0.9rem; color: var(--brown);
  flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.detail-actions { display: flex; gap: 8px; }

.detail-hero-img {
  width: 100%; max-height: 220px; object-fit: cover;
}
.detail-hero-placeholder {
  width: 100%; height: 180px;
  background: linear-gradient(160deg, var(--brown) 0%, #3d220e 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 3.5rem;
}
.detail-body { padding: 24px 20px 40px; }
.detail-cat-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
}
.detail-title {
  font-size: clamp(1.4rem, 5vw, 2rem);
  line-height: 1.25; margin-bottom: 16px; color: var(--brown);
}
.detail-verse-block {
  background: linear-gradient(135deg, var(--cream-dark), var(--cream));
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  padding: 16px 18px; margin-bottom: 24px;
  position: relative;
}
.detail-verse-block::before {
  content: '"'; font-family: var(--font-head); font-size: 4rem;
  color: var(--gold); opacity: 0.4;
  position: absolute; top: -8px; left: 10px; line-height: 1;
}
.detail-verse-text {
  font-family: var(--font-head); font-style: italic;
  font-size: 1rem; color: var(--brown); line-height: 1.6;
  padding-left: 10px;
}
.detail-verse-ref {
  font-size: 0.82rem; color: var(--gold-dark);
  font-weight: 700; margin-top: 8px; padding-left: 10px;
}

/* Contenido blog */
.detail-content { font-size: 0.97rem; color: var(--text); line-height: 1.8; }
.detail-content p  { margin-bottom: 1.1em; color: var(--text-muted); }
.detail-content h3 { margin: 1.5em 0 0.5em; color: var(--brown); font-size: 1.1rem; }
.detail-content em { font-style: italic; color: var(--brown-light); }
.detail-content strong { font-weight: 700; color: var(--brown); }

/* ── Reproductor de audio ────────────────────── */
.audio-player {
  background: var(--white);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  padding: 16px; margin-bottom: 24px;
}
.audio-player-title {
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-light); margin-bottom: 12px;
  display: flex; align-items: center; gap: 6px;
}
.audio-player-title svg { color: var(--gold); }
.audio-controls {
  display: flex; align-items: center; gap: 10px;
}
.audio-play-btn {
  width: 48px; height: 48px; flex-shrink: 0;
  background: var(--brown);
  border-radius: 50%; color: var(--gold-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; transition: background 0.2s, transform 0.1s;
}
.audio-play-btn:hover  { background: var(--brown-light); }
.audio-play-btn:active { transform: scale(0.95); }
.audio-progress-wrap { flex: 1; }
.audio-progress {
  width: 100%; height: 4px; border-radius: 2px;
  -webkit-appearance: none; appearance: none;
  background: var(--cream-dark); cursor: pointer; margin-bottom: 6px;
}
.audio-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--brown); border: 2px solid var(--gold);
}
.audio-progress::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--brown); border: 2px solid var(--gold);
}
.audio-time {
  display: flex; justify-content: space-between;
  font-size: 0.74rem; color: var(--text-light);
}
.audio-volume {
  display: flex; align-items: center; gap: 6px; margin-top: 10px;
  padding-top: 10px; border-top: 1px solid var(--border);
}
.audio-volume svg { color: var(--text-light); font-size: 0.9rem; flex-shrink: 0; }
.audio-volume input[type=range] {
  flex: 1; height: 3px; -webkit-appearance: none; appearance: none;
  background: var(--cream-dark); border-radius: 2px;
}
.audio-volume input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--brown);
}

/* ── Sección compartir ──────────────────────── */
.share-section { margin: 24px 0; }
.share-title {
  font-size: 0.82rem; color: var(--text-light); text-transform: uppercase;
  letter-spacing: 0.07em; margin-bottom: 12px;
}
.share-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.share-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--radius-xl);
  font-size: 0.82rem; font-weight: 700; border: 1.5px solid var(--border-mid);
  background: var(--white); color: var(--brown);
  transition: all 0.2s;
}
.share-btn:hover { background: var(--cream-dark); border-color: var(--gold); }
.share-btn svg { width: 15px; height: 15px; }

/* ── Comentarios ────────────────────────────── */
.comments-section { margin-top: 32px; }
.comments-title {
  font-family: var(--font-head); font-size: 1.1rem;
  color: var(--brown); margin-bottom: 16px;
}
.comment-form { margin-bottom: 24px; }
.comment-form input,
.comment-form textarea {
  width: 100%; padding: 12px 14px;
  background: var(--white); border: 1.5px solid var(--border-mid);
  border-radius: var(--radius-sm); font-size: 0.9rem; color: var(--text);
  outline: none; transition: border-color 0.2s;
  margin-bottom: 10px;
}
.comment-form input:focus,
.comment-form textarea:focus { border-color: var(--gold); }
.comment-form textarea { min-height: 90px; resize: vertical; }
.comment-send-btn {
  width: 100%; padding: 12px;
  background: var(--brown); color: var(--gold-light);
  border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 700;
  transition: background 0.2s;
}
.comment-send-btn:hover { background: var(--brown-light); }

.comment-item {
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.comment-item:last-child { border-bottom: none; }
.comment-author {
  font-size: 0.82rem; font-weight: 700; color: var(--brown);
  margin-bottom: 4px;
}
.comment-date { font-size: 0.73rem; color: var(--text-light); }
.comment-text { font-size: 0.88rem; color: var(--text-muted); margin-top: 6px; }

/* ── Barra de navegación inferior ───────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: 62px;
  background: rgba(253,248,240,0.97);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: flex; align-items: stretch;
}
.bottom-nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  color: var(--text-light); font-size: 0.64rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  transition: color 0.2s;
}
.bottom-nav-item svg { width: 22px; height: 22px; }
.bottom-nav-item.active { color: var(--brown); }
.bottom-nav-item.active svg { stroke: var(--gold); }

/* ── Páginas (vistas) ───────────────────────── */
.page { display: none; }
.page.active { display: block; }
.page-pad { padding-bottom: calc(62px + 20px); }

/* ── Empty state ────────────────────────────── */
.empty-state {
  text-align: center; padding: 60px 24px;
}
.empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-title { font-family: var(--font-head); color: var(--brown); margin-bottom: 8px; }
.empty-text  { font-size: 0.88rem; color: var(--text-light); }

/* ── Loading skeleton ────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--cream-dark) 25%, var(--border) 37%, var(--cream-dark) 63%);
  background-size: 400px 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton-card {
  background: var(--white); border-radius: var(--radius-lg);
  border: 1px solid var(--border); overflow: hidden;
}
.skeleton-img  { height: 120px; }
.skeleton-body { padding: 14px; }
.skeleton-line { height: 12px; margin-bottom: 8px; }
.skeleton-line.short { width: 60%; }
.skeleton-line.long  { width: 90%; }

/* ── Toast ──────────────────────────────────── */
.toast {
  position: fixed; bottom: 80px; left: 50%; z-index: 1000;
  transform: translateX(-50%) translateY(20px);
  background: var(--brown); color: var(--gold-light);
  padding: 10px 20px; border-radius: var(--radius-xl);
  font-size: 0.85rem; font-weight: 700;
  opacity: 0; transition: opacity 0.3s, transform 0.3s;
  pointer-events: none; white-space: nowrap;
  max-width: calc(100vw - 40px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Paginación ─────────────────────────────── */
.pagination {
  display: flex; justify-content: center; align-items: center;
  gap: 8px; padding: 20px 16px;
}
.page-btn {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700; color: var(--text-muted);
  border: 1.5px solid var(--border-mid); background: var(--white);
  transition: all 0.2s;
}
.page-btn.active { background: var(--brown); color: var(--gold-light); border-color: var(--brown); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Pantallas grandes ──────────────────────── */
@media (min-width: 480px) {
  .container { max-width: 480px; }
}
@media (min-width: 768px) {
  .container { max-width: 680px; }
  .cards-list { display: grid; grid-template-columns: repeat(2, 1fr); }
}
