/* Homepage Teaser: colored band with icon above text, full page width, template: www.sw-bb.de */

/* Backgrounds: every background only sets the variable. A further background needs one more
   select item in config.yaml, a label in the labels files and one more class like these. */
.cb-homepage-teaser--bg-orange-gradient {
  --homepage-teaser-bg: linear-gradient(225deg, rgb(240, 169, 38) 16.2%, rgb(240, 126, 38) 84.51%);
}

/* 100vw includes the width of the scrollbar, the overflow must not create a horizontal scrollbar */
html:has(.cb-homepage-teaser) {
  overflow-x: clip;
}

.cb-homepage-teaser {
  /* breaks out of the content area, the list below keeps the content width */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  background: var(--homepage-teaser-bg, var(--orange));
  color: var(--white);
}

.cb-homepage-teaser__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--gutter, 1rem);
  list-style: none;
}

.cb-homepage-teaser__item {
  position: relative;
  flex: 1 1 0;
  min-width: 9rem;
  margin: 0;
  padding: 0;
}

.cb-homepage-teaser__item:hover {
    background: var(--orange);
}

/* thin vertical line between two items */
.cb-homepage-teaser__item + .cb-homepage-teaser__item::before {
  content: "";
  position: absolute;
  top: 15%;
  bottom: 15%;
  left: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.35);
}

.cb-homepage-teaser .cb-homepage-teaser__link,
.cb-homepage-teaser .cb-homepage-teaser__link:visited {
  display: block;
  height: 100%;
  color: var(--white);
  text-decoration: none;
}

/* icon above text, centered, with and without a link around it */
.cb-homepage-teaser__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 100%;
  padding: 1.5rem 1rem;
  color: var(--white);
  text-align: center;
}

.cb-homepage-teaser__icon {
  display: block;
  height: 3rem;
  margin-bottom: 0.75rem;
  color: inherit;
  transition: transform 0.3s ease-in-out;
}

.cb-homepage-teaser__icon svg,
.cb-homepage-teaser__icon img {
  display: block;
  width: auto;
  max-width: none;
  height: 100%;
}

.cb-homepage-teaser__text {
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.3;
}

/* hover and keyboard focus: the icon grows by 20 percent */
.cb-homepage-teaser__link:hover .cb-homepage-teaser__icon,
.cb-homepage-teaser__link:focus-visible .cb-homepage-teaser__icon {
  transform: scale(1.2);
}

.cb-homepage-teaser a.cb-homepage-teaser__link:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: -4px;
}

@media screen and (max-width: 768px) {
  .cb-homepage-teaser__item {
    flex: 0 0 50%;
  }

  .cb-homepage-teaser__item + .cb-homepage-teaser__item::before {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cb-homepage-teaser__icon {
    transition: none;
  }
}
