/* Now City's layer over the Studio design system (/ds/ds.css). The system supplies the serif name
   (ds-brand--serif), the grouped menu, the footer mark, the bottom sheet, and square map chrome; what stays here is
   Now City's own: titles in the serif, a header across the full width of the window (the maps are full-bleed),
   the chapter links for when the book is published, and how its two map pages sit under the sheet. */

:root { --ds-font-title: var(--ds-font-serif); }
.nc-header .ds-container { max-width: none; }

/* Book chapters (shown once the book is published): the chapter count above the title, previous and next below. */
.nc-pager { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--ds-gap); max-width: var(--ds-measure); margin-top: var(--ds-space-12); padding-top: var(--ds-space-6); border-top: 1px solid var(--ds-rule); }
.nc-pager a { display: flex; flex-direction: column; gap: var(--ds-space-1); color: var(--ds-heading); text-decoration: none; }
.nc-pager a:hover .nc-pager__title { text-decoration: underline; text-underline-offset: 0.25em; }
.nc-pager__dir { font-size: var(--ds-text-sm); color: var(--ds-text); }
.nc-pager__title { font-weight: var(--ds-weight-strong); }
.nc-pager__next { grid-column: 2; text-align: right; align-items: flex-end; }
.nc-chapter-count { margin: 0 0 var(--ds-space-2); font-size: var(--ds-text-ui); color: var(--ds-text); }
.nc-contents { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ds-rule); }
.nc-contents li { padding-block: var(--ds-space-5); border-bottom: 1px solid var(--ds-rule); }
.nc-contents li + li { margin-top: 0; }
.nc-contents a { font-size: var(--ds-text-lg); font-weight: var(--ds-weight-strong); }

/* The two map pages under the system's bottom sheet on phones: the old handle and collapse buttons give way to
   the sheet's grab bar, the map fills the phone, and the overview's sections stay shown as the sheet rises. */
@media (max-width: 720px) {
  .ds-sheet-on .sheet-handle, .ds-sheet-on .sidebar-collapse, .ds-sheet-on .sidebar-expand { display: none !important; }
  .ds-sheet-on #map { left: 0 !important; bottom: 0 !important; }
  .ds-sheet-on .sidebar.ds-sheet .sidebar-inner { padding-top: 4px; }
  body.sidebar-collapsed .sidebar.ds-sheet .sidebar-inner > section:not([hidden]) { display: block; }
  body.sidebar-collapsed .sidebar.ds-sheet .sidebar-header h1::after { content: none; }
}
