/* poesia.css — hereda variables de style.css */

/* CONTENIDO */
.poesia-content {
  padding-top: 90px;
  padding-left: 2rem;
  padding-right: 2rem;
  min-height: 100vh;
  padding-bottom: 3rem;
}

/* CABECERA */
.poesia-header {
  margin-bottom: 3rem;
}

.poesia-header h1 {
  font-size: 2.5rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--ocre);
  margin-bottom: 0.4rem;
}

.poesia-header p {
  opacity: 0.45;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
}

/* CARD LIBRO */
.poesia-card {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  background: var(--negro);
  margin: 0;
  transition: transform var(--transicion);
}

.poesia-card:hover {
  transform: translateY(-5px);
}

.poesia-card img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
  transition:
    transform 0.5s ease,
    opacity 0.5s ease;
  opacity: 0.85;
}

.poesia-card:hover img {
  transform: scale(1.05);
  opacity: 1;
}

/* PLACEHOLDER SIN IMAGEN */
.book-img-placeholder {
  width: 100%;
  aspect-ratio: 2 / 3;
  background-color: #1a1a1a;
}

/* CAPTION */
.poesia-card figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.95) 0%,
    rgba(0, 0, 0, 0.6) 50%,
    rgba(0, 0, 0, 0) 100%
  );
}

.poesia-card h3 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
  font-weight: 400;
  color: var(--ocre);
  letter-spacing: 0.03em;
}

.poesia-card span {
  font-size: 0.78rem;
  opacity: 0.5;
  color: var(--blanco);
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .poesia-header h1 {
    font-size: 2rem;
  }
}

/* OVERLAY */
#book-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.25s ease;
}

#book-modal-overlay.active {
  opacity: 1;
}

/* MODAL */
.poesia-modal {
  width: 80%; /* era 90% */
  max-width: 820px; /* era 1100px */
  height: 85vh;
  background: #0e0e0e;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* BOTÓN CERRAR */
.poesia-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: white;
  cursor: pointer;
  opacity: 0.6;
}

.poesia-modal-close:hover {
  opacity: 1;
}

/* GRID */
.poesia-modal-grid {
  display: grid;
  grid-template-columns: 240px 1fr; /* era 280px */
  height: 100%;
}

/* SIDEBAR */
.poesia-sidebar {
  padding: 1.5rem;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  overflow-y: auto;
}

.poesia-sidebar img {
  width: 100%;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.poesia-sidebar h2 {
  font-size: 1.1rem;
  color: var(--ocre);
  margin-bottom: 0.2rem;
}

.poesia-sidebar span {
  font-size: 0.8rem;
  opacity: 0.5;
}

.poesia-resena {
  font-size: 0.85rem;
  opacity: 0.7;
  margin: 1rem 0;
}

.poesia-sidebar a {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--ocre);
}

/* LISTA */
.poesia-lista {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.poema-item {
  padding: 0.4rem 0;
  cursor: pointer;
  font-size: 0.85rem;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.poema-item:hover,
.poema-item.active {
  opacity: 1;
}

/* VISOR */
.poesia-viewer {
  padding: 2rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  max-width: 400px; /* ← agrega esto */
}

.poema-placeholder {
  opacity: 0.4;
}

/* TEXTO POEMA */
.poema-titulo {
  margin-bottom: 1.5rem;
  font-weight: 400;
  color: var(--ocre);
}

.poema-texto {
  max-width: 480px; /* ajusta este valor a tu gusto */
  line-height: 1.8;
  font-family: serif;
  font-size: 0.95rem;
  white-space: pre-wrap;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .poesia-modal-grid {
    grid-template-columns: 1fr;
  }

  .poesia-sidebar {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }
}

/* Scrollbar personalizada */
.poesia-viewer::-webkit-scrollbar,
.poesia-sidebar::-webkit-scrollbar {
  width: 4px;
}

.poesia-viewer::-webkit-scrollbar-track,
.poesia-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.poesia-viewer::-webkit-scrollbar-thumb,
.poesia-sidebar::-webkit-scrollbar-thumb {
  background: rgba(176, 125, 43, 0.3); /* ocre suave */
  border-radius: 2px;
}

.poesia-viewer::-webkit-scrollbar-thumb:hover,
.poesia-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(176, 125, 43, 0.7);
}
