/* Approved option B: the original cover beside the story explainer.
   Scoped to this section; the hero, chapter cards, reader, and forms are unchanged. */
.story-cover-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: clamp(28px, 4.6vw, 64px);
  margin: 18px 0 42px;
}

.story-cover-layout .story-cover {
  width: 100%;
  max-width: 360px;
  min-width: 0;
  margin: 0 auto;
}

.story-cover-layout .story-cover img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: 0 18px 34px #0006;
}

.story-cover-layout .explainer {
  min-width: 0;
  margin: 0;
  padding: 27px 0 12px;
  border: 0;
  border-top: 1px solid var(--gold);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.story-cover-layout .explainer > h2 {
  margin: 0 0 6px;
}

.story-cover-layout .steps {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.story-cover-layout .story-step {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 20px;
  padding: 21px 0;
}

.story-cover-layout .steps > div + div {
  padding-left: 0;
  border-left: 0;
  border-top: 1px solid var(--line);
}

.story-cover-layout .story-step-icon {
  display: block;
  width: 40px;
  height: 40px;
  margin-top: 2px;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 960px) {
  .story-cover-layout {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 30px;
  }

  .story-cover-layout .explainer > h2 {
    font-size: 31px;
  }

  .story-cover-layout .story-step {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 15px;
    padding: 18px 0;
  }

  .story-cover-layout .story-step-icon {
    width: 34px;
    height: 34px;
  }
}

@media (max-width: 700px) {
  .story-cover-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 30px;
    margin: 12px 0 32px;
  }

  .story-cover-layout .story-cover {
    width: min(100%, 320px);
  }

  .story-cover-layout .explainer {
    padding-top: 24px;
  }

  .story-cover-layout .explainer > h2 {
    font-size: 29px;
  }

  .story-cover-layout .story-step {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 16px;
    padding: 20px 0;
  }
}

/* Cover detail viewer. Native dialog keeps the rest of the page inert. */
.story-cover-button {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--paper);
  cursor: zoom-in;
}
.story-cover-expand {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: #101211e8;
  color: var(--gold);
  font-size: 25px;
  line-height: 1;
}
.story-cover figcaption {
  margin-top: 10px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
html.cover-modal-open { overflow: hidden; }
.cover-dialog {
  width: min(1120px, calc(100vw - 28px));
  max-width: none;
  height: calc(100vh - 28px);
  height: calc(100dvh - 28px);
  max-height: 1100px;
  padding: 0;
  overflow: hidden;
  background: #101211;
}
.cover-dialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.cover-dialog::backdrop { background: #000e; }
.cover-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 12px;
  padding: 10px 16px 8px;
  border-bottom: 1px solid var(--line);
}
.cover-toolbar h2 {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.4;
  font-weight: 400;
}
.cover-close {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--paper);
  font-size: 30px;
  line-height: 1;
}
.cover-controls {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}
.cover-controls .language-bar { padding: 0; gap: 4px; }
.cover-controls .language-bar button, .cover-zoom { min-height: 44px; }
.cover-zoom {
  padding: 7px 13px;
  color: var(--gold);
  background: #20251f;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 13px;
}
.cover-viewport {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y pinch-zoom;
  scrollbar-color: var(--line) #101211;
  background: #090b0a;
}
.cover-viewport:focus-visible { outline-offset: -3px; }
.cover-viewport img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.cover-viewport.is-zoomed img {
  width: var(--cover-detail-width, 1024px);
  height: auto;
  max-width: none;
  max-height: none;
  margin: 0 auto;
}
.cover-dialog .cover-hint {
  margin: 0;
  padding: 10px 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
@media (max-width: 480px) {
  .cover-dialog {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
    height: calc(100dvh - 16px);
  }
  .cover-toolbar { padding: 8px 10px; gap: 2px 8px; }
  .cover-toolbar h2 { font-size: 13px; }
  .cover-dialog .cover-hint { padding: 8px 10px; }
}
