/* ============================================
   ESI · Escuela Sabática Infantil
   III Trimestre 2026 · "Los Viajes Misioneros de Pablo"
   Iglesia de Dios – Dpto. de Literatura
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Nunito:wght@400;600;700;800;900&display=swap');

:root {
  /* Paleta infantil */
  --sun:      #FFD43B;
  --sky:      #74C0FC;
  --grass:    #69DB7C;
  --coral:    #FF6B6B;
  --violet:   #CC5DE8;
  --orange:   #FF922B;
  --teal:     #38D9A9;
  --navy:     #1971C2;

  /* Neutros */
  --cream:    #FFFBF0;
  --white:    #FFFFFF;
  --ink:      #1A1A2E;
  --muted:    #666680;
  --border:   #E8E0FF;

  /* Tipografía */
  --font-display: 'Fredoka One', cursive;
  --font-body:    'Nunito', sans-serif;

  /* Radios y sombras */
  --r-sm:  10px;
  --r-md:  18px;
  --r-lg:  28px;
  --r-xl:  40px;
  --shadow-sm: 0 3px 12px rgba(0,0,0,.08);
  --shadow-md: 0 6px 24px rgba(0,0,0,.12);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.16);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; display: block; }
a   { color: inherit; text-decoration: none; }

/* ===== TOPBAR ===== */
.topbar {
  background: var(--ink);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}
.topbar-brand {
  font-family: var(--font-display);
  color: var(--sun);
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-brand span { color: rgba(255,255,255,.7); font-size:.85rem; font-family: var(--font-body); font-weight:600; }
.topbar-nav { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.topbar-nav a {
  color: rgba(255,255,255,.75);
  font-size: .85rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 50px;
  transition: background .2s, color .2s;
}
.topbar-nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.topbar-nav a.active { background: var(--violet); color: #fff; }

/* ===== HERO INDEX ===== */
.hero {
  background: linear-gradient(135deg, #74C0FC 0%, #A9E34B 55%, #FFD43B 100%);
  position: relative;
  overflow: hidden;
  padding: 70px 24px 80px;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.18) 2px, transparent 2px);
  background-size: 36px 36px;
}
.hero-inner {
  max-width: 1060px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 48px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.hero-text { flex: 1; min-width: 260px; }
.hero-eyebrow {
  display: inline-block;
  background: rgba(255,255,255,.9);
  color: var(--violet);
  font-weight: 900;
  font-size: .85rem;
  letter-spacing: .8px;
  text-transform: uppercase;
  padding: 6px 18px;
  border-radius: 50px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 1.08;
  color: var(--white);
  text-shadow: 3px 4px 0 rgba(0,0,0,.15);
  margin-bottom: 18px;
}
.hero-title em { color: var(--sun); font-style: normal; }
.hero-sub {
  color: rgba(255,255,255,.92);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.65;
  max-width: 460px;
  margin-bottom: 30px;
}
.hero-chips { display: flex; gap: 12px; flex-wrap: wrap; }
.chip {
  background: rgba(255,255,255,.22);
  border: 2px solid rgba(255,255,255,.5);
  backdrop-filter: blur(4px);
  color: var(--white);
  font-weight: 800;
  font-size: .88rem;
  padding: 8px 18px;
  border-radius: 50px;
}
.hero-cover {
  flex: 0 0 260px;
  display: flex;
  justify-content: center;
}
.hero-cover img {
  width: 240px;
  border-radius: var(--r-lg);
  border: 6px solid var(--white);
  box-shadow: var(--shadow-lg);
  transform: rotate(2.5deg);
}

/* ===== WAVE ===== */
.wave { display: block; width: 100%; overflow: hidden; line-height: 0; margin-top: -2px; }
.wave svg { display: block; width: 100%; }

/* ===== INTRO STRIP ===== */
.intro-strip {
  background: var(--violet);
  color: var(--white);
  text-align: center;
  padding: 16px 24px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.6;
}
.intro-strip em { color: var(--sun); font-style: normal; }

/* ===== SECTIONS ===== */
.section { max-width: 1060px; margin: 0 auto; padding: 60px 24px; }
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin-bottom: 8px;
  color: var(--violet);
  text-align: center;
}
.section-line {
  width: 64px; height: 5px;
  border-radius: 4px;
  background: var(--sun);
  margin: 8px auto 36px;
}
.section-desc {
  text-align: center;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 560px;
  margin: 0 auto 48px;
}

/* ===== LECCIONES GRID ===== */
.lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.lesson-card {
  background: var(--white);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 3px solid transparent;
  display: flex;
  flex-direction: column;
  transition: transform .25s, box-shadow .25s;
}
.lesson-card:hover {
  transform: translateY(-6px) rotate(-.4deg);
  box-shadow: var(--shadow-lg);
}
.card-head {
  padding: 22px 22px 16px;
  color: var(--white);
  position: relative;
  overflow: hidden;
  min-height: 100px;
}
.card-num-bg {
  font-family: var(--font-display);
  font-size: 5rem;
  opacity: .18;
  position: absolute;
  top: -10px; right: 10px;
  line-height: 1;
  color: var(--white);
  pointer-events: none;
}
.card-fecha {
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .8px;
  opacity: .85;
  margin-bottom: 6px;
}
.card-title-text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.2;
  position: relative;
  z-index: 1;
}
.card-body {
  padding: 16px 20px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card-verso {
  background: var(--cream);
  border-left: 4px solid;
  padding: 10px 13px;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: .86rem;
  font-style: italic;
  color: #333;
  line-height: 1.55;
}
.card-verso .ref { font-style: normal; font-weight: 800; font-size: .78rem; color: #888; margin-top: 4px; }
.card-lectura { font-size: .84rem; color: var(--muted); font-weight: 700; }
.card-lectura strong { color: var(--ink); }
.card-objetivo { font-size: .84rem; color: #444; line-height: 1.6; }
.card-thumb {
  border-top: 2px dashed var(--border);
  overflow: hidden;
  background: #f8f8f8;
}
.card-thumb img {
  width: 100%;
  max-height: 190px;
  object-fit: contain;
  padding: 10px;
  background: var(--white);
  transition: transform .3s;
}
.card-thumb img:hover { transform: scale(1.04); }
.card-footer {
  display: flex;
  gap: 0;
}
.btn-ver, .btn-dl {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: .82rem;
  cursor: pointer;
  border: none;
  transition: opacity .2s, filter .2s;
  text-align: center;
}
.btn-ver:hover, .btn-dl:hover { filter: brightness(.9); }
.btn-ver { color: var(--white); }
.btn-dl  { background: var(--cream); border-top: 2px solid var(--border); border-left: 2px solid var(--border); }

/* ===== PÁGINA LECCIÓN ===== */
.lesson-page { max-width: 860px; margin: 0 auto; padding: 48px 24px 80px; }

.lesson-header {
  border-radius: var(--r-lg);
  padding: 36px 36px 28px;
  color: var(--white);
  margin-bottom: 36px;
  position: relative;
  overflow: hidden;
}
.lesson-header::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.14) 2px, transparent 2px);
  background-size: 28px 28px;
}
.lh-num {
  font-family: var(--font-display);
  font-size: 6rem;
  opacity: .18;
  position: absolute;
  top: -8px; right: 20px;
  line-height: 1;
  color: var(--white);
}
.lh-eyebrow {
  font-size: .8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: .85;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}
.lh-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.1;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}
.lh-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.lh-chip {
  background: rgba(255,255,255,.22);
  border: 2px solid rgba(255,255,255,.4);
  color: var(--white);
  font-weight: 800;
  font-size: .82rem;
  padding: 6px 16px;
  border-radius: 50px;
}

/* Verso de memoria */
.verso-block {
  background: var(--white);
  border-radius: var(--r-md);
  padding: 24px 28px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
  position: relative;
  border-left: 6px solid;
}
.verso-label {
  font-size: .75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  opacity: .7;
}
.verso-text {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.6;
  font-style: italic;
  color: var(--ink);
  margin-bottom: 6px;
}
.verso-ref {
  font-style: normal;
  font-weight: 900;
  font-size: .85rem;
  color: var(--muted);
}

/* Objetivo */
.objetivo-block {
  background: linear-gradient(135deg, #EEF2FF, #F3E8FF);
  border-radius: var(--r-md);
  padding: 20px 24px;
  margin-bottom: 28px;
  font-size: .95rem;
  font-weight: 700;
  color: #5a348a;
  line-height: 1.65;
  border: 2px solid #D8B4FE;
}
.objetivo-block strong { display: block; font-size: .75rem; letter-spacing: .8px; text-transform: uppercase; margin-bottom: 6px; color: #9b59d0; }

/* Comentario */
.comentario-block {
  background: var(--white);
  border-radius: var(--r-md);
  padding: 28px 32px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
  line-height: 1.8;
  font-size: .97rem;
  color: #333;
}
.comentario-block h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.comentario-block p { margin-bottom: 12px; }
.comentario-block p:last-child { margin-bottom: 0; }

/* Preguntas */
.preguntas-block {
  background: var(--white);
  border-radius: var(--r-md);
  padding: 28px 32px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
}
.preguntas-block h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.pregunta-item {
  display: flex;
  gap: 14px;
  margin-bottom: 16px;
  align-items: flex-start;
}
.pregunta-num {
  flex: 0 0 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 900;
  font-size: .9rem;
  flex-shrink: 0;
}
.pregunta-text {
  font-size: .95rem;
  font-weight: 700;
  color: var(--ink);
  padding-top: 6px;
  line-height: 1.55;
}

/* Conclusión */
.conclusion-block {
  border-radius: var(--r-md);
  padding: 22px 28px;
  margin-bottom: 28px;
  color: var(--white);
  font-weight: 700;
  font-size: .97rem;
  line-height: 1.65;
}
.conclusion-block strong { font-family: var(--font-display); font-size: 1rem; display: block; margin-bottom: 6px; }

/* Ilustración con descarga */
.ilustracion-block {
  background: var(--white);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 36px;
  border: 3px dashed var(--border);
}
.ilustracion-header {
  padding: 14px 20px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--violet);
  border-bottom: 2px dashed var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.ilustracion-img {
  padding: 16px;
  background: #fafafa;
  text-align: center;
}
.ilustracion-img img {
  max-height: 420px;
  margin: 0 auto;
  border-radius: var(--r-sm);
  cursor: zoom-in;
}
.ilustracion-footer {
  padding: 14px 20px;
  border-top: 2px dashed var(--border);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: 50px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: .88rem;
  color: var(--white);
  cursor: pointer;
  border: none;
  transition: transform .2s, box-shadow .2s;
  text-decoration: none;
}
.dl-btn:hover { transform: scale(1.04); box-shadow: var(--shadow-md); }
.dl-btn.secondary {
  background: var(--white);
  border: 2px solid;
  color: var(--violet);
}
.dl-btn.secondary:hover { background: var(--violet); color: var(--white); }

/* Navegación lección anterior/siguiente */
.lesson-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  flex-wrap: wrap;
}
.lesson-nav-btn {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--white);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
  font-size: .9rem;
  color: var(--ink);
  transition: transform .2s, box-shadow .2s;
  border: 2px solid var(--border);
}
.lesson-nav-btn:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.lesson-nav-btn.next { justify-content: flex-end; text-align: right; }
.lesson-nav-btn .nav-icon { font-size: 1.4rem; }
.lesson-nav-btn .nav-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.lesson-nav-btn .nav-name  { font-family: var(--font-display); font-size: 1rem; }

/* Lightbox */
.lightbox {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.82);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lightbox.open { display: flex; }
.lightbox-box {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: 24px;
  max-width: 640px;
  width: 100%;
  position: relative;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.lightbox-box img { max-width: 100%; border-radius: var(--r-sm); margin-bottom: 18px; }
.lightbox-close {
  position: absolute; top: 14px; right: 18px;
  font-family: var(--font-display); font-size: 1.8rem;
  background: none; border: none; cursor: pointer; color: #888; line-height: 1;
}
.lightbox-title { font-family: var(--font-display); font-size: 1.1rem; margin-bottom: 14px; color: var(--violet); }

/* ===== BANNER DESCARGA PDF ===== */
.pdf-banner {
  background: linear-gradient(135deg, var(--grass), var(--teal));
  padding: 36px 24px;
  text-align: center;
  color: var(--white);
}
.pdf-banner h3 { font-family: var(--font-display); font-size: 1.7rem; margin-bottom: 10px; text-shadow: 1px 2px 0 rgba(0,0,0,.1); }
.pdf-banner p { font-size: .95rem; font-weight: 700; opacity: .9; max-width: 500px; margin: 0 auto 20px; line-height: 1.6; }
.pdf-dl-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--white); color: #2f9e44;
  font-family: var(--font-body); font-weight: 900; font-size: 1rem;
  padding: 14px 36px; border-radius: 50px;
  box-shadow: var(--shadow-md);
  transition: transform .2s, box-shadow .2s;
}
.pdf-dl-btn:hover { transform: scale(1.04); box-shadow: var(--shadow-lg); }

/* ===== FOOTER ===== */
footer {
  background: var(--ink);
  color: rgba(255,255,255,.65);
  text-align: center;
  padding: 36px 24px;
  font-size: .88rem;
  line-height: 1.9;
  margin-top: auto;
}
footer .brand { font-family: var(--font-display); font-size: 1.3rem; color: var(--sun); display: block; margin-bottom: 4px; }
footer a { color: var(--sky); }

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
  .hero-inner { gap: 30px; }
  .hero-cover { flex: 0 0 100%; }
  .lesson-grid { grid-template-columns: 1fr; }
  .topbar-nav { gap: 6px; }
  .topbar-nav a { font-size: .78rem; padding: 5px 10px; }
  .lesson-page { padding: 28px 16px 60px; }
  .lesson-header { padding: 24px 20px 18px; }
  .comentario-block, .preguntas-block { padding: 20px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
</style>
