/* A real flex item constrains the scrollable category list inside <details>.
   display:contents on details lets its anonymous content box overflow. */
@media (min-width:701px) {
  .reading-nav > .category-picker {
    display:block!important;
    flex:1 1 0%;
    min-width:0;
    margin:0;
  }
  .reading-nav .category-picker .category-nav {
    width:100%;
    min-width:0;
    max-width:100%;
    padding:7px 6px;
    scroll-padding-inline:6px;
    overscroll-behavior-x:contain;
    scrollbar-width:thin;
    scrollbar-color:var(--muted) transparent;
  }
  .reading-nav .category-nav::-webkit-scrollbar {display:block;height:3px}
  .reading-nav .category-nav::-webkit-scrollbar-thumb {background:var(--muted)}
  .reading-nav {padding-block:7px}
  .reading-nav .category-nav button:focus-visible {outline-offset:3px}
}

/* Keep metadata together above a generous gallery at intermediate widths. */
@media (min-width:701px) and (max-width:1050px) {
  .case {grid-template-columns:minmax(0,1fr) minmax(0,2fr);gap:24px 32px;padding-block:24px 48px}
  .case-heading,.case-story {position:static;min-width:0}
  .case-heading h2 {font-size:16px}
  .case-story {font-size:15px;padding-right:0;max-width:620px}
  .case-gallery {grid-column:1/-1;min-width:0}
}

/* An unpaired image fills its row without cropping the original. */
.case-gallery > .gallery-fill, .chapter-gallery > .gallery-fill {
  grid-column:1/-1!important;
  aspect-ratio:auto!important;
}
.gallery-fill img {height:auto!important;object-fit:contain}
