﻿/* ===========================
   HERO SECTION - BIENVENIDA
=========================== */
.hero-bienvenidos {
  position: relative;
  width: 100%;
  max-height: 300px;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

.banner-bienvenidos {
  position: relative;
  width: 100%;
  height: 300px;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.hero-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

.banner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  margin: 0;
  padding: 2rem;
  text-align: center;
  z-index: 2;
}

.overlay-content {
  max-width: 800px;
  animation: fadeInUp 0.8s ease-out;
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  color: #ffffff;
  margin: 0 0 1rem 0;
  font-weight: 600;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.hero-subtitle {
  font-family: 'Lora', serif;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: #f0f0f0;
  margin: 1rem 0 0 0;
  font-weight: 300;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.6);
  letter-spacing: 0.5px;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===========================
   SELECTOR DE IDIOMAS
=========================== */
.language-selector {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #c5963a;
  border-radius: 25px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #3a2a1a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.lang-btn:hover {
  background: #c5963a;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(197, 150, 58, 0.3);
}

.lang-btn i {
  font-size: 18px;
}

#current-lang {
  font-family: 'Lora', serif;
  letter-spacing: 0.5px;
}

.lang-dropdown {
  position: absolute;
  top: 60px;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  border: 2px solid #c5963a;
  border-radius: 12px;
  min-width: 180px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  max-height: 400px;
  overflow-y: auto;
}

.lang-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  text-decoration: none;
  color: #3a2a1a;
  font-size: 14px;
  font-family: 'Lora', serif;
  transition: background 0.2s ease;
  border-bottom: 1px solid #f0e8d8;
}

.lang-option:last-child {
  border-bottom: none;
}

.lang-option:hover {
  background: #faf5ed;
  color: #6b2d3e;
}

.lang-option.active {
  background: #c5963a;
  color: #fff;
  font-weight: 600;
}

/* Media queries responsivo */
@media (max-width: 768px) {
  .hero-bienvenidos {
    max-height: 200px;
  }
  
  .banner-bienvenidos {
  position: relative;
  width: 100%;
  height: 200px;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
  
  .hero-title {
    font-size: 2rem;
    margin-bottom: 0.75rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
    margin-top: 0.5rem;
  }
}

@media (max-width: 480px) {
  .hero-bienvenidos {
    max-height: 300px;
  }
  
  .banner-bienvenidos {
  position: relative;
  width: 100%;
  height: 600px;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
  
  .hero-title {
    font-size: 1.5rem;
  }
  
  .hero-subtitle {
    font-size: 0.9rem;
  }
}


* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Lora', serif;
  background: #2c1e14;
  background-image:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 40px,
      rgba(0,0,0,.08) 40px,
      rgba(0,0,0,.08) 42px
    ),
    linear-gradient(180deg, #3a2a1c 0%, #1e1208 50%, #2a1c12 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  color: #3a2a1a;
  line-height: 1.6;
}

/* ========== BOOK ========== */
.book {
  position: relative;
  width: min(90vw, calc(80vh * 1.5));
  height: 80vh;
  margin: 10px auto;
}

/* Tapas del libro */
.book-cover {
  position: absolute;
  top: -8px;
  bottom: -8px;
  width: calc(50% + 10px);
  background: linear-gradient(135deg, #5c3a28, #3a2010);
  border: 3px solid #a0845c;
  border-radius: 4px;
  box-shadow: 0 6px 25px rgba(0,0,0,.5);
}

.left-cover {
  left: -10px;
  border-radius: 6px 2px 2px 6px;
  background: linear-gradient(135deg, #5c3a28 0%, #4a2a18 100%);
}

.right-cover {
  right: -10px;
  border-radius: 2px 6px 6px 2px;
  background: linear-gradient(225deg, #5c3a28 0%, #4a2a18 100%);
}

/* Lomo del libro */
.book-spine {
  position: absolute;
  top: -10px;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  background: linear-gradient(to right,
    #3a2010,
    #5c3a28 20%,
    #7a5a40 50%,
    #5c3a28 80%,
    #3a2010
  );
  z-index: 10;
  border-radius: 3px;
  box-shadow: 0 0 8px rgba(0,0,0,.5);
}

/* Bordes de páginas apiladas */
.page-edges {
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: 6px;
  z-index: 5;
}

.left-edges {
  left: 4px;
  background: repeating-linear-gradient(to bottom,
    #f8f5f0 0px, #e0dbd3 1px, #f5f2ed 2px
  );
  border-radius: 3px 0 0 3px;
}

.right-edges {
  right: 4px;
  background: repeating-linear-gradient(to bottom,
    #f8f5f0 0px, #e0dbd3 1px, #f5f2ed 2px
  );
  border-radius: 0 3px 3px 0;
}

/* Área de páginas */
.pages-area {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 14px;
  right: 14px;
  display: flex;
  z-index: 8;
}

.left-page, .right-page {
  flex: 1;
  background: #fffef8;
  overflow: hidden;
  position: relative;
}

.left-page {
  border-radius: 3px 0 0 3px;
  box-shadow: inset -4px 0 8px rgba(0,0,0,.06);
}

.right-page {
  border-radius: 0 3px 3px 0;
  box-shadow: inset 4px 0 8px rgba(0,0,0,.06);
}

.left-page.empty, .right-page.empty {
  background: #e8ddd0;
}

/* Gutter (centro) */
.gutter {
  width: 20px;
  flex-shrink: 0;
  background: linear-gradient(to right,
    rgba(0,0,0,.08),
    rgba(0,0,0,.15) 40%,
    rgba(0,0,0,.2) 50%,
    rgba(0,0,0,.15) 60%,
    rgba(0,0,0,.08)
  );
  z-index: 9;
}

/* ========== COVER PAGE ========== */
.cover-page {
  background: linear-gradient(160deg, #4a2020, #2c1810) !important;
}

.p-cover {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Portada dividida con índice */
.p-indice-page {
  height: 100%;
  background: linear-gradient(135deg, #1a1410 0%, #2a1f18 100%);
  padding: 30px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.p-indice {
  background: linear-gradient(135deg, #1a1410 0%, #2a1f18 100%);
  padding: 30px 20px;
  overflow-y: auto;
  border-right: 2px solid #d4af37;
}

.indice-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: rgba(212, 175, 55, 0.1);
  border-left: 3px solid #d4af37;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.indice-item:hover {
  background: rgba(212, 175, 55, 0.2);
  transform: translateX(5px);
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

.indice-num {
  font-family: 'Playfair Display', serif;
  color: #d4af37;
  font-weight: 700;
  min-width: 40px;
  font-size: 0.9em;
}

.indice-title {
  font-family: 'Lora', serif;
  color: #e8e8e8;
  font-size: 0.85em;
  line-height: 1.3;
}

.p-cover-right {
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, #4a2020, #2c1810);
}

.p-cover-right img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.p-cover img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.p-cover-body {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
}

.p-cover.back { 
  justify-content: center;
  background: linear-gradient(160deg, #4a2020, #2c1810) !important;
}
.p-cover.back .p-cover-body { flex-grow: 0; }

.cross { font-size: 2rem; color: #c5963a; margin-bottom: 6px; }
.p-cover h1 { font-family: 'Playfair Display',serif; color: #fff; font-size: 1.4rem; margin-bottom: 6px; }
.p-cover h2 { font-family: 'Playfair Display',serif; color: #fff; font-size: 1.2rem; }
.p-sub { color: #c5963a; font-size: calc(.8rem + 1px); letter-spacing: 1px; margin-bottom: 8px; }
.p-verse { color: #f0e6d6; font-size: calc(.72rem + 1px); }
.p-cover.back p { color: rgba(255,255,255,.5); font-size: .75rem; }
.p-quote-frame {
  margin-top: 32px;
  padding: 10px 12px;
  max-width: 340px;
  width: 100%;
  border: 1px solid rgba(197, 150, 58, 0.6);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
  color: #f0e6d6;
  font-family: 'Lora', serif;
  font-size: .98rem;
  line-height: 1.35;
  font-style: italic;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}
.p-quote-frame--cr {
  font-size: 1.05rem;
  border-color: rgba(212, 175, 55, 0.85);
  background: rgba(0, 0, 0, 0.45);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 6px 14px rgba(0, 0, 0, 0.35);
}
.p-verse--cr {
  color: #bca98d;
  font-size: calc(.72rem + 1px);
}
.p-verse--hm {
  color: #bda585;
  font-size: calc(.72rem + 1px);
}

/* ========== PAGE INNER ========== */
.p-inner {
  padding: 20px 22px;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Páginas con solo imágenes */
.p-inner:has(.p-img-full) {
  padding: 10px;
}

.p-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e0d8cc;
  font-family: 'Playfair Display', serif;
  font-size: .95rem;
  flex-shrink: 0;
}

/* Cabecera sin borde para páginas de solo imagen */
.p-head:has(+ .p-img-full) {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.p-head b { flex-grow: 1; }
.orn { color: #c5963a; }
.pn { font-size: .65rem; color: #bbb; font-style: italic; }

p { font-size: .73rem; margin-bottom: 6px; }
.lt { font-size: .78rem; color: #6b5a4a; margin-bottom: 10px; }

blockquote {
  margin: 10px 0;
  padding: 8px 12px;
  border-left: 2px solid #c5963a;
  background: #fdf9f0;
  font-style: italic;
  font-size: .72rem;
  color: #6b5a4a;
  border-radius: 0 4px 4px 0;
}

.p-img { 
  width: auto; 
  max-width: 100%;
  height: 100%;
  max-height: 90%;
  border-radius: 6px; 
  margin: 0 auto; 
  object-fit: contain;
  display: block;
}
.p-img-full { 
  width: auto; 
  max-width: 95%;
  flex: 1;
  min-height: 0;
  object-fit: contain; 
  border-radius: 4px; 
  display: block;
  margin: 0 auto;
}

/* Trans list */
.tl {
  margin: 8px 0;
  padding: 8px 12px;
  background: #faf5ed;
  border-left: 2px solid #c5963a;
  border-radius: 0 4px 4px 0;
  font-size: .72rem;
}
.tl div { padding: 2px 0; color: #5a4a3a; }

/* Verse cards */
.vc {
  padding: 6px 10px;
  margin-bottom: 5px;
  background: #faf5ed;
  border-radius: 4px;
  border: 1px solid #ebe3d6;
}
.vc b { font-size: .68rem; color: #6b2d3e; display: block; }
.vc p { font-size: .68rem; margin: 2px 0 0; color: #5a4a3a; }

/* Etapa rows */
.er {
  display: flex;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #f0e8d8;
  align-items: flex-start;
}
.er:last-of-type { border-bottom: none; }
.en {
  display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; min-width: 20px;
  background: #6b2d3e; color: #fff; border-radius: 50%;
  font-size: .6rem; font-weight: 700;
}
.en.si { background: #c5963a; font-size: .75rem; }
.er b { font-size: .72rem; }
.er em { font-size: .65rem; color: #999; }
.er p { font-size: .68rem; color: #6b5a4a; margin: 2px 0 0; }

/* Silencio note */
.sn {
  margin-top: 8px; padding: 6px 10px;
  background: #2c1810; color: #fff;
  border-radius: 4px; font-size: .7rem; text-align: center;
}
.sn b { color: #c5963a; }

/* Two boxes */
.tb { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.tbx { padding: 8px; background: #faf5ed; border-radius: 4px; border-top: 2px solid #c5963a; }
.tbx b { font-size: .72rem; color: #6b2d3e; display: block; margin-bottom: 2px; }
.tbx p { font-size: .68rem; color: #5a4a3a; margin: 0; }

/* Peregrino */
.pg {
  padding: 7px 10px; margin-bottom: 4px;
  background: #faf5ed; border-radius: 4px;
  font-size: .75rem; display: flex; align-items: center; gap: 8px;
}
.pg i { color: #c5963a; font-size: 1rem; }

/* Downloads */
.dlm {
  display: block; padding: 10px 14px; margin-bottom: 6px;
  background: #6b2d3e; color: #fff; border-radius: 6px;
  text-decoration: none; font-weight: 600; font-size: .75rem;
}
.dlm:hover { background: #8a3d52; color: #fff; }
.dlm i { color: #c5963a; margin-right: 6px; }

.dli {
  display: block; padding: 6px 14px; margin-bottom: 4px;
  background: #faf5ed; border: 1px solid #ebe3d6; border-radius: 4px;
  text-decoration: none; color: #3a2a1a; font-size: .7rem;
}
.dli:hover { background: #f0e8d8; color: #3a2a1a; }
.dli i { color: #6b2d3e; margin-right: 6px; }

/* ========== NAV ========== */
.nav-bar {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; margin-top: 16px;
}
.nav-bar button {
  width: 40px; height: 40px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  color: #fff; border-radius: 50%; font-size: 1rem;
  cursor: pointer; transition: background .2s;
  display: flex; align-items: center; justify-content: center;
}
.nav-bar button:hover { background: rgba(255,255,255,.2); }

#pinfo {
  color: rgba(255,255,255,.5); font-size: .75rem;
  font-style: italic; min-width: 100px; text-align: center;
}

.footer-info {
  margin-top: 12px; font-size: .65rem; color: rgba(255,255,255,.3); text-align: center;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 800px) {
  body {
    justify-content: flex-start;
    padding: 20px 0;
  }

  /* Libro: una sola página vertical centrada */
  .book {
    width: 85vw;
    max-width: 380px;
    height: 70vh;
    max-height: 540px;
    margin: 0 auto;
  }

  /* Tapa única que cubre todo el libro */
  .book-cover {
    top: 0; bottom: 0; left: 0;
    width: 100%;
    border-radius: 10px;
    border: 4px solid #a0845c;
    background: linear-gradient(160deg, #4a2a18 0%, #2a1508 100%);
    box-shadow: 0 8px 25px rgba(0,0,0,.6);
  }
  .right-cover { display: none; }

  /* Ocultar elementos de libro abierto */
  .book-spine { display: none; }
  .page-edges { display: none; }
  .gutter { display: none; }
  .left-page { display: none; }

  /* Página única centrada */
  .pages-area {
    left: 14px; right: 14px;
    top: 14px; bottom: 14px;
  }
  .right-page {
    flex: 1;
    border-radius: 6px;
    box-shadow: none;
    background: #fffef8;
  }

  /* Contenido legible */
  .p-inner { padding: 20px; overflow-y: auto; }
  p { font-size: .85rem; margin-bottom: 8px; }
  .lt { font-size: .9rem; }
  .p-head { font-size: 1.05rem; margin-bottom: 12px; }
  blockquote { font-size: .8rem; padding: 10px 14px; }
  .vc b { font-size: .78rem; }
  .vc p { font-size: .78rem; }
  .er b { font-size: .82rem; }
  .er em { font-size: .74rem; }
  .er p { font-size: .78rem; }
  .en { width: 24px; height: 24px; min-width: 24px; font-size: .68rem; }
  .pg { font-size: .85rem; padding: 10px 12px; }
  .tl { font-size: .82rem; }
  .sn { font-size: .8rem; }
  .tbx b { font-size: .82rem; }
  .tbx p { font-size: .78rem; }
  .dlm { font-size: .85rem; padding: 14px 18px; }
  .dli { font-size: .8rem; padding: 12px 18px; margin-bottom: 6px; }
  .pn { font-size: .72rem; }

  .p-cover h1 { font-size: 1.4rem; }
  .p-cover h2 { font-size: 1.2rem; }
  .p-sub { font-size: .9rem; }
  .p-verse { font-size: .8rem; }
  .cross { font-size: 2.4rem; }

  /* Navegación centrada debajo del libro */
  .nav-bar {
    width: 85vw;
    max-width: 380px;
    margin: 14px auto 0;
    justify-content: center;
  }
  .nav-bar button {
    width: 50px;
    height: 50px;
    font-size: 1.4rem;
    background: rgba(255,255,255,.12);
    border: 2px solid rgba(255,255,255,.25);
  }
  #pinfo { font-size: .85rem; min-width: 100px; }
  .footer-info { font-size: .6rem; margin-top: 10px; }
}



