:root { color-scheme: light dark; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  max-width: 46rem;
  margin: 2rem auto;
  padding: 0 1.25rem 4rem;
  line-height: 1.55;
}
h1 { margin-bottom: 0.25rem; }
h2 { margin-top: 2rem; padding-bottom: 0.25rem; border-bottom: 1px solid; opacity: 0.9; }
nav { margin-bottom: 1rem; font-size: 0.9rem; }
ul { padding-left: 1.2rem; }
li { margin: 0.3rem 0; }

.metadata {
  background: rgba(128, 128, 128, 0.08);
  border: 1px solid rgba(128, 128, 128, 0.25);
  border-radius: 0.5rem;
  padding: 0.25rem 1.25rem 1rem;
  margin: 1rem 0 2rem;
}
.metadata dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; margin: 1rem 0; }
.metadata dt { font-weight: 600; opacity: 0.7; }
.metadata dd { margin: 0; }
.metadata dd .inline-icon { max-height: 1.4em; max-width: 8em; vertical-align: middle; margin-left: 0.4em; }

.metadata details { margin-top: 0.6rem; }
.metadata summary { cursor: pointer; font-weight: 600; opacity: 0.85; }
.metadata summary:hover { opacity: 1; }

/* A zero-count section (see EmptySectionHtml/ScriptsHtmlBuilder) keeps the exact same
   <details>/<summary> shape as a populated one — same disclosure triangle, same position on the
   page — so the page looks the same whether or not there's anything behind it. pointer-events:
   none (plus tabindex="-1" on the <summary> itself) is what actually makes it non-clickable, since
   a native <details> has no "disabled" attribute; the dark gray color and default cursor are the
   visual signal that it's inert rather than just collapsed. */
.metadata details.empty > summary {
  cursor: default;
  pointer-events: none;
  opacity: 1;
  color: rgba(128, 128, 128, 0.7);
}
/* A source-type group's <details> nests inside the "Locations (N)" <details> (see
   Rendering/BookPage/LocationsHtmlBuilder.Build) — indented so that nesting also reads visually,
   not just structurally, once the outer one is expanded. */
.metadata details details { margin-left: 1rem; }

.locations { list-style: none; padding: 0; margin: 0.5rem 0 0; font-size: 0.92rem; }
.locations li { padding: 0.4rem 0; border-top: 1px solid rgba(128, 128, 128, 0.2); }
.locations li:first-child { border-top: none; }

.leveled-lists { list-style: none; padding: 0; margin: 0.5rem 0 0; font-size: 0.92rem; }
.leveled-lists li { padding: 0.4rem 0; border-top: 1px solid rgba(128, 128, 128, 0.2); }
.leveled-lists li:first-child { border-top: none; }

.scripts { list-style: none; padding: 0; margin: 0.5rem 0 0; font-size: 0.92rem; }
.scripts li { padding: 0.4rem 0; border-top: 1px solid rgba(128, 128, 128, 0.2); }
.scripts li:first-child { border-top: none; }

.menu-art-gallery { list-style: none; padding: 0; margin: 0.5rem 0 0; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.menu-art-gallery li { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; }
.menu-art-gallery span { font-size: 0.8rem; opacity: 0.75; }

/* Checkbox-driven zoom, no JavaScript: each thumbnail's own <label class="image-zoom"> wraps a
   hidden checkbox plus its <img>, so a click anywhere on the image toggles that one checkbox
   without an id/for pair — :checked + img then scales that same image up in place. */
.zoom-toggle { display: none; }

.image-zoom img {
  display: block;
  max-width: 12rem;
  max-height: 12rem;
  height: auto;
  border: 1px solid rgba(128, 128, 128, 0.3);
  border-radius: 0.3rem;
  cursor: zoom-in;
}

@media (prefers-reduced-motion: no-preference) {
  .image-zoom img { transition: transform 300ms ease; }
}
@media (prefers-reduced-motion: reduce) {
  .image-zoom img { transition: none; }
}

.zoom-toggle:checked + img {
  transform: scale(3);
  cursor: zoom-out;
  position: relative;
  z-index: 1000;
}

.flag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0 0.5em;
  margin-left: 0.35em;
  border: 1px solid;
  border-radius: 1em;
  opacity: 0.85;
}

.tp-cmd {
  display: inline-block;
  font-size: 0.85em;
  padding: 0.05em 0.5em;
  margin-top: 0.3em;
  background: rgba(128, 128, 128, 0.15);
  border-radius: 0.3em;
  user-select: all;
}

/* Laid out in the book menu's own Flash stage pixels, so authored <img width/height> and
   <font size> values keep their in-game proportion to the text; zoom scales the page to screen. See
   docs/src/generator/styling.md#book-page-geometry. */
.content {
  --book-zoom: 0.75;
  zoom: var(--book-zoom);

  color: #302a20;
  background:
    radial-gradient(
      ellipse at center,
      #dfd0ad 0%,
      #d8c9a5 65%,
      #c8b58c 100%
    );

  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  line-height: 1.6;

  padding: 42px 48px;
  margin: 21px 0;

  border: 1px solid #a99670;

  box-shadow:
    inset 0 0 30px rgba(80, 55, 25, 0.18),
    0 2px 8px rgba(0, 0, 0, 0.25);
}

.content p {
  margin: 0 0 1.1em;
}

/* Inline on the text baseline, the way Scaleform lays out <img> in a book text field. */
.content img {
  max-width: 100%;
  height: auto;
}

/* Unsized images draw into a fixed 64 x 64 box in-game, whatever the texture's own size. */
.content img:not([width]) {
  width: 64px;
  height: 64px;
}

.content h1,
.content h2,
.content h3 {
  color: #292218;

  font-family: Georgia, "Times New Roman", serif;
  font-weight: normal;
  text-shadow: none;
}

.content h2 {
  margin: 1.8rem 0 0.8rem;
  padding: 0;

  font-size: 1.35rem;
  border: none;
}

.content h3 {
  margin: 1.4rem 0 0.6rem;
  font-size: 1.15rem;
}

.content a {
  color: #55452d;
  text-decoration: underline;
}

.content a:hover {
  color: #211b13;
}

.content hr.pagebreak {
  border: none;
  border-top: 1px solid rgba(75, 55, 30, 0.35);
  margin: 2rem 0;
}

/* A generated placeholder note (BookPageWriter's contentIsPlaceholder path — a book whose own
   DESC is empty, its real "content" a referenced object's baked-in artwork instead) isn't in-game
   text, so it reads in the site's own plain UI font rather than the SkyrimBooks content face —
   same font stack as body above, restated here since specificity-wise a class selector needs it
   spelled out to win over the plainer .content rule instead of just inheriting. */
.content.placeholder-note {
  --book-zoom: 1;
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
}

/* Site UI inside the zoomed page: sized back down to the page's own UI text. */
.content .menu-art {
  margin-top: 1rem;
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: calc(1rem / var(--book-zoom));
  line-height: 1.55;
}
.content .menu-art summary { cursor: pointer; font-weight: 600; opacity: 0.85; }
.content .menu-art summary:hover { opacity: 1; }
.content .menu-art select { margin-top: 0.6rem; font: inherit; }

.content blockquote {
  margin: 1.5rem 0;
  padding: 0.5rem 1rem;

  color: #4b3e2b;
  font-style: italic;

  border-left: 2px solid #9b8965;
}

.muted { opacity: 0.65; font-size: 0.9em; }
