:root {
  --paper: #f7f4ec;
  --cream: #fffdf6;
  --ink: #192d28;
  --muted: #55655e;
  --green: #174a3c;
  --line: #dcded1;
  --serif: "Playfair Display", Georgia, serif;
  --ui: "PT Sans", Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font: 100%/1.5 var(--ui);
  scrollbar-gutter: stable;
}

* { box-sizing: border-box; }
body, h1, h2, h3, p, figure, dl, dd { margin: 0; }
a { color: var(--green); text-underline-offset: .22em; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid #52804e; outline-offset: 3px; }
[hidden] { display: none !important; }
::selection { background: #d9e6cf; color: var(--ink); }

.wrap { width: min(calc(100% - 84px), 1260px); margin-inline: auto; }
.main-content { min-width: 0; padding-block-end: 3rem; }
.skip {
  position: absolute;
  z-index: 3;
  inset: .5rem auto auto .5rem;
  background: var(--cream);
  padding: .5rem .75rem;
  transform: translateY(-160%);
}
.skip:focus { transform: none; }

.site-header { background: var(--cream); border-bottom: 1px solid var(--line); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  padding-block: .75rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  color: var(--ink);
  text-decoration: none;
}
.brand-symbol {
  display: grid;
  place-items: center;
  flex: 0 0 39px;
  width: 39px;
  height: 39px;
  border-radius: 8px;
  background: var(--green);
  color: var(--cream);
}
.brand-symbol svg, .icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.brand-title { font: 400 clamp(1.2rem, calc(.3rem + 1.7vw), 2.25rem)/1.15 var(--serif); }
.brand-caption {
  display: block;
  margin-top: .2rem;
  color: var(--muted);
  font: .8125rem/1.35 var(--ui);
}
.header-nav { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem 1.2rem; }
.header-nav a, .nav-button {
  display: inline-block;
  padding-block: .25rem;
  color: var(--green);
  font-size: .9375rem;
  text-decoration: none;
}
.header-nav a:hover, .nav-button:hover, .header-nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: .22em;
}
.nav-button { background: transparent; border: 0; padding-inline: 0; }

.section-head { padding-block: 2rem .75rem; border-bottom: 1px solid var(--line); }
.section-head h1 {
  font: 400 clamp(1.25rem, calc(1rem + 1vw), 2.25rem)/1.25 var(--serif);
  letter-spacing: .05em;
  overflow-wrap: anywhere;
}
.section-head p { margin-top: .25rem; color: var(--muted); }
.panel { min-width: 0; border-top: 1px solid #88958a; padding-top: .9375rem; }
.empty { padding: 2rem 0; color: var(--muted); border-bottom: 1px solid var(--line); }

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: .5rem;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: .55rem 1rem;
  background: var(--green);
  color: var(--cream);
  font-weight: 700;
  text-decoration: none;
}
.button:hover { background: #205e4b; }

.sign-in { max-width: 27rem; margin-inline: auto; }
.sign-in-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--cream);
}
.sign-in-form .form-field { display: grid; gap: .35rem; }
.sign-in-form label { font-weight: 700; }
.sign-in-form input:not([type="hidden"]) {
  width: 100%;
  min-height: 44px;
  padding: .5rem .65rem;
  border: 1px solid #88958a;
  border-radius: 4px;
  color: var(--ink);
  background: #fff;
}
.sign-in-form .button { justify-self: start; }
.errorlist { margin: 0; padding-inline-start: 1.2rem; color: #8f2828; }

@media (max-width: 950px) {
  .wrap { width: calc(100% - 48px); }
}
@media (max-width: 670px) {
  .header-inner { flex-wrap: wrap; }
  .header-nav { width: 100%; }
}
@media (max-width: 470px) {
  .wrap { width: calc(100% - 28px); }
  .section-head { padding-top: 1.4rem; }
}

.reader-page .header-inner {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) minmax(14rem, 25rem) auto;
}
.reader-search {
  display: flex;
  min-width: 0;
  min-height: 44px;
  gap: .25rem;
  padding: .2rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
}
.reader-search input {
  width: 100%; min-width: 0;
  padding: .35rem .55rem;
  border: 0; border-radius: 3px;
  background: transparent; color: var(--ink);
}
.reader-search button {
  padding: .35rem 1rem;
  border: 0; border-radius: 4px;
  background: var(--green); color: var(--cream);
}
.reader-page .page-shell {
  width: min(calc(100% - 84px), 1260px);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: clamp(1.4rem, 3vw, 2.75rem);
  align-items: start;
}
.reader-sidebar { min-width: 0; padding-top: 1.5rem; }
.reader-sections {
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--cream);
}
.reader-sections summary { padding: .7rem; cursor: pointer; color: var(--green); }
.reader-sections nav { display: grid; gap: .15rem; padding: .4rem; }
.reader-sections nav a {
  padding: .55rem .7rem;
  color: var(--ink); text-decoration: none; border-radius: 3px;
}
.reader-sections nav a:is(:hover, [aria-current]) { background: #e8eee2; color: var(--green); }
.reader-sections nav a[aria-current] { box-shadow: inset 3px 0 var(--green); }
@media (min-width: 821px) {
  .reader-sidebar { position: sticky; top: 0; max-height: 100vh; overflow-y: auto; }
  .reader-sections[open] summary { display: none; }
}
@media (max-width: 950px) {
  .reader-page .page-shell { width: calc(100% - 48px); }
}
@media (max-width: 820px) {
  .reader-page .page-shell { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .reader-page .header-inner { grid-template-columns: minmax(0, 1fr) auto; }
  .reader-search { grid-column: 1 / -1; grid-row: 2; }
  .reader-sidebar { padding-top: .75rem; }
  .reader-sections[open] nav { border-top: 1px solid var(--line); }
  .reader-page .header-nav { justify-content: end; }
}
@media (max-width: 470px) {
  .reader-page .page-shell { width: calc(100% - 28px); }
  .reader-page .header-inner { gap: .55rem .65rem; }
  .reader-page .header-nav { max-width: 6.25rem; text-align: end; }
  .reader-page .brand { gap: .5rem; }
}
