/*

#############################
### ORGANISM: cities ########
#############################

*/

@import '_extends.scss';
@import '_functions.scss';
@import '_mixins.scss';
@import '_variables.scss';

@import 'components/atoms/_headline.scss';
@import 'components/atoms/_text.scss';
@import 'components/atoms/_color.scss';

.#{organism('cities')} {
  margin-top: 30px;

  @media (min-width: 768px) {
    margin-top: 0px;
  }

  .#{molecule('tip')} {
    max-width: 60%;

    &-important {
      max-width: none;
      width: auto;
      margin: 50px 0;
      margin-left: 20px;
    }

    button {
      float: right;
    }
  }

  &-map {
    $self: &;
    height: 0;
    padding-top: 45.45454545%;
    position: relative;
    margin: 20px 0 60px;

    &-grid {
      position: absolute;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      display: grid;
      grid-template-columns: repeat(110, 1fr);
      grid-template-rows: repeat(50, 1fr);
      grid-gap: 1px;
      z-index: 1;
      pointer-events: none;

      &-dev {
        overflow: hidden;
        grid-gap: 0;
      }

      &-cell {
        position: relative;
        pointer-events: auto;
        cursor: pointer;

        &:hover {
          #{$self}-pin { z-index: 3; }
          #{$self}-tooltip { display: block; }
        }

        &:nth-child(odd) #{$self}-pin-next::before {
          animation-delay: -.75s;
        }
      }
    }

    &-pin {
      position: relative;
      display: block;
      width: 100%;
      height: 100%;
      border-radius: 100%;
      box-shadow: 1px 1px 2px rgba(black,.25);
      transform: scale(1.2);
      z-index: 2;

      &-next {
        background-color: transparent;
        box-shadow: none;
        z-index: 3;

        &::before {
          content: '';
          display: block;
          width: 600%;
          height: 250%;
          position: absolute;
          left: 50%;
          bottom: 0;
          border-radius: 100%;
          background-color: rgba(#fff, 0.9);
          border: 1px solid #fff;
          box-shadow: 1px 1px 2px rgba(black,.25);
          transform: translate(-50%, 10px);
          transform-origin: center center;
          animation: pulsePin 2s infinite ease-out;
        }

        & + #{$self}-tooltip {
          @include color-blue-ribbon;
        }
      }

      &-past {
        background-color: rgba(#fff, 0.8);
      }

      @keyframes pulsePin {
        from { transform: translate(-50%, 10px) scale(0.1); opacity: 1; }
        to { transform: translate(-50%, 10px) scale(1.5); opacity: 0; }
      }
    }

    &-icon {
      width: 600%;
      height: 600%;
      position: absolute;
      left: 50%;
      bottom: 0;
      fill: #fff;
      filter: drop-shadow(1px 1px 2px rgba(black,.25));
      transform: translateX(-50%);
    }

    &-tooltip {
      display: none;
      position: absolute;
      left: 100%;
      top: 50%;
      transform: translate(8px, -50%);
      padding: 3px 7px;
      font-size: 14px;
      font-weight: 700;
      font-family: 'Poppins',  system;
      white-space: nowrap;
      text-transform: uppercase;
      color: fade_out(color('charade'), 0.25);
      background: #fff;
      box-shadow: 1px 2px 5px 0 rgba(black, .25);
      border-radius: 3px;
      z-index: 4;

      &::before {
        content: '';
        display: block;
        position: absolute;
        left: -6px;
        top: 7px;
        width: 0;
        height: 0;
        border-top: 6px solid transparent;
        border-bottom: 6px solid transparent;
        border-right: 6px solid #fff;
      }
    }

    &-control {
      width: 100%;
      height: 100%;
      margin: 0;
      padding: 0;
      font-size: 0;
      line-height: 0;
      border: none;
      outline: none;
      box-shadow: -1px -1px 0 rgba(0,0,0,0.15);
      cursor: default;
      -moz-appearance: none;
      -webkit-appearance: none;
      pointer-events: auto;

      &:checked {
        border-radius: 100%;
        background-color: color('guardsman-red');
        box-shadow: none;
      }
    }

    &-background {
      display: flex;
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;

      svg {
        filter: drop-shadow(5px 12px 10px rgba(0,0,0,0.19));
        width: 100%;
      }
    }
  }

  &-headline {
    @include hl;
    @include hl-h2;

  }

  &-sub-headline {
    @include hl;
    @include hl-h4;
  }

  &-next-events {
    text-align: center;
    padding-bottom: 60px;
    margin-bottom: 40px;
    border-bottom: 1px solid color('iron');

    &-list {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      margin: 20px 0 60px;
    }

    &-checkback {
      @include txt;
      grid-column: 1 / -1;
      margin: 0 auto;
      text-align: left;
    }

    h4 {
      margin-top: 2.5rem;
    }
  }

  &-visited-list {
    display: grid;
    grid-gap: 30px;
    grid-template-columns: repeat(2, 1fr);
    list-style: none;
    padding-left: 0;
    margin-top: 50px;

    @media (min-width: 480px) {
      grid-template-columns: repeat(3, 1fr);
    }

    @media (min-width: 1024px) {
      grid-template-columns: repeat(4, 1fr);
    }

    @media (min-width: 1200px) {
      grid-template-columns: repeat(5, 1fr);
    }
  }
}
