:root {
  --primary: #f0f0f0;
  --primary-overlay: rgba(24, 24, 24, 0.1);
  --primary-bg: rgba(218, 218, 218);
  --primary-bg-faded: rgba(245, 245, 245, 0.95);
  --primary-bg-faded-95: rgba(218, 218, 218, 0.96);
  --primary-bg-gradient: linear-gradient(180deg, var(--primary-bg-faded), var(--primary-bg-faded-95));
  --primary-shadow: 0px -2px 25px -10px #181818;
  --primary-nav-overlay: rgba(20, 20, 20, 0.2);
  --primary-nav: #cecece;
  --primary-nav-faded: rgba(240, 240, 240, 0.9);
  --primary-nav-faded-95: rgba(206, 206, 206, 0.95);
  --primary-nav-gradient: linear-gradient(0deg, var(--primary-nav-faded), var(--primary-nav-faded-95));
  --primary-link: #0e0e0e;
  --primary-text: #222;
  --go-to-home-shadow: inset 0 -6px 21px -5px var(--primary-bg);

  .dark {
    --primary-bg: rgba(24, 24, 24, 0.5);
    --primary-nav: rgba(20, 20, 20, 0.6);
    --primary: #0e0e0e;
    --primary-link: #f0f0f0;
    --primary-text: #f0f0f0;
  }
}

/*! HTML5 Boilerplate v9.0.1 | MIT License | https://html5boilerplate.com/ */

/* main.css 3.0.0 | MIT License | https://github.com/h5bp/main.css#readme */
/*
 * What follows is the result of much research on cross-browser styling.
 * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
 * Kroc Camen, and the H5BP dev community and team.
 */

/* ==========================================================================
   Base styles: opinionated defaults
   ========================================================================== */

html {
  color: #222;
  font-size: 1em;
  line-height: 1.4;
}

/*
 * Remove text-shadow in selection highlight:
 * https://twitter.com/miketaylr/status/12228805301
 *
 * Customize the background color to match your design.
 */

::-moz-selection {
  background: #b3d4fc;
  text-shadow: none;
}

::selection {
  background: #b3d4fc;
  text-shadow: none;
}

/*
 * A better looking default horizontal rule
 */

hr {
  display: block;
  height: 1px;
  border: 0;
  border-top: 1px solid #ccc;
  margin: 1em 0;
  padding: 0;
}

/*
 * Remove the gap between audio, canvas, iframes,
 * images, videos and the bottom of their containers:
 * https://github.com/h5bp/html5-boilerplate/issues/440
 */

audio,
canvas,
iframe,
img,
svg,
video {
  vertical-align: middle;
}

/*
 * Remove default fieldset styles.
 */

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

/*
 * Allow only vertical resizing of textareas.
 */

textarea {
  resize: vertical;
}

/* ==========================================================================
   Author's custom styles
   ========================================================================== */

/* ==========================================================================
   Helper classes
   ========================================================================== */

/*
 * Hide visually and from screen readers
 */

/*.hidden,*/
[hidden] {
  display: none !important;
}

/*
 * Hide only visually, but have it available for screen readers:
 * https://snook.ca/archives/html_and_css/hiding-content-for-accessibility
 *
 * 1. For long content, line feeds are not interpreted as spaces and small width
 *    causes content to wrap 1 word per line:
 *    https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
 */

.visually-hidden {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
  /* 1 */
}

/*
 * Extends the .visually-hidden class to allow the element
 * to be focusable when navigated to via the keyboard:
 * https://www.drupal.org/node/897638
 */

.visually-hidden.focusable:active,
.visually-hidden.focusable:focus {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  white-space: inherit;
  width: auto;
}

/*
 * Hide visually and from screen readers, but maintain layout
 */

.invisible {
  visibility: hidden;
}

/*
 * Clearfix: contain floats
 *
 * The use of `table` rather than `block` is only necessary if using
 * `::before` to contain the top-margins of child elements.
 */

.clearfix::before,
.clearfix::after {
  content: "";
  display: table;
}

.clearfix::after {
  clear: both;
}

/* ==========================================================================
   EXAMPLE Media Queries for Responsive Design.
   These examples override the primary ('mobile first') styles.
   Modify as content requires.
   ========================================================================== */

@media only screen and (min-width: 35em) {
  /* Style adjustments for viewports that meet the condition */
}

@media print,
(-webkit-min-device-pixel-ratio: 1.25),
(min-resolution: 1.25dppx),
(min-resolution: 120dpi) {
  /* Style adjustments for high resolution devices */
}

/* ==========================================================================
   Print styles.
   Inlined to avoid the additional HTTP request:
   https://www.phpied.com/delay-loading-your-print-css/
   ========================================================================== */

@media print {
  *,
  *::before,
  *::after {
    background: #fff !important;
    color: #000 !important;
    /* Black prints faster */
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  abbr[title]::after {
    content: " (" attr(title) ")";
  }

  /*
   * Don't show links that are fragment identifiers,
   * or use the `javascript:` pseudo protocol
   */
  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }

  pre {
    white-space: pre-wrap !important;
  }

  pre,
  blockquote {
    border: 1px solid #999;
    page-break-inside: avoid;
  }

  tr,
  img {
    page-break-inside: avoid;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
}

/** custom */

:root {
  --logo-area-width: calc(50vw - 5em);
  --landscape-width: 768px;
  --potrait-width: calc(var(--landscape-width) - 1px);
  --menu-items: 3;
  --nav-grid-columns: 4;
}

* {
  color: var(--primary-text, #222);
}

.smart-sticky {
  /*background-color: var(--primary-nav);*/
  background-image: var(--primary-nav-gradient);
  border-radius: 0 0 1.5em 1.5em;

  & a {
    color: var(--primary-link);
  }
}

@media (max-device-width: var(--potrait-width, 991px)) {}
@media (max-device-width: 767px) and (min-height: 640px) {
  .smart-sticky {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 20;

    & .header-left {
      padding-left: 6em;
    }
  }

  header ul.offcanvas-menu.inview-right {
    position: fixed;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(var(--nav-grid-columns, 3), 1fr);
    left: 0;
    margin: 0 auto;
    width: 100%;
    justify-items: center;
    /*background-color: var(--primary-bg);*/
    background-image: var(--primary-bg-gradient);
    border-radius: 1.2em 1.2em 0 0;
    z-index: 11;
    box-shadow: var(--primary-shadow);
    padding-top: 2.5em;

    /*&:not(.active) li:not(.current-menu) {
      display: none;
    }*/

    &::before {
      content: url("../img/icons/chevron-down.svg");
      position: absolute;
      /*padding: 3em;*/
      top: 2%;
      /*margin-left: -20%;*/
      width: 2em;
      /*height: 100%;*/
      /*background-color: rgba(24, 24, 24, 0.5);*/
      z-index: 10;
      border-radius: 1.2em 0 0 1.2em;
      -webkit-filter: drop-shadow(0px 0px 2px var(--shadow-fa, rgba(255, 255, 255, .6)));
      filter: drop-shadow(0px 0px 2px var(--shadow-fa, rgba(255, 255, 255, .6)));

      &:hover {
        filter: drop-shadow(0px 0px 5px var(--shadow-fa-active, rgba(255, 255, 255, .8)));
      }
    }

    &.active {
      padding: .6em .2em;
    }

    .current-menu-item {
      display: block;
      position: fixed;
      /*background: linear-gradient(0deg, rgba(85, 85, 85, 0.1), transparent 60%);*/
      min-width: 6em;
      /*height: 7em;*/
      align-content: center;
      /*bottom: 0;
      right: 0;*/
      top: 0;
      left: 0;
      height: 5em;
      /*margin-top: 0.4rem;*/
      margin-bottom: 0.4rem;
      border-bottom-left-radius: 1.5em;
      z-index: 10;
      box-shadow: var(--go-to-home-shadow);

      &:has(.done) {
        bottom: 6em;

        & span::before {
          content: url("../img/icons/chevron-down.svg");
        }
      }

      & span::before {
        content: url("../img/icons/chevron-up.svg");
        display: block;
        max-width: 2em;
        margin: 0 auto;
      }
    }

    & li.menu-item {
      padding: .6rem 0;
      text-align: center;

      & a {
        font-size: small;
      }
    }
  }
}

@media (min-device-width: var(--landscape-width, 992px)) {}
@media (min-device-width: 768px) or (max-height: 639px){
  .smart-sticky {
    position: fixed;
    top: 0;
    z-index: 1001;
    padding: 0 1em;
    left: var(--logo-area-width);
  }

  header ul.offcanvas-menu {
    position: fixed;
    top: 33.3vh;
    right: 0;
    /*width: 100%;*/
    /*height: 100%;*/
    z-index: 20;
    background-color: var(--primary-overlay);
    display: flex;
    flex-direction: column;
    justify-content: center;
    /*grid-template-columns: repeat(5, 1fr);*/
    justify-items: center;
    /*align-items: center;*/
    padding: 1em 1em 1em 3em;
    border-radius: 1.2em 0 0 1.2em;
    backdrop-filter: blur(6px);

    &::before {
      content: url("../img/icons/chevron-right.svg");
      position: absolute;
      /*padding: 3em;*/
      top: 45%;
      margin-left: -20%;
      width: 2em;
      /*height: 100%;*/
      /*background-color: rgba(24, 24, 24, 0.5);*/
      z-index: 10;
      border-radius: 1.2em 0 0 1.2em;
      -webkit-filter: drop-shadow(0px 0px 2px var(--shadow-fa, rgba(255, 255, 255, .6)));
      filter: drop-shadow(0px 0px 2px var(--shadow-fa, rgba(255, 255, 255, .6)));

      &:hover {
        filter: drop-shadow(0px 0px 5px var(--shadow-fa-active, rgba(255, 255, 255, .8)));
      }
    }

    &.active {
      display: block;
      padding: .6em .2em;
    }

    & li.menu-item {
      padding: .6rem 0;
      text-align: start;

      &.current-menu-item {
        /*display: none;*/
      }

      & a {
        font-size: initial;
        display: flex;
        align-items: center;

        & i {
          display: inline-block;
          width: 1.5em;
          height: 1.5em;
          background-size: contain;
          background-repeat: no-repeat;
          background-position: center;
          margin-right: .5em;
        }
      }
    }
  }
}
@media (max-height: 520px){
  header ul.offcanvas-menu {
    top: 0;
  }
}
