/* The condensed face the game uses for anything that reads like airport
   signage. The theme only loads the two fonts named in zensical.toml, so the
   headings face is fetched here. */
@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600&display=swap");

/* The game's palette, copied from AirlineGameStatic/src/colors.css. Kept under
   its own names so this file reads the same as the game's stylesheet, and only
   the mapping below has to know what the theme calls things. */
:root {
  --color-background-main:#0e2c3b;
  --color-background-deep:#081f2b;
  --color-border-deep:#144153;
  --color-action:#144d52;
  --color-action-border:#257079;
  --color-primary-action:#eca42e;
  --color-primary-action-border:#ba7e1c;
  --color-primary-action-text:#333;
  --color-hover:#257079;
  --color-text:#ddd;
  --color-warning:#f7941d;
  --color-error:#f24646;
  --color-success:#049b4a;

  --font-airport:"Barlow Condensed", "Inter", Arial, Helvetica, sans-serif;
}

/* One scheme only: the game is dark and has no light mode, so there is no
   toggle and nothing here is duplicated for a second scheme. */
[data-md-color-scheme="paxtycoon"] {
  color-scheme: dark;

  /* Header, tabs and anything else the theme paints in the primary colour get
     the surface the game's header uses, sitting on the darker gradient below */
  --md-primary-fg-color:var(--color-background-main);
  --md-primary-fg-color--light:var(--color-action);
  --md-primary-fg-color--dark:var(--color-background-deep);
  --md-primary-bg-color:var(--color-text);
  --md-primary-bg-color--light:#ffffffb3;

  /* Amber is the game's primary action, so it is what a link or a control
     answers a pointer in */
  --md-accent-fg-color:var(--color-primary-action);
  --md-accent-fg-color--transparent:#eca42e1f;
  --md-accent-bg-color:var(--color-primary-action-text);
  --md-accent-bg-color--light:#333333b3;

  --md-default-fg-color:var(--color-text);
  --md-default-fg-color--light:#b6c2ca;
  --md-default-fg-color--lighter:#8b98a2;
  --md-default-fg-color--lightest:#ffffff1f;
  --md-default-bg-color:var(--color-background-deep);
  --md-default-bg-color--light:#081f2bb3;
  --md-default-bg-color--lighter:#081f2b4d;
  --md-default-bg-color--lightest:#081f2b1f;

  --md-typeset-color:var(--color-text);
  --md-typeset-a-color:var(--color-primary-action);
  --md-typeset-mark-color:#eca42e40;
  --md-typeset-del-color:#f2464640;
  --md-typeset-ins-color:#049b4a40;
  --md-typeset-kbd-color:var(--color-background-main);
  --md-typeset-kbd-accent-color:var(--color-action);
  --md-typeset-kbd-border-color:var(--color-border-deep);
  --md-typeset-table-color:var(--color-border-deep);

  /* The theme works this one out at :root, before the scheme below is in
     scope, so an admonition would otherwise take the light theme's near-black
     body text onto a dark panel */
  --md-admonition-fg-color:var(--color-text);

  --md-code-fg-color:var(--color-text);
  --md-code-bg-color:var(--color-background-main);
  --md-code-hl-color:#eca42e26;
  --md-code-hl-comment-color:var(--md-default-fg-color--lighter);
  --md-code-hl-punctuation-color:var(--md-default-fg-color--light);
  --md-code-hl-keyword-color:#7fb8c4;
  --md-code-hl-string-color:#7fc9a0;
  --md-code-hl-number-color:var(--color-primary-action);
  --md-code-hl-constant-color:var(--color-primary-action);
  --md-code-hl-function-color:#e9c46a;
  --md-code-hl-operator-color:var(--md-default-fg-color--light);
  --md-code-hl-name-color:var(--md-code-fg-color);
  --md-code-hl-variable-color:var(--md-default-fg-color--light);
  --md-code-hl-special-color:var(--color-error);

  --md-footer-fg-color:var(--color-text);
  --md-footer-fg-color--light:#ddddddb3;
  --md-footer-fg-color--lighter:#dddddd73;
  --md-footer-bg-color:var(--color-background-main);
  --md-footer-bg-color--dark:var(--color-background-deep);

  --md-shadow-z1:0 0.25rem 0.75rem #00000040;
  --md-shadow-z2:0 0.5rem 1.25rem #00000059;
  --md-shadow-z3:0 0.75rem 1.75rem #00000073;
}

/* The game's backdrop: one fixed glow at the top of the viewport, with the
   page itself transparent over it rather than repeating the gradient per
   section */
body[data-md-color-scheme="paxtycoon"] {
  background-image:radial-gradient(ellipse 75% 55% at 50% 0%, var(--color-action) 0%, var(--color-background-deep) 70%);
  background-attachment:fixed;
  background-repeat:no-repeat;
}

/* The header is the surface wrapped around the content, so the only lines
   drawn are the ones separating it from it */
.md-header {
  border-bottom:1px solid var(--color-border-deep);
  box-shadow:none;
}

.md-tabs {
  border-bottom:1px solid var(--color-border-deep);
}

/* Nothing is set for the footer to carry — no copyright, no generator line and
   no page-to-page links — so it is a rule and a band of padding under content
   that has already ended */
.md-footer {
  display:none;
}

/* The theme drops the content 1.5rem below the tabs. The tabs already carry a
   rule under them, so that gap reads as a band of empty page rather than as
   separation, and the content starts against the rule instead */
.md-main__inner {
  margin-top:0;
}

/* Headings are the game's signage: condensed, bold, and shouted at the top two
   levels only — a deep heading in a manual is a sentence, and uppercase costs
   more in readability there than it buys in flavour */
.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4 {
  font-family:var(--font-airport);
  font-weight:600;
  color:var(--color-text);
  letter-spacing:0.01em;
}

.md-typeset h1,
.md-typeset h2 {
  text-transform:uppercase;
}

/* The theme's heading margins are tuned for Inter. Barlow Condensed sets
   narrower, and uppercased at the top two levels it leaves no descenders
   reaching into the space below, so the same metric gap reads as a hole.
   Half the heading's own size is the rule, which em gives directly: each
   level then gets space in proportion to how loud it is. Only the space
   below a heading is pulled in — the space above it is what separates one
   section from the last, and that still has work to do */
.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4 {
  margin-bottom:0.5em;
}

/* Tabular figures keep money, times and flight numbers lined up the way they
   are in the game */
.md-typeset {
  font-feature-settings:"tnum" 1;
}

/* The search field and code blocks are the game's inputs: the deeper surface,
   inside the border the rest of the chrome is drawn in. Zensical opens search
   in an overlay rather than filling an inline form, so the field in the header
   is the button that opens it */
.md-search__button {
  background-color:var(--color-background-deep);
  border:1px solid var(--color-border-deep);
  border-radius:5px;
  color:var(--color-text);
}

.md-search__button:focus,
.md-search__button:hover {
  background-color:var(--color-background-deep);
  border-color:var(--color-action-border);
  color:var(--color-text);
}

/* The magnifier is a mask, so it is painted by its background */
.md-search__button::before {
  background-color:var(--color-text);
}

/* The keyboard shortcut sits on the surface above the field, the way a key
   cap does elsewhere */
.md-search__button::after {
  background-color:var(--color-background-main);
}

/* The field and the table of contents are one column. The header's inner and
   the content's inner are both .md-grid, so they share an edge to measure
   from: the table of contents is the last 12.1rem of that grid, and the field
   is laid out from the same right edge, back past the 0.4rem the header's
   inner holds as padding and the 0.2rem of scrollbar gutter the sidebar keeps
   outside its 11.5rem of nav — 0.4 + 0.2 + 11.5 = 12.1rem, the sidebar's own
   left edge. Below 60em the field is not rendered and the contents collapse to
   a floating button, so there is nothing to line up */
@media screen and (min-width:60em) {
  /* No repository is configured, so this is an empty column between the field
     and the edge the field is measured from */
  .md-header__source {
    display:none;
  }

  .md-search {
    flex-shrink:0;
  }

  .md-search__button {
    width:11.5rem;
    margin-right:0.2rem;
  }
}

.md-typeset pre > code,
.md-typeset code {
  border-radius:5px;
}

.md-typeset pre > code {
  border:1px solid var(--color-border-deep);
}

/* A table is a panel, like the game's sections */
.md-typeset table:not([class]) {
  background-color:var(--color-background-main);
  border:1px solid var(--color-border-deep);
  border-radius:0.625rem;
  box-shadow:none;
}

.md-typeset table:not([class]) th {
  background-color:var(--color-background-deep);
  font-family:var(--font-airport);
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:0.02em;
}

/* Admonitions borrow the game's status colours rather than the theme's. A
   panel in the game is one flat surface, so the kind is carried by the bar
   down its edge and by its icon, and the other three sides stay in the
   ordinary panel border */
.md-typeset .admonition,
.md-typeset details {
  background-color:var(--color-background-main);
  border:1px solid var(--color-border-deep);
  border-left-width:0.2rem;
  border-radius:0.625rem;
  box-shadow:none;
  font-size:0.7rem;
}

/* This theme variant washes the whole panel in its kind's colour, one selector
   deeper than the rule above — matching an admonition on the class it always
   carries is enough to take the surface back */
.md-typeset .admonition[class],
.md-typeset details[class] {
  background-color:var(--color-background-main);
}

/* A title is the panel's header, so it reads as signage */
.md-typeset .admonition > .admonition-title,
.md-typeset details > summary {
  font-family:var(--font-airport);
  font-weight:600;
  font-size:0.85rem;
  text-transform:uppercase;
  letter-spacing:0.02em;
}

/* The rule under a title is drawn only when the admonition is open */
.md-typeset .admonition > .admonition-title,
.md-typeset details[open] > summary {
  border-bottom:1px solid var(--color-border-deep);
}

/* Each kind names its colour once, and the edge bar and the icon both take it.
   The theme's own icons are masks, so an icon is painted by its background */
.md-typeset .note {
  --color-kind:var(--color-action-border);
}

.md-typeset .tip {
  --color-kind:var(--color-success);
}

.md-typeset .warning {
  --color-kind:var(--color-warning);
}

.md-typeset .danger {
  --color-kind:var(--color-error);
}

.md-typeset :is(.note, .tip, .warning, .danger) {
  border-left-color:var(--color-kind);
}

.md-typeset :is(.note, .tip, .warning, .danger) > :is(.admonition-title, summary)::before {
  background-color:var(--color-kind);
}

/* The active page in the sidebar and the table of contents is marked in the
   game's action amber, the same as a link answering a pointer */
.md-nav__link--active,
.md-nav__link--active:focus,
.md-nav__link--active:hover {
  color:var(--color-primary-action);
}

.md-nav__item--active > .md-nav__link {
  font-weight:700;
}

/* The sidebar's section labels read as signage, like the game's list headers */
.md-nav--primary .md-nav__title {
  font-family:var(--font-airport);
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:0.02em;
}

/* A section nested inside another section (the job families under "Jobs")
   keeps the indentation the theme drops for top-level sections, so the
   families do not read as siblings of "Jobs", "Competence" and "Training" */
.md-nav--primary .md-nav__item--section .md-nav__item--section > .md-nav > .md-nav__list {
  margin-inline-start:0.6rem;
}

/* "Back to top" and the version/edit buttons are the game's quiet buttons */
.md-top {
  background-color:var(--color-background-main);
  border:1px solid var(--color-action-border);
  color:var(--color-text);
  box-shadow:var(--md-shadow-z2);
}

.md-top:hover {
  background-color:var(--color-action);
  color:var(--color-text);
}
