// Demo content
//
// Please note: These are mostly for demo purposes
// so feel free to remove everything in this file
// and start over.

// This is just for demoing purposes so let's give it some slack
/* stylelint-disable */

// Demo variables
$color-wild-blue-yonder: #737fbf;

:root {
  --color-baby-blue: #60f4ea;
  --color-heliotrope: #866cff;
  --color-wild-blue-yonder: #{$color-wild-blue-yonder};
  --color-wild-blue-yonder-rgb: #{hextorgb($color-wild-blue-yonder)};
  --color-border-demo-header: rgba(var(--color-wild-blue-yonder-rgb), .5);
}

// Demo navigation background on sub pages
@media (min-width: $width-max-mobile) {
  body .nav-container {
    background-color: var(--color-main);
  }
}

.site-header {
  padding-top: 4rem;
  padding-bottom: 4rem;

  @media (max-width: $width-max-mobile) {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  .site-title {
    margin: 0;

    svg {
      transition: transform 1s ease-in;

      // Accessibility: Disable animation if reduce motion is enabled
      @media screen and (prefers-reduced-motion: reduce), (update: slow) {
        transition: none;
      }
    }

    .clr-i-solid-path-2 {
      fill: var(--color-white);
    }

    a {
      color: var(--color-baby-blue);
      display: flex;
      align-items: center;
    }

    a:hover svg {
      transition: transform .4s cubic-bezier(.6, -.68, .73, .04);
      transform: translate(260%, -220%);

      // Accessibility: Disable animation if reduce motion is enabled
      @media screen and (prefers-reduced-motion: reduce), (update: slow) {
        transition: none;
        transform: none;
      }

      .clr-i-solid-path-2 {
        display: block !important;
        fill: var(--color-baby-blue);
      }
    }

    .logo-name {
      content: 'Air';
      display: block;
      text-transform: lowercase;
      letter-spacing: .1em;
      font-weight: var(--font-weight-paragraphs);
      color: var(--color-white);
      margin-left: .75rem;
      font-size: 2.2rem;
    }
  }
}

// Demo structure
.block.block-entry-header-demo {
  background-color: var(--color-valhalla);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  max-height: 80rem;
  height: 60vh;
  max-width: $width-max-layout;
  margin: 0 auto;

  @media (min-width: $container-mobile) {
    min-height: 60rem;
  }

  @media (max-width: $container-mobile) {
    padding-top: 6rem;
    padding-bottom: 6rem;
  }

  .shade {
    opacity: .4;
  }

  .inner {
    display: grid;
    grid-template-rows: 1fr 1fr;

    /* autoprefixer: off */
    align-items: center;
    max-height: 100%;
    justify-items: center;
    padding: 2rem;
    max-width: $container-desktop;
    margin-top: 140px;
    margin-bottom: 80px;

    @media (min-width: $container-ipad) {
      padding: 0;
      display: grid;
      grid-template-rows: none;
      grid-template-columns: 3fr 5fr;
      max-width: $width-max-article;
    }
  }

  @keyframes plane-container {
    0% {
      overflow: visible;
    }

    80% {
      overflow: hidden;
    }

    100% {
      overflow: hidden;
    }
  }

  .logo {
    color: var(--color-baby-blue);
    border-top: 2px solid var(--color-border-demo-header);
    border-right: 0;
    width: 100%;
    text-align: center;
    order: 2;
    overflow: visible;
    animation: plane-container 10s linear 1s infinite;

    .logo-name {
      display: none;
    }

    @keyframes plane {
      0% {
        transform: translate(-200%, 140%);
      }

      10% {
        transform: translate(0, 0);
        opacity: 1;
      }

      85% {
        transform: translate(0, 0);
        opacity: 1;
      }

      95% {
        transform: translate(140%, -100%);
      }

      97% {
        opacity: 0;
      }

      100% {
        transform: translate(0, 0);
      }
    }

    svg {
      padding: 2rem;
      height: auto;
      width: 100%;
      max-width: 20rem;
      opacity: 0;
      transform: translate(-100%, 100%);
      animation: plane 5s cubic-bezier(.86, 0, .07, 1) 1s infinite;
      animation-delay: -5s;
      position: relative;
      z-index: 6;

      // Accessibility: Disable animation if reduce motion is enabled
      @media screen and (prefers-reduced-motion: reduce), (update: slow) {
        animation: none;
        transform: none;
        opacity: 1;
      }

      @media (max-width: $container-mobile) {
        max-width: 15rem;
      }
    }

    @media (min-width: $container-ipad) {
      border-top: 0;
      border-right: 2px solid var(--color-border-demo-header);
      order: 0;
      text-align: right;

      svg {
        padding: 2rem 4rem;
      }
    }
  }

  .heading-hero {
    color: var(--color-white);
    margin: 0;
    padding: 2rem;
    position: relative;
    z-index: 2;
    text-align: center;
    line-height: 1.23;

    @media (min-width: $container-ipad) {
      padding: 2rem 4rem;
      text-align: left;
    }
  }
}

.accent {
  font-size: var(--font-size-h3);
  font-style: normal;
  letter-spacing: .05em;
  text-transform: lowercase;
  font-weight: var(--font-weight-medium);
  margin: 0;
  margin-bottom: 1rem;
  color: var(--color-wild-blue-yonder);
  display: block;
  position: relative;
  z-index: 2;
}

@media (min-width: $width-max-mobile) {
  .dropdown-toggle,
  .menu-item.current-menu-item > a,
  .menu-item.current-menu-parent > a,
  .site-header .site-branding .site-title a,
  .site-header .nav-primary .menu-items.nav-menu .menu-item > .dropdown-toggle,
  .site-header .nav-primary .menu-items .current-menu-parent > a,
  .site-header .nav-primary .menu-items .current-menu-item > a {
    color: var(--color-baby-blue);
  }

  .site-header .nav-primary .menu-items .sub-menu .current-menu-parent > a,
  .site-header .nav-primary .menu-items .sub-menu .current-menu-item > a,
  .site-header .nav-primary .menu-items .sub-menu .dropdown-toggle {
    color: var(--color-current);
  }

  .site-header .nav-primary .menu-items.nav-menu .sub-menu .menu-item > .dropdown-toggle {
    color: var(--color-valhalla);
  }
}

.block.block-entry-header-demo + .block .container {
  max-width: $width-max-article;

  &.gutenberg-content {
    max-width: 100%;
  }
}

// Build these to views/_index.scss for example
.block.block-blog article,
.block.block-blog nav {
  max-width: $width-max-article;
  margin-left: auto;
  margin-right: auto;
}

.block-blog article {
  margin-bottom: var(--padding-block);

  &:last-child {
    margin-bottom: 0;
  }
}

.block-blog ul.tags {
  padding-left: 0;
}

@media (min-width: $width-max-mobile) {
  .block {
    min-height: 78px;
  }
}

.site-footer {
  background-color: var(--color-valhalla);
}

// Demo components
.components {
  display: flex;
  flex-wrap: wrap;
  margin-top: 6rem;
  margin-bottom: -4rem;
  align-items: flex-start;
}

.heading-demo {
  margin-top: 6rem;
}

.link-demo {
  @include link();
}

.site-main .component {
  border: 1px dashed var(--color-heliotrope);
  padding: 19px;
  margin-right: 4rem;
  margin-bottom: 4rem;

  .component-label {
    color: var(--color-heliotrope);
    font-size: 12px;
    position: absolute;
    margin-top: -42px;
    margin-left: -20px;

    &::before {
      background-image: url('https://airwptheme.com/demo/figma-component.svg');
      background-repeat: no-repeat;
      content: '';
      display: inline-block;
      width: 11px;
      height: 11px;
      margin-right: 5px;
    }
  }

  p {
    display: flex;
    align-items: center;
    margin: 0 0 2rem;

    &:last-child {
      margin-bottom: 0;
    }
  }
}
