/*
 * Fonts and plain elements: what a page looks like before any component is used.
 * Reads only tokens.css.
 *
 *   1. Fonts
 *   2. Page and text
 *   3. Links and focus
 *   4. Small helpers (hidden text, the skip link)
 */

/* --- 1. Fonts -------------------------------------------------------------------------------
 * Figtree for text, Fraunces for titles. The files are in /static/fonts/ (see the README
 * there for where they come from and their licence). Each family has two files: "latin" with
 * the basic letters and â î, and "latin-ext" with ă ș ț and other accented letters. The
 * browser reads unicode-range and downloads a file only when a page has letters from it.
 * One file holds every weight (a variable font), so font-weight is a range.
 */
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("../fonts/figtree-latin-wght-normal.202cfb54d4e6.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("../fonts/figtree-latin-ext-wght-normal.eca8d8b337ff.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/fraunces-latin-opsz-normal.069cb90e11a3.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/fraunces-latin-ext-opsz-normal.a04d353989ad.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- 2. Page and text --------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--gc-ground);
  color: var(--gc-ink);
  font-family: var(--gc-font-body);
  font-size: var(--gc-text-base);
  line-height: 1.5;
  /* A phone must not enlarge the text by itself when it is turned on its side. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Keep room for the scrollbar on every page, also on one too short to scroll. Otherwise,
     where the scrollbar takes room, the centred column moves sideways when going from a
     short page (Acasă) to a long one (Animale). GC-118. */
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--gc-font-display);
  font-weight: 500;
  line-height: 1.15;
  /* A long name without spaces must not push the page wider than the screen. */
  overflow-wrap: anywhere;
}
h1 { font-size: var(--gc-title-page); line-height: 1.1; }
h2 { font-size: var(--gc-title-section); }
h3 { font-size: var(--gc-title-card); }

p {
  margin: 0;
}

img,
svg {
  max-width: 100%;
}

/* Form controls do not take the page's font by themselves. */
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* --- 3. Links and focus ------------------------------------------------------------------- */
a {
  color: var(--gc-link);
}
a:hover {
  color: var(--gc-ink);
}

/* The keyboard focus is always visible: a ring in the accent colour, 5.7:1 on the page. */
:focus-visible {
  outline: 3px solid var(--gc-accent);
  outline-offset: 2px;
}
/* The main column gets the focus from the skip link; it needs no ring of its own. */
main:focus {
  outline: none;
}

/* --- 4. Small helpers --------------------------------------------------------------------- */

/* Text for screen readers only: it is read out, but not shown. */
.gc-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* The first link of every page, for keyboard users: it jumps over the navigation. It stays
 * off the screen until it gets the focus. */
.gc-skip {
  position: absolute;
  left: 8px;
  top: -100px;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  min-height: var(--gc-tap);
  padding: 0 16px;
  border-radius: var(--gc-radius-pill);
  background: var(--gc-brand);
  color: var(--gc-on-brand);
  font-weight: 600;
  text-decoration: none;
}
.gc-skip:focus {
  top: 8px;
  color: var(--gc-on-brand);
}

/* An icon drawn inline (templates/components/paw.html): as big as the text around it. */
.gc-icon {
  width: 1em;
  height: 1em;
  flex: none;
  fill: currentColor;
}
