/* Leonida Waypoint — OSRS Wiki style layout layer.
   Applied only on pages carrying <body class="wiki"> (the database
   section and layout samples). It borrows the wiki's layout pattern:
   a persistent left sidebar with grouped navigation, a content-first
   main column, an infobox floated at the top right of the article,
   and dense data tables. All colors, fonts and the brand stay
   Leonida Waypoint's own; every CSS variable used here is defined
   in the :root of styles.css (both color schemes). The topbar is
   unchanged. On narrow screens the sidebar is hidden and navigation
   falls back to the site's existing mobile menu (a fixed takeover
   panel driven by main.js) plus the topbar nav. */

/* ---------- shell: sidebar + content column ---------- */
.wiki-shell {
  /* Shell widened 1460 -> 1700 (Nick, Nov 17, 2026: use more width).
     The homepage shells (.wiki-home-wrap, .wiki-welcome-in) keep
     their own 1460 measure and are deliberately not touched. */
  max-width: 1700px; margin: 0 auto; padding: 26px 22px 0;
  display: grid; grid-template-columns: 250px minmax(0, 1fr);
  gap: 36px; align-items: start;
}
.wiki-main { min-width: 0; }
.wiki-main .wrap { max-width: none; margin: 0; padding: 0; }
body.wiki section.block { padding-top: 36px; }

/* ---------- left sidebar ---------- */
.wiki-side {
  position: sticky; top: 76px;
  max-height: calc(100vh - 96px); overflow-y: auto;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow);
  padding: 16px 14px; font-size: 15px;
}
.wiki-search { display: flex; gap: 6px; }
.wiki-search input {
  flex: 1; min-width: 0; font: inherit; font-size: 14.5px;
  padding: 9px 10px; border: 1.5px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--ink);
}
.wiki-search button {
  font: inherit; font-weight: 700; font-size: 14.5px; cursor: pointer;
  background: var(--pink); color: #fff; border: none; border-radius: 6px;
  padding: 0 13px; min-height: 40px;
}
.wiki-sample-note {
  margin: 14px 0 0; padding: 10px 12px; font-size: 13px; line-height: 1.45;
  color: var(--ink-soft); background: var(--chip); border-radius: 6px;
}
.wiki-group { margin-top: 6px; }
.wiki-group h3 {
  font-family: "Barlow Condensed", sans-serif; font-size: 16px; font-weight: 700;
  letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-soft);
  margin: 0 0 6px; padding-top: 15px; border-top: 1px solid var(--line);
}
.wiki-group ul { list-style: none; margin: 0; padding: 0; }
.wiki-group li + li { margin-top: 1px; }
.wiki-group a {
  display: block; padding: 5px 9px; border-radius: 5px;
  color: var(--ink); text-decoration: none; font-weight: 500;
}
.wiki-group a:hover { background: var(--teal-soft); color: var(--teal); }
.wiki-group a.current {
  background: var(--chip); font-weight: 700;
  box-shadow: inset 3px 0 0 var(--pink);
}
/* Scrollspy (main.js): the "On this page" link for the section the
   reader is currently in. Gold bar, not pink: pink marks the page
   you are on, gold marks the section you are reading. */
.wiki-group a.spy-active {
  background: var(--chip); font-weight: 700;
  box-shadow: inset 3px 0 0 var(--gold);
}

/* ---------- infobox (floated top right of the article) ---------- */
.wiki-infobox {
  float: right; width: 302px; margin: 6px 0 20px 26px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow);
  overflow: hidden; font-size: 14.5px;
}
.wiki-infobox-title {
  background: var(--night); color: #fff; margin: 0;
  font-family: "Barlow Condensed", sans-serif; font-size: 20px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.03em; padding: 10px 14px;
}
.wiki-infobox dl { margin: 0; }
.wiki-infobox dl > div {
  display: grid; grid-template-columns: 40% 60%;
  border-top: 1px solid var(--line);
}
.wiki-infobox dt {
  padding: 8px 12px; font-weight: 700; color: var(--ink-soft);
  background: var(--bg);
}
.wiki-infobox dd { padding: 8px 12px; margin: 0; }
.wiki-infobox-note {
  margin: 0; padding: 10px 12px; border-top: 1px solid var(--line);
  font-size: 13px; line-height: 1.5; color: var(--ink-soft);
}

/* ---------- article column: rail removed, prose widens ---------- */
body.wiki .article-layout { display: block; }
/* 68em -> 84em with the Nov 17, 2026 shell widening, so the prose
   (and its tables) use the gained column instead of capping early. */
body.wiki .prose { max-width: 84em; }
/* Boxed prose components (facts box, quick version, callouts,
   figures) must not slide underneath the floated infobox the way
   plain text wraps around it: as block-formatting-context roots
   they sit beside it instead. Grid components (.cards, .step,
   .check-panel) are deliberately excluded, and .table-scroll
   already forms a context through its overflow. */
body.wiki .facts-box,
body.wiki .quick-block,
body.wiki .callout,
body.wiki figure { display: flow-root; }

/* ---------- dense wiki tables ---------- */
body.wiki table { font-size: 15px; }
body.wiki th, body.wiki td { padding: 9px 12px; }
body.wiki thead th { font-size: 17px; padding: 9px 12px; }
body.wiki tbody th { width: auto; }
body.wiki tbody tr:nth-child(even) { background: var(--bg); }
body.wiki .table-scroll { overflow-x: auto; }

/* ---------- breakpoints ---------- */
@media (max-width: 1080px) {
  /* Sidebar collapses away: below this width the topbar nav (to
     1080px) and then the fixed mobile menu panel carry navigation,
     exactly as on the rest of the site. */
  .wiki-shell { grid-template-columns: 1fr; padding-top: 20px; }
  .wiki-side { display: none; }
}
@media (max-width: 720px) {
  .wiki-infobox { float: none; width: auto; margin: 18px 0; }
}
@media (max-width: 560px) {
  /* styles.css turns every table into stacked blocks at this width;
     wiki pages keep real tables (the OSRS pattern) and let the
     .table-scroll wrapper scroll sideways instead. */
  body.wiki table { display: table; }
  body.wiki thead { display: table-header-group; }
  body.wiki tbody { display: table-row-group; }
  body.wiki tr { display: table-row; }
  body.wiki th, body.wiki td { display: table-cell; padding: 8px 10px; }
  body.wiki tbody td::before { content: none; }
}

/* ================================================================
   HOMEPAGE (body.wiki-home): the OSRS Wiki homepage pattern with
   Leonida Waypoint's Vice City skin. A full-bleed photo hero with the official
   key art and the neon countdown as its centerpiece, a top
   row of three news boxes (the newest Reports, fed by
   assets/js/home-news.js from LW_ARTICLES), a grid of section
   boxes, and a Popular pages button grid. Structure is the
   wiki's; every color, font and image stays this site's own.
   Variables used are the same :root set as above.
   ================================================================ */
.wiki-home-wrap {
  max-width: 1460px; margin: 0 auto; padding: 26px 22px 0;
}

/* ---------- hero: full-bleed key art, countdown centerpiece ----------
   The welcome section sits OUTSIDE .wiki-home-wrap as a
   full-viewport-width photo hero (the DayGoer pattern): the
   official key art fills the block, a night scrim rises from the
   bottom, and the kicker, headline, lede and search sit on the
   photo in the upper left. The neon countdown is the centerpiece:
   centered, anchored to the lower part of the photo, the largest
   element on the page, a neon sign over Vice City that happens to
   have a headline. Its grid tracks are minmax(0, 1fr), so the
   block keeps its shape at every width and in its post-launch
   state (the script freezes the cells at 0 / 00 / 00 / 00; no
   slot collapses). */
.wiki-welcome {
  position: relative; overflow: hidden; background: var(--night);
  display: flex; flex-direction: column;
  min-height: clamp(600px, 94vh, 860px);
}
.wiki-welcome-art { position: absolute; inset: 0; }
.wiki-welcome-art img {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: center 26%;
}
/* Legibility scrim: a left wash behind the headline column plus a
   night gradient rising from the bottom, where the countdown sits. */
.wiki-welcome::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(90deg, rgba(16, 5, 28, 0.52) 0%, rgba(16, 5, 28, 0.18) 55%, rgba(16, 5, 28, 0) 78%),
    linear-gradient(180deg, rgba(16, 5, 28, 0.34) 0%, rgba(16, 5, 28, 0.10) 30%, rgba(16, 5, 28, 0.52) 63%, rgba(16, 5, 28, 0.94) 100%);
}
/* Sunset band on the hero's bottom edge. */
.wiki-welcome::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; z-index: 3;
  background: linear-gradient(90deg, #ff2e88, var(--orange), var(--gold), #3ec6cf);
  box-shadow: 0 0 16px rgba(255, 46, 136, 0.45);
}
.wiki-welcome-in {
  position: relative; z-index: 2; flex: 1;
  display: flex; flex-direction: column;
  width: 100%; max-width: 1460px; margin: 0 auto;
  padding: clamp(34px, 5.5vh, 58px) 22px 30px;
}
.wiki-welcome-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
/* The kicker chip hugs its text: as a flex item it would
   otherwise stretch the full width of the hero. */
.wiki-welcome .kicker { align-self: flex-start; }
.wiki-welcome h1 {
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(40px, 4.8vw, 62px); line-height: 0.98;
  font-weight: 700; text-transform: uppercase;
  color: #fff; margin: 12px 0 12px; max-width: 12em;
  text-shadow: 0 2px 26px rgba(10, 4, 20, 0.65);
}
.wiki-welcome h1 em { font-style: normal; color: #ff5e8a; }
.wiki-welcome .lede {
  color: #f7e9f2; font-size: 17.5px; line-height: 1.55;
  max-width: 56ch; margin: 0;
  text-shadow: 0 1px 16px rgba(10, 4, 20, 0.85);
}
.wiki-welcome .hero-search { max-width: 640px; margin-bottom: 30px; }
/* The countdown block: sunset-wash glass over the photo, a glowing
   sunset band across the top, and big Barlow Condensed numerals
   with a pink / teal neon glow (alternating cells). margin-top:
   auto anchors it to the lower part of the hero; the search's
   margin-bottom guarantees the minimum gap above it. */
.wiki-welcome .countdown {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px; width: 100%; max-width: 940px;
  align-self: center; margin-top: auto; margin-bottom: 0;
  padding: 24px 22px 14px;
  border: 1px solid rgba(255, 255, 255, 0.20); border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(242, 109, 33, 0.16), rgba(232, 49, 111, 0.07) 48%, rgba(14, 125, 134, 0.13)),
    rgba(11, 4, 20, 0.52);
  box-shadow: 0 24px 60px rgba(5, 1, 12, 0.45);
}
.wiki-welcome .countdown::before {
  content: ""; grid-column: 1 / -1; height: 5px; border-radius: 3px;
  background: linear-gradient(90deg, #ff2e88, var(--orange), var(--gold), #3ec6cf);
  box-shadow: 0 0 18px rgba(255, 46, 136, 0.6);
}
.wiki-welcome .cd-cell {
  min-width: 0; padding: 24px 6px 18px; border-radius: 12px;
  background: rgba(11, 4, 20, 0.55);
  border: 2px solid rgba(255, 46, 136, 0.55);
  box-shadow: inset 0 0 18px rgba(255, 46, 136, 0.13), 0 0 22px rgba(255, 46, 136, 0.18);
}
.wiki-welcome .cd-cell:nth-child(even) {
  border-color: rgba(62, 198, 207, 0.55);
  box-shadow: inset 0 0 18px rgba(62, 198, 207, 0.13), 0 0 22px rgba(62, 198, 207, 0.18);
}
.wiki-welcome .cd-cell b {
  font-size: clamp(56px, 8.2vw, 112px);
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.55), 0 0 22px rgba(255, 46, 136, 0.9), 0 0 48px rgba(255, 46, 136, 0.5);
}
.wiki-welcome .cd-cell:nth-child(even) b {
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.55), 0 0 22px rgba(62, 198, 207, 0.9), 0 0 48px rgba(62, 198, 207, 0.5);
}
.wiki-welcome .cd-cell span { font-size: 13px; }
.wiki-welcome .cd-note {
  grid-column: 1 / -1; width: auto; color: #f0d9e8;
  text-shadow: 0 1px 10px rgba(10, 4, 20, 0.85);
}
.wiki-welcome .cd-note a { color: #ff8fab; }
.wiki-welcome .home-status { margin-top: 18px; justify-content: center; }

/* ---------- news row ---------- */
.wiki-news { margin-top: 38px; }
.wiki-head-link { font-weight: 700; font-size: 15px; white-space: nowrap; }

/* ---------- homepage layout: main column + right rail ----------
   Below the news row the homepage splits in two: the section
   tiles and Popular Pages run down the main column, and the From
   Rockstar panel sits in a sticky rail on the RIGHT (Nick's rule:
   content and link rails go right; the left is for filters). The
   rail is 372px, enough for the X embed at close to its natural
   width with the panel padding around it, so no dead space sits
   beside the feed. Under 900px the layout stacks back to one
   column and the rail flows after the main column. */
.home-split {
  display: grid; grid-template-columns: minmax(0, 1fr) 372px;
  gap: 24px; align-items: start; margin-top: 30px;
}
.home-col { min-width: 0; }
.home-side { position: sticky; top: 76px; align-self: start; }
.home-side .wiki-panel .x-embeds { max-width: 100%; }

/* ---------- rail panel (From Rockstar) ---------- */
.wiki-panel {
  background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); padding: 20px 22px;
}
.wiki-panel .sec-head { margin-bottom: 4px; }
.wiki-panel .x-embeds { max-width: 560px; }

/* ---------- section tiles (OSRS pattern) ----------
   A strict grid of uniform tiles: every tile is one link, a
   full-width image at a fixed 16/9 aspect on top, then a label
   area with the section name and one short line under it. No
   link lists inside tiles; those live on the hub pages.
   grid-auto-rows: 1fr plus height: 100% makes every tile the
   same height, so nothing breaks the grid's uniformity. The
   Tracker tile carries one slim progress line inside its label
   area; the grid absorbs it without changing any tile's size. */
.home-boxes {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr; gap: 20px; align-items: stretch;
}
.sec-tile {
  display: flex; flex-direction: column; height: 100%;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow); overflow: hidden;
  color: var(--ink); text-decoration: none;
}
.sec-tile-img {
  display: block; aspect-ratio: 16 / 9; overflow: hidden;
  background: var(--night); flex: none;
}
.sec-tile-img img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.25s ease;
}
.sec-tile:hover { box-shadow: 0 0 18px rgba(232, 49, 111, 0.35); }
.sec-tile:hover .sec-tile-img img { transform: scale(1.04); }
.sec-tile:hover .sec-tile-name { color: var(--pink-deep); }
.sec-tile:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }
.sec-tile-label { display: block; padding: 13px 15px 15px; }
.sec-tile-name {
  display: block; font-family: "Barlow Condensed", sans-serif;
  font-size: 19.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.01em; line-height: 1.05;
}
.sec-tile-desc {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden; margin-top: 4px;
  font-size: 13.5px; line-height: 1.4; color: var(--ink-soft);
}
.sec-tile-prog {
  display: block; margin-top: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--teal);
}
.sec-tile-prog b { font-weight: 700; }

/* ---------- popular pages ---------- */
.pop-panel {
  margin-top: 30px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); overflow: hidden;
}
.pop-title {
  background: linear-gradient(90deg, var(--pink-deep), var(--pink) 34%, var(--orange) 74%, var(--gold));
  color: #fff; margin: 0; text-shadow: 0 1px 12px rgba(22, 10, 36, 0.5);
  font-family: "Barlow Condensed", sans-serif; font-size: 22px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.03em; padding: 11px 18px;
}
.pop-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; padding: 18px;
}
.pop-btn {
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: var(--chip); border: 1.5px solid var(--line); border-radius: 10px;
  padding: 15px 12px; min-height: 56px;
  font-weight: 700; font-size: 16.5px; color: var(--ink); text-decoration: none;
}
.pop-btn:hover {
  background: var(--night); color: #fff; border-color: var(--pink);
  text-decoration: none; box-shadow: 0 0 18px rgba(232, 49, 111, 0.35);
}


/* ---------- Vice City accents on the boxes and panels ----------
   A rotating neon trim (pink / orange / teal) across the section
   boxes, a teal trim on the From Rockstar panel, and a soft pink
   glow when a news card is hovered. Structure stays the wiki's;
   the color language is the site's neon. */
.home-boxes .sec-tile { border-top: 3px solid var(--pink); }
.home-boxes .sec-tile:nth-child(3n+2) { border-top-color: var(--orange); }
.home-boxes .sec-tile:nth-child(3n) { border-top-color: var(--teal); }
.wiki-panel { border-top: 3px solid var(--teal); }
.wiki-news .card { transition: box-shadow 0.2s ease; }
.wiki-news .card:hover { box-shadow: 0 16px 36px rgba(194, 24, 82, 0.20); }

/* ---------- homepage breakpoints ---------- */
@media (max-width: 1400px) {
  /* With the rail taking 372px, three tile columns squeeze the
     labels under laptop widths; two wider columns keep every
     section name on one line and the tiles chunky. */
  .home-boxes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  /* The rail stacks under the main column and the panel's embed
     returns to its natural width instead of the rail width. */
  .home-split { grid-template-columns: minmax(0, 1fr); }
  .home-side { position: static; }
  .home-side .wiki-panel .x-embeds { max-width: 560px; }
}
@media (max-width: 720px) {
  /* Tiles stay two across on phones, with tighter labels. */
  .home-boxes { gap: 12px; }
  .sec-tile-label { padding: 10px 12px 12px; }
  .sec-tile-name { font-size: 16.5px; }
  .sec-tile-desc { font-size: 12.5px; -webkit-line-clamp: 3; }
  .sec-tile-prog { font-size: 11.5px; }
  .pop-grid { grid-template-columns: repeat(2, 1fr); }
  .wiki-welcome-in { padding: 20px 18px 24px; }
}
@media (max-width: 480px) {
  .pop-grid { grid-template-columns: 1fr; }
  .wiki-home-wrap { padding: 18px 14px 0; }
}
@media (max-width: 720px) {
  /* Hero, phone and small tablet: natural height, the key art
     crops toward the protagonists on the right of the frame, and
     the scrim's middle stops deepen a step because the lede now
     spans the full width over the art. */
  .wiki-welcome { min-height: 0; }
  .wiki-welcome-art img { object-position: 64% 20%; }
  .wiki-welcome::before {
    background:
      linear-gradient(90deg, rgba(16, 5, 28, 0.52) 0%, rgba(16, 5, 28, 0.30) 60%, rgba(16, 5, 28, 0.12) 85%),
      linear-gradient(180deg, rgba(16, 5, 28, 0.38) 0%, rgba(16, 5, 28, 0.24) 30%, rgba(16, 5, 28, 0.62) 63%, rgba(16, 5, 28, 0.95) 100%);
  }
  .wiki-welcome-in { padding: 28px 18px 24px; }
}
@media (max-width: 560px) {
  /* Neon countdown, phone size: tighter cells, numerals sized to
     the viewport, and smaller unit labels so the longest Spanish
     label (SEGUNDOS) still fits its cell on one line. The tracks
     stay minmax(0, 1fr), so nothing can push the hero sideways. */
  .wiki-welcome .countdown { gap: 8px; padding: 16px 12px 10px; }
  .wiki-welcome .cd-cell { padding: 16px 4px 12px; }
  .wiki-welcome .cd-cell b { font-size: clamp(50px, 14vw, 112px); }
  .wiki-welcome .cd-cell span { font-size: 10px; letter-spacing: 0.07em; }
  .wiki-welcome .home-status { justify-content: flex-start; }
}

/* ================================================================
   VICE CITY SKIN (Nov 16, 2026): the homepage's neon language on
   the wiki chrome. Sidebar group headers get the sunset underline,
   the sidebar card a pink top trim, the infobox title a sunset
   wash over the night band with a pink underline, and the sidebar
   search button the pink neon glow on hover. Dense wiki
   readability is untouched: no body text changes, no layout moves.
   ================================================================ */
.wiki-side { border-top: 3px solid var(--pink); }
.wiki-group h3 {
  background: linear-gradient(90deg, #ff2e88, var(--orange), var(--gold), #3ec6cf) left bottom / 42px 3px no-repeat;
  padding-bottom: 7px;
}
.wiki-search button:hover { box-shadow: 0 0 16px rgba(232, 49, 111, 0.5); }
.wiki-infobox-title {
  background:
    linear-gradient(90deg, rgba(255, 46, 136, 0.38), rgba(242, 109, 33, 0.22) 48%, rgba(62, 198, 207, 0.32)),
    var(--night);
  border-bottom: 3px solid var(--pink);
}

/* ---------- database entry pictures (Nov 17, 2026) ----------
   A leading picture column on every database table: a captioned,
   credited thumbnail where a verified official image exists, an
   empty cell where none does (no placeholders). Square variant
   for station art and song covers. Fixed box sizes keep the
   tables from shifting while images load. */
body.wiki td.pic-cell { width: 176px; vertical-align: top; }
body.wiki .db-pic { margin: 0; }
body.wiki .db-pic img {
  display: block; width: 160px; height: 90px; object-fit: cover;
  border-radius: 8px; background: var(--chip);
}
body.wiki .db-pic.sq img { width: 120px; height: 120px; }
body.wiki .db-pic figcaption {
  font-size: 12px; line-height: 1.4; color: var(--ink-soft);
  margin-top: 5px; max-width: 164px;
}
body.wiki figure.db-album { max-width: 300px; margin: 16px 0 4px; }
body.wiki figure.db-album img {
  display: block; width: 100%; height: auto; border-radius: 10px;
}
body.wiki figure.db-album figcaption {
  font-size: 12.5px; line-height: 1.45; color: var(--ink-soft); margin-top: 6px;
}

/* ---------- database tables as stacked cards (phones, Nov 17, 2026) ----------
   Nick's screenshot verdict: the 5 and 6 column database tables were
   crushed into phone width, columns wrapping a word or two per line
   into skyscraper rows, the last column off the right edge and the
   picture captions clipped mid-word. Under 720px the tables stop
   being tables: each row becomes a card. The picture is the card's
   top image (full width, caption and credit under it, never
   clipped), the row's name cell (.db-name) is the card title, and
   every other cell is a labeled line whose label comes from the
   cell's data-label attribute (injected from the table's own thead,
   in the page's own language). No horizontal scrolling anywhere.
   Desktop above 720px is untouched. */
@media (max-width: 720px) {
  body.wiki .table-scroll {
    overflow: visible; border: none; border-radius: 0;
    box-shadow: none; background: transparent;
  }
  body.wiki .table-scroll table,
  body.wiki .table-scroll tbody,
  body.wiki .table-scroll tr,
  body.wiki .table-scroll th,
  body.wiki .table-scroll td { display: block; width: auto; }
  body.wiki .table-scroll thead { display: none; }
  body.wiki .table-scroll tbody tr {
    background: var(--bg-2); border: 1px solid var(--line);
    border-radius: 10px; box-shadow: var(--shadow);
    padding: 14px 16px 12px; margin: 0 0 14px;
  }
  body.wiki .table-scroll tbody th,
  body.wiki .table-scroll tbody td {
    padding: 0; border: none; text-align: left;
  }
  body.wiki .table-scroll tbody td {
    margin-top: 10px; font-size: 15.5px; line-height: 1.5;
  }
  body.wiki .table-scroll tbody td::before {
    content: attr(data-label); display: block;
    font-size: 12px; font-weight: 700; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--pink-deep);
    margin-bottom: 2px;
  }
  body.wiki .table-scroll tbody th.db-name {
    font-family: "Barlow Condensed", sans-serif;
    font-size: 25px; font-weight: 700; line-height: 1.1;
    margin-top: 10px;
  }
  body.wiki .table-scroll tbody th.db-name::before { content: none; }
  /* Picture: the card's top image. Empty picture cells (entries with
     no verified official image) disappear instead of leaving a gap. */
  body.wiki .table-scroll td.pic-cell { width: auto; margin-top: 0; }
  body.wiki .table-scroll td.pic-cell:empty { display: none; }
  body.wiki .table-scroll td.pic-cell::before { content: none; }
  body.wiki .table-scroll .db-pic img {
    width: 100%; height: auto; max-height: 230px;
  }
  body.wiki .table-scroll .db-pic.sq img {
    width: 100%; height: auto; max-height: 260px;
  }
  body.wiki .table-scroll .db-pic figcaption {
    max-width: none; font-size: 12.5px;
  }
  /* Radio sample player: the JS-inserted player row becomes a plain
     block under the song's card, its iframe at full card width. */
  body.wiki .table-scroll tbody tr.sample-row {
    background: transparent; border: none; box-shadow: none;
    padding: 0; margin: -4px 0 14px;
  }
  body.wiki .table-scroll .sample-row td { margin-top: 0; padding: 0; }
  body.wiki .table-scroll .sample-row td::before { content: none; }
  body.wiki .table-scroll .sample-frame { width: 100%; max-width: 100%; }
}

/* ================================================================
   HOMEPAGE LEFT RAIL (preview trial, Nov 18, 2026): the OSRS Wiki
   homepage pattern, a grouped link rail on the LEFT of the main
   column, in this site's night / pink / gold palette. Sections:
   Navigation, Recent changes (the latest Patch Notes and Reports
   links), Guides, Community. Class names carry the lw- prefix:
   styles.css already owns .home-layout / .home-main / .home-rail
   for a different page shell. The tweet rail keeps its existing
   behaviour inside .home-split: under 900px it stacks below the
   main column; this rail is not sticky and scrolls with the
   page. On phones (860px and under)
   the rail is hidden entirely and the mobile menu carries
   navigation, so the phone homepage is unchanged.
   ================================================================ */
.lw-home-layout {
  display: grid; grid-template-columns: 248px minmax(0, 1fr);
  gap: 22px; align-items: stretch;
}
.lw-home-main { min-width: 0; }
.lw-home-rail {
  /* Not sticky (Nick, Nov 18, 2026): the rail scrolls away with
     the page like ordinary content. A little bigger and a little
     longer (Nick, Nov 18, 2026): the panel stretches with the
     layout row so its background runs down the column, capped at
     2400px so very long pages do not get an endless empty slab;
     the four sections stay at the top. */
  background: var(--night); border: 1px solid var(--night-2);
  border-radius: 10px; box-shadow: var(--shadow);
  padding: 16px 16px 6px;
  height: 100%; max-height: 2400px;
}
.lw-rail-group { margin-bottom: 14px; }
.lw-rail-head {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 13px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--gold);
  margin: 0 0 6px; padding-bottom: 5px;
  border-bottom: 1px solid rgba(255, 180, 58, 0.28);
}
.lw-rail-list { list-style: none; margin: 0; padding: 0; }
.lw-rail-list a {
  display: block; padding: 4px 9px; border-radius: 5px;
  color: #f6d9e8; text-decoration: none;
  font-size: 15px; font-weight: 600; line-height: 1.3;
}
.lw-rail-list a:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.lw-rail-news a { font-size: 14px; }
.lw-rail-date {
  display: block; padding: 0 9px 3px; margin-top: -3px;
  font-size: 11px; color: rgba(253, 240, 233, 0.55);
}
.lw-rail-more {
  margin-top: 6px; padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.lw-rail-more a { color: var(--gold); }
@media (max-width: 1100px) {
  .lw-home-layout { grid-template-columns: 224px minmax(0, 1fr); gap: 20px; }
}
@media (max-width: 860px) {
  .lw-home-layout { display: block; }
  .lw-home-rail { display: none; }
}

/* ---------- homepage bottom condense (Nov 18, 2026) ----------
   The rail made most footer lists duplicates, so the footer
   link columns were removed entirely (Nov 18, 2026): the
   homepage footer is now just the brand block and the legal
   line, and the homepage bottom tightens: less air above and
   inside the footer. The section-box grid was removed with the rest,
   then restored at Nick's direction, so the Popular pages
   panel keeps its normal margin under the tiles. Scoped to
   body.wiki-home so every other page keeps the shared footer
   exactly as it was. */
body.wiki-home footer { margin-top: 26px; padding: 16px 0 18px; }
/* The homepage footer lost all its link columns (Nov 18, 2026):
   only the brand block and the legal line remain, so the shared
   four-track grid is neutralised to a plain block on the
   homepages and no empty tracks show. */
body.wiki-home .foot-grid { display: block; }
body.wiki-home .foot-legal { margin-top: 10px; padding-top: 9px; }
body.wiki-home .home-split { margin-top: 22px; }

/* ---------- Latest Reports compact cards (Nov 18, 2026) ----------
   Nick: the homepage report cards "are taking up way too much
   space." Scoped to .wiki-news, which exists only on the two
   homepages, so the shared .card design everywhere else (news
   index, guides hub) is untouched. The three cards stay three
   across on desktop but shrink hard: a wider, shorter 21/9 image
   crop (object-fit: cover already prevents distortion), smaller
   headline type, tighter padding and gaps, and the standfirst
   clamped to 3 lines with an ellipsis instead of the full
   paragraph. Headlines clamp at 3 lines too, so one long title
   cannot stretch its row. Two across on tablets, one on phones. */
.wiki-news { margin-top: 26px; }
.wiki-news .cards { gap: 14px; }
.wiki-news .card .thumb { aspect-ratio: 21 / 9; }
.wiki-news .card-body { padding: 12px 14px 13px; gap: 6px; }
.wiki-news .card-meta .tag { font-size: 10.5px; padding: 2px 7px; }
.wiki-news .read-time { font-size: 12px; }
.wiki-news .card h3 {
  font-size: 17px; line-height: 1.22;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  line-clamp: 3; overflow: hidden;
}
.wiki-news .card p {
  font-size: 13.5px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  line-clamp: 3; overflow: hidden;
}
.wiki-news .card .card-link { font-size: 13.5px; }
@media (max-width: 1100px) {
  .wiki-news .cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .wiki-news .cards { grid-template-columns: 1fr; }
  .wiki-news .card h3 { font-size: 16.5px; }
}


/* ---------- Database hub compact section buttons (Nov 18, 2026) ----------
   Nick: the Database hub's section buttons "can be smaller too,"
   same direction as the Latest Reports shrink above. Scoped to
   .db-hub-cards, a class that exists only on the two database hub
   pages (database.html, es/database.html), so the shared .card
   design everywhere else (guides hub, news index, the database
   section pages) is untouched. Same recipe: a wider, shorter 21/9
   picture crop (object-fit: cover already prevents distortion),
   tighter padding and gaps, smaller headline and body type, and
   the description clamped to 3 lines so one long text cannot
   stretch its row. Each button still shows its picture, section
   name, entry count and the opening of its description. The grid
   keeps the base .cards breakpoints (3 across, 2 under 860px,
   1 under 560px). */
.db-hub-cards { gap: 14px; }
.db-hub-cards .card .thumb { aspect-ratio: 21 / 9; }
.db-hub-cards .card-body { padding: 12px 14px 13px; gap: 6px; }
.db-hub-cards .card-meta .tag { font-size: 10.5px; padding: 2px 7px; }
.db-hub-cards .read-time { font-size: 12px; }
.db-hub-cards .card h3 { font-size: 17px; line-height: 1.22; }
.db-hub-cards .card p {
  font-size: 13.5px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  line-clamp: 3; overflow: hidden;
}
.db-hub-cards .card .card-link { font-size: 13.5px; }
/* Fully clickable cards (Nick, Nov 18, 2026: "u should be able to
   click any of these boxes and it opens it up"). Each hub card is ONE
   anchor (.card-hit) wrapping the picture, title, description and the
   "Open the index" line (now a span keeping the .card-link styling),
   so the whole box is the link: one tab stop per card, a gold focus
   ring in the site palette, pointer cursor across the whole card,
   and the base .card hover shadow extended with the title and
   call-to-action emphasis the old title link had on hover. Any card
   added to this container in the same markup inherits all of it. */
.db-hub-cards .card { cursor: pointer; }
.db-hub-cards .card-hit {
  display: flex; flex-direction: column; flex: 1;
  color: inherit; text-decoration: none;
}
.db-hub-cards .card .card-link { color: var(--pink-deep); }
.db-hub-cards .card:hover h3 { color: var(--pink-deep); }
.db-hub-cards .card:hover .card-link { text-decoration: underline; }
.db-hub-cards .card-hit:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
@media (max-width: 640px) {
  .db-hub-cards .card h3 { font-size: 16.5px; }
}

/* Weapons index: GTABase-style filter panel, category pills, sort row
   and card grid (database/weapons, EN + ES). Scoped .wpn- throughout. */
.wpn-tools { margin: 18px 0 26px; }
.wpn-filterbar {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; box-shadow: var(--shadow);
}
.wpn-field { display: block; max-width: 430px; }
.wpn-field > span:first-child {
  display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-soft); margin-bottom: 7px;
}
.wpn-searchwrap { position: relative; display: block; }
.wpn-searchwrap svg {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--ink-soft); pointer-events: none;
}
.wpn-searchwrap input {
  width: 100%; box-sizing: border-box; padding: 10px 12px 10px 38px;
  font: inherit; font-size: 15.5px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
}
.wpn-searchwrap input:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }
.wpn-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.wpn-pill {
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  color: var(--ink); background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px;
}
.wpn-pill .wpn-n { opacity: .65; font-weight: 500; margin-left: 2px; }
.wpn-pill:hover { border-color: var(--pink); color: var(--pink-deep); }
.wpn-pill.is-on { background: var(--pink); border-color: var(--pink); color: #fff; }
.wpn-pill.is-on .wpn-n { opacity: .85; }
.wpn-pill:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.wpn-sortrow {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 16px 0 14px; padding: 10px 2px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.wpn-sort { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.wpn-sort select {
  font: inherit; font-size: 14.5px; font-weight: 600; color: var(--ink);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px;
}
.wpn-dir, .wpn-viewbtn {
  font: inherit; cursor: pointer; width: 36px; height: 36px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--ink);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px;
}
.wpn-dir:hover, .wpn-viewbtn:hover { border-color: var(--pink); color: var(--pink-deep); }
.wpn-dir:focus-visible, .wpn-viewbtn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.wpn-viewbtn.is-on { background: var(--night); border-color: var(--night); color: var(--gold); }
.wpn-count { margin: 0 auto; font-size: 15px; font-weight: 700; color: var(--ink); }
.wpn-view { display: inline-flex; gap: 6px; margin-left: auto; }
.wpn-sortrow .wpn-view { margin-left: 0; }
.wpn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 14px; }
.wpn-card {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 15px; display: flex; flex-direction: column; gap: 5px;
}
.wpn-card[hidden] { display: none; }
.wpn-card .wpn-pic { margin: -14px -15px 8px; }
.wpn-card .wpn-pic img { display: block; width: 100%; height: auto; border-radius: 14px 14px 0 0; }
.wpn-card .wpn-pic figcaption { font-size: 11.5px; color: var(--ink-soft); padding: 6px 15px 0; }
.wpn-name { font-family: "Barlow Condensed", sans-serif; font-size: 21px; font-weight: 600; line-height: 1.15; margin: 0; color: var(--ink); }
.wpn-cat { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--teal); }
.wpn-status { margin: 2px 0 0; }
.wpn-src { margin: auto 0 0; padding-top: 6px; font-size: 12.5px; line-height: 1.45; color: var(--ink-soft); }
.wpn-grid.wpn-as-list { grid-template-columns: 1fr; }
.wpn-grid.wpn-as-list .wpn-card { flex-direction: row; align-items: center; gap: 14px; flex-wrap: wrap; }
.wpn-grid.wpn-as-list .wpn-name { flex: 1 1 220px; }
.wpn-grid.wpn-as-list .wpn-cat { order: 2; }
.wpn-grid.wpn-as-list .wpn-status { order: 3; margin: 0; }
.wpn-grid.wpn-as-list .wpn-src { order: 4; margin: 0; padding: 0; flex: 1 1 200px; text-align: right; }
.wpn-grid.wpn-as-list .wpn-pic { display: none; }
.wpn-empty { font-size: 15px; color: var(--ink-soft); border: 1px dashed var(--line); border-radius: 12px; padding: 16px; text-align: center; }
@media (max-width: 640px) {
  .wpn-grid { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; }
  .wpn-name { font-size: 19px; }
  .wpn-count { order: 3; width: 100%; text-align: center; margin: 2px 0 0; }
  .wpn-view { margin-left: auto; }
}

/* ================================================================
   RAIL HUGS THE LEFT WALL (Nick, Nov 18, 2026): same treatment as
   the sitewide rail (styles.css) for the homepage rail, and for
   the database shell's own wiki rail, which was also inset
   (x=132 at 1920 inside the centered 1700px shell). Caps are the
   shells' old content maxima: homepage main 1460 - 44 - 248 - 22
   = 1146; database main 1700 - 44 - 250 - 36 = 1370. Scoped to
   the widths where each rail exists, so the <=1080 single-column
   database layout and all phone layouts are byte-identical.
   ================================================================ */
@media (min-width: 861px) {
  .wiki-home-wrap:has(> .lw-home-layout) { max-width: none; padding-left: 0; }
  .lw-home-layout { grid-template-columns: 248px minmax(0, 1146px); }
  .lw-home-rail { border-left: none; border-radius: 0 10px 10px 0; }
}
@media (min-width: 861px) and (max-width: 1100px) {
  .lw-home-layout { grid-template-columns: 224px minmax(0, 1fr); }
}
@media (min-width: 1081px) {
  .wiki-shell { max-width: none; padding-left: 0; grid-template-columns: 250px minmax(0, 1370px); }
  .wiki-side { border-left: none; border-radius: 0 10px 10px 0; }
}


/* ================================================================
   Sitewide rail inside the database shell (Nov 18, 2026): database
   pages now carry the homepage's rail (.lw-site-rail) in place of
   the old .wiki-side list, at Nick's direction ("i want all to have
   the 2nd pic, the one on the main page"). The database layout grid
   and its caps are unchanged: the rail stretches down its column
   like the homepage's, hides in the single-column band where the
   old sidebar hid, and takes the same squared wall-side corners in
   the railwall band. The current-page marker mirrors the old
   rail's: chip tint, bold, pink inset bar, in the rail's palette.
   ================================================================ */
.wiki-shell > .lw-site-rail { align-self: stretch; }
.wiki-shell .lw-rail-list a.current {
  background: rgba(255, 255, 255, 0.12); color: #fff; font-weight: 700;
  box-shadow: inset 3px 0 0 var(--pink);
}
@media (max-width: 1080px) {
  .wiki-shell > .lw-site-rail { display: none; }
}
@media (min-width: 1081px) {
  .wiki-shell > .lw-site-rail { border-left: none; border-radius: 0 10px 10px 0; }
}

/* ================================================================
   CONTENT CENTERED ON THE PAGE (Nick, Nov 18, 2026): same move as
   the sitewide rail (styles.css). Homepage: the 1146px column
   centers on the page (left margin = half the grid area minus
   half the cap minus 124px, half the 270px rail zone less the
   22px right padding), floored at 0; below a 1686px viewport the
   centered start would cut into the 22px rail gap, so the column
   sits beside the rail as the railwall fix left it. Database
   shell: the 1370px column centers the same way (minus 132px,
   half the 286px rail zone less the 22px right padding); its
   centering threshold is 1942px, so at 1920 it keeps its 36px
   rail gap with the slack on the right. The <=1080 database
   collapse and all phone layouts are untouched; both rails stay
   flush at x=0.
   ================================================================ */
@media (min-width: 1101px) {
  .lw-home-layout { grid-template-columns: 248px minmax(0, 1fr); }
}
@media (min-width: 861px) {
  .lw-home-main {
    max-width: 1146px;
    margin-left: max(0px, calc(50% - 573px - 124px));
    margin-right: auto;
  }
}
@media (min-width: 1081px) {
  .wiki-shell { grid-template-columns: 250px minmax(0, 1fr); }
  .wiki-main {
    max-width: 1370px;
    margin-left: max(0px, calc(50% - 685px - 132px));
    margin-right: auto;
  }
}

/* ================================================================
   RAIL PANEL FITS ITS CONTENT (Nick, Nov 18, 2026): same cut as
   the sitewide rail (styles.css). The homepage rail's stretch
   (height: 100%, capped at 2400px) and the database shell rail's
   align-self: stretch both left a long empty panel hanging
   below the last link; both panels now end shortly below their
   last section. The rails stay flush at x=0 with the same
   widths and sections; the database rail's current-page marker
   and squared wall-side corners are unchanged.
   ================================================================ */
.lw-home-rail { height: auto; max-height: none; align-self: start; }
.wiki-shell > .lw-site-rail { align-self: start; }
