/* ─────────────────────────────────────────────────────────
   DESNUDAS LETRAS — /poemas carousel
   Mobile-first. Full-viewport poem card experience.
   ───────────────────────────────────────────────────────── */

:root {
  --dark:          #0e0e0e;
  --wine:          #3a0d1a;
  --gold:          #c9a84c;
  --gold2:         #e8d5a3;
  --cream:         #f5ecd7;
  --muted:         #7a6a5a;
  --surface:       #161210;
  --border:        rgba(201,168,76,0.2);
  --header-h:      52px;
  --footer-h:      76px;
  --dots-h:        32px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--dark);
  color: var(--cream);
  font-family: 'Jost', sans-serif;
}

/* ── CAROUSEL SCREEN ─────────────────────────────────────── */

#carousel-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* No overflow:hidden here — that would clip the SEO section.
     Card clipping is handled by #carousel-root below. */
}

/* ── PAGE HEADER ─────────────────────────────────────────── */

#page-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(16px, 3vh, 36px) clamp(20px, 5vw, 72px);
}

.header-logo-link {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  width: 36px;
}

.header-logo {
  height: 36px;
  width: auto;
  display: block;
  opacity: 0.9;
}

.header-title {
  font-family: 'Cinzel', serif;
  font-size: 11.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

/* Balances the logo on the right so the title stays truly centered */
.header-logo-spacer {
  flex: 0 0 auto;
  width: 36px;
}

/* ── CAROUSEL ROOT ───────────────────────────────────────── */

#carousel-root {
  position: relative;
  /* Scales with viewport height: comfortable on any screen size.
     clamp(min, preferred, max) → 380px on very short, 560px max */
  height: clamp(380px, 62vh, 560px);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── CARD TRACK ──────────────────────────────────────────── */

#card-track {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── POEM CARD ───────────────────────────────────────────── */

.poem-card {
  position: absolute;
  width: 78vw;
  max-width: 420px;

  height: clamp(380px, 62vh, 560px);
  min-height: 300px;

  background: var(--surface);
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: 20px;

  display: flex;
  flex-direction: column;
  padding: 24px 22px 20px;

  /* default state: hidden off to the right */
  transform: translateX(110%) scale(0.9);
  opacity: 0;
  transition:
    transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    opacity   0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    box-shadow 0.45s ease,
    border-color 0.45s ease;
  pointer-events: none;
  user-select: none;
  /* No will-change here — it creates stacking contexts that swallow z-index */
}

/* Active card — stands out with glow + stronger border */
.poem-card.is-active {
  transform: translateX(0) scale(1);
  opacity: 1;
  pointer-events: auto;
  user-select: text;
  border-color: rgba(201,168,76,0.5);
  box-shadow:
    /* outer drop shadow for depth */
    0 12px 48px rgba(0,0,0,0.7),
    /* gold halo around the card */
    0 0 0 1px rgba(201,168,76,0.08),
    /* top-edge inner glow — warm gold light source from above */
    inset 0 1px 0 rgba(201,168,76,0.35),
    /* subtle inner radial warmth */
    inset 0 0 40px rgba(201,168,76,0.04);
}

/* Peek cards */
.poem-card.is-prev {
  transform: translateX(-106%) scale(0.88);
  opacity: 0.2;
}

.poem-card.is-next {
  transform: translateX(106%) scale(0.88);
  opacity: 0.2;
}

/* ── CARD EYEBROW ────────────────────────────────────────── */

.card-eyebrow {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.65;
  margin-bottom: 12px;
  flex-shrink: 0;
}

/* ── CARD TITLE ROW ──────────────────────────────────────── */

.card-title-row {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}

.poem-name {
  flex: 1;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: clamp(20px, 5.5vw, 27px);
  line-height: 1.2;
  color: var(--cream);
  letter-spacing: 0.01em;
}

/* ── SHARE BUTTON ────────────────────────────────────────── */

.share-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: none;
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  padding: 0;
  margin-top: 2px; /* optical align with first line of title */
}

.share-btn:hover,
.share-btn:focus-visible {
  border-color: rgba(201,168,76,0.5);
  color: var(--gold);
  background: rgba(201,168,76,0.06);
  outline: none;
}

/* Copied feedback state */
.share-btn--copied {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201,168,76,0.1);
}

/* ── CARD EXCERPT ────────────────────────────────────────── */

.card-excerpt {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 14px 0;
  border-top: 1px solid rgba(201,168,76,0.12);
  border-bottom: 1px solid rgba(201,168,76,0.12);
  margin-bottom: 16px;
}

.excerpt-text {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(15px, 4vw, 19px);
  line-height: 1.75;
  color: var(--cream);
  white-space: pre-line;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 8;
  -webkit-box-orient: vertical;
}

.excerpt-author {
  margin-top: 12px;
  font-family: 'Jost', sans-serif;
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.07em;
  color: var(--muted);
  flex-shrink: 0;
}

/* ── CARD CTA ────────────────────────────────────────────── */

.card-cta {
  flex-shrink: 0;
  margin-bottom: 12px;
}

.cta-primary {
  display: block;
  width: 100%;
  padding: 12px 16px;
  text-align: center;
  font-family: 'Jost', sans-serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.09em;
  color: var(--cream);
  border: 1px solid rgba(201,168,76,0.4);
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.cta-primary:active,
.cta-primary:hover,
.cta-primary:focus-visible {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--dark);
  outline: none;
}

/* ── PROGRESS BAR (inside card, inset from rounded corners) ─ */

.card-progress {
  position: absolute;
  bottom: 10px;       /* float above the very bottom edge */
  left: 20px;         /* inset so it never touches the rounded corners */
  right: 20px;
  height: 4px;
  background: rgba(255,255,255,0.06);  /* very muted track */
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}

.card-progress-fill {
  height: 100%;
  width: 0%;
  background: rgba(201,168,76,0.45);   /* muted gold — unobtrusive */
  border-radius: inherit;
  transition: width linear; /* duration set by JS */
}

/* Hide progress on non-active cards */
.poem-card:not(.is-active) .card-progress {
  opacity: 0;
}

/* ── SKELETON ────────────────────────────────────────────── */

.poem-card--skeleton {
  transform: translateX(0) scale(1);
  opacity: 1;
  pointer-events: none;
  border-color: rgba(201,168,76,0.15);
}

@keyframes shimmer {
  0%   { opacity: 0.25; }
  50%  { opacity: 0.45; }
  100% { opacity: 0.25; }
}

.skeleton-line,
.skeleton-btn {
  background: rgba(201,168,76,0.12);
  border-radius: 4px;
  animation: shimmer 1.6s ease-in-out infinite;
}

.skeleton-line          { height: 13px; margin-bottom: 10px; width: 100%; }
.skeleton-line--short   { width: 38%; }
.skeleton-line--medium  { width: 65%; }
.skeleton-btn           { height: 40px; border-radius: 8px; }

/* ── NAVIGATION DOTS ─────────────────────────────────────── */
/* Lives outside #carousel-root — no stacking context issues  */

#nav-dots {
  flex-shrink: 0;
  height: var(--dots-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(201,168,76,0.25);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.25s, transform 0.25s;
  flex-shrink: 0;
  /* Larger tap target without visual change */
  position: relative;
}

.nav-dot::before {
  content: '';
  position: absolute;
  inset: -8px;
}

.nav-dot.is-active {
  background: var(--gold);
  transform: scale(1.5);
}

.nav-dot:hover:not(.is-active) {
  background: rgba(201,168,76,0.55);
}

/* ── FOOTER CTA ──────────────────────────────────────────── */

#page-footer {
  flex-shrink: 0;
  height: var(--footer-h);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  background: linear-gradient(to top, rgba(14,14,14,0.95) 60%, transparent);
}

.book-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  font-family: 'Cinzel', serif;
  font-size: 10.5px;
  letter-spacing: 0.2em;
  color: var(--dark);
  background: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 6px;
  text-decoration: none;
  font-weight: 400;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
  white-space: nowrap;
  box-shadow: 0 2px 16px rgba(201,168,76,0.25);
}

.book-cta-btn:active,
.book-cta-btn:hover,
.book-cta-btn:focus-visible {
  background: var(--gold2);
  border-color: var(--gold2);
  box-shadow: 0 4px 24px rgba(201,168,76,0.4);
  outline: none;
}

/* ── SHORT SCREEN ADJUSTMENTS ────────────────────────────── */

@media (max-height: 640px) {
  :root {
    --header-h: 44px;
    --footer-h: 62px;
    --dots-h:   28px;
  }

  .poem-card {
    padding: 18px 18px 16px;
  }

  .card-eyebrow    { margin-bottom: 8px; }
  .card-title      { margin-bottom: 10px; }
  .card-excerpt    { padding: 10px 0; margin-bottom: 12px; }
  .excerpt-author  { margin-top: 8px; }
  .card-cta        { margin-bottom: 10px; }

  .excerpt-text {
    -webkit-line-clamp: 5;
  }

  .book-cta-btn {
    padding: 11px 22px;
    font-size: 10px;
  }
}

/* ── DESKTOP ADJUSTMENTS ─────────────────────────────────── */

@media (min-width: 600px) {
  .poem-card   { width: 66vw; }
  .poem-name   { font-size: 26px; }
  .excerpt-text { font-size: 18px; }
}

@media (min-width: 900px) {
  .poem-card   { width: 420px; }

  .poem-card.is-prev { opacity: 0.22; }
  .poem-card.is-next { opacity: 0.22; }
}

/* ── BOOK DESCRIPTION (SEO, below the fold) ─────────────── */

#book-description {
  padding: 40px 32px 52px;
  text-align: center;
  border-top: 1px solid rgba(201,168,76,0.1);
  /* Hidden by default on short/normal screens — accessible by scrolling */
}

.book-desc-text {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(16px, 4vw, 20px);
  line-height: 1.75;
  color: rgba(245,236,215,0.75);
  max-width: 560px;
  margin: 0 auto 16px;
}

.book-desc-attribution {
  font-family: 'Jost', sans-serif;
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* ── REDUCED MOTION ──────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .poem-card,
  .card-progress-fill {
    transition-duration: 0.01ms !important;
  }

  .skeleton-line,
  .skeleton-btn {
    animation: none;
    opacity: 0.35;
  }
}

/* ═══════════════════════════════════════════════════════════
   VERSOS SHEET — Bottom sheet / modal for email capture
   ═══════════════════════════════════════════════════════════ */

/* ── Overlay ─────────────────────────────────────────────── */

#versos-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#versos-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Sheet container ─────────────────────────────────────── */

#versos-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 201;
  background: #1a1008;
  border-radius: 24px 24px 0 0;
  padding: 0 24px 40px;
  max-height: 92dvh;
  overflow-y: auto;
  overscroll-behavior: contain;

  transform: translateY(100%);
  opacity: 0;
  visibility: hidden;
  transition:
    transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    opacity   0.35s ease,
    visibility 0s linear 0.35s;
  pointer-events: none;
}

#versos-sheet.is-open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  transition:
    transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    opacity   0.35s ease,
    visibility 0s linear 0s;
  pointer-events: auto;
}

/* Desktop modal */
@media (min-width: 768px) {
  #versos-sheet {
    left: 50%;
    right: auto;
    bottom: 50%;
    width: 480px;
    max-height: 86dvh;
    transform: translate(-50%, 100%) scale(0.95);
    border-radius: 24px;
    padding-bottom: 32px;
  }

  #versos-sheet.is-open {
    transform: translate(-50%, 50%) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  #versos-sheet,
  #versos-sheet.is-open { transition: visibility 0s linear; }
  #versos-overlay        { transition: none; }
}

/* ── Handle bar ──────────────────────────────────────────── */

.sheet-handle {
  width: 36px;
  height: 4px;
  background: rgba(201,168,76,0.25);
  border-radius: 4px;
  margin: 12px auto 20px;
}

@media (min-width: 768px) {
  .sheet-handle { display: none; }
}

/* ── Close button ────────────────────────────────────────── */

.sheet-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.sheet-close:hover,
.sheet-close:focus-visible {
  background: rgba(201,168,76,0.1);
  color: var(--gold);
  outline: none;
}

/* ── Poem header (title + chapter) ──────────────────────── */

.sheet-poem-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 18px;
  text-align: center;
  color: var(--cream);
  margin-bottom: 4px;
}

.sheet-poem-chapter {
  font-family: 'Jost', sans-serif;
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-align: center;
  color: var(--muted);
  margin-bottom: 16px;
}

.sheet-divider {
  width: 40px;
  height: 1px;
  background: var(--gold);
  opacity: 0.5;
  margin: 0 auto 20px;
}

/* ── Step panels ─────────────────────────────────────────── */

.sheet-step {
  display: none;
}

.sheet-step.is-active {
  display: block;
}

/* ── Step 1: Email capture ───────────────────────────────── */

.sheet-heading {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 400;
  text-align: center;
  color: var(--cream);
  margin-bottom: 20px;
}

.sheet-label {
  display: block;
  font-family: 'Jost', sans-serif;
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 6px;
}

.sheet-input {
  display: block;
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 8px;
  color: var(--cream);
  font-family: 'Jost', sans-serif;
  font-size: 15px;
  font-weight: 300;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 14px;
}

.sheet-input:focus {
  border-color: var(--gold);
}

.sheet-input::placeholder {
  color: var(--muted);
}

.sheet-submit {
  display: block;
  width: 100%;
  padding: 14px 16px;
  background: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 8px;
  color: var(--dark);
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, opacity 0.2s;
  margin-bottom: 12px;
}

.sheet-submit:hover,
.sheet-submit:focus-visible {
  background: var(--gold2);
  border-color: var(--gold2);
  outline: none;
}

.sheet-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.sheet-fine-print {
  font-family: 'Jost', sans-serif;
  font-size: 11px;
  font-weight: 400;
  text-align: center;
  color: rgba(245,236,215,0.6);
  margin-top: 4px;
}

.sheet-error {
  font-family: 'Jost', sans-serif;
  font-size: 12px;
  color: #c0392b;
  margin-bottom: 10px;
  display: none;
}

.sheet-error.is-visible {
  display: block;
}

/* ── Step 2: Contribution ────────────────────────────────── */

.sheet-check {
  text-align: center;
  font-size: 32px;
  color: var(--gold);
  margin-bottom: 12px;
  line-height: 1;
}

.sheet-confirm-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 400;
  text-align: center;
  color: var(--cream);
  margin-bottom: 8px;
}

.sheet-confirm-subtitle {
  font-family: 'Jost', sans-serif;
  font-size: 13px;
  font-weight: 300;
  text-align: center;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.sheet-book-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 13px 16px;
  background: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 8px;
  color: var(--dark);
  font-family: 'Cinzel', serif;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-decoration: none;
  text-align: center;
  margin-bottom: 12px;
  transition: background 0.2s;
}

.sheet-book-cta:hover { background: var(--gold2); border-color: var(--gold2); }

.sheet-contrib-divider {
  font-family: 'Jost', sans-serif;
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-align: center;
  color: var(--muted);
  margin-bottom: 12px;
  text-transform: uppercase;
}

.sheet-contrib-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.sheet-contrib-btn {
  flex: 1;
  padding: 12px 8px;
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 8px;
  color: var(--cream);
  font-family: 'Jost', sans-serif;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  text-align: center;
}

.sheet-contrib-btn:hover,
.sheet-contrib-btn:focus-visible {
  background: rgba(201,168,76,0.18);
  border-color: var(--gold);
  color: var(--gold);
  outline: none;
}

.sheet-contrib-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.sheet-custom-wrap {
  display: none;
  margin-bottom: 14px;
}

.sheet-custom-wrap.is-visible {
  display: flex;
  gap: 8px;
  align-items: center;
}

.sheet-custom-input {
  flex: 1;
  padding: 10px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 8px;
  color: var(--cream);
  font-family: 'Jost', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.sheet-custom-input:focus { border-color: var(--gold); }

.sheet-custom-confirm {
  padding: 10px 16px;
  background: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 8px;
  color: var(--dark);
  font-family: 'Jost', sans-serif;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.sheet-custom-confirm:hover { background: var(--gold2); }

.sheet-skip-link {
  display: block;
  text-align: center;
  font-family: 'Jost', sans-serif;
  font-size: 12px;
  font-weight: 300;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  background: none;
  border: none;
  width: 100%;
  padding: 6px 0;
  margin-top: 4px;
  transition: color 0.2s;
}

.sheet-skip-link:hover { color: var(--cream); }

.sheet-contrib-error {
  font-family: 'Jost', sans-serif;
  font-size: 12px;
  color: #c0392b;
  margin-bottom: 10px;
  display: none;
}

.sheet-contrib-error.is-visible { display: block; }

/* ── Stripe element inside sheet ─────────────────────────── */

#sheet-stripe-wrap {
  display: none;
  margin-bottom: 14px;
}

#sheet-stripe-wrap.is-visible { display: block; }

#sheet-stripe-element {
  padding: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 8px;
  margin-bottom: 12px;
  min-height: 44px;
}

#sheet-stripe-confirm {
  display: block;
  width: 100%;
  padding: 13px 16px;
  background: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 8px;
  color: var(--dark);
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  margin-bottom: 12px;
}

#sheet-stripe-confirm:hover { background: var(--gold2); }
#sheet-stripe-confirm:disabled { opacity: 0.6; cursor: not-allowed; }
