/* ===== Revista Circuito Seguro (/revista): portadas y flipbook en ventana (StPageFlip) ===== */

.revista-section {
  padding: 80px 0 100px;
  background-color: #f9f9f9;
}

.revista-encabezado {
  max-width: 720px;
  margin: 0 auto 40px;
  text-align: center;
}

.revista-ejemplar {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ap-verde-corporativo, #014536);
}

.revista-tema {
  margin: 0 0 16px;
  font-size: 32px;
  line-height: 1.25;
}

.revista-texto {
  margin: 0;
  font-size: 17px;
  line-height: 1.6;
  color: #666;
}

/* Portadas: una tarjeta por ejemplar, el más nuevo primero */
.revista-tarjetas {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;
  max-width: 760px;
  margin: 0 auto;
}

.revista-tarjeta {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  scroll-margin-top: 100px;
}

.revista-portada {
  position: relative;
  display: block;
  width: 100%;
  margin: 0 auto 22px;
  border-radius: 6px;
  overflow: hidden;
  background-color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.revista-portada:hover,
.revista-portada:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.26);
}

.revista-portada img {
  display: block;
  width: 100%;
  height: auto;
}

.revista-portada__hojear {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  padding: 8px 22px;
  border-radius: 999px;
  background-color: var(--ap-verde-corporativo, #014536);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

.revista-titulo {
  margin: 0 0 18px;
  flex: 1;
  font-size: 20px;
  line-height: 1.3;
}

/* Ventana con la revista */
html.revista-abierta {
  overflow: hidden;
}

.revista-modal {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background-color: rgba(10, 18, 15, 0.88);
  overflow: auto;
}

.revista-modal[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.revista-modal::backdrop {
  background-color: rgba(10, 18, 15, 0.88);
}

.revista-modal__caja {
  width: min(100% - 24px, max(300px, calc((100vh - 190px) * 1.348)));
  margin: auto;
  padding: 12px 0;
}

.revista-modal__barra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.revista-modal__titulo {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: #fff;
}

.revista-modal__cerrar {
  flex: none;
  padding: 6px 14px;
  font-size: 15px;
}

.revista-visor {
  width: 100%;
}

.revista-libro {
  margin: 0 auto;
}

.revista-pagina {
  background-color: #fff;
  overflow: hidden;
}

.revista-pagina img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

.revista-controles {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.revista-boton {
  padding: 10px 20px;
  border: 2px solid var(--ap-verde-corporativo, #014536);
  border-radius: 8px;
  background-color: #fff;
  color: var(--ap-verde-corporativo, #014536);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.revista-boton:hover:not(:disabled) {
  background-color: var(--ap-verde-corporativo, #014536);
  color: #fff;
}

.revista-boton:disabled {
  opacity: 0.35;
  cursor: default;
}

.revista-contador {
  min-width: 70px;
  font-weight: 600;
  text-align: center;
  color: #fff;
}

.revista-ayuda {
  margin: 12px 0 0;
  font-size: 14px;
  color: #c9d1cd;
  text-align: center;
}

@media (max-width: 768px) {
  .revista-section {
    padding: 50px 0 60px;
  }

  .revista-tema {
    font-size: 24px;
  }

  .revista-texto {
    font-size: 16px;
  }

  .revista-tarjetas {
    gap: 16px;
  }

  .revista-titulo {
    font-size: 15px;
    margin-bottom: 14px;
  }

  .revista-ejemplar {
    font-size: 12px;
  }

  .revista-portada__hojear {
    bottom: 10px;
    padding: 6px 16px;
    font-size: 13px;
  }

  /* El botón de descarga cabe en media pantalla */
  .revista-descargar {
    padding: 12px 14px;
    font-size: 13px;
  }

  .revista-descargar .icon-right-arrow {
    display: none;
  }

  .revista-boton {
    padding: 8px 14px;
    font-size: 15px;
  }

  .revista-ayuda {
    font-size: 13px;
  }
}
