/* ── PAGE TOKENS ── */
:root {
  --card-bg:           #0c2535;
  --card-border:       rgba(141, 182, 188, 0.12);
  --card-hover-border: rgba(234, 162, 124, 0.45);
  --text-primary:      #e8ddd0;
}

/* ── NOISE OVERLAY ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

/* ── BANNER ── */
.poem-banner {
  position: relative;
  width: 100%;
  height: 240px;
  overflow: hidden;
  z-index: 1;
}

.poem-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  display: block;
  max-width: 100% !important;
}

.poem-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, var(--bg) 100%);
}

/* ── HERO ── */
.poem-hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 3rem 2rem 1rem;
  animation: fadeUp 0.9s ease-out both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.poem-hero-title {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  line-height: 1.15;
  color: var(--text-primary);
  max-width: 780px;
  margin: 0 auto 1.2rem;
  letter-spacing: -0.01em;
}

.poem-hero-sub {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--sand);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.poem-hero-sub::before,
.poem-hero-sub::after {
  content: '✦';
  font-size: 0.6rem;
  opacity: 0.7;
}

.poem-hero-divider {
  width: 60px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--seamid), transparent);
  margin: 1.2rem auto 0;
}

/* ── GRID WRAPPER ── */
.poem-grid-wrapper {
  position: relative;
  z-index: 1;
  padding: 2.5rem 1.5rem 4rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

/* ── MASONRY ── */
.masonry {
  columns: 2;
  column-gap: 1rem;
}

@media (max-width: 768px) { .masonry { columns: 2; } }
@media (max-width: 480px) { .masonry { columns: 1; } }

/* ══════════════════════════════════════════
   POEM CARD — works for BOTH structures
   ══════════════════════════════════════════ */
.poem-card {
  break-inside: avoid;
  margin-bottom: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  animation: fadeUp 0.6s ease-out both;
  text-align: left;
}

.poem-card:hover {
  transform: translateY(-4px);
  border-color: var(--card-hover-border);
  box-shadow: 0 12px 32px rgba(0,0,0,0.35), 0 0 0 1px rgba(234,162,124,0.1);
}

/* ── Image (both structures) ── */
.poem-card img,
.poem-card-img {
  width: 100%;
  display: block;
  object-fit: cover;
  max-height: 220px;
  cursor: zoom-in;
  transition: transform 0.3s ease;
}

.poem-card img:hover,
.poem-card-img:hover {
  transform: scale(1.02);
}

/* ── NEW structure: poem-card-body ── */
.poem-card-body {
  padding: 0.85rem 1rem 1rem;
}

.poem-card-title {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 0.3rem;
}

.poem-card-author {
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sand);
  opacity: 0.85;
}

/* ── OLD structure: h2 + .author + read-btn ── */
.poem-card h2 {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.3;
  margin: 0.85rem 1rem 0.3rem;
  border: none;
  padding: 0;
}

.poem-card .author {
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sand);
  opacity: 0.85;
  margin: 0 1rem 0.85rem;
}

/* hide read-btn visually — card itself is clickable */
.poem-card .read-btn {
  display: none;
}

/* ── SPECIAL: TITLE CARD ── */
.card.poem-card-special {
  background: linear-gradient(135deg, var(--seadark) 0%, #0a2030 100%);
  border-color: rgba(14, 137, 145, 0.3);
  cursor: default;
  padding: 1.5rem 1.2rem;
  break-inside: avoid;
  margin-bottom: 1rem;
  border-radius: 10px;
  border: 1px solid rgba(14, 137, 145, 0.3);
}

.card.poem-card-special:hover {
  transform: none;
  box-shadow: none;
  border-color: rgba(14, 137, 145, 0.3);
}

.poem-collection-label {
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--seamid);
  margin-bottom: 0.75rem;
}

.poem-collection-title {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.3rem;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.poem-collection-class {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sand);
}

/* ── SPECIAL: EDITOR CARD ── */
.card.poem-card-editor {
  background: linear-gradient(135deg, #0a1f2e 0%, var(--blue-darkest) 100%);
  border-color: rgba(234, 162, 124, 0.2);
  cursor: default;
  padding: 1.2rem;
  break-inside: avoid;
  margin-bottom: 1rem;
  border-radius: 10px;
  border: 1px solid rgba(234, 162, 124, 0.2);
}

.card.poem-card-editor:hover {
  transform: none;
  box-shadow: none;
  border-color: rgba(234, 162, 124, 0.2);
}

.poem-editor-label {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sand);
  opacity: 0.7;
  margin-bottom: 0.6rem;
}

.poem-editor-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.poem-editor-item {
  font-family: 'Playfair Display', serif;
  font-size: 0.88rem;
  color: var(--text-primary);
  opacity: 0.85;
}

.poem-editor-note {
  margin-top: 0.75rem;
  font-size: 0.62rem;
  color: var(--sealight);
  opacity: 0.5;
  line-height: 1.5;
}

/* ── STAGGER ANIMATION ── */
.poem-card:nth-child(1)  { animation-delay: 0.05s; }
.poem-card:nth-child(2)  { animation-delay: 0.10s; }
.poem-card:nth-child(3)  { animation-delay: 0.15s; }
.poem-card:nth-child(4)  { animation-delay: 0.20s; }
.poem-card:nth-child(5)  { animation-delay: 0.25s; }
.poem-card:nth-child(6)  { animation-delay: 0.30s; }
.poem-card:nth-child(7)  { animation-delay: 0.35s; }
.poem-card:nth-child(8)  { animation-delay: 0.40s; }
.poem-card:nth-child(9)  { animation-delay: 0.45s; }
.poem-card:nth-child(10) { animation-delay: 0.50s; }

/* ══════════════════════════════════════════
   POEM MODAL
   ══════════════════════════════════════════ */
#poemModal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 10, 20, 0.82);
  backdrop-filter: blur(6px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

#poemModal.show {
  display: flex;
}

.poem-modal-inner {
  background: var(--card-bg);
  border: 1px solid rgba(141, 182, 188, 0.2);
  border-radius: 14px;
  max-width: 520px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  animation: modalIn 0.25s ease-out both;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* modal image at top */
.poem-modal-img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  display: block;
  border-radius: 14px 14px 0 0;
}

.poem-modal-body {
  padding: 1.5rem 1.75rem 1.75rem;
}

#modalTitle {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.4rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

#modalAuthor {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sand);
  margin-bottom: 1.2rem;
}

.poem-modal-divider {
  height: 1px;
  background: linear-gradient(to right, var(--seamid), transparent);
  margin-bottom: 1.4rem;
}

#modalBody {
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem;
  line-height: 1.9;
  color: rgba(232, 221, 208, 0.85);
  white-space: pre-line;
}

/* close + tutup buttons */
.poem-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(0,0,0,0.35);
  border: none;
  color: white;
  font-size: 1.1rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.2s;
  z-index: 10;
}

.poem-modal-close:hover { opacity: 1; }

.poem-modal-tutup {
  display: block;
  width: 100%;
  padding: 0.75rem;
  margin-top: 1.5rem;
  background: var(--seamid);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: 'Jost', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
}

.poem-modal-tutup:hover { background: var(--seadark); }

/* ══════════════════════════════════════════
   IMAGE LIGHTBOX MODAL
   ══════════════════════════════════════════ */
#imageModal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(4px);
  z-index: 1100;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 1.5rem;
}

#imageModal.show {
  display: flex;
}

#modalImage {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  animation: modalIn 0.2s ease-out both;
}

#modalImageSource {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.05em;
  text-align: center;
}

.image-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.image-modal-close:hover { background: rgba(255,255,255,0.2); }