/* Content that only shows up on the frontpage */
#front__searchresults {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0 24px;
  background: var(--white);
  padding-block: 2.4rem;
  justify-items: center;

  .no-js & {
    display: none;
  }
}

.searchresult__block {
  --zoom: clamp(100%, calc(150 / attr(data-length number) * 100%), 400%);
  /* --shift-x: calc(50% - attr(data-mark-pos-x number) * 1%);
  --shift-y: calc(50% - attr(data-mark-pos-y number) * 1%); */

  aspect-ratio: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  grid-column: span 3;
  font-size: 1.6rem;
  font-family: Merriweather;
  text-align: center;
  max-height: 30rem;

  opacity: 0;
  animation: fadeIn 0.7s 1 both;
  animation-delay: calc(sibling-index() * 0.2s);

  .info,
  .placeholder {
    aspect-ratio: 1;
    border-radius: var(--br-big) var(--br-big) 0 0;
    background-color: var(--primary-light);
    padding: 0 1rem;
    flex: 1;
    overflow: hidden;
    > div {
      height: 100%;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      justify-content: center;
      > div {
        scale: var(--zoom, 1);
      }
    }
    p:last-child {
      margin-bottom: 0;
    }
  }

  &:has(.placeholder) {
    width: 100%;
  }

  .placeholder {
    border-radius: var(--br-big);
    position: relative;
    overflow: hidden;

    &:before {
      content: "";
      position: absolute;
      pointer-events: none;
      inset: -50%;
      border-radius: var(--br-big);
      animation: shimmer 3s infinite;
      background-size: 1000px;
      background-image: linear-gradient(
        var(--primary-light) 5%,
        hsl(from var(--primary-light) h s calc(l * 1.05)) 25%,
        var(--primary-light) 55%
      );
      rotate: -45deg;
    }
  }

  .title {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0;
    border-radius: 0 0 var(--br-big) var(--br-big);
    background-color: var(--primary);
    padding: 0.8rem 3rem;
    width: 100%;
    color: white;
    font-weight: bold;
    font-family: Lato;
  }

  a {
    text-decoration: none;

    &:hover,
    &:focus {
      text-decoration: underline;
    }
  }
}

@keyframes shimmer {
  from {
    background-position: 0 -200px;
  }
  to {
    background-position: 0 1000px;
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 1080px) {
  #front__searchresults {
    grid-template-columns: repeat(9, 1fr);
  }
  .searchresult__block:nth-child(4) {
    display: none;
  }
}
@media (max-width: 800px) {
  #front__searchresults {
    grid-template-columns: repeat(6, 1fr);
  }
  .searchresult__block:nth-child(3) {
    display: none;
  }
}
@media (max-width: 520px) {
  #front__searchresults {
    grid-template-columns: repeat(3, 1fr);
  }
  .searchresult__block:nth-child(2) {
    display: none;
  }
}

#front__intro {
  padding-block: 5.6rem;

  img {
    grid-column: 2 / span 3;
  }

  blockquote {
    p:first-child {
      grid-column: 5 / span 5;
      margin-bottom: 0;
    }
    p:last-child {
      grid-column: 4 / span 5;
      margin-bottom: 6.4rem;
    }
  }
}

@media (max-width: 1000px) {
  #front__intro {
    blockquote {
      p:first-child {
        grid-column: 4 / span 8;
      }
      p:last-child {
        grid-column: 3 / span 9;
      }
    }
  }
}

@media (max-width: 700px) {
  #front__intro {
    img {
      grid-column: 2 / span 4;
    }

    blockquote {
      p:first-child {
        grid-column: 3 / span 9;
      }
      p:last-child {
        grid-column: 2 / span 10;
      }
    }
  }
}

@media (max-width: 600px) {
  #front__intro {
    blockquote {
      text-align: center;
      p:first-child {
        grid-column: 1 / span 12;
      }
      p:last-child {
        grid-column: 1 / span 12;
      }
    }
  }
}

@media (max-width: 400px) {
  #front__intro {
    img {
      grid-column: 1 / span 6;
    }
  }
}

/* Front: News Teaser */
#front__news {
  h2 a {
    font-style: normal;
  }

  .teaser__front {
    position: relative;
    grid-column: span 4;
    margin-bottom: 0;
    box-shadow: 4px 6px 15px 0 rgba(0, 0, 0, 0.15);
    border-radius: var(--br-big);
    background-color: var(--primary-light);
  }

  .teaser__category {
    margin-bottom: 0;
    border-radius: var(--br-big) var(--br-big) 0 0;
    background-color: var(--primary);
    padding-block: 1rem;
    color: white;
    font-weight: bold;
    text-align: center;
  }

  .teaser__text {
    margin: 3rem;
    font-size: 1.6rem;
  }

  .teaser__date {
    margin-bottom: 2.4rem;
    font-weight: bold;
  }

  h3 {
    margin-bottom: 2.4rem;
    font-weight: bold;
    font-size: 2rem;
  }

  .teaser__link {
    margin-bottom: 0;

    a {
      font-weight: normal;
    }
  }

  .teaser__showall {
    margin-bottom: 8rem;
    text-align: right;

    a {
      font-weight: normal;
    }
  }
}

@media (max-width: 900px) {
  #front__news .teaser__front:first-child {
    grid-column: span 12;
  }
  #front__news .teaser__front {
    grid-column: span 6;
  }
}

@media (max-width: 600px) {
  #front__news .teaser__front {
    grid-column: span 12;
  }
}

/* Front: Banner */
#front__banner {
  position: relative;
  margin-bottom: 8rem;
  background-size: cover;
  padding-block: 10rem;
  width: 100%;
  height: 580px;
  color: white;

  img {
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  p {
    font-weight: bold;
    font-size: 4.8rem;
    line-height: 1;
  }

  span:first-child {
    grid-column: 4 / span 8;
  }

  span:last-child {
    grid-column: 5 / span 7;
  }

  a {
    position: absolute;
    bottom: 9rem;
    left: 50%;
    transform: translate(-50%, 0);
  }
}

@media (max-width: 1060px) {
  #front__banner {
    span:first-child {
      grid-column: 2 / span 8;
    }
    span:last-child {
      grid-column: 4 / span 8;
    }
  }
}

@media (max-width: 920px) {
  #front__banner {
    padding-block: 24px;
    height: 320px;
    text-align: center;

    p {
      font-size: 3.2rem;
    }
    span:first-child {
      grid-column: 1 / span 12;
    }
    span:last-child {
      grid-column: 1 / span 12;
    }
    a {
      bottom: 24px;
    }
  }
}
