/* Layout of the multi-page site: a fixed table of contents on the left, the
   chapter on the right.  style.css (shared with the single-file HTML) sets
   the typography; this file only adds the two-column frame. */
:root { --sidebar: 19rem; --sidebar-bg: #f6f3ec; --active: #e8e2d2; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --sidebar-bg: #1b1e22; --active: #2a2e35; } }
:root[data-theme="dark"] { --sidebar-bg: #1b1e22; --active: #2a2e35; }

body { max-width: none; margin: 0; padding: 0; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--bg); padding: .5rem; z-index: 3; }

#sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: var(--sidebar); overflow-y: auto;
  background: var(--sidebar-bg); border-right: 1px solid var(--rule); padding: 1.2rem 0 2rem;
  font-family: "Helvetica Neue", Arial, sans-serif; font-size: .86rem; line-height: 1.35; }
#sidebar a { text-decoration: none; color: var(--fg); display: block; padding: .22rem 1.2rem; }
#sidebar a:hover { background: var(--active); }
#sidebar .home { font-family: Georgia, "DejaVu Serif", serif; font-size: 1.05rem; color: var(--accent);
  padding: 0 1.2rem .9rem; border-bottom: 1px solid var(--rule); margin-bottom: .6rem; }
#sidebar ul { list-style: none; margin: 0; padding: 0; }
#sidebar li.part > span { display: block; padding: .9rem 1.2rem .25rem; font-size: .72rem;
  letter-spacing: .12em; text-transform: uppercase; opacity: .65; }
#sidebar li.part > span a { display: inline; padding: 0; }
#sidebar li.active > a { background: var(--active); color: var(--accent); font-weight: bold;
  border-left: 3px solid var(--accent); padding-left: calc(1.2rem - 3px); }
#sidebar ul.sections a { padding-left: 2.2rem; font-size: .82rem; opacity: .9; }
#sidebar ul.sections a.current { color: var(--accent); font-weight: bold; }
#sidebar .num { display: inline-block; min-width: 1.6em; opacity: .7; }
#theme { display: block; width: calc(100% - 2.4rem); margin: .2rem 1.2rem .6rem; padding: .3rem .6rem; text-align: left;
  border: 1px solid var(--rule); border-radius: 4px; background: var(--bg); color: var(--fg); font: inherit; cursor: pointer; }
#theme:hover { background: var(--active); }

#content { margin-left: var(--sidebar); padding: 1.5rem 2.5rem 3rem; }
article { max-width: 46rem; margin: 0 auto; }
article h1 { margin-top: 1rem; }
.pager { max-width: 46rem; margin: 0 auto; display: flex; justify-content: space-between; gap: 1rem;
  font-family: "Helvetica Neue", Arial, sans-serif; }
.pager a { text-decoration: none; }
.pager.top { font-size: .85rem; opacity: .8; }
.pager.bottom { margin-top: 3rem; border-top: 1px solid var(--rule); padding-top: 1.2rem; }
.pager.bottom a { flex: 1; padding: .8rem 1rem; border: 1px solid var(--rule); border-radius: 4px; }
.pager.bottom a span { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; opacity: .6; }
.pager.bottom a.next { text-align: right; }
.pager a:only-child.next { margin-left: auto; }
footer { max-width: 46rem; margin: 2.5rem auto 0; font-size: .8rem; opacity: .7; }

#menu { display: none; position: fixed; top: .6rem; right: .6rem; z-index: 2; padding: .4rem .8rem;
  border: 1px solid var(--rule); border-radius: 4px; background: var(--bg); color: var(--fg); font: inherit; }

/* Contents page */
.contents ul { list-style: none; padding-left: 0; }
.contents > ul > li { margin: 1.2rem 0; }
.contents li.part > span { display: block; font-family: "Helvetica Neue", Arial, sans-serif; font-size: .8rem;
  letter-spacing: .12em; text-transform: uppercase; opacity: .65; margin: 2rem 0 .4rem; }
.contents ul.chapters > li { margin: .7rem 0; }
.contents ul.chapters > li > a { font-size: 1.1rem; font-weight: bold; text-decoration: none; }
.contents ul.sections { padding-left: 1.6rem; margin-top: .2rem; font-size: .92rem; columns: 2; column-gap: 2rem; }
.contents ul.sections a { text-decoration: none; color: var(--fg); }
.contents ul.sections a:hover { color: var(--accent); }
.cover p.subtitle { font-size: 1.2rem; margin-top: -.5rem; opacity: .8; }

@media (max-width: 60rem) {
  #sidebar { transform: translateX(-100%); transition: transform .2s; width: min(var(--sidebar), 85vw); z-index: 1; }
  #sidebar.open { transform: none; box-shadow: 0 0 2rem rgba(0,0,0,.3); }
  #content { margin-left: 0; padding: 3.5rem 1rem 3rem; }
  #menu { display: block; }
  .contents ul.sections { columns: 1; }
}
