/*
 * Pagle's look (WEB-R22): the Angler page prototype's palette and type (parchment, ink and gilt;
 * Marcellus, IM Fell English and Caveat) in an ordinary web layout. Hand-written, no framework (WEB-R2).
 * - Everything loads from Pagle's own origin: no imported stylesheets, and only the font files beside
 *   this one (WEB-R5).
 * - Every font-family ends in serif or cursive, so names in Hangul, Han or Cyrillic fall back to the
 *   system's fonts (WEB-R5).
 * - Light only: no dark-scheme media queries (WEB-R23).
 * - No sideways scroll from 360 px up; below 720 px the header's links wrap under the logo, and wide
 *   tables scroll inside their own .table-box (WEB-R24).
 * - Forms keep the browser's native controls (WEB-R22).
 */

/* Fonts: SIL OFL, subset to U+0000–024F, U+1E00–1EFF, U+2000–206F; licences in fonts/. The Marcellus subset
   is a Modified Version, so it may not carry its Reserved Font Name: it is renamed "Pagle Display". */
@font-face {
  font-family: "Pagle Display";
  src: url("/assets/fonts/marcellus-regular-77f6d8c2705c202013026357e58faf9c.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IM Fell English";
  src: url("/assets/fonts/im-fell-english-regular-4d753ba4fcf35933fb6c61c5a7c02e70.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IM Fell English";
  src: url("/assets/fonts/im-fell-english-italic-8e8507618d7bc47dc6953378aa768dfc.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Caveat";
  src: url("/assets/fonts/caveat-medium-d418601ba6dc99f8ecfecd217245f1fd.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* The prototype's colours. */
:root {
  --parchment: #f3e5c3;
  --parchment-light: #f8eed6;
  --parchment-deep: #e2c994;
  --ink: #3a2614;
  --ink-heading: #3e220c;
  --ink-muted: #7a5a38;
  --ink-blue: #23407a;
  --gilt: #e8c96a;
  --gilt-deep: #9a7420;
  --gilt-pale: #f4dfa8;
  --leather: #6a3e20;
  --leather-deep: #3a2010;
  --rule: #c4a874;
  --link: #7a2a14;
  --link-hover: #9a2a1a;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--parchment);
  background-image: radial-gradient(ellipse at 50% 0%, var(--parchment-light), var(--parchment) 55%, var(--parchment-deep));
  background-attachment: fixed;
  color: var(--ink);
  font-family: "IM Fell English", Georgia, serif;
  font-size: 1.125rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

h1,
h2,
h3,
h4 {
  font-family: "Pagle Display", Georgia, serif;
  font-weight: normal;
  color: var(--ink-heading);
  line-height: 1.2;
  margin: 1.5rem 0 0.5rem;
}

h1 {
  font-size: 2rem;
  margin-top: 0.5rem;
}

h2 {
  font-size: 1.5rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.125rem;
}

h3 {
  font-size: 1.25rem;
}

a {
  color: var(--link);
}

a:hover,
a:focus-visible {
  color: var(--link-hover);
}

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

pre {
  overflow-x: auto;
}

/* A handwritten note in the margin, as the prototype's blue ink. */
.hand {
  font-family: "Caveat", cursive;
  font-weight: 500;
  color: var(--ink-blue);
  font-size: 1.3em;
  line-height: 1.1;
}

/* Header (WEB-R20): the wordmark, then the navigation and Sign in on one row. */
.site-header {
  display: flex;
  align-items: center;
  gap: 0.5rem 2rem;
  padding: 0.75rem max(16px, calc((100% - 960px) / 2));
  background-color: var(--leather-deep);
  background-image: linear-gradient(var(--leather), var(--leather-deep));
  border-bottom: 3px double var(--gilt-deep);
}

.wordmark {
  font-family: "Pagle Display", Georgia, serif;
  font-size: 2rem;
  line-height: 1;
  color: var(--gilt);
  text-decoration: none;
  text-shadow: 0 1px 1px #000;
  white-space: nowrap;
}

.wordmark:hover,
.wordmark:focus-visible {
  color: var(--gilt-pale);
}

.site-links {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1.25rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.site-account {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1.25rem;
}

/* Signed in: the BattleTag, then the Player's links; Sign out is a form drawn like a link. */
.site-account .battle-tag {
  font-family: "Pagle Display", Georgia, serif;
  color: var(--gilt);
  white-space: nowrap;
}

.signout {
  display: inline;
  margin: 0;
}

.site-links .signout button {
  padding: 0;
  border: 0;
  background: none;
  font-family: "Pagle Display", Georgia, serif;
  font-size: inherit;
  line-height: inherit;
  color: var(--gilt-pale);
  white-space: nowrap;
  cursor: pointer;
}

.site-links .signout button:hover,
.site-links .signout button:focus-visible {
  color: #fff4c8;
  text-decoration: underline;
}

.site-links a {
  font-family: "Pagle Display", Georgia, serif;
  color: var(--gilt-pale);
  text-decoration: none;
  white-space: nowrap;
}

.site-links a:hover,
.site-links a:focus-visible {
  color: #fff4c8;
  text-decoration: underline;
}

/* The flash message (WEB-R4), at the top of the page's content. */
.flash {
  margin: 1.25rem max(16px, calc((100% - 960px) / 2)) 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gilt-deep);
  background-color: var(--parchment-light);
}

/* The page's content. */
main {
  flex: 1;
  width: 100%;
  max-width: calc(960px + 32px);
  margin: 0 auto;
  padding: 1.5rem 16px 2.5rem;
}

/* Tables: plain HTML, scrolling inside their own box when wider than the screen. */
.table-box {
  max-width: 100%;
  overflow-x: auto;
  margin: 0.75rem 0;
}

table {
  border-collapse: collapse;
  overflow-wrap: normal;
}

th,
td {
  padding: 0.25rem 0.75rem 0.25rem 0;
  text-align: left;
  vertical-align: baseline;
  border-bottom: 1px dotted var(--rule);
}

th {
  font-family: "Pagle Display", Georgia, serif;
  font-weight: normal;
  color: var(--ink-heading);
  border-bottom: 2px solid var(--rule);
  white-space: nowrap;
}

/* Native form controls, at the page's text size. */
input,
select,
textarea,
button {
  font-size: 1rem;
  max-width: 100%;
}

/* The Paste upload page (UPL-R81): its reply, set like a flash message, and a full-width text box. */
.paste-reply {
  margin: 0.75rem 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gilt-deep);
  background-color: var(--parchment-light);
}

.paste-reply p {
  margin: 0.25rem 0;
}

.paste-form label {
  display: block;
  margin-bottom: 0.25rem;
}

.paste-form textarea {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin-bottom: 0.75rem;
  word-break: break-all;
}

/*
 * The at-a-glance card (ANG-R24): a small bookplate after the prototype's variant B, with the kicker in small
 * caps, the page name, the brass plate in gilt and the region code. Here rather than in journal.css, since the
 * pages that show it don't draw the book.
 */
.glance {
  max-width: 22rem;
  margin: 0.75rem 0;
  padding: 0.75rem 1rem;
  border: 3px double var(--gilt-deep);
  background-color: var(--parchment-light);
  text-align: center;
}

.glance p {
  margin: 0.25rem 0;
}

.glance .kicker,
.glance .region {
  font-variant: small-caps;
  letter-spacing: 2px;
  color: var(--ink-muted);
  font-size: 0.875rem;
}

.glance .glance-name {
  font-family: "Pagle Display", Georgia, serif;
  font-size: 1.375rem;
  color: var(--ink-heading);
  line-height: 1.2;
}

.glance .more {
  display: block;
  font-family: "IM Fell English", Georgia, serif;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.glance .brass-plate {
  display: inline-block;
  padding: 0.125rem 0.625rem;
  border: 1px solid var(--leather-deep);
  border-radius: 3px;
  background-image: linear-gradient(var(--gilt), var(--gilt-deep));
  color: var(--leather-deep);
  font-size: 0.875rem;
}

.glance .missing {
  font-style: italic;
  font-size: 0.9375rem;
}

/* My Anglers (WEB-R130): one block per Angler, its notes beneath its row. */
.anglers .row .name {
  font-family: "Pagle Display", Georgia, serif;
  color: var(--ink-heading);
}

.anglers .note {
  margin: 0.25rem 0;
  font-style: italic;
}

/* Character search (WEB-R70, WEB-R73): the form's fields wrap on a narrow screen; one result per line. */
.search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 1rem;
}

.results .character-name {
  font-family: "Pagle Display", Georgia, serif;
  color: var(--ink-heading);
}

.results .hardcore,
.no-result {
  font-style: italic;
}

/* Footer (WEB-R20): Imprint, Privacy and the hobby line. */
.site-footer {
  padding: 1rem 16px 1.5rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-muted);
  font-size: 0.9375rem;
  text-align: center;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.5rem;
}

.site-footer p {
  max-width: 40rem;
  margin: 0.5rem auto 0;
}

/*
 * The Angler page's owner bars, above the book (ANG-R1): the owner banner (PUB-R42, WEB-R61), View as visitor's
 * bar and the View as visitor link (WEB-R62), and ANG-R15's text in place of the book. Here rather than in
 * journal.css, since View as visitor of an Angler with no visible character draws no book.
 */
.owner-banner,
.visitor-bar {
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--ink-blue);
  border-radius: 3px;
  background-color: var(--parchment-light);
}

.owner-banner p {
  margin: 0;
}

.owner-banner .only-you-see {
  font-family: "Pagle Display", Georgia, serif;
  color: var(--ink-blue);
}

.owner-links {
  margin: 0 0 0.75rem;
  text-align: right;
}

.not-visible {
  margin: 1.5rem 0;
  font-family: "IM Fell English", Georgia, serif;
  font-style: italic;
}

/* Below the narrow breakpoint (720 px), the header's links wrap under the logo. */
@media (max-width: 719.98px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-links {
    width: 100%;
  }

  .site-account {
    margin-left: 0;
  }
}
