@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url(../webfonts/source-sans-3-200-900-latin.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: 'Source Sans 3';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url(../webfonts/source-sans-3-200-900-latin-ext.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url(../webfonts/source-sans-3-200-900-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url(../webfonts/source-sans-3-200-900-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

.site-nav {
  --nav-primary: #0f8b5f;
  --nav-primary-dark: #0b6b49;
  --nav-primary-tint: #e4f3ec;
  --nav-accent: #ffb70f;
  position: relative;
  z-index: 30;
  font-family: "Source Sans 3", sans-serif;
  border-bottom: 1px solid #e3e3e3; /* sets it apart from white pages below */
  background-color: #fff;
}

.site-nav__container {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  min-height: 3.5rem;
  margin: 0 auto;
}

.site-nav__brand {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  padding: 0.5rem 0.75rem;
}

.site-nav__burger {
  position: relative;
  width: 3.5rem;
  height: 3.5rem;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

.site-nav__burger span {
  position: absolute;
  left: calc(50% - 0.5rem);
  width: 1rem;
  height: 2px;
  border-radius: 1px;
  background-color: currentColor;
  transition: transform 150ms ease-out, opacity 150ms ease-out;
}

.site-nav__burger span:nth-child(1) { top: calc(50% - 6px); }
.site-nav__burger span:nth-child(2) { top: calc(50% - 1px); }
.site-nav__burger span:nth-child(3) { top: calc(50% + 4px); }

/* Open: the three lines turn into a cross. */
.site-nav__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.site-nav__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.site-nav__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

.site-nav__menu {
  display: none;
  width: 100%;
  padding: 0.5rem;
  background-color: #fff;
  box-shadow: 0 8px 16px #0A0A0A1A;
}

.site-nav__menu--open {
  display: block;
}

/* Links are pills: the current page's is filled with the light brand
   green; hovering another shows the same background. */
.site-nav__item {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.5rem; /* between the icon and the title */
  padding: 0.5rem 0.875rem;
  border-radius: 999px;
  white-space: nowrap;
  color: #3a3a3a;
  /* Source Sans 3 runs small and light: 15px at 550 (it's a variable font)
     reads like 14px medium in wider fonts. */
  font-size: 0.9375rem;
  font-weight: 550;
  line-height: 1.2; /* set explicitly for the icon */
  text-decoration: none;
}

/* The item is a flex container, so its icon is a flex item with Font
   Awesome's line-height: 1, which made icon-only links (logout) shorter
   than text links. Same line height as the text keeps them equal. */
.site-nav__item i {
  line-height: inherit;
}

/* Match the MAX icon color to the other social icons. */
.site-nav__image {
  display: block;
  width: 1rem;
  height: 1rem;
  background-color: currentColor;
  -webkit-mask: url("../images/max-logo-black.svg") center / contain no-repeat;
  mask: url("../images/max-logo-black.svg") center / contain no-repeat;
}

/* Icon-only links (social networks, logout) are circles as tall as the
   text links' pills. */
.site-nav__item--icon-only {
  justify-content: center;
  width: calc(1.2em + 2 * 0.5rem);
  height: calc(1.2em + 2 * 0.5rem);
  padding: 0;
  border-radius: 50%;
}

/* Their Font Awesome icons at 16px, the size of image icons (MAX). */
.site-nav__item--icon-only i {
  font-size: 1rem;
}

.site-nav__item:hover {
  background-color: var(--nav-primary-tint);
}

/* Hovered in light yellow instead, e.g. logout. */
.site-nav__item--hover-accent:hover {
  background-color: #fff7e5;
}

/* Hovered in light gray instead, e.g. the social network links. */
.site-nav__item--hover-muted:hover {
  background-color: #efefef;
}

/* Their icons are dimmed a little. */
.site-nav__item--hover-muted :is(i, .site-nav__image) {
  opacity: 0.85;
}

.site-nav__item--primary {
  padding: calc(0.625rem - 2px) calc(1.25rem - 2px);
  border: 2px solid var(--nav-primary);
  background-color: transparent;
  color: var(--nav-primary);
  font-weight: 600;
}

.site-nav__item--primary:hover {
  border-color: var(--nav-primary-dark);
  background-color: #0F8B5F0F;
  color: var(--nav-primary-dark);
}

/* The current section. */
.site-nav__item--active {
  background-color: var(--nav-primary-tint);
  color: var(--nav-primary-dark);
  font-weight: 600;
}

/* A filled yellow button, e.g. registration. Defined after --active so it
   stays yellow on its own page too, and keeps yellow (slightly darker) on
   hover instead of the links' green. */
.site-nav__item--accent {
  padding: 0.625rem 1.25rem;
  background-color: var(--nav-accent);
  color: #4d3600;
  font-weight: 700;
}

.site-nav__item--accent:hover {
  background-color: #f5ab00;
}

.site-nav__item:focus-visible,
.site-nav__burger:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
}

@media (min-width: 1024px) {
  .site-nav__container {
    flex-wrap: nowrap;
    max-width: 960px;
  }

  /* Align the logo with the page content edge. */
  .site-nav__brand {
    margin-left: -0.75rem;
  }

  .site-nav__burger {
    display: none;
  }

  /* The links group: one row of pills, side by side, filling the space
     after the logo. */
  .site-nav__menu {
    display: flex;
    flex: 1;
    align-items: center;
    width: auto;
    padding: 0;
    box-shadow: none;
  }

  .site-nav__start,
  .site-nav__end {
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }

  /* Room between the logo and the first link, so a highlighted first link
     (the admin's current section) doesn't crowd the logo. */
  .site-nav__start {
    margin-left: 1rem;
  }

  /* Space between the login link and the registration button. */
  .site-nav__end {
    margin-left: auto;
  }

  /* Icon-only links next to each other (the social networks) touch:
     cancel the group's gap between them. */
  .site-nav__item--icon-only + .site-nav__item--icon-only {
    margin-left: calc(-1 * 0.25rem);
  }
}

@media (min-width: 1216px) {
  .site-nav__container {
    max-width: 1152px;
  }
}

.site-nav__brand img {
  display: block;
  width: 112px;
  height: 28px;
}

.site-nav__end {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.site-nav__dropdown {
  position: relative;
}

.site-nav__dropdown summary {
  cursor: pointer;
}

.site-nav__dropdown summary::after {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-right: 1px solid;
  border-bottom: 1px solid;
  transform: rotate(45deg);
}

.site-nav__dropdown-menu {
  padding: 0.25rem;
  border-radius: 0.75rem;
  background: #fff;
}

.site-nav__dropdown-menu a {
  white-space: normal;
}

@media (min-width: 1024px) {
  .site-nav__dropdown-menu {
    position: absolute;
    min-width: max-content;
    border: 1px solid #e3e3e3;
    box-shadow: 0 8px 16px #0a0a0a1a;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-nav__burger span {
    transition: none;
  }
}
