// Hero
//
// Extends Bulma hero.
//
// .hero-main - full image
// .hero-project - large left image
// .hero-initiative - medium left image
// .hero-person - pers image with nav overlay
//
// Styleguide: Componenet.Hero

.hero.is-light {
  background: $grey;
}

.hero-main {
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  margin-top: -4rem;
  &::before {
    position: absolute;
    display: block;
    top: 0;
    right: 0;
    left: 0;
    height: 11em;
    content: "";
    background: linear-gradient(to bottom, rgba(13,30,52,1) 25%,rgba(13,30,52,0) 100%);
  }
  a .icon {
    color: $dandelion;
  }
  a:hover,
  a:focus {
    .icon {
      color: $dandelion-light;
    }
  }
  .hero-body {
    padding-block: 7rem 5rem;
  }
}

.hero.is-blue {
  color: $white;
  background-color: $blue;
  -moz-transition: all .2s linear;
  -webkit-transition: all .2s linear;
  -ms-transition: all .2s linear;
  -o-transition: all .2s linear;
  transition: all .2s linear;
  // This is the same as we do for all cards at sass/agaric/_component.card.scss
  // but we're only doing this for people so far, who are hard-coded to blue.
  & > .container > .hero-image > .hero-image-shadow {
    position: relative;
  }
  & > .container > .hero-image > .hero-image-shadow:before {
    content: "";
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    box-shadow: inset 0 0 0 100vmax rgba($blue, .5);
  }
  &:hover,
  &:focus {
    color: $white;
    background-color: darken($blue, 5%);
    & > .container > .hero-image > .hero-image-shadow:before {
      box-shadow: none;
    }
  }
}

.hero.is-marine {
  color: $white;
  background-color: $marine;
}

.hero.is-berry {
  color: $white;
  background-color: $berry;
}

.hero.is-cinnamon {
  color: $white;
  background-color: $cinnamon;
}

.hero.is-dark {
  color: $white;
  background-color: $dark;
}

.hero.is-grey {
  color: $white;
  background-color: $grey;
}

.hero.is-dandelion {
  color: $white;
  background-color: $dandelion;
}

.hero.is-blue,
.hero.is-marine,
.hero.is-berry,
.hero.is-cinnamon,
.hero.is-dark,
.hero.is-dandelion {
  a {
    color: $text-light;
    &:hover,
    &:focus {
      color: $blue-light;
      background-color: $white;
    }
  }
}

.hero.is-light,
.hero.is-grey {
  a:not(.button):not(.dropdown-item):not(.tag) {
    color: $link;
  }
}

.hero.is-light,
.hero.is-grey {
  a:hover,
  a:focus {
    color: $blue-light;
    background-color: $white;
  }
}

.hero-project,
.hero-person {
  margin-top: -6rem;
}

// Project

.hero-project {
  .container {
    .hero-body {
      .title {
        color: currentColor;
        font-size: $size-3;
        line-height: 1em;
      }
      .subtitle {
        color: currentColor;
        font-family: $family-monospace;
        font-size: $size-5;
        line-height: 1.4em;
      }
      .title + .subtitle {
        margin-top: 1em;
      }
    }
    @include tablet {
      display: flex;
      flex-direction: row;
      .hero-image {
        width: 50%;
        img {
          display: block;
        }
      }
      .hero-body {
        padding: 6rem 2rem 2rem 1rem;
        z-index: +1;
        width: 50%;
        .title {
          margin-top: 0.25em;
          margin-left: -1.25em;
          max-width: 12em;
        }
        .subtitle {
          font-size: $size-5;
        }
      }
    }
    @include desktop {
      .hero-body {
        padding: 6rem 3rem 3rem 1.5rem;
        .title {
          margin-top: 0.25em;
          font-size: $size-2;
        }
        .subtitle {
          font-size: $size-4;
        }
      }
    }
  }
}

// Initiative

.hero-initiative .container {
  .hero-body {
    .title {
      color: currentColor;
      font-size: $size-3;
      line-height: 1em;
    }
    .subtitle {
      color: currentColor;
      font-family: $family-monospace;
      font-size: $size-5;
      line-height: 1.4em;
    }
    .title + .subtitle {
      margin-top: 1em;
    }
  }
  @include tablet {
    display: flex;
    flex-direction: row;
    .hero-image {
      box-sizing: border-box;
      padding-top: 3rem;
      padding-bottom: 3rem;
      padding-left: 3rem;
      width: 50%;
      img {
        display: block;
      }
    }
    .hero-body {
      padding: 3rem 3rem 3rem 1.5rem;
      width: 50%;
      z-index: +1;
      .title {
        display: inline-block;
        margin-top: 0.5em;
        margin-left: -1.25em;
      }
      .subtitle {
        font-size: $size-5;
      }
      .title + .subtitle {
        margin-top: 1em;
      }
    }
  }
  @include desktop {
    .hero-body {
      padding: 3rem 3rem 3rem 1.5rem;
      .title {
        margin-top: 0.25em;
        font-size: $size-2;
      }
      .subtitle {
        font-size: $size-4;
      }
    }
  }
}

// Person

.hero-person .container {
  .title {
    padding: 0.5em;
    color: currentColor;
    font-size: $size-3;
    line-height: 1em;
  }
  .subtitle {
    color: currentColor;
    font-size: $size-5;
    line-height: 1em;
  }
  .hero-body {
    padding-top: 0;
  }
  p {
    font-family: $family-monospace;
  }
  p + p {
    margin-top: 1.2em;
  }
  @include tablet {
    display: flex;
    flex-direction: row;
    .hero-image {
      box-sizing: border-box;
      padding: 3rem 3rem 3rem 6rem;
      width: 50%;
      img {
        display: block;
      }
      .title {
        // Needed to stay on top of the relative positioned .hero-image-shadow
        // which is relatively positioned to make its :before box-shadow work.
        position: relative;
        margin-top: -1.5em;
        margin-left: -1.25em;
        padding-bottom: 0.5em;
        z-index: +1;
      }
    }
    .hero-body {
      padding: 3rem 3rem 3rem 1.5rem;
      width: 50%;
      .subtitle {
        font-weight: bold;
      }
      .subtitle + p {
        margin-top: 1.2em;
      }
    }
  }
  @include desktop {
    .subtitle {
      font-size: $size-4;
    }
  }
}

// Specific to current elements

[about="/home-page"] .hero-main{
  background-position: bottom 20% center;
}