/* ═══════════════════════════════════════════════════
   24 VIRTUDES — Hoja de estilos compartida
   Tipografía máquina de escribir · Azul / Dorado / Blanco
   ═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Special+Elite&family=Courier+Prime:ital,wght@0,400;0,700;1,400&family=IM+Fell+English:ital@0;1&display=swap');

/* ── Variables ─────────────────────────────────── */
:root {
  --navy:     #080F1E;
  --blue-d:   #0E1F3D;
  --blue:     #163B6E;
  --blue-m:   #1E5090;
  --blue-l:   #3A78C2;
  --gold:     #C9A227;
  --gold-l:   #E8C040;
  --gold-dim: rgba(201,162,39,0.18);
  --cream:    #F5F0E0;
  --ivory:    #FDFAF2;
  --muted:    rgba(245,240,224,0.55);
  --border:   rgba(201,162,39,0.18);

  --type:  'Special Elite', 'Courier Prime', monospace;
  --body:  'Courier Prime', monospace;
  --serif: 'IM Fell English', serif;

  --radius: 2px;
  --trans:  all 0.22s ease;
}

/* ── Reset ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--navy);
  color: var(--cream);
  font-family: var(--body);
  line-height: 1.75;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ── Textura papel ─────────────────────────────── */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 23px,
      rgba(255,255,255,0.013) 23px, rgba(255,255,255,0.013) 24px),
    repeating-linear-gradient(90deg, transparent, transparent 23px,
      rgba(255,255,255,0.007) 23px, rgba(255,255,255,0.007) 24px);
}

/* ══════════════════════════════════════════════════
   TOPBAR DE NAVEGACIÓN
   ══════════════════════════════════════════════════ */
.topbar {
  position: sticky; top: 0; z-index: 200;
  background: rgba(8,15,30,0.97);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.topbar-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: stretch;
  height: 54px;
}

/* Logo / home */
.topbar-logo {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0 1.4rem;
  text-decoration: none;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}
.topbar-logo .lnum {
  font-family: var(--type);
  font-size: 1.5rem;
  color: var(--gold);
  line-height: 1;
  letter-spacing: -0.03em;
}
.topbar-logo .ltxt {
  display: flex; flex-direction: column;
  font-family: var(--type);
  line-height: 1.15;
}
.topbar-logo .ltxt span:first-child {
  font-size: 0.75rem; letter-spacing: 0.25rem;
  color: var(--ivory); opacity: 0.9;
}
.topbar-logo .ltxt span:last-child {
  font-size: 0.6rem; letter-spacing: 0.18rem;
  color: var(--gold); opacity: 0.65;
}

/* Botón selector de virtudes */
.nav-selector-btn {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0 1.2rem;
  background: none; border: none;
  font-family: var(--type);
  font-size: 0.75rem; letter-spacing: 0.2rem;
  color: var(--cream); opacity: 0.75;
  cursor: pointer;
  border-left: 1px solid var(--border);
  transition: var(--trans);
}
.nav-selector-btn:hover,
.nav-selector-btn.open { color: var(--gold); opacity: 1; background: var(--gold-dim); }
.nav-selector-btn .arrow { transition: transform 0.2s; }
.nav-selector-btn.open .arrow { transform: rotate(180deg); }

/* Virtud activa en topbar */
.topbar-current {
  flex: 1;
  display: flex; align-items: center;
  padding: 0 1.2rem;
  font-family: var(--type);
  font-size: 0.72rem; letter-spacing: 0.15rem;
  color: var(--muted);
  border-left: 1px solid var(--border);
  overflow: hidden;
}
.topbar-current .active-name {
  color: var(--gold); opacity: 0.85;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Prev / Next */
.topbar-nav {
  display: flex; align-items: stretch;
  border-left: 1px solid var(--border);
}
.nav-arrow {
  display: flex; align-items: center; justify-content: center;
  width: 48px;
  background: none; border: none;
  color: var(--cream); opacity: 0.5;
  font-size: 1rem; cursor: pointer;
  text-decoration: none;
  transition: var(--trans);
}
.nav-arrow + .nav-arrow { border-left: 1px solid var(--border); }
.nav-arrow:hover:not(.disabled) { color: var(--gold); opacity: 1; background: var(--gold-dim); }
.nav-arrow.disabled { opacity: 0.2; pointer-events: none; }

/* ── DROPDOWN PANEL ─────────────────────────────── */
.dropdown-panel {
  position: fixed;
  top: 54px; left: 0; right: 0;
  z-index: 190;
  background: rgba(8,15,30,0.98);
  border-bottom: 2px solid var(--gold);
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
  max-height: calc(100vh - 54px);
  overflow-y: auto;
}
.dropdown-panel.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}

.dropdown-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 2rem 1.5rem;
}

.dropdown-title {
  font-family: var(--type);
  font-size: 0.65rem; letter-spacing: 0.4rem;
  color: var(--gold); opacity: 0.7;
  margin-bottom: 1.2rem;
  text-transform: uppercase;
}

.virtud-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.5rem;
}

.virtud-link {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 0.8rem;
  text-decoration: none;
  border: 1px solid rgba(201,162,39,0.12);
  background: rgba(22,59,110,0.15);
  font-family: var(--type);
  font-size: 0.8rem; letter-spacing: 0.03rem;
  color: rgba(245,240,224,0.7);
  transition: var(--trans);
}
.virtud-link:hover,
.virtud-link.active {
  background: rgba(201,162,39,0.12);
  border-color: rgba(201,162,39,0.4);
  color: var(--gold);
  transform: translateX(3px);
}
.virtud-link .vnum {
  font-size: 0.68rem; color: var(--gold);
  opacity: 0.55; min-width: 1.8rem;
}
.virtud-link.active .vnum { opacity: 1; }

/* ══════════════════════════════════════════════════
   CONTENIDO PRINCIPAL
   ══════════════════════════════════════════════════ */
.page-content {
  position: relative; z-index: 1;
}

/* ══════════════════════════════════════════════════
   HERO DE VIRTUD
   ══════════════════════════════════════════════════ */
.virtud-hero {
  padding: 5rem 2rem 3.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.virtud-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 40%,
    rgba(30,80,144,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.v-roman {
  font-family: var(--type);
  font-size: 0.7rem; letter-spacing: 0.5rem;
  color: var(--gold); opacity: 0.65;
  margin-bottom: 0.8rem;
}
.v-title {
  font-family: var(--type);
  font-size: clamp(2.4rem, 7vw, 4.5rem);
  color: var(--ivory);
  letter-spacing: 0.1em; line-height: 1;
}
.v-ornament {
  margin: 1.2rem 0;
  color: var(--gold); opacity: 0.45;
  font-size: 0.9rem; letter-spacing: 0.6rem;
  font-family: var(--type);
}

/* ══════════════════════════════════════════════════
   SECCIONES DE CONTENIDO
   ══════════════════════════════════════════════════ */
.content-wrap {
  max-width: 820px; margin: 0 auto;
  padding: 0 1.5rem 5rem;
}

/* Versículo principal */
.verse-main {
  margin: 2.5rem 0;
  padding: 1.4rem 1.8rem;
  border-left: 3px solid var(--gold);
  background: linear-gradient(90deg, rgba(201,162,39,0.07), transparent 70%);
  position: relative;
}
.verse-main::before {
  content: '"';
  position: absolute; top: -0.6rem; left: 1rem;
  font-family: var(--serif);
  font-size: 3.5rem; color: var(--gold); opacity: 0.2; line-height: 1;
}
.verse-main p {
  font-family: var(--serif); font-style: italic;
  font-size: 1.15rem; color: rgba(245,240,224,0.92);
  line-height: 1.7; margin-bottom: 0.6rem;
}
.verse-main a {
  font-family: var(--type); font-size: 0.78rem;
  color: var(--gold); text-decoration: none;
  letter-spacing: 0.1rem;
  border-bottom: 1px dotted rgba(201,162,39,0.4);
  transition: var(--trans);
}
.verse-main a:hover { color: var(--gold-l); border-bottom-style: solid; }

/* Descripción */
.v-desc {
  font-family: var(--body);
  font-size: 1.02rem;
  color: rgba(245,240,224,0.78);
  line-height: 1.9; margin-bottom: 2rem;
}

/* Bloque de sección con etiqueta */
.block {
  margin: 2.2rem 0;
  border: 1px solid var(--border);
  position: relative;
}
.block-label {
  position: absolute; top: -0.6rem; left: 1rem;
  background: var(--navy);
  padding: 0 0.6rem;
  font-family: var(--type);
  font-size: 0.6rem; letter-spacing: 0.3rem;
  text-transform: uppercase;
}
.block-label.gold { color: var(--gold); }
.block-label.blue { color: var(--blue-l); }

.block-inner { padding: 1.6rem 1.8rem; }

/* Referencias */
.refs-chips {
  display: flex; flex-wrap: wrap; gap: 0.55rem;
  margin-top: 0.3rem;
}
.ref-chip {
  font-family: var(--type); font-size: 0.76rem;
  color: var(--gold); letter-spacing: 0.05rem;
  background: rgba(201,162,39,0.07);
  border: 1px solid rgba(201,162,39,0.22);
  padding: 0.3rem 0.75rem;
  text-decoration: none;
  transition: var(--trans);
}
.ref-chip:hover {
  background: rgba(201,162,39,0.18);
  border-color: var(--gold); color: var(--gold-l);
}

/* Preguntas */
.preguntas-list {
  padding-left: 0; list-style: none;
  counter-reset: q;
}
.preguntas-list li {
  counter-increment: q;
  display: flex; gap: 0.8rem;
  font-family: var(--type); font-size: 0.9rem;
  color: rgba(245,240,224,0.75);
  line-height: 1.7; margin-bottom: 1rem;
}
.preguntas-list li::before {
  content: counter(q, upper-roman) '.';
  color: var(--blue-l); font-weight: bold;
  flex-shrink: 0; min-width: 2rem;
  font-size: 0.78rem; margin-top: 0.05rem;
}

/* Oración */
.oracion-text {
  font-family: var(--serif); font-style: italic;
  font-size: 1.02rem;
  color: rgba(245,240,224,0.82);
  line-height: 1.95;
}

/* ══════════════════════════════════════════════════
   PÁGINA DE INICIO
   ══════════════════════════════════════════════════ */
.hero-main {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, #040A14 0%, var(--navy) 60%, #0C1E3A 100%);
  border-bottom: 2px solid var(--gold);
}
.hero-main::after {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% 30%, rgba(58,120,194,0.1) 0%, transparent 70%),
    radial-gradient(ellipse 60% 60% at 20% 80%, rgba(201,162,39,0.05) 0%, transparent 60%);
}
.hero-lines { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hero-lines span {
  display: block; position: absolute; background: var(--gold); opacity: 0.06;
}
.hero-lines span:nth-child(1) { width:1px; height:100%; left:14%; }
.hero-lines span:nth-child(2) { width:1px; height:100%; left:86%; }
.hero-lines span:nth-child(3) { width:100%; height:1px; top:18%; }
.hero-lines span:nth-child(4) { width:100%; height:1px; top:82%; }

.hero-inner { position: relative; z-index: 1; max-width: 740px; }

.hero-tag {
  font-family: var(--type);
  font-size: 0.7rem; letter-spacing: 0.5rem;
  color: var(--gold); opacity: 0.7;
  margin-bottom: 2rem;
  animation: fadeDown 1s ease both;
}
.hero-num {
  font-family: var(--type);
  font-size: clamp(5rem, 18vw, 11rem);
  color: transparent;
  -webkit-text-stroke: 1px rgba(201,162,39,0.22);
  line-height: 0.9; letter-spacing: -0.03em;
  display: block;
  animation: fadeDown 1s ease 0.1s both;
}
.hero-title {
  font-family: var(--type);
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  color: var(--ivory);
  letter-spacing: 0.3em; line-height: 1.15;
  margin-top: 0.5rem;
  animation: fadeDown 1s ease 0.2s both;
}
.hero-line {
  width: 100px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 2rem auto;
  animation: fadeIn 1s ease 0.4s both;
}
.hero-subtitle {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  color: rgba(245,240,224,0.62);
  max-width: 480px; margin: 0 auto;
  line-height: 1.7;
  animation: fadeUp 1s ease 0.5s both;
}
.hero-cta {
  margin-top: 2.5rem;
  animation: fadeUp 1s ease 0.7s both;
}
.btn-primary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--type); font-size: 0.78rem;
  letter-spacing: 0.25rem; text-transform: uppercase;
  color: var(--navy);
  background: var(--gold);
  padding: 0.7rem 1.8rem;
  text-decoration: none;
  border: 1px solid var(--gold);
  transition: var(--trans);
}
.btn-primary:hover {
  background: var(--gold-l);
  box-shadow: 0 0 20px rgba(201,162,39,0.2);
}
.btn-ghost {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--type); font-size: 0.78rem;
  letter-spacing: 0.25rem; text-transform: uppercase;
  color: var(--cream); opacity: 0.65;
  background: transparent;
  padding: 0.7rem 1.8rem;
  text-decoration: none;
  border: 1px solid var(--border);
  transition: var(--trans);
  margin-left: 0.8rem;
}
.btn-ghost:hover { color: var(--gold); opacity: 1; border-color: rgba(201,162,39,0.4); }

/* Intro sección */
.intro-section {
  max-width: 820px; margin: 0 auto;
  padding: 4.5rem 1.5rem 2rem;
  position: relative; z-index: 1;
}
.sec-label {
  font-family: var(--type);
  font-size: 0.65rem; letter-spacing: 0.45rem;
  color: var(--gold); opacity: 0.65;
  text-transform: uppercase; margin-bottom: 1.2rem;
}
.sec-title {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  color: var(--ivory); line-height: 1.3;
  margin-bottom: 1.8rem;
}
.intro-text {
  font-family: var(--body); font-size: 1rem;
  color: rgba(245,240,224,0.75);
  line-height: 1.9; margin-bottom: 1.2rem;
}
.intro-cite {
  margin: 2rem 0;
  padding: 1rem 1.4rem;
  border-left: 3px solid var(--gold);
  background: rgba(201,162,39,0.05);
}
.intro-cite p {
  font-family: var(--serif); font-style: italic;
  font-size: 1.05rem; color: rgba(245,240,224,0.88);
  margin-bottom: 0.3rem;
}
.intro-cite cite {
  font-family: var(--type); font-size: 0.72rem;
  color: var(--gold); letter-spacing: 0.1rem;
}

/* Grid de virtudes en inicio */
.home-grid-section {
  position: relative; z-index: 1;
  padding: 3rem 1.5rem 5rem;
  background: rgba(4,10,20,0.5);
  border-top: 1px solid var(--border);
}
.home-grid {
  max-width: 1100px; margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.55rem;
  margin-top: 2rem;
}
.home-grid-item {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.65rem 0.9rem;
  text-decoration: none;
  border: 1px solid rgba(201,162,39,0.13);
  background: rgba(22,59,110,0.12);
  font-family: var(--type); font-size: 0.82rem;
  color: rgba(245,240,224,0.68);
  transition: var(--trans);
}
.home-grid-item:hover {
  background: rgba(201,162,39,0.1);
  border-color: rgba(201,162,39,0.38);
  color: var(--gold);
  transform: translateX(4px);
}
.home-grid-item .num {
  color: var(--gold); opacity: 0.5;
  font-size: 0.7rem; min-width: 2rem;
}

/* Divisor ornamental */
.ornamental-div {
  text-align: center;
  margin: 3rem 0;
  font-family: var(--type);
  color: var(--gold); opacity: 0.28;
  font-size: 0.85rem; letter-spacing: 0.7rem;
}

/* ══════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════ */
footer {
  position: relative; z-index: 1;
  text-align: center;
  padding: 2.5rem 1.5rem;
  border-top: 1px solid var(--border);
  background: rgba(4,10,20,0.6);
  font-family: var(--type);
  font-size: 0.72rem; letter-spacing: 0.1rem;
  color: rgba(245,240,224,0.28);
}
footer a { color: rgba(201,162,39,0.45); text-decoration: none; }
footer a:hover { color: var(--gold); }
.footer-orn { color: var(--gold); opacity: 0.2; margin-bottom: 0.8rem; font-size: 1rem; }

/* Botón volver arriba */
#back-top {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  width: 2.8rem; height: 2.8rem;
  background: rgba(14,31,61,0.95);
  border: 1px solid rgba(201,162,39,0.35);
  color: var(--gold);
  font-family: var(--type); font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; cursor: pointer;
  z-index: 300;
  opacity: 0; transition: opacity 0.3s;
}
#back-top.visible { opacity: 1; }
#back-top:hover { background: rgba(201,162,39,0.12); }

/* ══════════════════════════════════════════════════
   ANIMACIONES
   ══════════════════════════════════════════════════ */
@keyframes fadeDown { from { opacity:0; transform:translateY(-16px); } to { opacity:1; transform:none; } }
@keyframes fadeUp   { from { opacity:0; transform:translateY(16px);  } to { opacity:1; transform:none; } }
@keyframes fadeIn   { from { opacity:0; } to { opacity:1; } }

/* ══════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .topbar-current { display: none; }
  .virtud-grid { grid-template-columns: 1fr 1fr; }
  .home-grid { grid-template-columns: 1fr 1fr; }
  .hero-title { letter-spacing: 0.1em; }
  .content-wrap { padding: 0 1rem 4rem; }
  .block-inner { padding: 1.2rem 1rem; }
  .btn-ghost { margin-left: 0; margin-top: 0.5rem; }
  .hero-cta { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
}
