/* Shared layout, typography, accessibility, forms, and reference tables. */
:root {
  color-scheme: light;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #242424;
  background: #faf9f6;
  font-size: 18px;
  line-height: 1.65;
}
* {
  box-sizing: border-box;
}
body {
  max-width: 76ch;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
}
a {
  color: #245b7a;
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
}
a:hover {
  color: #15374a;
}
:focus-visible {
  outline: 3px solid #245b7a;
  outline-offset: 4px;
}
.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #fff;
  transform: translateY(-200%);
}
.skip-link:focus {
  transform: none;
}
header {
  margin-bottom: 2rem;
}
.eyebrow {
  color: #595959;
  font-size: 0.875rem;
  margin: 0 0 0.25rem;
}
h1 {
  font-size: clamp(2rem, 5vw, 2.6rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin: 0 0 0.75rem;
}
header p:last-child {
  margin: 0;
  color: #595959;
}
h2 {
  font-size: 1.4rem;
  line-height: 1.35;
  margin: 0 0 1rem;
  overflow-wrap: anywhere;
}
nav {
  border-block: 1px solid #d6d3cc;
  padding: 1.4rem 0;
  margin-bottom: 2.5rem;
}
nav h2 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}
nav ol {
  columns: 2;
  column-gap: 2.5rem;
  padding-left: 1.4rem;
  margin: 0;
  font-size: 0.875rem;
}
nav li {
  break-inside: avoid;
  padding: 0.2rem 0;
  line-height: 1.5;
}
main:focus {
  outline: none;
}
section {
  border-bottom: 1px solid #d6d3cc;
  padding-bottom: 1.75rem;
  margin-bottom: 2rem;
  scroll-margin-top: 1.5rem;
}
section:last-child {
  margin-bottom: 0;
}
p {
  margin: 0 0 1rem;
}
section > :last-child {
  margin-bottom: 0;
}
ul {
  padding-left: 1.4rem;
  margin: 0 0 1rem;
}
li {
  padding-left: 0.15rem;
  margin-bottom: 0.35rem;
}
strong {
  font-weight: 650;
}
form {
  max-width: 26rem;
  margin: 1.5rem 0 2rem;
}
.field {
  margin-bottom: 1rem;
}
label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
select,
button {
  font: inherit;
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
}
select {
  width: 100%;
}
button {
  max-width: 100%;
  cursor: pointer;
}
.reference {
  font-size: 0.9rem;
}
.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
}
caption {
  text-align: left;
  font-weight: 650;
  margin-bottom: 0.65rem;
}
th,
td {
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid #d6d3cc;
  text-align: center;
  white-space: nowrap;
  vertical-align: top;
}
thead th {
  background: #eceae4;
}
th:first-child {
  text-align: left;
}
tbody th {
  font-weight: 500;
}
tbody tr:nth-child(even) {
  background: #f2f0eb;
}
.note,
footer {
  color: #595959;
  font-size: 0.875rem;
}
footer {
  margin-top: 2rem;
}
footer p {
  margin-bottom: 0.5rem;
}

h3 {
  font-size: 1.05rem;
  line-height: 1.4;
  margin: 1.5rem 0 0.75rem;
}
h4 {
  font-size: 1rem;
  line-height: 1.4;
  margin: 1.25rem 0 0.65rem;
}
h3,
h4 {
  scroll-margin-top: 1.5rem;
}
dl {
  margin: 0 0 1rem;
}
dt {
  font-weight: 650;
}
dd {
  margin: 0 0 1rem;
}
dd > :last-child {
  margin-bottom: 0;
}
ol {
  padding-left: 1.4rem;
  margin: 0 0 1rem;
}
/* Opt in to wrapping table cells on pages with longer descriptions. */
.wrapping-tables th,
.wrapping-tables td {
  white-space: normal;
  overflow-wrap: anywhere;
}
.spell-stats,
.class-stats,
.race-stats {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 0.35rem 1rem;
  margin: 0 0 1.5rem;
  padding: 1rem;
  background: #f2f0eb;
}
.spell-stats {
  grid-template-columns: minmax(5rem, 1fr) minmax(0, 4fr);
}
.spell-stats dd,
.class-stats dd,
.race-stats dd {
  margin: 0;
}
.spell-stats dt,
.spell-stats dd,
.class-stats dt,
.class-stats dd,
.race-stats dt,
.race-stats dd {
  overflow-wrap: anywhere;
}
.expertise,
.source-note {
  border-left: 3px solid #d6d3cc;
  padding-left: 0.85rem;
}
.table-key,
.source-note {
  font-size: 0.875rem;
}
.source-note h3 {
  font-size: 1rem;
}
.spell-list {
  columns: 2;
  column-gap: 2.5rem;
  font-size: 0.875rem;
  margin-bottom: 2rem;
}
.spell-list li {
  break-inside: avoid;
}
.spell {
  border-top: 1px solid #d6d3cc;
  padding-top: 1.5rem;
  margin-top: 1.5rem;
  scroll-margin-top: 1.5rem;
}
.spell > h3 {
  font-size: 1.2rem;
  margin-top: 0;
}
.spell-count,
.spell-page .back-link {
  color: #595959;
  font-size: 0.875rem;
}
.spell-page thead th {
  white-space: nowrap;
}

/* The site index uses a simpler navigation and paragraph layout. */
.site-index h2 {
  margin-bottom: 1.25rem;
  overflow-wrap: normal;
}
.site-index p {
  color: #595959;
  margin: 0;
}
.site-index nav {
  padding: 1.5rem 0;
  margin-bottom: 0;
}
.site-index nav h2 {
  font-size: 1.4rem;
  margin-bottom: 1.25rem;
}
.page-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.page-list li {
  break-inside: auto;
  padding: 0;
  margin-bottom: 0;
  line-height: inherit;
}
.page-list li + li {
  margin-top: 1.25rem;
}
.page-list a {
  font-weight: 650;
}
.page-list p {
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

@media (max-width: 600px) {
  body {
    padding-top: 1.5rem;
  }
  nav ol,
  .spell-list {
    columns: 1;
  }
  h2 {
    font-size: 1.25rem;
  }
  .site-index nav h2 {
    font-size: 1.25rem;
  }
  .spell-stats,
  .class-stats,
  .race-stats {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0;
  }
  .spell-stats dd:not(:last-child),
  .class-stats dd:not(:last-child),
  .race-stats dd:not(:last-child) {
    margin-bottom: 0.75rem;
  }
}
@media print {
  :root {
    color: #000;
    background: #fff;
    font-size: 11pt;
  }
  body {
    max-width: none;
    padding: 0;
  }
  nav,
  .skip-link,
  .back-link,
  .spell-list {
    display: none;
  }
  a {
    color: inherit;
  }
  :focus-visible {
    outline: none;
  }
  h2,
  h3,
  h4,
  dt,
  caption {
    break-after: avoid;
  }
  p,
  li {
    orphans: 3;
    widows: 3;
  }
  .table-scroll {
    overflow: visible;
  }
  tr {
    break-inside: avoid;
  }
  th,
  td {
    padding: 0.3rem;
  }
  section {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
  }

  .wrapping-tables table {
    font-size: 9pt;
  }
  .wrapping-tables th,
  .wrapping-tables td {
    padding: 0.3rem 0.2rem;
  }
  .spell-stats,
  .class-stats,
  .race-stats {
    break-inside: avoid;
    background: transparent;
    padding: 0;
  }
  .spell {
    margin-top: 1rem;
    padding-top: 1rem;
  }
  .spell-stats {
    margin-bottom: 0.75rem;
  }
  .site-index nav {
    display: block;
  }
  .site-index h2 {
    break-after: auto;
  }
  .page-list p,
  .page-list li {
    orphans: 2;
    widows: 2;
  }
}
