/* ============================================================
   Himnario Celebremos Su Gloria — Rediseño Religioso
   Paleta: Amanecer dorado / Borgoña / Crema cálida
   ============================================================ */

/* Fuentes cargadas localmente desde assets/fonts/fonts.css */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --amber:       #C8620A;
  --amber-lt:    #FFF3E0;
  --gold:        #C8A01F;
  --gold-lt:     #FDF7DC;
  --burg:        #742F3A;
  --burg-dk:     #5A2430;
  --burg-lt:     #F9EEF0;
  --cream:       #FDF8F2;
  --warm-white:  #FFFDF9;
  --text:        #2C1A14;
  --text-muted:  #8A7060;
  --border:      #E5D9CF;
  --card-bg:     #FFFCF8;
  --radius:      8px;
  --shadow:      0 2px 12px rgba(116,47,58,.12);

  /* Ad columns */
  --ad-w:        160px;
  --gap:         24px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', 'Segoe UI', Arial, sans-serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Decorative cross pattern background ───────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle at 15% 15%, rgba(200,96,10,.04) 0%, transparent 50%),
    radial-gradient(circle at 85% 80%, rgba(116,47,58,.04) 0%, transparent 50%);
}

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
  background: linear-gradient(135deg, var(--burg-dk) 0%, var(--burg) 100%);
  color: #fff;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 3px 16px rgba(0,0,0,.35);
}

/* Shimmer line on topbar */
.topbar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  animation: shimmer-line 3s infinite;
}
@keyframes shimmer-line {
  0%   { background-position: -100% center; }
  100% { background-position: 200% center; }
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.topbar-book {
  width: 32px;
  height: 40px;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
  transition: transform .3s;
}
.topbar-brand:hover .topbar-book { transform: rotate(-4deg) scale(1.08); }
.topbar-logo {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.1;
}
.topbar-logo span { display: block; color: rgba(255,255,255,.75); font-size: .72rem; font-weight: 400; letter-spacing: .05em; }

.topbar-search {
  flex: 1;
  max-width: 440px;
  position: relative;
}
.topbar-search input {
  width: 100%;
  padding: 8px 14px 8px 38px;
  border-radius: 20px;
  border: 1px solid rgba(200,160,31,.4);
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: .93rem;
  outline: none;
  transition: background .2s, border-color .2s;
}
.topbar-search input::placeholder { color: rgba(255,255,255,.5); }
.topbar-search input:focus {
  background: rgba(255,255,255,.2);
  border-color: var(--gold);
}
.topbar-search svg {
  position: absolute; left: 11px; top: 50%;
  transform: translateY(-50%); opacity: .65; pointer-events: none;
}
.topbar-count {
  font-size: .78rem;
  background: rgba(200,160,31,.25);
  border: 1px solid rgba(200,160,31,.4);
  padding: 4px 10px;
  border-radius: 12px;
  color: var(--gold);
  white-space: nowrap;
}

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(145deg, #5A1E28 0%, #8B3040 30%, #C4550A 65%, #D4900A 100%);
  position: relative;
  overflow: hidden;
  padding: 0;
}

/* Shimmer dorado animado */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg,
    transparent 0%,
    rgba(255,220,80,.06) 40%,
    rgba(255,220,80,.13) 50%,
    rgba(255,220,80,.06) 60%,
    transparent 100%);
  background-size: 200% 100%;
  animation: hero-shimmer 6s ease-in-out infinite;
}
@keyframes hero-shimmer {
  0%   { background-position: -100% 0; }
  100% { background-position: 200% 0; }
}

/* Resplandor radial detrás de la portada */
.hero::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 50%;
  background: radial-gradient(ellipse at 80% 50%, rgba(255,180,30,.15) 0%, transparent 68%);
  pointer-events: none;
}

/* ── Contenedor central estrecho ─────────────────────────── */
.hero-inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 30px 32px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
  position: relative;
  z-index: 1;
}

.hero-text { flex: 1; min-width: 0; }

/* Cruz integrada en el título */
.hero-cross {
  font-size: .85em;
  color: rgba(255,220,80,.85);
  margin-right: 7px;
  display: inline;
  vertical-align: baseline;
  animation: cross-pulse 4s ease-in-out infinite;
  text-shadow: 0 0 16px rgba(255,200,50,.5);
}
@keyframes cross-pulse {
  0%,100% { opacity: .75; text-shadow: 0 0 10px rgba(255,200,50,.4); }
  50%      { opacity: 1;   text-shadow: 0 0 24px rgba(255,200,50,.85); }
}

.hero-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.5rem, 3.2vw, 2.3rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  text-shadow: 0 2px 10px rgba(0,0,0,.4);
  margin: 0;
}
.hero-title em {
  display: block;
  font-style: italic;
  color: var(--gold);
  font-size: 1.06em;
  margin-top: 1px;
}

/* Verso bíblico */
.hero-verse {
  margin: 12px 0 0;
  font-family: 'IM Fell English', 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: .87rem;
  color: rgba(255,255,255,.76);
  line-height: 1.55;
  border-left: 2px solid rgba(200,160,31,.55);
  padding-left: 10px;
}
.hero-verse cite {
  display: block;
  font-style: normal;
  font-family: 'DM Sans', sans-serif;
  font-size: .8rem;
  color: rgba(255,255,255,.48);
  margin-top: 5px;
  letter-spacing: .02em;
}

/* Stats: franja horizontal con separadores */
.hero-stats {
  display: flex;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.16);
  gap: 0;
}
.hero-stat {
  flex: 1;
  text-align: center;
  padding: 2px 0;
  border-right: 1px solid rgba(255,255,255,.13);
}
.hero-stat:last-child { border-right: none; }
.hero-stat-n {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}
.hero-stat-l {
  display: block;
  font-size: .67rem;
  color: rgba(255,255,255,.5);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-top: 3px;
}

/* Portada del libro */
.hero-cover-wrap {
  flex-shrink: 0;
  position: relative;
}

.hero-cover {
  width: 130px;
  border-radius: 4px;
  box-shadow: -10px 10px 36px rgba(0,0,0,.6), 4px 0 14px rgba(0,0,0,.3);
  display: block;
  animation: cover-float 5s ease-in-out infinite;
}
@keyframes cover-float {
  0%,100% { transform: rotate(2deg) translateY(0); }
  50%      { transform: rotate(2deg) translateY(-7px); }
}

/* Ground shadow */
.hero-cover-wrap::before {
  content: '';
  position: absolute;
  bottom: -12px; left: 4px; right: -4px;
  height: 18px;
  background: rgba(0,0,0,.28);
  border-radius: 50%;
  filter: blur(8px);
  animation: shadow-pulse 5s ease-in-out infinite;
}
@keyframes shadow-pulse {
  0%,100% { opacity: .7; }
  50%      { opacity: .35; transform: scaleX(.88); }
}

/* ── 3-column page layout ───────────────────────────────────── */
.page-wrapper {
  display: flex;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 8px;
  gap: 0;
  position: relative;
  z-index: 1;
}

/* Ad rails */
.ad-rail {
  width: var(--ad-w);
  flex-shrink: 0;
  padding: 20px 8px;
}
.ad-rail-inner {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.ad-slot {
  background: var(--warm-white);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  gap: 4px;
  overflow: hidden;
}
.ad-slot svg { opacity: .25; }

.ad-slot-v {
  width: 144px;
  height: 600px;
}
.ad-slot-rect {
  width: 144px;
  height: 250px;
}
.ad-slot-h {
  width: 100%;
  height: 90px;
}

/* Main content area */
.main-col {
  flex: 1;
  min-width: 0;
  padding: 20px var(--gap);
}

/* ── Bottom ad bar ──────────────────────────────────────────── */
.ad-bottom {
  background: var(--warm-white);
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 1;
}
.ad-slot-lb {
  width: 728px;
  max-width: 100%;
  height: 90px;
}

/* ── Section heading ornament ───────────────────────────────── */
.section-ornament {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.section-ornament-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border));
}
.section-ornament-line.left {
  background: linear-gradient(90deg, var(--border), transparent);
}
.section-ornament-icon { color: var(--gold); font-size: 1rem; }
.section-ornament-text {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .1em;
}

/* ── Result count ───────────────────────────────────────────── */
.result-count {
  font-size: .83rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding: 6px 0;
}
.result-count a { color: var(--burg); }

/* ── Hymn cards grid ────────────────────────────────────────── */
.hymns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(192px, 1fr));
  gap: 10px;
  padding-bottom: 40px;
}

.hymn-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--burg);
  border-radius: var(--radius);
  padding: 12px 14px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  transition: box-shadow .18s, transform .15s, border-left-color .18s;

  /* Initial hidden state for animation */
  opacity: 0;
  transform: translateY(12px);
}
.hymn-card.visible {
  animation: card-in .35s ease forwards;
}
@keyframes card-in {
  to { opacity: 1; transform: translateY(0); }
}
.hymn-card:hover {
  box-shadow: 0 6px 20px rgba(116,47,58,.15);
  transform: translateY(-2px);
  border-left-color: var(--gold);
}

.hymn-num {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--burg);
  min-width: 34px;
  line-height: 1.3;
}
.hymn-title {
  font-size: .85rem;
  line-height: 1.4;
  color: var(--text);
}

/* ── Empty state ────────────────────────────────────────────── */
.empty-msg {
  grid-column: 1/-1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-msg svg { opacity: .3; margin-bottom: 12px; }

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  background: var(--burg-dk);
  color: rgba(255,255,255,.5);
  text-align: center;
  padding: 20px;
  font-size: .78rem;
  position: relative;
  z-index: 1;
}
.site-footer a { color: var(--gold); text-decoration: none; }
.site-footer-dev {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: .72rem;
  color: rgba(255,255,255,.3);
  letter-spacing: .03em;
}

/* ══════════════════════════════════════════════════════════════
   HIMNO INDIVIDUAL
   ══════════════════════════════════════════════════════════════ */

/* Breadcrumb */
.breadcrumb {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.breadcrumb a { color: var(--burg); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* Himno card wrapper */
.himno-wrap {
  animation: page-in .4s ease;
}
@keyframes page-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Himno header */
.himno-header {
  background: linear-gradient(135deg, var(--burg-dk) 0%, var(--burg) 70%, #9B4050 100%);
  color: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 24px 28px 20px;
  position: relative;
  overflow: hidden;
}
/* decorative starburst */
.himno-header::before {
  content: '';
  position: absolute;
  right: -40px; top: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(200,160,31,.2) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.himno-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.himno-num-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(200,160,31,.25);
  border: 1px solid rgba(200,160,31,.5);
  color: var(--gold);
  font-weight: 700;
  font-size: .75rem;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 10px;
  letter-spacing: .08em;
}

.himno-titulo {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0,0,0,.3);
}

.himno-header-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity .15s, transform .12s, box-shadow .15s;
}
.btn:hover { opacity: .9; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.btn:active { transform: translateY(0); }
.btn-pdf  { background: #C0392B; color: #fff; }
.btn-ppt  { background: #D35400; color: #fff; }
.btn-back { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.3); }

/* Verso clave */
.himno-verso-wrap {
  background: linear-gradient(to right, var(--gold-lt), var(--warm-white));
  border-left: 4px solid var(--gold);
  padding: 16px 22px;
  position: relative;
}
.himno-verso-wrap::before {
  content: '\201C';
  position: absolute;
  left: 14px; top: 4px;
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  color: var(--gold);
  opacity: .35;
  line-height: 1;
}
.himno-verso {
  font-family: 'IM Fell English', 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.65;
  padding-left: 20px;
}
.himno-ref {
  font-size: .82rem;
  color: var(--text-muted);
  margin-top: 8px;
  padding-left: 20px;
  font-weight: 600;
}
.otras-ref {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: 6px;
  padding-left: 20px;
  line-height: 1.5;
}

/* Himno body */
.himno-body {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 28px;
}

.seccion {
  margin-bottom: 28px;
  animation: section-in .4s ease both;
}
.seccion:last-child { margin-bottom: 0; }
@keyframes section-in {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}
/* stagger */
.seccion:nth-child(1) { animation-delay: .05s; }
.seccion:nth-child(2) { animation-delay: .10s; }
.seccion:nth-child(3) { animation-delay: .15s; }
.seccion:nth-child(4) { animation-delay: .20s; }
.seccion:nth-child(5) { animation-delay: .25s; }
.seccion:nth-child(6) { animation-delay: .30s; }

.seccion-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.seccion-label::before {
  content: '';
  display: block;
  width: 20px; height: 2px;
  border-radius: 1px;
}
.seccion-label.estrofa { color: var(--burg); }
.seccion-label.estrofa::before { background: var(--burg); }
.seccion-label.coro    { color: #2563EB; }
.seccion-label.coro::before    { background: #2563EB; }

.seccion-lineas {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--text);
}
.seccion.coro .seccion-lineas {
  background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
  border-left: 4px solid #3B82F6;
  padding: 14px 18px;
  border-radius: 6px;
  font-style: italic;
  box-shadow: 0 2px 8px rgba(59,130,246,.08);
}

/* Navigation */
.himno-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 22px;
  gap: 12px;
}
.himno-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--burg);
  text-decoration: none;
  font-size: .85rem;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--radius);
  background: var(--warm-white);
  border: 1px solid var(--border);
  transition: background .15s, box-shadow .15s, transform .12s;
}
.himno-nav a:hover {
  background: var(--burg-lt);
  box-shadow: 0 2px 8px rgba(116,47,58,.12);
  transform: translateY(-1px);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .ad-rail.ad-left  { display: none; }
  .ad-rail.ad-right { display: none; }
}
@media (max-width: 900px) {
  .hero-cover-wrap { display: none; }
  .hero-inner { justify-content: flex-start; }
}
@media (max-width: 600px) {
  .hymns-grid { grid-template-columns: repeat(2, 1fr); }
  .himno-titulo { font-size: 1.3rem; }
  .himno-body { padding: 18px; }
  .topbar-count { display: none; }
  .ad-bottom { display: none; }
  .hero-inner { padding: 24px 16px 20px; }
  .hero-stats { gap: 10px; }
}
