/* One open canvas, anchored to a shared left grid rather than the hero ratio. */
:root[data-palette="graphite"][data-scheme="light"][data-density="compact"][data-contrast="high"]{--canvas:var(--panel)}
.site-shell.nm-panel{padding:0;background:transparent;background-image:none;box-shadow:none;border:0;border-radius:0;justify-self:start;align-self:start}
.site-shell.nm-panel>.nm-layers{display:none}
.posts-frame-wrap::before,.posts-frame-wrap::after{display:none}
@media screen and (min-width:851px){
 :root{
  --sidebar-width:13.5rem;
  --mm-shell-width:min(100%,calc(var(--sidebar-width) + var(--mm-shell-gap) + var(--mm-layout-content-max)))
 }
 body{place-items:start}
 .site-shell.nm-panel{width:var(--mm-shell-width);column-gap:var(--mm-shell-gap)}
 .posts-frame-wrap .content-well,.posts-frame-wrap .content-well.nm-scroll{padding:0 0 var(--mm-content-gap)}
 .mm-reading-surface{margin:0;padding:0}
 .mm-reading-surface .entry-header h1{margin-top:0}
 .mm-welcome-art{object-position:left top}
 .mm-credits-frame{padding-top:var(--mm-content-gap)}
}

/* List padding lives here, not in theme.css. The document scrolls; the shell does not. */
.mm-view-list .posts-frame-wrap .content-well,
.mm-view-list .posts-frame-wrap .content-well.nm-scroll,
.mm-view-list #posts-frame{padding:0 0 var(--mm-content-gap);scrollbar-gutter:auto}
/* Native document scrolling; only the mobile navigation drawer is an overlay. */
html{height:auto;min-height:100%;overflow-x:hidden;overflow-y:auto}
html body{height:auto;min-height:100dvh;overflow:visible;align-content:start}
html body .site-shell.nm-panel,
html body.mm-view-welcome .site-shell.nm-panel,
html.mm-js body:not(.mm-view-welcome) .site-shell.nm-panel{height:auto;max-height:none;min-height:0;overflow:visible;grid-template-rows:auto auto}
html.mm-js body:not(.mm-view-welcome) :is(.site-shell>.page,.site-shell main,.news-section,.posts-frame-wrap),
html body.mm-view-welcome .site-shell>.page,
html body.mm-view-welcome .site-shell>.page>main{height:auto;max-height:none;overflow:visible;flex:none}
html.mm-js body:not(.mm-view-welcome) .content-well.nm-scroll,
html body .posts-frame-wrap .content-well{height:auto;max-height:none;min-height:0;overflow:visible;flex:none;contain:none;clip-path:none}
html body #posts-frame.mm-welcome-well,
html body .mm-welcome-figure,html body .mm-welcome-art{height:auto;max-height:none}
.site-shell>.sidebar{overflow:visible;align-self:start;max-height:none}
.sidebar-search{margin:0 var(--mm-ui-inline) 1.5rem;min-width:0}
.sidebar-search .mm-search{width:100%;flex:1 1 auto;max-width:100%}
.sidebar-search .search-page-link{display:none}
.sidebar-credits{display:grid;gap:.25rem;margin:1.5rem var(--mm-ui-inline) 0;color:var(--text-secondary);font-size:.75rem;font-weight:400;line-height:1.5}
.site-shell>.pagination-slot{grid-column:2;grid-row:2;margin:0;padding:var(--mm-content-gap) 0 0;display:block;background:transparent;box-shadow:none}
.site-shell>.pagination-slot:empty{display:none}
.pagination-slot>.pagination{display:flex;justify-content:flex-start;width:auto;max-width:100%;flex-wrap:wrap}
.mobile-search-link{display:none}
@media(min-width:851px){
 body.search .page .posts-toolbar{display:flex}
 .mm-view-welcome .posts-frame-wrap{flex:none}
}
@media(max-width:850px){
 .sidebar-search{display:none}
 .mobile-header>a:first-child{margin-inline-end:auto}
 .mobile-search-link{display:inline-grid;place-items:center;flex:none;width:var(--mm-ui-height);height:var(--mm-ui-height)}
 .site-shell>.sidebar{overflow:auto;max-height:calc(100dvh - 2 * var(--site-gutter))}
 .site-shell>.pagination-slot{padding-top:var(--mm-content-gap)}
}
@media print{.sidebar-credits,.sidebar-search,.mobile-search-link,.pagination-slot{display:none!important}}
html.mm-js body:not(.mm-view-welcome) #posts-frame.content-well{height:auto;max-height:none;overflow:visible;contain:none;clip-path:none}

.sidebar .primary-navigation{gap:var(--space-1)}

/* Keep desktop navigation in view while the document scrolls normally. */
@media(min-width:851px){
 html body .site-shell>.sidebar{
  position:sticky;top:var(--site-gutter);align-self:start;
  max-height:calc(100dvh - 2 * var(--site-gutter));overflow-y:auto;overflow-x:hidden
 }
 body.admin-bar .site-shell>.sidebar{top:calc(32px + var(--site-gutter));max-height:calc(100dvh - 32px - 2 * var(--site-gutter))}
}
@media(min-width:851px){html body.mm-view-welcome{padding-bottom:0}}

/* Keep the desktop category row at its original top gutter while scrolling. */
.news-section{--mm-toolbar-top:max(0px,calc(var(--site-gutter) - var(--mm-ui-gap)))}
@media(max-width:850px){.news-section{--mm-toolbar-top:0px}}
.news-section>.posts-toolbar:has(.category-browser){
 position:sticky;top:var(--mm-toolbar-top);z-index:20;background:var(--panel);
 padding-block:var(--mm-ui-gap);margin-top:calc(-1 * var(--mm-ui-gap))
}
body.admin-bar .news-section>.posts-toolbar:has(.category-browser){top:calc(32px + var(--mm-toolbar-top))}
@media(max-width:782px){body.admin-bar .news-section>.posts-toolbar:has(.category-browser){top:calc(46px + var(--mm-toolbar-top))}}

.news-section>.posts-toolbar:has(.category-browser)::before{content:"";position:absolute;inset-inline:0;bottom:100%;height:var(--mm-toolbar-top);background:inherit;pointer-events:none}

/* The homepage uses the same content column and outer gutter as other routes. */
@media(min-width:851px){
 html body.mm-view-welcome{padding-right:var(--site-gutter)}
}

/* Remove obsolete shadow gutters: identical sidebar origin on every route. */
@media(min-width:851px){
 html body .site-shell>#sidebar{margin:0;padding:0;align-self:start}
}

/* Fit the complete engraving within both the content width and viewport height. */
@media(min-width:851px){
 html body.mm-view-welcome{padding-top:0;padding-bottom:0}
 html body.mm-view-welcome .mm-welcome-art{
  width:auto;height:auto;max-width:min(100%,var(--mm-content-width));max-height:var(--mm-welcome-max-height);
  object-fit:contain;object-position:left top
 }
 html body.mm-view-welcome.admin-bar{--mm-welcome-max-height:calc(100dvh - 32px)}
 html body.mm-view-welcome #posts-frame.mm-welcome-well{overflow:visible}
}

/* Give the navigation and content distinct breathing room on desktop. */
@media(min-width:851px){:root{--mm-shell-gap:clamp(2rem,2.5vw,4.5rem)}}

/* Brand and menu share the available height at every desktop size. */
@media screen and (min-width:851px){
 .sidebar{--mm-sidebar-logo-max:13rem}
 .sidebar .brand-block .brand-identity{width:min(85%,var(--mm-sidebar-logo-max));max-width:100%}
 .sidebar .brand-block .brand-icon{width:100%;height:auto;aspect-ratio:1;object-fit:contain}
 .sidebar .brand-block .site-brand{font-size:clamp(1.375rem,1.65vw,1.75rem);white-space:nowrap}
 .sidebar .brand-block .site-description{font-size:var(--mm-type-small)}
 .sidebar .site-description>span,.sidebar .control-label,.sidebar .subnav a{white-space:nowrap;overflow-wrap:normal;word-break:normal}
 .sidebar :is(.nav-link,.nm-disclosure-trigger),.sidebar .subnav a{font-size:.9375rem;line-height:1.4}
}
@media screen and (min-width:851px) and (max-height:750px){
 .sidebar{--mm-sidebar-logo-max:clamp(4rem,15dvh,7rem)}
 .sidebar .brand-block{margin-bottom:.75rem;gap:.375rem}
 #sidebar>.sidebar-credits{padding-top:.75rem}
}

/* A stable sidebar viewport: opening a section only scrolls the navigation. */
@media(min-width:851px){
 html body .site-shell>#sidebar{
  grid-row:1;display:flex;flex-direction:column;
  height:calc(100dvh - 2 * var(--site-gutter));overflow:hidden
 }
 html body.admin-bar .site-shell>#sidebar{height:calc(100dvh - 32px - 2 * var(--site-gutter))}
 #sidebar>.brand-block,#sidebar>.sidebar-credits,#sidebar>.sidebar-bottom{flex:none}
 #sidebar>.primary-navigation{flex:0 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;align-content:start;scrollbar-width:thin}
}

/* Legal links occupy the bottom of the sidebar, outside its scrolling menu. */
@media(min-width:851px){
 #sidebar>.sidebar-credits{margin-top:auto;padding-top:1.5rem}
}
@media(max-width:850px){
 html.mm-js .site-shell>#sidebar{display:flex;flex-direction:column;height:calc(100dvh - 2 * var(--site-gutter));overflow:hidden}
 html.mm-js body.admin-bar .site-shell>#sidebar{height:calc(100dvh - 54px - var(--site-gutter));max-height:calc(100dvh - 54px - var(--site-gutter))}
 html.mm-js #sidebar>.brand-block,html.mm-js #sidebar>.sidebar-bottom,html.mm-js #sidebar>.sidebar-credits{flex:none}
 html.mm-js #sidebar>.primary-navigation{flex:0 1 auto;min-height:0;overflow:auto;align-content:start;overscroll-behavior:contain}
 html.mm-js #sidebar>.sidebar-credits{margin-top:auto;padding-top:1.5rem}
}

/* The welcome has no pagination row. Keep the viewport sidebar in its sole row;
 * spanning two auto rows makes their intrinsic sizes add empty document height. */
@media(min-width:851px){
 html body.mm-view-welcome .site-shell.nm-panel{grid-template-rows:auto}
 html body.mm-view-welcome .site-shell>#sidebar{grid-row:1}
}

/* Retain the shared top gutter while fitting the welcome art below it. */
@media(min-width:851px){
 html body.mm-view-welcome{padding-top:var(--site-gutter);--mm-welcome-max-height:calc(100dvh - var(--site-gutter))}
 html body.mm-view-welcome.admin-bar{--mm-welcome-max-height:calc(100dvh - 32px - var(--site-gutter))}
}

/* Keep adjacent hover/current surfaces separate at every navigation depth. */
:root{--mm-nav-row-gap:.25rem}
.sidebar .primary-navigation,.sidebar .nm-accordion,.sidebar .subnav{row-gap:var(--mm-nav-row-gap)}
.sidebar .nm-disclosure-panel>.nm-disclosure-body{padding-block-start:var(--mm-nav-row-gap)}

/* Persistent pagination shelf; the reserved space keeps the last entry readable. */
:root{--mm-pagination-height:4rem;--mm-pagination-gap:var(--mm-nav-row-gap);--mm-pagination-inset:var(--site-gutter)}
html body .site-shell:has(>.pagination-slot:not(:empty)){padding-bottom:calc(var(--mm-pagination-height) + env(safe-area-inset-bottom,0px))}
html body .site-shell>.pagination-slot:not(:empty){position:fixed;inset-block-end:0;inset-inline-start:calc(var(--site-gutter) + var(--sidebar-width) + var(--mm-shell-gap));width:min(var(--mm-content-width),calc(100% - 2 * var(--site-gutter) - var(--sidebar-width) - var(--mm-shell-gap)));min-height:var(--mm-pagination-height);box-sizing:border-box;display:flex;align-items:center;z-index:10;margin:0;padding:.5rem 0 calc(.5rem + env(safe-area-inset-bottom,0px));background:var(--panel);border:0;box-shadow:none}
.pagination-slot>.pagination{gap:var(--mm-pagination-gap);margin:0;padding:0;align-items:center}
.pagination-slot .pagination-pages{display:flex;align-items:center;gap:var(--mm-pagination-gap)}
.pagination-slot .pagination.nm-pagination .nm-button{min-height:var(--row-min);min-width:var(--row-min);padding:var(--space-control) var(--space-group);border:0;border-radius:var(--mm-selected-radius);background:transparent;background-image:none;box-shadow:none;font:inherit;font-size:var(--mm-type-body);font-weight:400;line-height:var(--mm-action-line-height);color:var(--text);transition:background-color var(--hover-ease),color var(--hover-ease)}
.pagination-slot .pagination.nm-pagination .nm-button>.nm-layers{display:none}
.pagination-slot .pagination.nm-pagination .nm-button::before,.pagination-slot .pagination.nm-pagination .nm-button::after{display:none}
.pagination-slot .pagination.nm-pagination .nm-button[aria-current=page]{background:var(--mm-selected-fill);color:var(--mm-color-active);font-weight:500}
@media(hover:hover){.pagination-slot .pagination.nm-pagination .nm-button[href]:hover{background:var(--mm-ui-hover);color:var(--mm-color-link-hover)}}
.pagination-slot .pagination.nm-pagination .nm-button:disabled{color:var(--text-secondary);opacity:.5;background:transparent}
@media(max-width:850px){html body .site-shell>.pagination-slot:not(:empty){inset-inline-start:var(--site-gutter);width:calc(100% - 2 * var(--site-gutter))}.pagination-slot .pagination.nm-pagination .nm-button{min-height:44px;min-width:36px;padding:.375rem .5rem}}
@media(prefers-reduced-motion:reduce){.pagination-slot .pagination.nm-pagination .nm-button{transition:none}}
:root[data-motion=off] .pagination-slot .pagination.nm-pagination .nm-button{transition:none}
.pagination-slot>.pagination{flex-wrap:nowrap}
@media(max-width:560px){.pagination-slot .pagination-pages{display:none}.pagination-slot .pagination-status{display:inline-flex;min-width:4.5em;justify-content:center;font-variant-numeric:tabular-nums}.pagination-slot>.pagination{width:100%;justify-content:space-between}}

/* The desktop sidebar belongs to the viewport, not the archive's scroll limits. */
@media(min-width:851px){
 html body .site-shell>#sidebar{position:fixed;inset-inline-start:var(--site-gutter);top:var(--site-gutter);width:var(--sidebar-width);box-sizing:border-box}
 html body.admin-bar .site-shell>#sidebar{top:calc(32px + var(--site-gutter))}
 html body .site-shell>.page{grid-column:2;grid-row:1}
}
/* Prevent boundary scroll chaining/rubber-banding from shifting the page chrome. */
html{overscroll-behavior-y:none}
