/* Libritos ZP — product detail page
   Place at: static/css/lzp-product-detail.css
   Replaces lzp-image-overlay.css (overlay styles are included below).
   Load AFTER lzp-refresh.css so these rules win. */

/* ---------- 1. Hero: tighter title, sticky cover ---------- */

.lzp-refresh.lzp-detail .lzp-detail-panel h1 {
  font-size: clamp(1.75rem, 2.6vw, 2.4rem);
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

@media (min-width: 992px) {
  .lzp-refresh.lzp-detail .lzp-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: clamp(2rem, 4vw, 3.5rem);
    align-items: start;
  }

  /* Cover follows you while the purchase panel scrolls — no empty column */
  .lzp-refresh.lzp-detail .lzp-detail-gallery {
    position: sticky;
    top: 130px; /* clears the sticky site header */
    align-self: start;
  }
}

/* ---------- 2. Image overlay ---------- */

.lzp-detail-stage {
  position: relative;
  overflow: hidden;
}

.lzp-stage-overlay {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
  padding: clamp(0.75rem, 2.5vw, 1.25rem) clamp(0.9rem, 3vw, 1.5rem);
  color: #fff;
  font-weight: 600;
  font-size: clamp(0.85rem, 1.6vw, 1rem);
  line-height: 1.35;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.lzp-stage-overlay[hidden] { display: none; }

.lzp-stage-overlay--bottom {
  bottom: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.4) 60%, rgba(0, 0, 0, 0));
  padding-top: clamp(1.75rem, 5vw, 2.75rem);
}

.lzp-stage-overlay--top {
  top: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.4) 60%, rgba(0, 0, 0, 0));
  padding-bottom: clamp(1.75rem, 5vw, 2.75rem);
}

/* ---------- 3. Story section: one centered column ---------- */

.lzp-refresh .lzp-story {
  padding: clamp(2.5rem, 6vw, 4.5rem) 0;
}

.lzp-refresh .lzp-story-head,
.lzp-refresh .lzp-story-body {
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
}

.lzp-refresh .lzp-story-head {
  text-align: center;
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.lzp-refresh .lzp-story-head h2 {
  margin: 0.5rem 0 0.4rem;
}

.lzp-refresh .lzp-story-head p {
  margin: 0;
  opacity: 0.75;
}

.lzp-refresh .lzp-story-body {
  font-size: 1.02rem;
  line-height: 1.65;
}

.lzp-refresh .lzp-story-body h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: clamp(1.4rem, 2.4vw, 1.75rem);
}

.lzp-refresh .lzp-story-body h3 {
  margin: 2rem 0 0.6rem;
  font-size: clamp(1.1rem, 1.8vw, 1.25rem);
}

.lzp-refresh .lzp-story-body ul {
  padding-left: 1.2rem;
}

.lzp-refresh .lzp-story-body li + li {
  margin-top: 0.35rem;
}

/* ---------- 4. Category tables ---------- */

.lzp-refresh .lzp-story-body table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0.5rem 0 1.25rem;
  font-size: 0.95rem;
  background: #fff;
  border: 1px solid rgba(46, 26, 71, 0.12);
  border-radius: 14px;
  overflow: hidden;
}

/* Stop words from splitting mid-word ("Puzz-les", "Herramienta-s") */
.lzp-refresh .lzp-story-body th,
.lzp-refresh .lzp-story-body td {
  word-break: normal;
  overflow-wrap: normal;
  hyphens: manual;
  padding: 0.7rem 0.9rem;
  vertical-align: top;
  text-align: left;
  border-bottom: 1px solid rgba(46, 26, 71, 0.08);
}

.lzp-refresh .lzp-story-body tr:last-child td { border-bottom: 0; }

.lzp-refresh .lzp-story-body th {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(46, 26, 71, 0.05);
  white-space: nowrap;
}

.lzp-refresh .lzp-story-body tbody tr:nth-child(even) td {
  background: rgba(46, 26, 71, 0.025);
}

/* Category | Puzzles | Sample words */
.lzp-refresh .lzp-story-body td:first-child {
  width: 30%;
  font-weight: 600;
}

.lzp-refresh .lzp-story-body td:first-child em {
  display: block; /* Spanish name on its own line, never broken */
  font-weight: 400;
  opacity: 0.75;
}

.lzp-refresh .lzp-story-body th:nth-child(2),
.lzp-refresh .lzp-story-body td:nth-child(2) {
  width: 1%;
  white-space: nowrap;
  text-align: center;
}

/* Mobile: each row becomes a small card */
@media (max-width: 640px) {
  .lzp-refresh .lzp-story-body table,
  .lzp-refresh .lzp-story-body tbody,
  .lzp-refresh .lzp-story-body tr,
  .lzp-refresh .lzp-story-body td {
    display: block;
    width: 100%;
  }

  .lzp-refresh .lzp-story-body thead { display: none; }

  .lzp-refresh .lzp-story-body tr {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid rgba(46, 26, 71, 0.08);
  }

  .lzp-refresh .lzp-story-body tr:last-child { border-bottom: 0; }

  .lzp-refresh .lzp-story-body td {
    padding: 0.15rem 0;
    border: 0;
    background: none !important;
    text-align: left;
  }

  .lzp-refresh .lzp-story-body td:first-child em {
    display: inline;
  }

  .lzp-refresh .lzp-story-body td:first-child em::before {
    content: "· ";
  }

  .lzp-refresh .lzp-story-body td:nth-child(2) {
    font-size: 0.8rem;
    opacity: 0.7;
  }

  .lzp-refresh .lzp-story-body td:nth-child(2)::before { content: "Puzzles: "; }
  html[lang="es"] .lzp-refresh .lzp-story-body td:nth-child(2)::before { content: "Sopas de letras: "; }
}
