@import '../../_global/styles/mixins';
@import '../../_global/styles/vars';

section.marketingheader {
  margin-top: 0;

  &.miniinfoteaser {
    .kicker {
      color: var(--theme-color-secondary);
    }

    .mini-teaser {
      .category {
        color: var(--theme-color-secondary);
      }
    }

    .text-only .kicker {
      color: white;
    }
  }

  .rotation {
    .slider {
      @media(min-width: 901px) {
        height: 100%;
        .slide-overflow {
          height: 100% !important;
        }
        .slide-wrapper, .slide, .outer {
          height: 100%;
        }
      }

      .outer {
        @media(max-width: 999px) {
          max-height: none;
          height: auto;
        }
      }

      .image-box {
        picture {
          width: 100%;
        }
      }

      .copyright {
        @media(max-width: 900px) {
          left: calc(100% - 30px);
        }
        @media(max-width: 767px) {
          left: calc(100% - 20px);
        }
      }
    }
  }

  .text-box {
    .btn.has-icon.icon-small-arrow-right-simple {
      bottom: auto;
    }
  }

  .search {
    position: relative;
    overflow: hidden;
    margin: 0;
    background-color: var(--theme-color-primary-dimmed-04);
    height: 100px;
    transition: all .6s ease-in-out;
    background-size: cover;
    @media (max-width: 767px) {
      max-height: 78px;
    }

    .artwork-left .foreground,
    .artwork-left .background,
    .artwork-left + .artwork .foreground,
    .artwork-left + .artwork .background {
      height: 100%;
      min-height: 437px;
    }

    .sc.container {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      width: 100%;
      max-width: 100%;
      @media (max-width: 767px) {
        top: auto;
        bottom: 0;
        .close-search {
          position: relative !important;
          right: 0 !important;
          top: 0 !important;
          float: right;
          margin-bottom: 15px;
        }
      }

      .close-search {
        display: none;
        position: absolute;
        right: 30px;
        top: 33px;
        left: auto;
        cursor: pointer;
        transition: 0.3s ease;
        border: 1px solid var(--theme-color-primary-dimmed-04);
        border-radius: 10px;
        height: 34px;
        width: 34px;
        background-color: var(--theme-color-primary);
        @include focus-visible;
        z-index: 2;

        &:before, &:after {
          content: "";
          position: absolute;
          top: 50%;
          left: 50%;
          width: 17px;
          height: 1.5px;
          border-radius: 2px;
          background-color: var(--theme-color-white);
          transform: translate(-50%, -50%) rotate(45deg);
          transition: 0.3s ease;
        }

        &:after {
          transform: translate(-50%, -50%) rotate(-45deg);
        }
      }
    }

    &.open {
      height: 390px;
      @media (max-width: 767px) {
        height: 385px;
        max-height: 385px;
      }
      @media (max-width: 567px) {
        height: 509px;
        max-height: 509px;
      }

      &.has-button-wrapper {
        height: 460px;
        @media (max-width: 767px) {
          height: 395px;
          max-height: 395px;
        }
        @media (max-width: 567px) {
          height: 519px;
          max-height: 519px;
        }
      }

      .close-search {
        display: block !important;
      }

      .tiles {
        top: 0;
        padding-bottom: 9px;
        @media screen and (max-width: 767px) {
          padding-bottom: 0;
        }
      }

      .all-button-wrapper {
        top: 0;
      }

      form {
        max-width: 580px;
      }
    }

    form {
      border-radius: 24px;
      box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.25) !important;
      overflow: hidden;
      font-size: 22px;
      max-width: 360px;
      margin: 20px auto !important;
      transition: 0.3s ease;
      @media(max-width: 767px) {
        font-size: 18px;
        margin: 15px auto !important;
        border-radius: 18px;
      }
      @media(max-width: 399px) {
        max-width: 250px;
      }
    }

    + section, + #toclist > section:first-child {
      @media(min-width: 768px) {
        margin-top: 0;
      }
    }

    input#search-term {
      border-color: white !important;
      height: 60px;
      border-top-left-radius: 24px;
      border-bottom-left-radius: 24px;
      font-size: 22px;
      @media(max-width: 767px) {
        font-size: 18px;
        height: 48px;
        border-top-left-radius: 18px;
        border-bottom-left-radius: 18px;
      }

      &::placeholder {
        color: var(--theme-color-primary) !important;
      }
    }

    button.search-submit {
      background-color: var(--theme-color-primary) !important;
      color: white;
      border-top-left-radius: 0 !important;
      border-bottom-left-radius: 0 !important;
      border-top-right-radius: 0 !important;
      border-bottom-right-radius: 0 !important;
      border-color: white !important;
      height: 60px;
      width: 60px;
      font-size: 22px;
      @media(max-width: 767px) {
        font-size: 18px;
        height: 48px;
        width: 48px;
      }

      &:before {
        width: 30px;
        height: 30px;
        font-size: 30px;
        @media(max-width: 767px) {
          width: 24px;
          height: 24px;
          font-size: 24px;
        }
      }
    }

    .container {
      position: relative;
      z-index: 1;

      .row {
        @media(max-width: 567px) {
          min-height: 0;
        }

        > .col {
          margin-top: 0;
          padding-top: 0;
          padding-bottom: 0;
        }
      }
    }

    .artwork {
      @media(max-width: 420px) {
        top: 30px;
        right: -20px;
      }
      @media(max-width: 340px) {
        top: 40px;
        right: -30px;
      }

    }

    form {
      position: relative;
      margin: 0 0 16px;

      @media(max-width: 567px) {
        margin-top: 20px;
      }
    }

    h1 {
      margin-left: 0;
      margin-top: 0;

      @media(max-width: 567px) {
        font-size: 24px;
        margin: 0;
      }
    }

    .tiles {
      margin: 0 -8px 0 -8px;
      position: relative;
      top: 100px;
      display: flex;
      flex-wrap: wrap;
      font-family: "Korb", sans-serif;
      transition: all 0.3s ease-in;
      padding-bottom: 0;

      .tile {
        position: relative;
        display: flex;
        padding: 8px;
        flex: 1 1 33.3333%;
        max-width: 33.3333%;
        margin-top: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        margin-bottom: 16px !important;

        &::before {
          position: absolute;
          top: 8px;
          right: 8px;
          margin: 10px 8px;
          font-family: Icons, sans-serif;
          font-size: 18px;
          line-height: 1;
          text-align: center;
          pointer-events: none;
          z-index: 1;
        }

        &[data-type="download"]::before {
          @include icon-small-download;
        }

        &[data-type="external"]::before {
          @include icon-small-link-external;
        }

        @media(max-width: 567px) {
          flex: 1 1 50%;
          max-width: 50%;
        }

        &:nth-child(3) ~ .tile {
          z-index: 1;
        }

        &.downloads, &.a-z, &.events {
          order: 1;
          background-color: transparent;

          &::before {
            font-family: "Icons", sans-serif;
            position: absolute;
            font-size: 24px;
            line-height: 1;
            right: 0;
            top: 0;
            margin: 11px 10px;
            z-index: 1;
            background-color: white;
            padding: 7px 6px 5px;
            border-top-right-radius: 8px;
            border-bottom-left-radius: 8px;

            @media(max-width: 767px) {
              margin: 18px;
              font-size: 24px;
            }
          }

          .outer {
            background-color: var(--theme-color-primary-dimmed-04);
          }

          p {
            margin-bottom: 0.4em;
          }
        }

        &.downloads::before {
          @include icon-suche-datei;
        }

        &.a-z::before {
          @include icon-suche-az;
        }

        &.events::before {
          @include icon-suche-veranstaltung;
        }
      }

      .tile > a, .outer {
        position: relative;
        display: flex;
        align-items: flex-end;
        width: 100%;
        height: 108px;
        max-height: 108px;
        padding: 10px 24px 18px 24px;
        border-radius: var(--border-radius-md);
        box-shadow: 0 4px 20px -5px rgba(#000, 0.25);
        transition: 0.25s ease;
        line-height: 1.2;
        background-color: var(--theme-color-background);
        overflow: hidden;
        @include focus-visible();

        @media(max-width: 767px) {
          font-size: 16px;
          padding: 10px 10px 15px;
          min-height: 84px;
        }

        &:before {
          content: "";
          position: absolute;
          display: block;
          bottom: 0;
          left: 0;
          right: 0;
          height: var(--border-width);
          background-color: var(--theme-color-secondary);
          transition: 0.25s $easeOutQuad;
        }

        &:hover {
          color: var(--theme-color-secondary-intensed);

          &:before {
            height: var(--border-width-hover);
          }
        }
      }

      .tile > a {
        .item-title {
          text-decoration: underline;
        }
      }

      .outer {
        background-color: var(--theme-primary-light-04);
        padding: 14px 20px 18px;
        border: 4px solid white;

        &::after, &::before {
          display: none;
        }
      }

      .inner {
        display: block;
        max-width: 100%;
      }

      .kicker {
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
        max-width: 100%;
        display: block;
        text-decoration: none;
      }

      ul {
        list-style: none;
        padding: 0;
        font-size: 16px;
        max-width: 100%;
        margin: 0;

        li {
          margin-top: 5px;
        }

        a {
          display: block;
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
          transition: 0.2s ease;
          font-weight: 500;

          &:hover {
            color: var(--color-secondary-dark);
          }
        }
      }

      .proposals {
        flex: 1 1 100%;
        padding: 10px 12px 0;
        order: 2;

        a {
          margin: 0 0.3em 0 0.1em;
        }

        p {
          margin-bottom: 0;
        }
      }

      .all-button-wrapper {
        padding: 16px 8px;
        display: block;
        flex: 1 1 100%;
        order: 3;

        .btn {
          transition: 0.2s ease;

          .count {
            margin-left: 0.3em;

            &::before {
              content: '(';
            }

            &::after {
              content: ')';
            }
          }
        }
      }
    }

    &.background-image {
      &:after {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
        z-index: 0;
        content: "";
        opacity: 0.6;
        background: linear-gradient(87deg, #036 12.55%, rgba(1, 40, 81, 0.86) 56.52%, rgba(0, 51, 102, 0.00) 94.05%);
        background-blend-mode: overlay;
      }

      .artwork-wrapper {
        display: none;
      }
    }

    &.picto-image {
      background-position: 50% 0;
      background-size: auto 100%;
      background-repeat: repeat-x;
      @media (max-width: 767px) {
        background-size: auto 78px;
      }

      .artwork-wrapper {
        display: none;
      }
    }

    .all-button-wrapper {
      display: block;
      padding-top: 10px;
      position: relative;
      top: 100px;
      transition: all 0.3s ease-in;
    }
  }

  &.infoteaser {
    border-radius: 4px;

    .slide-overflow {
      border-radius: 4px;
    }

    .outer {
      @media(max-width: 999px) {
        max-height: none;
        height: auto;
      }
    }

    .rotation {
      padding: 0;
      @media screen and (max-width: 999px) {
        .slide:not(.text-only) .text-box {
          padding: 16px 0;
        }
        .slide .image-box img {
          position: static;
          height: 300px;
        }
        .slider-tabs {
          top: 0;
          height: auto;
          bottom: auto;
          margin-top: 15px;
        }
      }
      @media screen and (max-width: 900px) {
        .slider .image-box {
          padding-left: var(--container-padding);
          padding-right: var(--container-padding);
        }
        .slider .text-box:first-child::after {
          display: none;
        }
      }

      .text-box {
        min-height: 0;
      }
    }

    .outer {
      border-radius: 4px;

      .image-box img {
        border-radius: 4px;
      }
    }

    .image-box {
      @media(min-width: 1000px) {
        min-height: 427px;
        height: 100%;
      }

      picture {
        @media(min-width: 1000px) {
          min-height: 427px;
          height: 100%;
        }
      }

      img {
        object-position: right;
        @media(min-width: 1000px) {
          min-height: 427px;
          height: 100%;
        }
      }
    }

    .mainstage {
      @media screen and (max-width: 900px) {
        padding: 0;
      }

      .row {
        margin: 16px 0;
        @media screen and (min-width: 901px) {
          margin: 30px -8px 0;
        }

        .col {
          flex: 1 1 100%;
          max-width: 100%;

          @media screen and (min-width: 901px) {
            padding: 0 8px;
            flex: 1 1 calc(100% - 322px);
            max-width: calc(100% - 322px);
          }

          + .col {
            flex: 1 1 100%;
            max-width: 100%;
            display: flex;
            flex-flow: column;
            justify-content: space-between;
            margin: 0;
            padding: 0 var(--container-padding);
            @media screen and (min-width: 901px) {
              flex: 1 1 322px;
              max-width: 322px;
              padding: 0 8px;
              margin: -8px 0;
            }

            .mt {
              height: 100%;
              padding: 8px 0;
              @media screen and (max-width: 575px) {
                padding: 4px 0;
              }

              .mini-teaser {
                height: 100%;

                .text-box {
                  height: 100%;
                  flex-flow: column;
                  justify-content: space-between;

                  .btn {
                    height: fit-content;
                  }
                }
              }
            }
          }
        }
      }
    }

  }

  &.hero-fullwidth {
    .mainstage.container {
      /*max-width: 1920px;*/
      width: 100%;
      padding: 0;

      > .row {
        margin: 0;
      }
    }

    .rotation {
      margin: 0 !important;
      padding: 0 !important;
      width: 100%;

      .outer {
        margin: 0 !important;
        position: relative;
        justify-content: center;
        max-height: 566px;
      }

      .copyright {
        left: 100%;
      }

      .slide-wrapper,
      .slide,
      .outer {
        height: 100%;
      }

      .slider {
        background-color: transparent;

        .image-box img {
          @media (max-width: 999px) {
            min-height: calc(18vw + 300px) !important;
          }
        }

        .slide.text-only.current {
          background: linear-gradient(-10deg, var(--theme-color-gradient-01) 10%, var(--theme-color-gradient-02) 55%, var(--theme-color-gradient-03) 90%);
        }

        .slide-overflow {
          height: 100% !important;
        }
      }


    }

    .image-box {
      width: 100%;
      flex: 1 1 100%;
      max-width: 100%;
      max-height: 566px;
      position: relative;
      padding-right: 0 !important;

      &:after {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
        z-index: 0;
        content: "";
        opacity: 0.6;
        background: linear-gradient(87deg, #036 12.55%, rgba(1, 40, 81, 0.86) 56.52%, rgba(0, 51, 102, 0.00) 94.05%);
        background-blend-mode: overlay;

        &:before {
          display: none;
        }
      }

      picture {
        position: static;
      }

      img {
        object-fit: cover;
        z-index: -1;
        left: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        position: static;
      }
    }

    .text-box {
      height: 100%;
      color: white;
      width: var(--container-width);
      padding: 0 var(--container-padding);
      max-width: 100%;
      margin: 0 auto;
      position: absolute;

      * {
        color: white;
      }

      .btn {
        background-color: white !important;
        color: var(--theme-color-primary) !important;

        &:hover:after {
          box-shadow: 0 0 0 var(--button-hover-shadow-size) white !important;
        }
      }

      * {
        max-width: 580px;
      }

      &:after {
        display: none;
      }

      &:before {
        display: none;
      }
    }

    .slide.text-only {
      @media screen and (max-width: 900px) {
        padding: 16px var(--container-padding) 0;
      }

      .text-box {
        width: auto;
        @media (max-width: 999px) {
          min-height: calc(18vw + 300px) !important;
        }
        @media screen and (max-width: 900px) {
          padding-left: 0;
          padding-right: 0;
        }
      }
    }

    .controls {
      width: var(--container-width);
      padding: 0 var(--container-padding);
      max-width: 100%;
      margin: 0 auto;
      position: relative;

      .slider-tabs {
        right: 30px;
      }
    }
  }

  .rotation .slider {
    border-bottom: 0;

    background-color: white;

    h3, .like-h2 {
      margin-top: 4px;
      margin-bottom: 8px;
    }

    .kicker {
      margin-bottom: 0;
    }

    p {
      margin-bottom: 0.4em;
    }

    .btn {
      margin-top: 0.4em;
    }

    &.ishovered .slider-tabs li.active button.btn::before {
      animation-play-state: paused;
    }

    &.btnanimation {
      .slider-tabs {
        li.active {
          button.btn::before {
            animation: fillgrey 7s linear forwards;
          }
        }
      }
    }

    .slider-tabs {
      li:first-child:last-child {
        display: none;
      }

      li.active {
        button.btn {
          background-blend-mode: overlay;
          overflow: hidden;
        }
      }

      li {
        button.btn {
          position: relative;
          border-radius: var(--border-radius-lg);
        }

        button.btn::before {
          width: 0;
          background-color: var(--theme-grey-light);
          content: "";
          z-index: 0;
          height: 100%;
          position: absolute;
          top: 0;
          bottom: 0;
          right: 0;
          left: 0;
          right: 0;
          display: block;
          background-blend-mode: multiply;
        }
      }
    }

    .slide.text-only.current {
      background: none;

      .outer {
        background: linear-gradient(-10deg, var(--theme-color-gradient-01) 10%, var(--theme-color-gradient-02) 55%, var(--theme-color-gradient-03) 90%);

        .text-box {
          justify-content: center;
          max-width: 580px;
        }
      }
    }

    .text-box {
      color: var(--theme-color-primary);
      padding: 30px 36px 24px 36px;
      display: flex;
      flex-flow: column;
      justify-content: center;
      min-width: 324px;

      &:not(:first-child)::before {
        background-color: var(--theme-color-primary-dimmed-04);
      }

      .btn {
        background-color: var(--theme-color-primary);
        color: white;

        &:hover:after {
          box-shadow: 0 0 0 var(--button-hover-shadow-size) var(--theme-color-primary);
        }
      }
    }

    .text-only {
      .text-box {
        color: white;
      }
    }
  }

  .rotation {
    margin: 0;
    @media (max-width: 1339px) {
      .rotation .slider .text-box {
        min-width: 324px;
      }
    }
    @media (min-width: 1000px) {
      .slider .text-box:not(:first-child)::before {
        border-top-right-radius: 16% 50% !important;
        border-bottom-right-radius: 16% 50% !important;
        margin: -15% -8% -15% 20px;
      }
    }
    @media (max-width: 999px) {
      .slider {
        background-color: white;


        .text-box:not(:first-child)::before {
          display: none;
        }

        .image-box {
          order: 0;
          height: auto;
          max-height: none !important;

          img {
            aspect-ratio: 16 / 9;
            height: auto !important;
            max-height: none !important;
            min-height: 177px !important;
          }

          &:before {
            display: none;
          }

          img {
            position: static;
          }
        }
      }
    }
    @media screen and (max-width: 900px) {
      .slider {
        margin-bottom: 20px;

        .slide:not(.text-only) {
          .text-box {
            padding: 16px var(--container-padding) 0;
          }
        }

        .slide.text-only {
          padding-left: var(--container-padding);
          padding-right: var(--container-padding);
        }

        .controls {
          position: absolute;
          right: 20px;
          bottom: 27px;
          width: auto;
          padding: 0;
        }

        .slider-tabs {
          position: relative;
          right: auto;
          top: auto;
          padding: 0;
          margin: 0;

          .btn {
            margin-top: 0 !important;
          }
        }
      }
    }
    @media screen and (max-width: 767px) {
      .slider {
        .slide:not(.text-only) .text-box {
          padding: 16px var(--container-padding);
        }
      }
    }
    @media screen and (max-width: 567px) {
      .slider {
        margin: 0;
        margin-bottom: 8px;
      }
    }

    .context-box {
      display: none !important;
    }
  }
}

@keyframes fillgrey {
  0% {
    width: 0;
  }
  100% {
    width: 100%
  }
}