/* ==============================================================================
   FLAG — the flag of a language (templates/shared/flag.html, prompt 58 and
   prompt 136): the set the PDF draws, in the PDF's 3:2 box at the size of
   the text beside it, and the code on a pill for a language the PDF has no
   flag for. One sheet for the three places that draw one, the portal, the
   admin and a client's public pages (the catalogue, the cover and the open
   page), so a flag looks the same wherever a language is shown.
   ============================================================================== */

/* The hairline round a flag, so a white stripe does not melt into the
   card: dark on the light card, light on the dark one, the two blocks of
   tokens.css. */
:root {
  --flag-hairline: rgb(0 0 0 / 25%);
}

:root[data-theme="dark"] {
  --flag-hairline: rgb(255 255 255 / 30%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --flag-hairline: rgb(255 255 255 / 30%);
  }
}

.flag {
  display: inline-block;
  flex: 0 0 auto;
  width: 1.5rem;
  height: 1rem;
  border-radius: 2px;
  box-shadow: 0 0 0 1px var(--flag-hairline);
  vertical-align: -0.15em;
}

.flag--pill {
  width: auto;
  height: auto;
  padding: 0 0.3em;
  font-size: 0.75em;
  font-weight: 700;
  line-height: 1.35;
  text-transform: uppercase;
}
