/* ============================================================
   Revista Digital ACTIVACOOP
   Dirección: libro sobre mesa de sala cooperativa.
   Escenario teal profundo · papel cálido · acento dorado.
   Display: Fraunces · Texto: Figtree
   ============================================================ */

:root {
  /* Paleta de marca ACTIVACOOP: verde + naranja, texto índigo */
  --stage:       #598f31;   /* fondo escenario (verde bosque profundo) */
  --stage-2:     #143a24;   /* gradiente escenario */
  --stage-glow:  #2c7a45;   /* resplandor verde tras el libro */

  --paper:       #fdfcf7;   /* papel blanco cálido */
  --paper-2:     #f2ecdd;   /* borde/curvatura del papel */
  --paper-edge:  #e7ddca;

  --ink:         #1a5c30;   /* verde profundo institucional (títulos) */
  --ink-body:    #2b2740;   /* índigo de marca (texto de lectura) */
  --ink-soft:    #6f6b7d;   /* texto secundario */

  --coop:        #2e9e4f;   /* verde cooperativo (énfasis, subtítulos) */
  --naranja:       #e85d1e;   /* naranja de marca (acento) */
  --naranja-claro:  #ff7a45;
  --line:        #e2dccd;   /* hairline sobre papel */

  --sombra-libro: 0 40px 80px -20px rgba(0,0,0,.55), 0 12px 28px -12px rgba(0,0,0,.5);

  --fuente-display: "Fraunces", Georgia, serif;
  --fuente-texto:   "Figtree", -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--fuente-texto);
  color: var(--ink-body);
  background:
    radial-gradient(120% 80% at 50% 8%, var(--stage-2) 0%, var(--stage) 60%) fixed;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Encabezado superior ---------- */
.revista-top {
  text-align: center;
  padding: clamp(1.4rem, 3vw, 2.6rem) 1rem .6rem;
}
.revista-top__marca {
  display: inline-block;
  font-weight: 600;
  font-size: .72rem;
  letter-spacing: .42em;
  text-transform: uppercase;
  color: var(--naranja-claro);
  margin-bottom: .55rem;
  padding-left: .42em;
}
.revista-top__lema {
  margin: 0;
  font-family: var(--fuente-display);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: clamp(1.35rem, 3.6vw, 2.35rem);
  line-height: 1.12;
  color: #f6efe1;
  letter-spacing: .002em;
}

/* ---------- Escenario ---------- */
.escenario {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 3vw, 2.4rem) 1rem 5.5rem;
}
.escenario__resplandor {
  position: absolute;
  top: 50%; left: 50%;
  width: min(90vw, 1100px);
  height: min(70vh, 720px);
  transform: translate(-50%, -55%);
  background: radial-gradient(50% 50% at 50% 50%, var(--stage-glow) 0%, transparent 70%);
  opacity: .5;
  filter: blur(10px);
  pointer-events: none;
}

/* ---------- Contenedor del libro ---------- */
.libro-wrap {
  position: relative;
  width: 100%;
  max-width: 1180px;
  z-index: 1;
}
.flipbook {
  margin: 0 auto;
  touch-action: pan-y;
}

/* Cada hoja física del libro */
.page {
  background:
    linear-gradient(90deg, rgba(0,0,0,.05), transparent 8%, transparent 92%, rgba(0,0,0,.05)),
    var(--paper);
  color: var(--ink-body);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
}
.page[data-density="hard"],
.page[data-layout="portada"],
.page[data-layout="cierre"] {
  background: var(--paper);
}
.stf__parent { margin: 0 auto; }
.flipbook, .stf__wrapper { box-shadow: none; }
.stf__block { box-shadow: var(--sombra-libro); border-radius: 3px; }

.page__contenido {
  position: absolute;
  inset: 0;
  padding: clamp(1.4rem, 3.2vw, 2.9rem) clamp(1.5rem, 3.4vw, 3rem);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.page__contenido::-webkit-scrollbar { width: 6px; }
.page__contenido::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }

.page__folio {
  position: absolute;
  bottom: .85rem;
  right: 1.4rem;
  font-size: .72rem;
  letter-spacing: .12em;
  color: var(--ink-soft);
  opacity: .7;
}

/* ---------- Hoja: estructura de contenido ---------- */
.hoja {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.hoja--contenido { justify-content: flex-start; }

.hoja__cab { margin-bottom: clamp(1rem, 2.4vw, 1.7rem); }
.hoja__eyebrow {
  display: inline-block;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--naranja);
  margin-bottom: .5rem;
}
.hoja__seccion {
  margin: 0;
  font-family: var(--fuente-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(1.4rem, 3vw, 2.15rem);
  line-height: 1.08;
  color: var(--ink);
  position: relative;
  padding-bottom: .7rem;
}
.hoja__seccion::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 3.2rem; height: 3px;
  border-radius: 3px;
  /* guiño al degradado verde -> naranja del libro original */
  background: linear-gradient(90deg, var(--coop), var(--naranja));
}
.hoja__subtitulo {
  margin: .8rem 0 0;
  font-family: var(--fuente-display);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  color: var(--coop);
}
.hoja__cuerpo { flex: 1; }

/* ---------- Bloque: párrafo ---------- */
.pg-parrafo {
  margin: 0 0 1rem;
  font-size: clamp(.92rem, 1.7vw, 1.02rem);
  line-height: 1.62;
  color: var(--ink-body);
}
.pg-parrafo b, .pg-lista b, .pg-clausula b { color: var(--ink); font-weight: 700; }

/* ---------- Bloque: listas ---------- */
.pg-lista {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}
.pg-lista li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: .85rem;
  font-size: clamp(.9rem, 1.7vw, 1.01rem);
  line-height: 1.55;
}
.pg-lista li::before {
  content: "\2737";              /* ✷ flor cooperativa */
  position: absolute;
  left: 0; top: .06em;
  color: var(--naranja);
  font-size: .95em;
}
.pg-lista--sub li::before {
  content: "\2727";              /* ✧ estrella hueca para sub-ítems */
  color: var(--coop);
}

.pg-grupo { margin-bottom: 1.3rem; }
.pg-grupo__titulo {
  margin: 0 0 .7rem;
  font-family: var(--fuente-texto);
  font-weight: 700;
  font-size: .74rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--coop);
  display: flex;
  align-items: center;
  gap: .6rem;
}
.pg-grupo__titulo::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---------- Bloque: tabla ---------- */
.pg-tabla {
  width: 100%;
  border-collapse: collapse;
  margin: .5rem 0 1rem;
  font-size: clamp(.85rem, 1.6vw, .96rem);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.pg-tabla thead th {
  background: var(--ink);
  color: #f4ecd9;
  font-weight: 600;
  text-align: left;
  padding: .7rem .9rem;
  font-size: .82rem;
  letter-spacing: .02em;
}
.pg-tabla tbody td {
  padding: .62rem .9rem;
  border-top: 1px solid var(--line);
}
.pg-tabla tbody tr:nth-child(even) { background: rgba(181,133,31,.06); }
.pg-tabla tbody td:last-child { font-weight: 700; color: var(--coop); }

/* ---------- Bloque: cláusula ---------- */
.pg-clausula {
  position: relative;
  background: linear-gradient(180deg, rgba(31,122,94,.06), rgba(181,133,31,.05));
  border: 1px solid var(--line);
  border-left: 3px solid var(--naranja);
  border-radius: 10px;
  padding: 1.3rem 1.4rem 1.35rem;
  margin: .4rem 0 1.2rem;
}
.pg-clausula__titulo {
  margin: 0 0 .6rem;
  font-family: var(--fuente-display);
  font-weight: 600;
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--ink);
}
.pg-clausula p {
  margin: 0;
  font-size: clamp(.88rem, 1.6vw, .98rem);
  line-height: 1.6;
}

/* ---------- Bloque: figura/imagen ---------- */
.pg-figura {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
}
.pg-figura img {
  max-width: 100%;
  max-height: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 8px 24px -12px rgba(0,0,0,.3);
}

/* ---------- Bloque: botón ---------- */
.pg-boton { margin-top: auto; padding-top: 1rem; }
.pg-boton a {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--ink);
  color: #f6efe1;
  text-decoration: none;
  font-weight: 600;
  font-size: .9rem;
  letter-spacing: .02em;
  padding: .7rem 1.3rem;
  border-radius: 999px;
  transition: transform .15s ease, background .2s ease;
}
.pg-boton a::after { content: "\2197"; color: var(--naranja-claro); }
.pg-boton a:hover { background: var(--coop); transform: translateY(-1px); }

/* ---------- Portada ---------- */
.hoja--portada, .hoja--cierre {
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 100%;
  gap: 0;
}
.pg-portada, .pg-cierre {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  padding: 1rem;
  background:
    radial-gradient(70% 55% at 50% 42%, rgba(31,122,94,.09), transparent 70%);
}
.pg-portada__logo img, .pg-cierre__logo img {
  width: clamp(120px, 34%, 200px);
  height: auto;
  margin-bottom: 1.6rem;
}
.pg-portada__pre {
  margin: 0 0 .5rem;
  font-size: clamp(.66rem, 1.5vw, .8rem);
  font-weight: 600;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--coop);
}
.pg-portada__titulo {
  margin: 0;
  font-family: var(--fuente-display);
  font-optical-sizing: auto;
  font-weight: 900;
  font-size: clamp(2.6rem, 8vw, 4.2rem);
  letter-spacing: -.01em;
  line-height: .95;
  color: var(--ink);
}
.pg-portada__anios {
  margin: 1.6rem 0 0;
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  font-family: var(--fuente-display);
  font-style: italic;
  font-size: clamp(.95rem, 2.2vw, 1.2rem);
  color: var(--naranja);
  padding: .45rem 1.2rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.pg-portada__anios i { color: var(--ink-soft); font-style: normal; }

/* ---------- Contraportada ---------- */
.pg-cierre__logo img { width: clamp(100px, 28%, 170px); }
.pg-cierre__lema {
  margin: 1.4rem 0 0;
  font-family: var(--fuente-display);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(1.2rem, 3.4vw, 1.9rem);
  line-height: 1.25;
  color: var(--ink);
  max-width: 22ch;
}

/* ---------- Controles de navegación ---------- */
.revista-nav {
  position: fixed;
  bottom: 1.3rem;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: rgba(9, 32, 29, .72);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(217,178,94,.25);
  padding: .4rem .5rem;
  border-radius: 999px;
  z-index: 20;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.6);
}
.revista-nav__btn {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #f0e7d4;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.revista-nav__btn:hover { background: var(--naranja); color: var(--stage); }
.revista-nav__btn:disabled { opacity: .3; cursor: default; }
.revista-nav__btn:focus-visible { outline: 2px solid var(--naranja-claro); outline-offset: 2px; }
.revista-nav__indicador {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: #e9dfc9;
  min-width: 3.6rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ---------- Pie ---------- */
.revista-pie {
  text-align: center;
  padding: 1.2rem 1rem 1.5rem;
  color: #cdbf9f;
}
.revista-pie p {
  margin: 0;
  font-family: var(--fuente-display);
  font-style: italic;
  font-size: clamp(.95rem, 2vw, 1.15rem);
  color: #efe4cd;
}
.revista-pie__anios {
  display: block;
  margin-top: .3rem;
  font-size: .72rem;
  letter-spacing: .2em;
  color: var(--naranja-claro);
  opacity: .8;
}

/* ---------- Cargando ---------- */
.flipbook:not(.listo) { min-height: 60vh; }
.flipbook:not(.listo) .page { opacity: 0; }

/* ---------- Responsivo ---------- */
@media (max-width: 720px) {
  .revista-top { padding-top: 1.2rem; }
  .page__contenido { padding: 1.4rem 1.35rem; }
  .revista-nav { bottom: .9rem; }
}

/* ---------- Accesibilidad: menos movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
