/*
 * The static site pages' one stylesheet (#5123). No scripts anywhere: this
 * file is the whole look. The build writes it as /static/site.<hash>.css,
 * since every .css is served immutable for a year.
 *
 * Colors: the game's own, every one a custom property below, each equal to
 * its source (src/brand.config.json's game block, or a constant in
 * src/app/shared/config/ui-colours.config.ts); site.css.spec.ts holds them
 * equal. Nothing below the :root block spells a color.
 *
 * Contrast: every text-on-surface and ring-on-surface pair is declared on a
 * "contrast:" line below, and site.css.spec.ts holds each to WCAG AA (4.5:1
 * text, 3:1 for the focus ring). A color var used as a foreground or
 * background that is in no declared pair fails that spec.
 *
 * contrast: --site-text on --site-bg (text)
 * contrast: --site-text on --site-panel (text)
 * contrast: --site-gold on --site-bg (text)
 * contrast: --site-gold on --site-panel (text)
 * contrast: --site-gold on --site-bg (ring)
 * contrast: --site-gold on --site-panel (ring)
 * contrast: --site-gold on --site-button-bg (ring)
 * contrast: --site-button-text on --site-button-bg (text)
 * contrast: --site-button-text on --site-button-hover (text)
 * contrast: --site-bg on --site-gold (text)
 */

/* "Pokemon Mystery Dungeon" by cheezonpeaz41 (CC BY-SA 3.0; public/fonts/pokemon-mystery-dungeon/), as styles.scss loads it. */
@font-face {
    font-family: 'Pokemon-MD';
    src: url('/fonts/pokemon-mystery-dungeon/pokemon-mystery-dungeon.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/*
 * Pixel Operator (CC0) fills the glyphs the game face lacks (the é in
 * Pokémon, quotes, accents), at the same cap height: the size-adjust is
 * styles.scss's, and site.css.spec.ts holds the two equal.
 */
@font-face {
    font-family: 'Pixel Operator';
    src: url('/fonts/PixelOperator.ttf') format('truetype');
    size-adjust: 88.8888888889%;
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    /* brand.config.json game.backdrops[2]: the full view's backdrop. */
    --site-bg: #0b1422;
    /* brand.config.json game.backdrops[1]: the Tab menus' navy. */
    --site-panel: #101830;
    /* brand.config.json game.selected.text. */
    --site-text: #ffffff;
    /* ui-colours.config.ts PMD_GOLD (= brand game.ring.color): links, the focus ring, headings' rule. */
    --site-gold: #ffd76a;
    /* brand.config.json game.button.secondary.border: table and section rules. */
    --site-rule: rgba(255, 255, 255, 0.35);
    /* brand.config.json game.button.primary: the Play now button. */
    --site-button-bg: #7a4a16;
    --site-button-hover: #8f5a1d;
    --site-button-border: #e8b84a;
    --site-button-text: #ffffff;

    --site-heading-font: 'Pokemon-MD', 'Pixel Operator', system-ui, sans-serif;
    --site-body-font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

    color-scheme: dark;
}

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

html {
    background: var(--site-bg);
    color: var(--site-text);
}

body {
    margin: 0;
    background: var(--site-bg);
    color: var(--site-text);
    font: 1.0625rem/1.6 var(--site-body-font);
    overflow-wrap: break-word;
}

/*
 * Headings in the game face. Its own box is 0.625em tall (ascender 1125 +
 * descender 125 over 2000 units, UI_FONT_LINE_HEIGHT's note in
 * ui-scale.config.ts), so the sizes run larger than a system face would to
 * reach the same cap height. The line box is stated, never "normal", and
 * leaves room for a fallback glyph and for a heading that wraps.
 */
h1,
h2,
h3 {
    font-family: var(--site-heading-font);
    font-weight: normal;
    line-height: 1.15;
    margin: 1.2em 0 0.5em;
}

h1 {
    font-size: 3.25rem;
    margin-top: 0.4em;
}

h2 {
    font-size: 2.4rem;
    padding-bottom: 0.2em;
    border-bottom: 2px solid var(--site-gold);
}

h3 {
    font-size: 1.85rem;
}

@media (max-width: 36rem) {
    h1 {
        font-size: 2.6rem;
    }

    h2 {
        font-size: 2.1rem;
    }
}

p,
ul,
ol,
table {
    margin: 0 0 1em;
}

a {
    color: var(--site-gold);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

/*
 * The game's focus ring on every link, as the game draws it: gold, on :focus
 * (not :focus-visible), thick enough to read over any surface here.
 */
a:focus {
    outline: 3px solid var(--site-gold);
    outline-offset: 3px;
    border-radius: 2px;
}

a:hover {
    text-decoration-thickness: 2px;
}

.site-skip {
    position: absolute;
    left: 0.75rem;
    top: -10rem;
    z-index: 10;
    padding: 0.5em 1em;
    background: var(--site-gold);
    color: var(--site-bg);
    font-weight: 600;
}

.site-skip:focus {
    top: 0.75rem;
}

.site-wrap {
    max-width: 52rem;
    margin: 0 auto;
    padding: 0 1rem;
}

.site-header {
    background: var(--site-panel);
    border-bottom: 2px solid var(--site-gold);
}

.site-header .site-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.5rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.site-name {
    font-family: var(--site-heading-font);
    font-size: 2rem;
    line-height: 1.15;
    color: var(--site-gold);
    text-decoration: none;
}

.site-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav a[aria-current='page'] {
    text-decoration-thickness: 3px;
}

.site-crumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
    font-size: 0.95rem;
}

.site-crumbs li + li::before {
    content: '›';
    margin-right: 0.25rem;
    color: var(--site-text);
}

main {
    display: block;
    padding-bottom: 3rem;
}

.site-lede {
    font-size: 1.15rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

caption {
    text-align: left;
    font-weight: 600;
    padding-bottom: 0.4em;
}

th,
td {
    padding: 0.4em 0.6em;
    border: 1px solid var(--site-rule);
    text-align: left;
    vertical-align: top;
}

th {
    background: var(--site-panel);
    color: var(--site-text);
}

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

.site-footer {
    background: var(--site-panel);
    color: var(--site-text);
    border-top: 2px solid var(--site-gold);
    padding: 1.5rem 0 2rem;
}

.site-footer p {
    max-width: 44rem;
}

.site-play {
    display: inline-block;
    padding: 0.5em 1.25em;
    border: 2px solid var(--site-button-border);
    border-radius: 6px;
    background: var(--site-button-bg);
    color: var(--site-button-text);
    font-family: var(--site-heading-font);
    font-size: 1.75rem;
    line-height: 1.15;
    text-decoration: none;
}

.site-play:hover {
    background: var(--site-button-hover);
}

.site-play:focus {
    outline-offset: 3px;
}

/*
 * A capture from the game (the wiki pages' WIKI_MEDIA): a frame the game
 * drew, scaled down to the column, so it is smoothed rather than drawn
 * with hard pixels like the art the site shows at its own size. Its box
 * comes from the width and height attributes, so nothing shifts while it
 * loads.
 */
.site-capture,
.site-diagram {
    margin: 1.5rem 0;
}

.site-capture img {
    display: block;
    width: 100%;
    image-rendering: auto;
    border: 1px solid var(--site-rule);
}

figcaption {
    margin-top: 0.5rem;
}

/* The two lines a new player reads first, under the summary. */
.site-in-short {
    margin: 1rem 0 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--site-panel);
    color: var(--site-text);
    border-left: 4px solid var(--site-gold);
}

.site-in-short p,
.site-in-short ul {
    margin: 0.25rem 0;
}

/* A diagram in words: numbered boxes joined by arrows, wrapping on a narrow screen. */
.site-diagram ol {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.site-diagram li {
    flex: 1 1 10rem;
    max-width: 16rem;
    padding: 0.6rem 0.75rem;
    background: var(--site-panel);
    color: var(--site-text);
    border: 1px solid var(--site-rule);
    counter-increment: step;
}

.site-diagram li::before {
    content: counter(step) '. ';
    color: var(--site-gold);
    font-weight: 700;
}

/* The arrow leads each later step, inline, so a box that starts a new row keeps it inside the column. */
.site-diagram li + li::before {
    content: '→ ' counter(step) '. ';
}

.site-diagram li span {
    display: block;
    font-size: 0.9rem;
}

details {
    margin: 0.5rem 0 1rem;
}

summary {
    min-height: 44px;
    padding: 0.6rem 0;
    cursor: pointer;
    color: var(--site-gold);
}
