/* ================= RESET Y BASE ================= */

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Montserrat', Arial, sans-serif !important;
  background: #f4f4f4;
  color: #111827;
}

html {
  -webkit-text-size-adjust: 100%;
}

img {
  max-width: 100%;
  margin: 15px 0;
  display: block;
}

h1, h2, h3 {
  font-weight: 600;
}

p {
  font-weight: 400;
  line-height: 1.6;
  max-width: 800px;
}

/* ================= PORTADA PRINCIPAL ================= */

.home {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: linear-gradient(180deg, #1f2933 0%, #111827 100%);
  color: white;
  text-align: center;
  padding: 100px 20px 110px;
  padding-bottom: 180px;
  position: relative;
  overflow: hidden;
}

.home-title {
  font-size: clamp(2.4rem, 7vw, 5.5rem);
  letter-spacing: 6px;
  margin-top: 8px;
  margin-bottom: 4px;
}

.home-subtitle {
  font-size: clamp(1rem, 2.4vw, 1.4rem);
  color: #cbd5e1;
  max-width: 700px;
  margin-bottom: 50px;
}

.home-buttons {
  display: grid;
  width: min(680px, 100%);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  justify-content: center;
  justify-items: stretch;
  margin: 0 auto;
}

.home-buttons button {
  font-size: 1.2rem;
  padding: 16px;
  min-height: 58px;
  width: 100%;
  background: linear-gradient(135deg, #2b3340, #1f2933);
  color: white;
  border: 1px solid #4b5563;
  border-radius: 6px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* Hover "fundición" para todos los botones (excepto menú) */
button:not(.menu-toggle) {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

button:not(.menu-toggle)::before {
  content: "";
  position: absolute;
  inset: -35%;
  background: radial-gradient(circle at 30% 30%, rgba(245, 158, 11, 0.6), rgba(245, 158, 11, 0.08) 55%, rgba(17, 24, 39, 0.05) 70%);
  opacity: 0;
  transform: translateY(10%) scale(1.1);
  transition: opacity 0.35s ease, transform 0.35s ease;
  z-index: -1;
}

button:not(.menu-toggle)::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(245, 158, 11, 0.15), rgba(250, 204, 21, 0.55), rgba(245, 158, 11, 0.15));
  opacity: 0;
  mix-blend-mode: screen;
  transition: opacity 0.35s ease;
  z-index: -1;
}

button:not(.menu-toggle):hover {
  border-color: #f59e0b;
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}

button:not(.menu-toggle):hover::before,
button:not(.menu-toggle):hover::after {
  opacity: 1;
  transform: translateY(0) scale(1.05);
}

/* ================= VIDEOS PORTADA ================= */

.home-video {
  position: absolute;
  top: 0;
  width: 28vw;
  height: 100vh;
  object-fit: cover;
  opacity: 0.7;
  pointer-events: none;
}

.home-video.left {
  left: 0;
  animation: slideInRight 1.1s ease-out both;
}

.home-video.right {
  right: 0;
  animation: slideInLeft 1.1s ease-out both;
}

@keyframes slideInRight {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 0.7;
  }
}

@keyframes slideInLeft {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 0.7;
  }
}

.home-center {
  position: relative;
  z-index: 2;
  margin-top: clamp(36px, 6vh, 80px);
}

.home::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(17,24,39,0.95) 0%,
    rgba(17,24,39,0.85) 35%,
    rgba(17,24,39,0.6) 55%,
    rgba(17,24,39,0.0) 70%
  );
}

/* ================= BOTÓN VOLVER ================= */

#backButton {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  padding: 12px 16px;
  background: #1f2933;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: none;
}

#backButton:hover {
  background: #374151;
}

/* ================= LIBROS ================= */

.book {
  display: none;
  min-height: 100vh;
  padding: 40px 0;
  background: #f8fafc;
}

/* ================= PORTADA LIBRO ================= */

.book-header {
  text-align: center;
  margin-bottom: 50px;
}

.book-header h2 {
  font-size: 2.6rem;
  margin-bottom: 20px;
}

.book-header h1 {
  font-size: 2.6rem;
  margin-bottom: 20px;
}

/* ================= HEADER INTERNO ================= */

.site-header {
  background: #1f2937;
  color: #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 900;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-brand {
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.site-brand img {
  height: 64px;
  width: auto;
  display: block;
}

.header-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.header-nav a {
  color: #e5e7eb;
  text-decoration: none;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.header-nav a:hover {
  color: #ffffff;
  border-color: #ffffff;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.2);
  color: #ffffff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 6px;
}

.menu-toggle img {
  width: 22px;
  height: 22px;
  display: block;
}

.book-subtitle {
  color: #555;
  margin: 10px 0 25px 0;
}

.book-header img,
.book-cover-image {
  width: 100%;
  max-width: 100vw;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
  margin: 0 auto;
}

/* ================= BOTÓN CAPÍTULOS ================= */

.chapters-button {
  position: fixed;
  bottom: 70px;
  right: 20px;
  z-index: 1000;
  padding: 12px 16px;
  background: #374151;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.chapters-button:hover {
  background: #1f2937;
}

/* ================= CUERPO LIBRO ================= */

.book-body {
  display: none;
  min-height: 100vh;
  margin-top: 30px;
}

.book-body.fullpage {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 0 20px;
}

/* ================= ÍNDICE ================= */

.chapters {
  flex: 0 0 240px;
  width: 240px;
  padding-right: 20px;
  border-right: 1px solid #e5e7eb;
}

.chapters button {
  width: 100%;
  margin-bottom: 8px;
  padding: 10px 12px;
  background: #374151;
  color: white;
  border: 1px solid #4b5563;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.chapters button:hover {
  background: #1f2937;
  border-color: #f59e0b;
}

/* ================= CONTENIDO ================= */

.content {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 30px;
    --content-pad-right: 30px;
padding-right: var(--content-pad-right, 30px);
  /* el espacio para el vídeo fijo se activa con body.has-video */
  background: #fcfcfd;
  border-radius: 8px;
}


body.has-video .content {
  --content-pad-right: 340px;
}
.chapter {
  display: none;
  margin-bottom: 60px;
}

.chapter h2 {
  margin-bottom: 15px;
}

/* ================= VIDEO FIJO CAPÍTULOS ================= */

.chapter-video {
  position: fixed;
  top: 100px;
  right: 20px;
  width: 300px;
  height: 70vh;
  z-index: 500;
}

.chapter-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}
/* ===== VIDEO GLOBAL FIJO PARA CAPÍTULOS ===== */

#globalChapterVideo {
  position: fixed;
  top: 100px;
  right: 20px;

  width: 300px;
  height: 70vh;

  display: none;
  z-index: 500;
}

#globalChapterVideo video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

/* Nota: el espacio para el vídeo fijo se gestiona con padding-right en .content */
.hero-header {
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 3;
}

.hero-logo {
    max-width: 600px;
    height: auto;
}
.home-footer-logo {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}

.home-footer-logo img {
  max-width: 220px;
  height: auto;
}
/* ===== SEO TEXT (contenido indexable en portada) ===== */
.seo-text{
  position: relative;
  z-index: 2;

  max-width: 700px;
  margin: 18px auto 0 auto;

  padding: 22px 26px;

  background: rgba(17,24,39,0.70);
  border: 1px solid rgba(255,255,255,0.15);

  border-radius: 14px;

  box-shadow: 0 10px 25px rgba(0,0,0,0.35);
}


.seo-text h2{
  margin: 0 0 10px 0;
  font-size: 1.8rem;
  font-weight: 600;
  color: #fff;
}

.seo-text p{
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #cbd5e1;
  max-width: 100%;
}

/* ================= FOOTER ================= */

.site-footer {
  background: #111827;
  color: #cbd5e1;
  padding: 24px 20px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.95rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links a {
  color: #e5e7eb;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.footer-links a:hover {
  color: #ffffff;
  border-color: #ffffff;
}

/* ================= LEGALES ================= */

.legal-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 20px;
}

.legal-page h1 {
  font-size: 2.2rem;
  margin-bottom: 16px;
}

.legal-page h2 {
  font-size: 1.4rem;
  margin-top: 28px;
  margin-bottom: 10px;
}

.legal-page p {
  max-width: 100%;
  color: #1f2937;
}

.legal-page a {
  color: #1d4ed8;
  text-decoration: underline;
}

/* ================= ESTILOS PROPUESTA (PROCESO) ================= */

.page-proceso {
  background: #0b1220;
  color: #e5e7eb;
}

.page-proceso .book {
  display: block;
  background: transparent;
  padding: 28px 0 80px;
}

.page-proceso .book-header {
  max-width: 1180px;
  margin: 0 auto 26px;
  padding: 0 24px;
  text-align: left;
}

.page-proceso .book-header h1 {
  font-size: clamp(2.1rem, 3.8vw, 3.2rem);
  margin-bottom: 14px;
  color: #f8fafc;
  text-transform: uppercase;
}

.page-proceso .book-header img {
  width: 100%;
  max-width: 900px;
  max-height: 55vh;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  margin: 0;
}

.page-proceso .proceso-hero-image {
  cursor: zoom-in;
}

.page-proceso .chapters-button {
  position: static;
  margin-top: 16px;
  background: #1f2937;
}

.page-proceso .book-body {
  display: grid;
  grid-template-columns: minmax(240px, 280px) 1fr;
  gap: 28px;
  align-items: start;
  padding: 0 24px;
}

.page-proceso .book-body.fullpage {
  display: grid;
  padding: 0 24px;
}

.page-proceso .chapters {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 16px;
  padding: 16px;
  position: sticky;
  top: 130px;
  max-height: calc(100vh - 120px);
  overflow: auto;
}

.page-proceso .chapters button {
  background: transparent;
  border-color: rgba(148, 163, 184, 0.3);
  color: #e2e8f0;
  font-size: 0.95rem;
}

.page-proceso .chapters button:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.7);
}

.page-proceso .content {
  background: #f8fafc;
  color: #0f172a;
  border-radius: 18px;
  padding: 34px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

.page-proceso .chapter {
  display: block;
  padding-bottom: 30px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 30px;
}

.page-proceso .chapter:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.page-proceso .chapter h2 {
  color: #0f172a;
  margin-bottom: 10px;
}

.page-proceso .chapter p {
  color: #1f2937;
  font-size: 1rem;
}

.page-proceso .youtube-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 16px;
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
  text-decoration: none;
  font-weight: 600;
}

.page-proceso .youtube-link:hover {
  background: #1d4ed8;
  color: #ffffff;
}

@media (max-width: 1024px) {
  .page-proceso .book-body,
  .page-proceso .book-body.fullpage {
    grid-template-columns: 1fr;
  }

  .page-proceso .chapters {
    position: static;
    max-height: none;
  }
}

@media (max-width: 768px) {
  .page-proceso .book-header {
    text-align: left;
  }

  .page-proceso .book-header img {
    margin: 0;
  }

  .page-proceso .chapters button {
    text-align: center;
  }

  .page-proceso .content {
    padding: 22px;
  }

  .page-proceso .book-header h1 {
    font-size: clamp(1.6rem, 6.2vw, 2.1rem);
  }
}

/* ================= LIGHTBOX PROCESO ================= */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1200;
}

.lightbox.open {
  display: flex;
}

.lightbox:target {
  display: flex;
}

.lightbox-link {
  display: inline-block;
  text-decoration: none;
}

.lightbox-content {
  position: relative;
  max-width: 92vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.lightbox-content img {
  max-width: 92vw;
  max-height: 75vh;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.9);
  color: #ffffff;
  font-size: 1.6rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.lightbox-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: #f59e0b;
  color: #111827;
  text-decoration: none;
  font-weight: 700;
}

.lightbox-download:hover {
  background: #fbbf24;
}
.chapter {
  scroll-margin-top: 100px;
}

/* ================= RESPONSIVE (MÓVIL / TABLET) ================= */

@media (max-width: 1024px) {
  .hero-logo { max-width: min(420px, 90vw); }
  .home-footer-logo img { max-width: 220px; }

  /* En tablet se prioriza legibilidad: se elimina vídeo fijo y se recupera ancho útil */
  #globalChapterVideo,
  .chapter-video {
    display: none !important;
  }

  .content {
    padding-right: 30px;
  }
}

@media (max-width: 768px) {
  .home {
    height: auto;
    min-height: 100svh;
    padding: 80px 16px 18px;
  }
  .home-center {
    margin-top: clamp(28px, 5vh, 70px);
  }

  .home-video {
    display: none;
  }

  .home-title {
    letter-spacing: 3px;
  }

  .home-subtitle {
    margin-bottom: 24px;
  }

  .home-buttons {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .home-buttons button {
    width: 100%;
    font-size: 1.05rem;
    padding: 14px 14px;
  }

  .seo-text {
    margin-top: 12px;
    padding: 16px 18px;
  }

  .seo-text h2 { font-size: 1.35rem; }
  .seo-text p { font-size: 0.98rem; }

  .book { padding: 24px 0; }
  .book-header h2,
  .book-header h1 { font-size: 1.9rem; padding: 0 16px; }

  .header-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 4px 14px;
  }

  .menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .header-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-top: 8px;
    padding-bottom: 8px;
    order: 3;
  }

  .site-brand img {
    height: 50px;
  }

  .site-header.nav-open .header-nav {
    display: flex;
  }

  .book-body.fullpage {
    flex-direction: column;
    padding: 0 16px;
  }

  .chapters {
    width: 100%;
    flex: 0 0 auto;
    padding-right: 0;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 14px;
    margin-bottom: 14px;
  }

  .chapters button {
    text-align: center;
  }

  .content {
    padding: 18px;
    padding-right: 18px;
  }

  #backButton {
    bottom: 16px;
    right: 16px;
  }

  .chapters-button {
    bottom: 70px;
    right: 16px;
  }

  .home-footer-logo{
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    margin-top: 18px;
  }

  .chapter {
    scroll-margin-top: 120px;
  }
}

@media (max-width: 480px) {
  .home-title { letter-spacing: 2px; }
  .book-header img,
  .book-cover-image { max-height: 60vh; }
  .home-footer-logo img { max-width: 190px; }
}
