.library-page .top-nav a[aria-current="page"] {
  color: var(--gold);
}

.library-main {
  padding-bottom: clamp(32px, 6vw, 72px);
}

.library-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: 18px;
  padding-top: 22px;
  border-top: 1px solid var(--iron);
}

.library-heading h1,
.library-sheet h2 {
  margin: 0;
  font: 900 clamp(28px, 4vw, 44px)/1.1 var(--display);
}

.library-sheet {
  padding: clamp(16px, 3vw, 34px);
  border: 1px solid #aa9779;
  color: #392718;
  background: var(--parch);
}

.library-sheet h2 {
  padding-bottom: 14px;
  border-bottom: 1px solid #aa9779;
  font-size: clamp(24px, 3vw, 36px);
}

.library-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17%;
  gap: clamp(12px, 3vw, 36px);
  align-items: start;
  margin-top: 22px;
}

.library-toc {
  columns: 2;
  column-gap: clamp(20px, 4vw, 48px);
  margin: 0;
  padding-left: 1.15em;
  list-style: square;
  overflow-wrap: anywhere;
}

.library-toc > li {
  break-inside: avoid;
  margin-bottom: 14px;
}

.library-toc > li > a {
  font: 700 1.2rem/1.35 var(--display);
}

.library-toc ul {
  margin: 5px 0 0;
  padding-left: 1.2em;
  list-style: disc;
}

.library-toc ul li {
  margin-bottom: 4px;
}

.library-toc a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.library-toc a:hover,
.library-toc a:focus-visible {
  color: #7c2c17;
}

.library-toc a:focus-visible {
  outline-color: #7c2c17;
}

.library-toc img {
  vertical-align: text-bottom;
}

.library-illustration {
  width: 100%;
  height: auto;
  filter: grayscale(1) contrast(1.2);
  mix-blend-mode: multiply;
  mask-image: radial-gradient(ellipse at center, #000 42%, transparent 74%);
}

.library-breadcrumbs {
  padding: 15px 0;
  border-top: 1px solid var(--iron);
  color: var(--steel);
  font-size: .875rem;
  overflow-wrap: anywhere;
}

.library-article {
  overflow-wrap: break-word;
}

.library-article h1,
.library-article h3,
.library-article h4 {
  font-family: var(--display);
  line-height: 1.2;
}

.library-article h1 {
  margin: 0 0 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid #aa9779;
  font-size: clamp(26px, 4vw, 42px);
}

.library-article a {
  color: #742b19;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.library-article :focus-visible {
  outline-color: #742b19;
}

.library-article img {
  height: auto;
}

.library-article summary {
  cursor: pointer;
  font-weight: 600;
}

.library-catalog {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #aa9779;
}

.library-catalog > ul {
  columns: 2 240px;
}

.library-catalog > ul > li {
  break-inside: avoid;
  margin-bottom: 12px;
}

.library-article > table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

.library-table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.library-experience-note {
  margin-top: 20px;
}

#experience-rewards {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #aa9779;
  font-variant-numeric: tabular-nums;
}

#experience-rewards th,
#experience-rewards td {
  padding: 8px 10px;
  border: 1px solid #aa9779;
  white-space: nowrap;
}

#experience-rewards th {
  color: var(--parch);
  background: var(--stone);
}

#experience-rewards tbody tr:nth-child(even) {
  background: #e2d4bd;
}

#experience-rewards tr.exp-current td {
  background: #ffe59a;
  color: #302300;
  font-weight: bold;
}

#experience-rewards tr.exp-next td {
  background: #dcefd6;
  color: #173d12;
}

#experience-status {
  padding: 10px;
  border: 1px solid #aa9779;
  background: #fff5cf;
}

#experience-rewards tr:focus {
  outline: 2px solid #805d00;
  outline-offset: -2px;
}

@media (max-width: 760px) {
  .library-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .library-toc {
    columns: 1;
  }

  .library-illustration {
    display: none;
  }
}
