/* Porivela C01–C07. Shared by the four existing book editions. */
.chapter-picker { display: none; }
.chapter-arrow svg { display: block; }
.reader-tools button { min-width: 48px; width: 48px; height: 48px; padding: 0; }
.reader-overlay {
  height: 100dvh;
  max-height: 100dvh;
}
.reader-header, .reader-progress, .reader-mobile-select { flex-shrink: 0; }

@media (max-width: 820px) {
  .site-header .main-nav:not(.is-open), .site-header .main-nav:not(.is-open) * {
    visibility: hidden;
    pointer-events: none;
  }
  .main-nav.is-open { visibility: visible; }
  .chapter-picker {
    display: grid;
    gap: 8px;
    min-width: 0;
    order: 0;
  }
  .chapter-picker label {
    color: var(--muted);
    font: 12px/1.4 var(--font-sans);
    letter-spacing: .08em;
    text-transform: uppercase;
  }
  .chapter-picker select {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--paper-light);
    color: var(--ink);
    padding: 10px 12px;
    font: 17px/1.4 var(--font-serif);
    text-overflow: ellipsis;
  }
  .toc-layout { gap: 12px; min-width: 0; }
  .toc-layout .chapter-list { display: none; }
  .toc-layout .chapter-preview {
    order: 1;
    min-width: 0;
    min-height: 0;
    padding: 24px;
  }
  .chapter-preview .preview-number { top: 16px; right: 20px; font-size: 64px; }
  .chapter-preview .preview-label { margin-bottom: 18px; }
  .chapter-preview h3 { font-size: clamp(27px, 6vw, 38px); }
  .chapter-preview > p:not(.preview-label) { margin-top: 16px; font-size: 15px; line-height: 1.5; }
  .chapter-preview blockquote { margin-top: 16px; padding-top: 14px; font-size: 17px; line-height: 1.4; }
  .chapter-preview .preview-read-button { min-height: 48px; margin-top: 14px; }
  .chapter-preview .chapter-dots { display: none; }
  .reader-pane { min-height: 0; overscroll-behavior: contain; }
  .reader-tools { flex-shrink: 0; }
  .reader-tools .reader-close { margin-left: 0; }
}

@media (max-width: 560px) {
  .section-heading > div { min-width: 0; max-width: 100%; }
  .gallery-section .section-heading h2 { font-size: clamp(32px, 10vw, 44px); }
  .gallery-grid { grid-auto-rows: auto; }
  .gallery-grid .gallery-card { grid-area: auto; height: auto; min-width: 0; }
  .gallery-grid .gallery-card img { display: block; width: 100%; height: auto; object-fit: contain; }
  .gallery-grid .gallery-card span {
    position: static;
    background: var(--ink-blue);
    padding: 14px 16px;
    font-size: 18px;
    line-height: 1.35;
    text-align: left;
  }
  .gallery-grid .gallery-card:hover img, .gallery-grid .gallery-card:focus-visible img { transform: none; }
  .reader-header { gap: 6px; padding-inline: 12px; }
  .reader-header > div:first-child { min-width: 0; }
  .reader-world-link { gap: 6px; font-size: 16px; }
  .reader-tools { gap: 4px; }
  .reader-tools button { min-width: 44px; width: 44px; height: 44px; }
}

@media (min-width: 360px) and (max-width: 560px) {
  .reader-tools button { min-width: 48px; width: 48px; height: 48px; }
}

