/* Keep style.css as the original desktop design; layer repairs here. */
@font-face {
  font-family: 'Josefin Slab';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/josefin-slab.ttf') format('truetype');
}

[hidden] { display: none !important; }

/* Native buttons retain the original heading's typography and appearance. */
.collapse-toggle {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.collapse-toggle > span {
  display: inline-block;
  width: 15px;
  height: 15px;
}
.collapse-toggle:focus-visible,
.nav-toggle:focus-visible,
a:focus-visible { outline: 2px solid rgb(35, 82, 124); outline-offset: 2px; }
.major-heading:focus:not(:focus-visible),
.content:focus:not(:focus-visible) { outline: none; }
#skip-nav a:focus {
  z-index: 10;
  background: white;
  padding: .25em;
}
.major-heading { width: auto; }
.viewport { overflow-wrap: anywhere; }

/* Readable fallbacks if scripts are unavailable. */
body:not(.js) .content { height: auto; }
body:not(.js) .content-panel { height: auto; margin-bottom: 1em; }
body:not(.js) .viewport { max-height: none; }
body:not(.js) .nav-toggle { display: none; }
body:not(.js) .sidebar-nav { display: block; }

/* Blog pages use natural document scrolling for long articles. */
.reading-page main { max-height: none; }
.reading-page .content,
.reading-page .content-panel { height: auto; min-height: 640px; }
.reading-page .viewport { max-height: none; overflow: visible; }
.prose { padding-bottom: 1em; }
.prose img { max-width: 100%; height: auto; }
.prose pre { max-width: 100%; overflow: auto; }
.prose article { margin-bottom: 1.5em; }
.prose time { font-size: .85em; }
.post-navigation { display: flex; flex-wrap: wrap; gap: .75em; margin-top: 1.5em; }

@media screen and (min-width: 641px) {
  /* Fit long, wrapped titles inside the fixed desktop panels. */
  .js[data-home] .content-panel { display: flex; flex-direction: column; }
  .js[data-home] .no-scroll { flex: 1; min-height: 0; display: flex; }
  .js[data-home] .viewport { flex: 1; min-width: 0; }
}

@media screen and (max-width: 640px) {
  html { box-sizing: border-box; }
  /* Retain the original centered title, floated button, and link spacing. */
  html.menu-open { overflow: hidden; overscroll-behavior: none; }
  .js .sidebar-nav {
    position: fixed;
    z-index: 5;
    top: var(--menu-top);
    left: 6px;
    right: 6px;
    height: calc(100vh - var(--menu-top));
    height: calc(100dvh - var(--menu-top));
    box-sizing: border-box;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: rgb(248, 248, 248);
    border: 2px solid rgb(230,230,230);
    border-top: 0;
    border-radius: 0 0 4px 4px;
  }
  .sidebar-nav.is-open { display: flow-root; }
  .content { float: none; display: block; min-width: 0; }
  .content-panel { box-sizing: border-box; width: 100%; height: auto; }
  .major-heading { overflow-wrap: anywhere; }
  .headshot { box-sizing: content-box; width: 240px; max-width: calc(100% - 8px); height: auto; }
  .sidebar-element > li > a { display: block; }
  .reading-page .content,
  .reading-page .content-panel { min-height: calc(100vh - 5.75em); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
