/* The Chasers' Lodge: the main theme ("Lantern").
   A book on a shelf: cream paper, deep ink, one ember. Dark mode is
   candlelight, not inverted greys (theme.js sets data-theme on <html>).
   Campaign sheets (<campaign>/_layout/style.css) load after this one and
   mostly change the variables below.
   Fonts (SIL Open Font License): Fraunces (display), Newsreader (reading),
   Badaawi (the script used in some pages). */

@font-face { font-family: "Fraunces"; src: url("fonts/Fraunces-normal.woff2") format("woff2"); font-weight: 300 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("fonts/Fraunces-italic.woff2") format("woff2"); font-weight: 300 600; font-style: italic; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("fonts/Newsreader-normal.woff2") format("woff2"); font-weight: 300 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("fonts/Newsreader-italic.woff2") format("woff2"); font-weight: 300 600; font-style: italic; font-display: swap; }
/* the campaigns' faces, for their names in the sidebar (fetched only when used) */
@font-face { font-family: "Cinzel"; src: url("/foolslanding/_layout/fonts/Cinzel.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "PR Viking"; src: url("/skarnholm/_layout/fonts/PRViking.ttf"); font-display: swap; }
@font-face { font-family: "El Messiri"; src: url("/sunfire/_layout/fonts/ElMessiri.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Badaawi"; src: url("fonts/badaawi-Regular.otf"); font-display: swap; }

:root {
  /* paper and ink */
  --paper: #f6f0e3;
  --paper-deep: #ece3d0;
  --sheet: #fbf7ee;            /* slips, editor sheet */
  --ink: #2a2119;
  --ink-soft: #5b4d3f;
  /* derived, so every campaign palette gets them: faint text, hairlines,
     and the desk the page lies on */
  --ink-faint: color-mix(in srgb, var(--ink-soft) 85%, var(--paper));
  --rule: color-mix(in srgb, var(--ornament) 55%, var(--paper));
  --desk: color-mix(in srgb, var(--paper-deep) 85%, var(--ornament));
  --accent-line: color-mix(in srgb, var(--accent) 45%, var(--paper));   /* rules in the campaign's colour */
  --accent: #a3431a;           /* the one ember */
  --ornament: #b88a35;         /* fleurons, markers, hairlines */
  --mark: #f1dfb4;             /* selection, highlights */
  --board: #e6dbc4;            /* the notice board */
  --del: #f1d6cb;
  --add: #dfe6cc;
  --glow: none;                /* text-shadow on accented words */
  --vignette: none;            /* background light */
  --slip-filter: none;

  /* type */
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --display-settings: "SOFT" 60, "WONK" 0;
  --display-case: none;
  --display-tracking: -.005em;
  --text: "Newsreader", "Iowan Old Style", Georgia, serif;
  --mono: ui-monospace, Consolas, "Courier New", monospace;

  --measure: 42rem;
  --margin: 13rem;
  --pad: 4rem;                 /* the sheet's margins around the text */
  --width: calc(var(--measure) + 2 * var(--pad) + 2 * var(--margin) + 7rem);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #17120d;
  --paper-deep: #211910;
  --sheet: #1e1710;
  --ink: #eadcc0;
  --ink-soft: #c5b292;
  --accent: #f0a35e;
  --ornament: #c99b4c;
  --mark: #4a3518;
  --board: #120e0a;
  --del: #4a2419;
  --add: #2c3519;
  --glow: 0 0 14px rgba(240, 163, 94, .38);
  --vignette: radial-gradient(1200px 700px at 50% -260px, rgba(240, 160, 90, .12), transparent 70%);
  --slip-filter: brightness(.78) sepia(.25);
  --desk: color-mix(in srgb, var(--paper) 72%, black);
  color-scheme: dark;
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }
html { font-synthesis-weight: none; /* no fake bold for faces with one weight (PR Viking) */ font-size: 112.5%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 1.5rem; }
body {
  margin: 0;
  background: var(--desk) var(--vignette) no-repeat;
  background-attachment: fixed;
  color: var(--ink);
  font: 400 1.125rem/1.68 var(--text);
  font-optical-sizing: auto;
  font-kerning: normal;
  font-variant-numeric: oldstyle-nums proportional-nums;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--mark); }
a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em;
    text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent); }
a:hover { color: var(--accent); text-decoration-color: var(--accent); text-shadow: var(--glow); }
:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
img { max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }

/* small capitals of the reading face: labels, running heads */
.masthead, .breadcrumbs, .sidebar h2, .page-info, .lw-history th {
  font-variant-caps: all-small-caps; letter-spacing: .08em;
}

/* ---------- Masthead: the running head ---------- */

.masthead {
  max-width: var(--width);
  margin: 0 auto;
  padding: 1.2rem 1.5rem 1rem;
  display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 1rem;
  font-size: 1.02rem; color: var(--ink-soft);
}
.masthead a { text-decoration: none; }
.lodge {
  font-family: var(--display); font-variation-settings: var(--display-settings);
  font-variant-caps: normal; letter-spacing: 0; font-style: italic; font-size: 1.12rem; color: var(--ink); font-weight: 560;
}
.lodge::before { content: "❦"; font-style: normal; color: var(--ornament); margin-right: .45rem; font-size: .9em; }

.masthead-tools { justify-self: end; display: flex; gap: 1.2rem; align-items: baseline; }
.masthead-tools a, .theme-toggle { color: var(--ink-faint); }
.masthead-tools a:hover, .theme-toggle:hover { color: var(--accent); }
.search-link::after { content: "  /"; white-space: pre; color: var(--rule); }
.theme-toggle { background: none; border: 0; padding: 0; cursor: pointer; font-variant-caps: all-small-caps; letter-spacing: .08em; font-size: 1.02rem; }
.theme-toggle .to-light { display: none; }
:root[data-theme="dark"] .theme-toggle .to-light { display: inline; }
:root[data-theme="dark"] .theme-toggle .to-dark { display: none; }
.theme-toggle span::before { content: "☾ "; font-variant-caps: normal; }
.theme-toggle .to-light::before { content: "☼ "; }

/* ---------- Frame: margin | the sheet | air ---------- */

/* The page is a sheet of paper lying on the desk; the masthead and the
   sidebar are written on the desk around it. */
.frame {
  display: grid;
  grid-template-columns: minmax(var(--margin), 1fr) minmax(0, calc(var(--measure) + 2 * var(--pad))) minmax(0, 1fr);   /* the margin keeps its width; the sheet gives way */
  column-gap: 2.5rem;
  max-width: var(--width);
  margin: 0 auto;
  padding: 1.4rem 1.5rem 5rem;
}
.main {
  grid-column: 2; grid-row: 1; min-width: 0;
  background: var(--paper); padding: 2.4rem var(--pad) 2.5rem; border-radius: 7px;
  border-top: 3px solid var(--accent-line);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--rule) 70%, transparent), 0 2px 4px rgba(0, 0, 0, .06), 0 24px 50px -24px rgba(0, 0, 0, .45);
}
:root[data-theme="dark"] .main { box-shadow: 0 0 0 1px var(--rule), 0 24px 60px -20px rgba(0, 0, 0, .8); }
/* A page's text keeps its measure; a page with a wide widget (map, charts)
   gets a wider sheet, over the air on the right, so no page needs a wider
   layout of its own. The banner and the notice board overhang the text a
   little. */
.mode-show .main:has(.page > .widget:not(.widget-recent, .widget-calendar)) { grid-column: 2 / -1; }
.mode-show :is(.breadcrumbs, .page > *, .page-info) { max-width: var(--measure); }
.mode-show .page > .widget:not(.widget-recent, .widget-calendar) { max-width: none; }
.mode-show .page > .noticeboard { max-width: calc(var(--measure) + 5rem); }
.sidebar {
  grid-column: 1; grid-row: 1; justify-self: end; align-self: start;
  width: var(--margin);
  position: sticky; top: 1.5rem; max-height: calc(100vh - 3rem); overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: transparent transparent;
  padding: .3rem .5rem 1rem 0;
  font-size: .95rem; line-height: 1.45; color: var(--ink-faint);
}
.sidebar:hover { scrollbar-color: var(--rule) transparent; }
.sidebar h2 { font: inherit; font-variant-caps: all-small-caps; letter-spacing: .08em; font-size: .92rem; color: var(--accent); margin: 1.8rem 0 .45rem; font-weight: 600; }
.sidebar h2::after { content: ""; display: block; width: 1.6rem; height: 1px; background: var(--ornament); margin-top: .3rem; opacity: .7; }
.sidebar > :first-child, .sidebar > .toc:first-child h2 { margin-top: 0; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { margin: .18rem 0; }
.sidebar a { color: var(--ink); text-decoration: none; }
.sidebar a:hover { color: var(--accent); }
.sidebar a[aria-current="page"] { color: var(--accent); font-style: italic; }
.sidebar form { margin: 0; }
.sidebar button { background: none; border: 0; padding: 0; color: var(--ink-soft); cursor: pointer; font-size: inherit; }
.sidebar button:hover { color: var(--accent); }
/* the shelf of volumes, at the top of the sidebar: plain links, numbered
   like a set, each name in its campaign's face; each campaign sheet marks
   its own volume (.volumes a[href="/skarnholm/"]) */
.volumes { margin: 0 0 2.4rem; counter-reset: vol; }
.volumes a { display: block; counter-increment: vol; margin: .25rem 0; font-size: 1.12rem; line-height: 1.3; color: var(--ink-soft); }
.volumes a::before { content: counter(vol, upper-roman) "\2002"; display: inline-block; min-width: 1.6rem; font: .8rem var(--text); color: var(--ornament); }
.volumes a[href="/foolslanding/"] { font-family: "Cinzel", var(--display); font-size: 1rem; }
.volumes a[href="/skarnholm/"] { font-family: "PR Viking", var(--display); }
.volumes a[href="/sunfire/"] { font-family: "El Messiri", var(--display); }
:root { --here-line: underline 1px var(--ornament); }

/* the sidebar page (_layout/sidebar.md): "**People**" then a list of links */
.sidebar-nav p { margin: 1.8rem 0 .45rem; font-size: .92rem; color: var(--accent); font-variant-caps: all-small-caps; letter-spacing: .08em; }
.sidebar-nav p:first-child { margin-top: 0; }
.sidebar-nav p::after { content: ""; display: block; width: 1.6rem; height: 1px; background: var(--ornament); margin-top: .3rem; opacity: .7; }
.sidebar-nav strong { font-weight: 600; }
.sidebar-nav ul + ul { margin-top: .6rem; }
.sidebar-nav + * { margin-top: 2.4rem; }
.sidebar .user-name { font-style: italic; color: var(--ink-soft); }
/* the contents: the page title itself is redundant there */
.toc > ul > li > a { display: none; }
.toc ul ul { padding: 0; }
.toc ul ul ul { padding-left: .9rem; }
.toc a { color: var(--ink); }
.to-top { display: block; margin-top: 2rem; color: var(--ink-faint) !important; font-size: .88rem; font-style: italic; }

.menu-link { display: none; }

/* ---------- Breadcrumbs ---------- */

.breadcrumbs { display: flex; justify-content: space-between; gap: 1rem; font-size: .92rem; color: var(--ink-faint); margin-bottom: 2.2rem; line-height: 1.4; }
.breadcrumbs a { color: var(--ink-soft); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { color: var(--ornament); margin: 0 .5rem; }
.breadcrumbs [aria-current] { color: var(--accent); }

/* ---------- The page ---------- */

.page { overflow-wrap: break-word; }
.page p { margin: 0 0 1.05em; hyphens: auto; text-wrap: pretty; }
.page :is(h1, h2, h3, h4) {
  font-family: var(--display); font-variation-settings: var(--display-settings);
  text-transform: var(--display-case); letter-spacing: var(--display-tracking);
  font-weight: 560; line-height: 1.15; color: var(--ink); text-wrap: balance;
}
.page h2 { font-size: 1.85rem; margin: 2.8rem 0 .9rem; padding-bottom: .35rem; border-bottom: 2px solid var(--accent-line); }
.page h3 { font-size: 1.35rem; font-style: italic; margin: 2.2rem 0 .7rem; color: var(--accent); }
.page h4 { font-size: 1.1rem; margin: 1.8rem 0 .5rem; }

/* The page title: the first heading of the page (an h1, or an h2 on older
   pages such as Amiko's), centred, with a fleuron underneath. */
.page h1, .page > h2:first-child {
  font-size: clamp(2.2rem, 5vw, 3rem); font-style: normal; text-align: center; font-weight: 600; border: 0; padding: 0;
  margin: 0 0 2.4rem; line-height: 1.08;
}
.page h1::after, .page > h2:first-child::after {
  content: ""; display: block; width: 10rem; height: 16px; margin: 1.1rem auto 0;
  background: var(--accent);
  -webkit-mask: var(--fleuron) center / contain no-repeat; mask: var(--fleuron) center / contain no-repeat;
}
:root { --fleuron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 12'%3E%3Cpath d='M2 6h44M74 6h44' stroke='%23000' stroke-width='.9'/%3E%3Cpath d='M60 .8 65.2 6 60 11.2 54.8 6z'/%3E%3Ccircle cx='50' cy='6' r='1.4'/%3E%3Ccircle cx='70' cy='6' r='1.4'/%3E%3C/svg%3E"); }

/* an italic line right under the title is its subtitle */
.page > :is(h1, h2:first-child) + p:has(> em:only-child) {
  text-align: center; color: var(--ink-soft); font-size: 1.2rem; margin: -1rem 0 2.4rem;
}

/* Banner: a picture that is the first thing on the page, right before the
   "# Title", at its natural size (no width, no #small/#medium/#left/#right). */
.page > :is(a.image, p):first-child:has(+ h1):has(img:not([width]):not(.left):not(.right):not(.small):not(.medium)) { display: block; margin: 0 -2.5rem 2.6rem; max-width: calc(var(--measure) + 5rem); }
.page > :is(a.image, p):first-child:has(+ h1):has(img:not([width]):not(.left):not(.right):not(.small):not(.medium)) img {
  display: block; width: 100%; height: clamp(14rem, 34vw, 23rem); object-fit: cover; object-position: center 40%;
  border-radius: 2px; box-shadow: 0 0 0 1px var(--rule), 0 0 0 6px var(--paper), 0 0 0 7px var(--rule);
}
:root[data-theme="dark"] .page img { filter: brightness(.9); }

/* The drop cap: the first real paragraph of the story (theme.js marks it) */
.page > p.lede::first-letter {
  float: left; font-family: var(--display); font-variation-settings: var(--display-settings);
  font-size: 3.9em; line-height: .8; margin: .07em .12em 0 -.02em; padding-top: .04em;
  color: var(--accent); text-shadow: var(--glow); font-style: normal; text-transform: var(--display-case); font-weight: 600;
}
.page > p.lede { display: flow-root; }
.page > p.lede::first-line { font-variant-caps: small-caps; letter-spacing: .03em; }

/* lists */
.page ul, .page ol { padding-left: 1.4rem; margin: 0 0 1.1em; }
.page li { margin: .2rem 0; }
.page li::marker { color: var(--ornament); }
.page ul > li { list-style-type: "–  "; }

.page blockquote { margin: 1.8rem 0; padding: 0 0 0 1.4rem; border-left: 2px solid var(--accent-line); font-style: italic; color: var(--ink-soft); }
.page code { font-family: var(--mono); font-size: .9em; background: var(--paper-deep); padding: .05em .3em; border-radius: 2px; }
.page pre { font-family: var(--mono); font-size: .88rem; background: var(--paper-deep); padding: 1rem 1.2rem; overflow: auto; border-radius: 2px; }

/* the thin ornament divider */
.page hr {   /* as wide as the text, the ornament drawn in its middle (so it stays centred on the text) */
  border: 0; height: 12px; margin: 2.8rem 0; background: var(--ornament);
  -webkit-mask: var(--fleuron) center / 7.5rem 12px no-repeat; mask: var(--fleuron) center / 7.5rem 12px no-repeat;
}

.page a.missing { color: var(--ink-faint); text-decoration-style: dotted; }
.page a.external::after { content: "\2009↗"; font-size: .75em; color: var(--ornament); }

/* tables */
.table-wrap { overflow-x: auto; margin: 1.6rem 0; }
.page table { border-collapse: collapse; width: 100%; font-size: .98rem; }
.page th { font-weight: 500; text-align: left; font-variant-caps: all-small-caps; letter-spacing: .07em; color: var(--ink-soft); border-bottom: 2px solid var(--ornament); padding: .4rem .6rem; }
.page td { border-bottom: 1px solid var(--rule); padding: .45rem .6rem; vertical-align: top; }

/* images, laid out by the wiki */
.page > a.image, .page p.pic { display: block; margin: 2rem 0; text-align: center; }
:where(.page > a.image, .page p.pic) img {   /* weak, so the presets below win */ max-height: 34rem; width: auto; display: inline-block; vertical-align: top; border-radius: 2px; }
.page figure { margin: 2rem 0; text-align: center; }
:where(.page figure) img { max-height: 34rem; border-radius: 2px; }
.page figcaption { font-style: italic; font-size: .95rem; color: var(--ink-faint); margin-top: .5rem; }
.page figcaption::before { content: "— "; color: var(--ornament); }
.page img.small { width: 200px; }   /* the sizes the wiki scales images for */
.page img.medium { width: 400px; }
.page img.full { width: 100%; max-height: none; }
.page img:is(.right, .left):not(.small, .medium) { max-width: 40%; }
.page img.right { float: right; margin: .3rem 0 1rem 1.5rem; }
.page img.left { float: left; margin: .3rem 1.5rem 1rem 0; }
.page p.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .6rem; margin: 2rem 0; }
.page p.gallery img { aspect-ratio: 1; object-fit: cover; width: 100%; display: block; border-radius: 2px; }

/* the list widget */
.pagelist ul, .pagelist ol { columns: var(--columns, 3) 12rem; column-gap: 2.5rem; padding-left: 1.1rem; }
.pagelist li { break-inside: avoid; }
.pagelist a { text-decoration-color: transparent; }
.pagelist a:hover { text-decoration-color: var(--accent); }
.pagelist .date { color: var(--ink-faint); font-size: .88em; font-style: italic; }

/* ---------- Colophon (last edited, history, mentions) ---------- */

.page-info {
  clear: both; margin-top: 4rem; padding-top: 1.4rem; text-align: center;
  font-size: .98rem; color: var(--ink-faint); line-height: 1.6;
}
.page-info::before {
  content: ""; display: block; width: 4.5rem; height: 10px; margin: 0 auto 1.2rem; background: var(--ornament); opacity: .8;
  -webkit-mask: var(--fleuron) center / contain no-repeat; mask: var(--fleuron) center / contain no-repeat;
}
.page-info a { color: var(--ink-soft); }
.page-info .sep { color: var(--ornament); margin: 0 .4rem; }

/* ==========================================================================
   Home pages: plain Markdown, styled
   ========================================================================== */

/* <div class="shelf">: the root start page's campaigns, a numbered list,
   each item a linked picture and the campaign's name. */
.shelf > ol {
  list-style: none; padding: 0; margin: 0 -2rem; max-width: calc(var(--measure) + 4rem); counter-reset: vol;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.4rem;
}
.shelf > ol > li { counter-increment: vol; text-align: center; margin: 0; line-height: 1.35; }
.shelf > ol > li::before {
  content: counter(vol, upper-roman); display: block; font-family: var(--display); color: var(--ornament); font-size: 1.05rem; margin-bottom: .6rem;
}
.shelf > ol img {
  display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; margin-bottom: 1.1rem;
  border-radius: 2px; box-shadow: 0 0 0 1px var(--ornament), 0 0 0 5px var(--paper), 0 0 0 7px var(--ornament), 0 14px 24px -14px rgba(0, 0, 0, .5);
  transition: transform .4s ease;
}
.shelf > ol a:hover img { transform: translateY(-3px); }
.shelf > ol a { text-decoration: none; }
.shelf > ol a:not(:has(img)) { font-family: var(--display); font-size: 1.4rem; color: var(--ink); }
.shelf > ol a:not(:has(img)):hover { color: var(--accent); }
.shelf > ol em { display: block; color: var(--ink-faint); margin-top: .3rem; }
.shelf + p { text-align: center; color: var(--ink-faint); font-style: italic; margin-top: 3rem; }

/* <div class="directory">: a home page's directory of sections, written as a
   nested list ("- **People**" then indented links). */
.directory > ul { list-style: none; padding: 0; margin: 0 0 2.4rem; border-top: 1px solid var(--rule); }
.directory > ul > li {
  list-style: none; display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; align-items: baseline;
  margin: 0; padding: .75rem 0 .7rem; border-bottom: 1px solid var(--rule);
}
.directory > ul > li > strong { font-weight: 400; font-style: italic; font-family: var(--display); color: var(--accent); font-size: 1.05rem; }
.directory ul ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; }
.directory ul ul li { list-style: none; margin: 0; }
.directory ul ul li:not(:last-child)::after { content: "·"; color: var(--ornament); margin: 0 .55rem; }
.directory ul ul a { text-decoration: none; }
.directory ul ul a:hover { text-decoration: underline; }
.shelf + .directory { margin-top: 3.2rem; }   /* under the shelf of campaigns */

/* <div class="noticeboard">: notices as slips pinned on a board */
.noticeboard {
  margin: 1.6rem -2.5rem 2.4rem; padding: 2.4rem 2rem 2rem;
  background: var(--board);
  box-shadow: inset 0 0 0 1px var(--rule), inset 0 0 40px -10px rgba(60, 40, 15, .18);
  border-radius: 2px;
}
.noticeboard .pagelist.pictures { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 2rem 1.6rem; margin: 0; }
.noticeboard .pagelist.pictures a {
  position: relative; display: block; flex: 0 1 calc(33.3% - 1.1rem); max-width: 13rem;
  transform: rotate(var(--tilt, -1.5deg)); transition: transform .25s ease;
  filter: var(--slip-filter);
}
.noticeboard .pagelist.pictures a:nth-child(3n+2) { --tilt: 1.8deg; margin-top: .8rem; }
.noticeboard .pagelist.pictures a:nth-child(3n+3) { --tilt: -.7deg; }
.noticeboard .pagelist.pictures a:nth-child(4n+4) { --tilt: 2.4deg; }
.noticeboard .pagelist.pictures a:hover { transform: rotate(0) translateY(-3px); text-shadow: none; }
.noticeboard .pagelist.pictures a::before {      /* the pin */
  content: ""; position: absolute; top: 1.1rem; left: 50%; width: 13px; height: 13px; margin-left: -6.5px; border-radius: 50%; z-index: 1;
  background: radial-gradient(circle at 35% 30%, #f0b48a, var(--pin, #9b3a1e) 55%, #3d1208);
  box-shadow: 0 3px 3px -1px rgba(0, 0, 0, .4);
}
.noticeboard .pagelist.pictures img { display: block; width: 100%; height: auto; filter: drop-shadow(0 8px 6px rgba(20, 12, 4, .45)); }  /* follows the paper's shape */
.noticeboard .pagelist.pictures .no-picture { display: block; background: var(--sheet); padding: 1.5rem .5rem; text-align: center; font-family: var(--display); color: var(--ink); }
.noticeboard + p, .noticeboard ~ .more { text-align: center; }

/* the recent widget (```widget recent```): the last few changes, quietly */
.widget-recent ol { list-style: none; padding: 0; margin: 0 0 1rem; }
.widget-recent li { display: grid; grid-template-columns: 4.6rem 1fr; gap: 0 1rem; margin: 0; padding: .45rem 0; border-bottom: 1px dotted var(--rule); line-height: 1.45; }
.widget-recent time { font-variant-caps: all-small-caps; letter-spacing: .06em; color: var(--ink-faint); font-size: .98rem; padding-top: .1rem; }
.widget-recent .what a { text-decoration: none; }
.widget-recent .what a:hover { text-decoration: underline; }
.widget-recent .who { color: var(--ink-faint); font-style: italic; font-size: .95rem; }
.widget-recent .all { font-style: italic; font-size: .98rem; }

/* ==========================================================================
   Built-in screens (markup from the core; restyled, not restructured)
   ========================================================================== */

/* working screens: the margin stays, the column widens */
:is(.mode-edit, .mode-history, .mode-diff, .mode-recent, .mode-search) .frame {
  grid-template-columns: var(--margin) minmax(0, 1fr); max-width: 80rem;
}
:is(.mode-edit, .mode-history, .mode-diff, .mode-recent, .mode-search) .sidebar { justify-self: start; }
:is(.mode-history, .mode-diff, .mode-recent, .mode-search) .main { max-width: 52rem; width: 100%; justify-self: center; }

.page .lw-quiet { color: var(--ink-faint); }
.page :is(h1):has(> a) { font-size: clamp(1.9rem, 4vw, 2.5rem); }
.page h1 > a { text-decoration: none; font-style: italic; color: var(--accent); }
.lw-button, .lw-link {
  display: inline-block; background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; color: var(--ink-soft) !important; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: .2em;
}
.lw-button:hover, .lw-link:hover { color: var(--accent) !important; background: none; }
.lw-inline { display: inline; margin: 0; }

/* editor */
.lw-editor-head h1 { text-align: left !important; margin-bottom: 1rem !important; }
.lw-editor-head h1::after { display: none !important; }
.lw-editor-tabs { display: flex; flex-wrap: wrap; gap: .3rem 1.6rem; align-items: baseline; border-bottom: 1px solid var(--rule); margin-bottom: 0; }
.lw-tab {
  background: none; border: 0; padding: .4rem 0 .5rem; margin-bottom: -1px; cursor: pointer;
  font-variant-caps: all-small-caps; letter-spacing: .08em; font-size: 1.02rem; color: var(--ink-faint);
  border-bottom: 1px solid transparent;
}
.lw-tab:hover { color: var(--ink); }
.lw-tab.lw-active { background: none; color: var(--accent); border-bottom-color: var(--accent); }
.lw-format { gap: .2rem; margin-left: 0; }
.lw-format button { color: var(--ink-faint); padding: .1rem .35rem; font-size: 1.02rem; }
.lw-format button:hover { color: var(--accent); border-color: transparent; }
.lw-format button[aria-pressed="true"] { color: var(--accent); background: var(--sheet); border-color: var(--rule); }
.lw-format .lw-mk { font-family: var(--mono); }
/* the code editor (CodeMirror) on the theme's paper, in both modes; its own
   stylesheet loads after this one, hence .mode-edit */
.mode-edit .CodeMirror { background: var(--sheet); color: var(--ink); border: 1px solid var(--rule); font-family: var(--mono); }
.mode-edit .CodeMirror-cursor { border-left-color: var(--ink); }
.mode-edit .CodeMirror-selected, .mode-edit .CodeMirror-focused .CodeMirror-selected { background: var(--mark); }
.mode-edit .CodeMirror .cm-header, .mode-edit .CodeMirror .cm-strong, .mode-edit .CodeMirror .cm-link { color: var(--accent); }
.mode-edit .CodeMirror :is(.cm-tag, .cm-attribute, .cm-url, .cm-comment, .cm-quote) { color: var(--ink-faint); }
.mode-edit .CodeMirror .cm-string { color: var(--ink-soft); }
.lw-help { margin-left: auto; font-style: italic; font-size: .95rem; color: var(--ink-faint); }
.lw-editor-panes { display: grid; grid-template-columns: 1fr; gap: 0; margin-top: 1.4rem; }
.lw-editor-panes.lw-mode-split { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
.lw-editor-panes.lw-mode-write .lw-preview { display: none; }
.lw-text {
  width: 100%; min-height: 34rem; resize: vertical; display: block;
  background: var(--sheet); color: var(--ink); border: 1px solid var(--rule); border-radius: 2px;
  padding: 1.6rem 1.8rem; font: .95rem/1.75 var(--mono);
  box-shadow: 0 18px 30px -26px rgba(40, 25, 10, .5);
}
.lw-text:focus { outline: none; border-color: var(--ornament); }
.lw-preview { min-width: 0; max-height: 40rem; overflow: auto; padding-right: .5rem; }
.lw-preview .page { font-size: 1rem; }
.lw-editor-foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: .8rem 1.4rem; margin-top: 1.4rem; }
.lw-summary {
  flex: 1 1 18rem; background: transparent; border: 0; border-bottom: 1px solid var(--ink-faint);
  padding: .4rem 0; color: var(--ink); font: italic 1.05rem var(--text);
}
.lw-summary::placeholder { color: var(--ink-faint); }
.lw-summary:focus { outline: none; border-bottom-color: var(--accent); }
.lw-button.lw-primary {
  text-decoration: none; padding: .45rem 1.3rem; border: 1px solid var(--accent); color: var(--accent) !important;
  font-variant-caps: all-small-caps; letter-spacing: .1em; font-size: 1.05rem; border-radius: 2px;
}
.lw-button.lw-primary:hover { background: var(--accent); color: var(--paper) !important; text-shadow: none; }
.lw-editor-foot .lw-hint { flex-basis: 100%; font-style: italic; font-size: .95rem; color: var(--ink-faint); }

/* history: a ledger */
.lw-history { width: 100%; border-collapse: collapse; font-size: 1rem; }
.lw-history th { text-align: left; font-weight: 500; color: var(--ink-faint); border-bottom: 1px solid var(--ornament); padding: .3rem .8rem .4rem 0; }
.lw-history td { padding: .7rem .8rem .7rem 0; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
.lw-history td:first-child { white-space: nowrap; font-variant-numeric: tabular-nums lining-nums; font-size: .95rem; color: var(--ink-soft); }
.lw-history td:first-child .lw-quiet { display: block; font-style: italic; font-size: .9rem; font-variant-numeric: oldstyle-nums; }
.lw-history:not(.lw-admin) td:nth-child(2) { font-style: italic; }
.lw-history td:nth-child(3) { color: var(--ink); }
.lw-history .lw-actions { text-align: right; white-space: nowrap; font-size: .95rem; color: var(--ornament); }
.lw-history .lw-actions a, .lw-history .lw-actions .lw-link { color: var(--ink-soft); }
/* the newest revision on a History page (lw-history also styles the Users, Files and Admin tables) */
.lw-history:not(.lw-users, .lw-files, .lw-admin) tbody tr:first-child td:nth-child(3)::after { content: " ❦"; color: var(--ornament); }

/* diff */
.lw-diff {
  display: block; white-space: normal; background: var(--sheet) !important; padding: 0 !important;
  border: 1px solid var(--rule); border-radius: 2px; font: .86rem/1.65 var(--mono) !important; overflow: hidden;
}
pre.lw-diff > span { display: block; white-space: pre-wrap; padding: .1rem 1.1rem .1rem 2.4rem;   /* pre. to win over the core stylesheet */ position: relative; min-height: 1.65em; }
pre.lw-diff > .lw-hunk { margin: 0; background: var(--paper-deep); color: var(--ink-faint); font-style: italic; padding-left: 1.1rem; border-block: 1px solid var(--rule); }
.lw-diff .lw-del { background: var(--del); }
.lw-diff .lw-add { background: var(--add); }
.lw-diff .lw-del::before, .lw-diff .lw-add::before { position: absolute; left: 1rem; color: var(--ink-faint); }
.lw-diff .lw-del::before { content: "−"; }
.lw-diff .lw-add::before { content: "+"; }
.lw-diff .lw-ctx { color: var(--ink-soft); }
.lw-diff .lw-ctx::before { content: none; }

/* recent changes: a day-book */
.lw-recent { list-style: none; padding: 0 !important; }
.page .lw-recent > li { list-style: none; margin: 0; padding: .8rem 0 .85rem; border-bottom: 1px solid var(--rule); line-height: 1.55; }
.lw-recent > li > .lw-quiet:first-child { font-variant-caps: all-small-caps; letter-spacing: .06em; }
.lw-recent > li > strong { font-weight: 500; font-style: italic; color: var(--ink-soft); }
.lw-recent > li > a:not(.lw-quiet) { text-decoration-color: var(--rule); }
.lw-recent a.lw-quiet { font-size: .85em; text-decoration: none; }
.lw-recent > li > span.lw-quiet:last-child { display: block; font-style: italic; }

/* ==========================================================================
   Phones and narrow windows: one column, the margin becomes a colophon
   ========================================================================== */

@media (max-width: 1080px) {
  .frame, :is(.mode-edit, .mode-history, .mode-diff, .mode-recent, .mode-search) .frame { grid-template-columns: minmax(0, calc(var(--measure) + 2 * var(--pad))); justify-content: center; padding-top: 1.4rem; }
  .mode-edit .frame { --measure: 60rem; }
  .main, .mode-show .main, .mode-edit .main, .mode-history .main, .mode-diff .main, .mode-recent .main { grid-column: 1; }
  .sidebar {
    grid-column: 1; grid-row: 2; justify-self: stretch; width: auto; position: static; max-height: none; overflow: visible;
    margin-top: 3rem; padding: 1.6rem 0 0; border-top: 1px solid var(--rule);
    display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0 2rem;
  }
  .sidebar > h2 { margin-top: 0; }
  .sidebar .toc, .sidebar .to-top, .sidebar .volumes { grid-column: 1 / -1; }
  .sidebar .toc { margin-bottom: 1.6rem; }
  .sidebar-group { min-width: 0; }
  .menu-link { display: inline; white-space: nowrap; }
  .shelf > ol { margin: 0; }
  .page > :is(a.image, p):first-child:has(+ h1), .noticeboard { margin-left: 0; margin-right: 0; }
}
@media (max-width: 760px) {
  .masthead { grid-template-columns: minmax(0, 1fr) auto; padding: .9rem 1rem .8rem; gap: .5rem 1rem; }
  .search-link::after { content: ""; }
  .lodge { white-space: nowrap; font-size: 1.02rem; }
  .theme-toggle span { font-size: 0; }
  .theme-toggle span::before { font-size: 1.05rem; }
  .frame { padding: 0 0 4rem; }
  .main { --pad: 1.1rem; padding-top: 1.4rem; border-radius: 0; }
  .sidebar { padding-inline: 1.1rem; }
  html { font-size: 100%; }
  body { font-size: 1.07rem; }
  .breadcrumbs { margin-bottom: 1.6rem; }
  .shelf > ol { grid-template-columns: 1fr; gap: 2.4rem; }
  .shelf > ol img { aspect-ratio: 16 / 10; }
  .directory > ul > li { grid-template-columns: 1fr; gap: .1rem; }
  .noticeboard { padding: 2rem 1rem 1.6rem; margin-left: -1.1rem; margin-right: -1.1rem; }
  .noticeboard .pagelist.pictures a { flex-basis: calc(50% - .8rem); }
  .page img.right, .page img.left { float: none; display: block; max-width: 100%; margin: 1.5rem auto; }
  .lw-editor-panes.lw-mode-split { grid-template-columns: 1fr; }
  .lw-history thead { display: none; }
  .lw-history tr { display: grid; grid-template-columns: 1fr auto; border-bottom: 1px solid var(--rule); padding: .6rem 0; }
  .lw-history td { border: 0; padding: .1rem 0; }
  .lw-history td:nth-child(3) { grid-column: 1 / -1; }
  .lw-history td:first-child .lw-quiet { display: inline; }
  .lw-history .lw-actions { grid-column: 1 / -1; text-align: left; }
  .widget-recent li { grid-template-columns: 1fr; }
}


@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* additions: recent widget message, margin groups */
.widget-recent .msg { display: block; font-style: italic; font-size: .93rem; color: var(--ink-faint); }
.sidebar .toc h2, .sidebar > .sidebar-group:first-child h2 { margin-top: 0; }
@media (max-width: 1080px) { .sidebar-group h2 { margin-top: 0; } .sidebar-group { margin-bottom: 1.4rem; } }

/* ==========================================================================
   Boxes used in pages (classes written in page content)
   ========================================================================== */

.page .footnotes { margin-top: 2.5rem; font-size: .9rem; color: var(--ink-faint); }
.page .footnotes hr { margin: 0 0 .8rem; }
.page img.center { display: block; margin: 0 auto 1rem; }
.page del { color: var(--ink-faint); }
.page sup, .page sub { line-height: 0; font-size: .75em; }

.pagelist-heading { font-variant-caps: all-small-caps; letter-spacing: .08em; color: var(--ink-faint); margin-bottom: .4rem; }
.pagelist.pictures { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.2rem; }
.pagelist.pictures a { display: block; text-decoration: none; }
.pagelist.pictures img { display: block; width: 12rem; border-radius: 2px; }
.pagelist.pictures .no-picture { width: 12rem; min-height: 7rem; display: flex; align-items: center; justify-content: center; padding: 1rem; text-align: center; background: var(--paper-deep); }
.pagelist.tree ul { columns: auto; list-style: none; padding-left: 1.1rem; }
.pagelist.tree > ul { padding-left: 0; }
.pagelist.tree li.folder > a { font-style: italic; }

/* <span class="badaawi">: the Badaawi script */
.badaawi { font-family: "Badaawi", var(--text); }

/* <div class="spoiler">: blurred until hovered or tapped */
.spoiler { margin: 0 0 1.1rem; padding: .6rem 1rem; border: 1px dashed var(--ornament); filter: blur(5px); transition: filter .2s; cursor: help; }
.spoiler:hover, .spoiler:focus-within { filter: none; }
.spoiler > :last-child { margin-bottom: 0; }

/* <div class="noticeboard wood1">: the wood is a choice of board */
.noticeboard:is(.wood1, .wood2, .wood3) { background-size: cover; box-shadow: inset 0 0 40px rgba(0, 0, 0, .45); }
.wood1 { background-image: url("images/wood1.jpg"); }
.wood2 { background-image: url("images/wood2.jpg"); }
.wood3 { background-image: url("images/wood3.jpg"); }

/* <div class="statusboard on_quest">: character portraits on a scene */
.statusboard { min-height: 30rem; margin: 0 0 1.1rem; padding: .5rem; border-radius: 2px; background-size: cover; }
.statusboard p { margin: 0; }
.statusboard img { display: inline-block; width: 17.5%; margin: .4rem .8%; vertical-align: middle; filter: drop-shadow(5px 5px 4px rgba(0, 0, 0, .6)); }
.dead { background-image: url("images/dead.jpg"); }
.looking_for_quest { background-image: url("images/looking_for_quest_2.png"); }
.retired { background-image: url("images/retired.jpg"); }
.on_quest { background-image: url("images/on_quest.jpg"); }
.missing:not(a) { background-image: url("images/missing.jpg"); }
@media (max-width: 760px) { .statusboard img { width: 29%; margin: .3rem; } }

@media print {
  .masthead, .sidebar, .page-info, .breadcrumbs { display: none; }
  .frame { display: block; padding: 0; }
  body, .main { background: none; box-shadow: none; padding: 0; }
}
