/*
Theme Name: Ledger
Theme URI: https://ntrgames.io
Author: ntrgames.io
Description: Paper index for NTR Games. One address per game, set in Spectral, built to stay light.
Version: 1.0.1
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.1
Text Domain: ledger
*/

@font-face {
  font-family: Spectral;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/spectral-400.woff2") format("woff2");
}
@font-face {
  font-family: Spectral;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/spectral-700.woff2") format("woff2");
}
@font-face {
  font-family: Spectral;
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/spectral-italic-400.woff2") format("woff2");
}

:root {
  --paper: #e4dccb;
  --ink: #1c1612;
  --muted: #5c5348;
  --rule: rgba(28, 22, 18, 0.22);
  --stamp: #a33b24;
  --olive: #31422c;
  --serif: Spectral, "Iowan Old Style", Palatino, "Palatino Linotype", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --rail: 52px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; }

button,
input,
textarea { font: inherit; color: inherit; }

::selection { background: var(--ink); color: var(--paper); }

:focus-visible {
  outline: 2px solid var(--stamp);
  outline-offset: 3px;
}

a { color: inherit; }

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.4rem 0.6rem;
  z-index: 80;
}
.skip:focus { left: 64px; }

.rail {
  display: none;
}

.page { min-height: 100vh; }

.wrap {
  width: min(1040px, calc(100% - 2rem));
  margin: 0 auto;
}

.mast {
  padding: 1.15rem 0 0.85rem;
  border-bottom: 1px solid var(--ink);
  box-shadow: 0 3px 0 var(--paper), 0 4px 0 var(--ink);
}

.mast-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem 1.5rem;
}

.brand { margin: 0; font-weight: 400; }

.brand a {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  text-decoration: none;
  color: inherit;
}

.brand-ntr {
  font-weight: 700;
  font-size: clamp(4rem, 16vw, 7.5rem);
  letter-spacing: -0.055em;
  line-height: 0.76;
}

.brand-games {
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.7rem, 5vw, 2.9rem);
  color: var(--stamp);
  letter-spacing: -0.03em;
  line-height: 1;
}

.mast-kicker {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-style: italic;
  font-size: 0.98rem;
}

.find { display: grid; gap: 0.15rem; align-self: end; }

.find label,
.sheet label,
.ledger-head,
.shelves a,
.dock a,
.spec dt,
.gate-kicker,
.crumb,
.kicker {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.find label { color: var(--muted); }

.find input {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  padding: 0.28rem 0 0.35rem;
  font-size: 1.2rem;
}

.find input:focus { outline: none; border-bottom-color: var(--stamp); }
.find input::-webkit-search-cancel-button { appearance: none; }

.shelves {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.05rem;
  padding-top: 0.15rem;
}

.shelves a {
  text-decoration: none;
  padding-bottom: 0.12rem;
}

.shelves a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--stamp); }

.shelf-intro { margin-top: 1.35rem; }

.crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
  margin: 0 0 0.45rem;
  color: var(--muted);
}

.crumb a { color: inherit; }

h1.game-title,
.miss,
.page-title {
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.92;
  margin: 0.15rem 0 0.7rem;
}

.page-title,
.miss { font-size: clamp(2.4rem, 6vw, 4.2rem); max-width: 12em; }

.game-title {
  font-size: clamp(2.7rem, 7vw, 4.8rem);
  max-width: 11em;
}

.deck {
  font-size: clamp(1.35rem, 2.5vw, 1.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.22;
  max-width: 18em;
  margin: 1.35rem 0 0.75rem;
}

.lede,
.prose {
  max-width: 40rem;
  font-size: 1.06rem;
  line-height: 1.55;
}

.lede p,
.prose p { margin: 0 0 0.85rem; }

.prose a { color: var(--stamp); }

.statline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.2rem;
  list-style: none;
  padding: 0.75rem 0 0;
  margin: 0.3rem 0 0;
  border-top: 1px solid var(--ink);
}

.statline b { font-weight: 700; }

.shelf-label {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin: 2.15rem 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.shelf-label::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--ink);
}

.shelf-label a { color: inherit; text-decoration: none; }

.ledger { margin-top: 0.2rem; }

.ledger-head,
.row-link {
  display: grid;
  grid-template-columns: 2.2rem 4.6rem minmax(0, 1.5fr) minmax(3rem, 0.55fr) minmax(4rem, 0.55fr) minmax(4.6rem, 0.6fr) minmax(5rem, 0.6fr);
  column-gap: 0.75rem;
  align-items: center;
}

.ledger-head {
  color: var(--muted);
  padding: 0 0 0.3rem;
}

.row { border-top: 1px solid var(--rule); }

.row-link {
  padding: 0.62rem 0;
  text-decoration: none;
  color: inherit;
}

.row-link:hover { box-shadow: inset 3px 0 0 var(--stamp); }
.row-link:hover .row-title { color: var(--stamp); }

.num {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.86rem;
}

.thumb,
.mark {
  width: 72px;
  height: 52px;
  border: 1px solid var(--ink);
  background: var(--ink);
  object-fit: cover;
}

.mark {
  display: grid;
  place-items: center;
  color: var(--paper);
  font-weight: 700;
  font-size: 1.2rem;
}

.ident { min-width: 0; }

.row-title {
  display: block;
  font-weight: 700;
  font-size: 1.14rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.row-note {
  display: block;
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.facts { display: contents; }

.ver,
.lang,
.plat,
.state { font-size: 0.92rem; }

.state-finished { color: var(--olive); }
.state-ongoing { color: var(--stamp); }

.more {
  display: inline-block;
  margin-top: 0.85rem;
  color: var(--stamp);
}

.empty {
  margin: 0.4rem 0 0;
  padding: 0.8rem 0;
  border-top: 1px solid var(--ink);
  font-style: italic;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 0.9rem;
  margin-top: 1rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--ink);
}

.pager .page-numbers {
  text-decoration: none;
  color: inherit;
}

.pager .page-numbers.current {
  box-shadow: inset 0 -2px 0 var(--stamp);
}

.version-stamp {
  display: inline-block;
  margin: 0 0 0.9rem;
  padding: 0.12rem 0.45rem 0.05rem;
  border: 1.5px solid var(--stamp);
  color: var(--stamp);
  letter-spacing: 0.04em;
}

.spec {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  margin: 0.4rem 0 1.3rem;
  border-top: 1px solid var(--ink);
}

.spec > div { display: contents; }

.spec dt,
.spec dd {
  margin: 0;
  padding: 0.42rem 0;
  border-bottom: 1px solid var(--rule);
}

.spec dt { color: var(--muted); }
.spec dd { margin: 0; }
.spec a { color: inherit; }

.cover {
  display: block;
  width: min(100%, 820px);
  max-height: 460px;
  object-fit: cover;
  border: 1px solid var(--ink);
  margin: 0 0 1.2rem;
}

.block-label {
  margin: 1.6rem 0 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.changes {
  max-width: 40rem;
  white-space: pre-wrap;
  margin: 0;
  font-family: inherit;
  font-size: 1.02rem;
  line-height: 1.5;
}

.files {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 40rem;
}

.files a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  border-top: 1px solid var(--ink);
  text-decoration: none;
}

.files li:last-child a { border-bottom: 1px solid var(--ink); }

.files a span { color: var(--stamp); }

.adjacent {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.4rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--ink);
}

.adjacent a { color: var(--stamp); }

.colophon {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem 1.2rem;
  margin-top: 2.8rem;
  padding: 0.8rem 0 1.4rem;
  border-top: 1px solid var(--ink);
  font-size: 0.92rem;
}

.colophon nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
}

.colophon a { text-decoration: none; }
.colophon a:hover { color: var(--stamp); }

.sheet { max-width: 36rem; }

.sheet label { display: block; margin: 1rem 0 0.2rem; color: var(--muted); }

.sheet input,
.sheet textarea {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  padding: 0.4rem 0;
}

.sheet textarea {
  border: 1px solid var(--ink);
  padding: 0.6rem;
  min-height: 8.5rem;
  resize: vertical;
}

.sheet button {
  margin-top: 1rem;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  border-radius: 0;
  padding: 0.62rem 0.95rem;
  cursor: pointer;
}

.sheet button:hover { background: var(--stamp); }

.hp {
  position: absolute;
  left: -9999px;
  height: 0;
  width: 0;
  overflow: hidden;
}

.notice {
  margin: 0 0 1rem;
  padding-left: 0.7rem;
  border-left: 3px solid var(--stamp);
}

.noscript {
  margin: 0;
  padding: 0.45rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.92rem;
}

.dock { display: none; }

.gate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--paper);
}

html.is-gated .gate { display: block; }
html.is-gated,
html.is-gated body { overflow: hidden; }

.gate-inner {
  width: min(38rem, calc(100% - 2.4rem));
  margin: 16vh auto 0;
}

.gate-kicker {
  margin: 0;
  color: var(--stamp);
}

.gate-title {
  margin: 0.35rem 0 0.8rem;
  font-size: clamp(2.8rem, 8vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.9;
}

.gate-copy { max-width: 34rem; margin: 0; }

.gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem 1.6rem;
  margin-top: 1.4rem;
}

.gate-actions button {
  background: none;
  border: 0;
  border-bottom: 2px solid var(--ink);
  border-radius: 0;
  padding: 0 0 0.15rem;
  cursor: pointer;
  font-size: 1.2rem;
}

.gate-actions .leave {
  border-bottom-color: transparent;
  color: var(--muted);
}

@media (min-width: 860px) {
  .rail {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--rail);
    background: var(--ink);
    color: var(--paper);
    z-index: 5;
  }

  .rail span {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    letter-spacing: 0.28em;
    text-transform: uppercase;
    font-size: 0.72rem;
  }

  .page { margin-left: var(--rail); }

  .mast { padding-top: 1.4rem; }

  .mast-grid {
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem);
    align-items: end;
  }

  .brand { grid-column: 1; grid-row: 1; }
  .mast-kicker { grid-column: 1; }
  .find { grid-column: 2; grid-row: 1 / span 2; }
  .shelves {
    grid-column: 1 / -1;
    margin-top: 0.2rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--rule);
  }

  .wrap { width: min(1040px, calc(100% - 4rem)); }
}

@media (max-width: 859px) {
  body { border-top: 6px solid var(--stamp); }

  .ledger-head { display: none; }

  .row-link {
    grid-template-columns: 4.6rem minmax(0, 1fr);
    grid-template-areas: "thumb ident" "thumb facts";
    row-gap: 0.2rem;
  }

  .num { display: none; }
  .thumb,
  .mark { grid-area: thumb; align-self: start; }
  .ident { grid-area: ident; }
  .facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.1rem 0.6rem;
    grid-area: facts;
    color: var(--muted);
    font-size: 0.82rem;
  }

  .dock {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    background: var(--paper);
    border-top: 1px solid var(--ink);
  }

  .dock a {
    flex: 1;
    text-align: center;
    text-decoration: none;
    padding: 0.72rem 0.15rem calc(0.72rem + env(safe-area-inset-bottom));
  }

  .dock a[aria-current="page"] { color: var(--stamp); }

  .page { padding-bottom: 3.2rem; }

  .spec { grid-template-columns: 6.2rem 1fr; }
}

@media (max-width: 520px) {
  .brand a { flex-wrap: wrap; }
  .adjacent { flex-direction: column; }
}
