/* =============================================================================
   Facts & Figures (textmedia-fact)
   Top level: background over the full width of the frame (grid__main),
   inside a container: only as wide as the container column
   ========================================================================== */

.frame-type-gkmb_textmedia_fact_07 {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: rgb(var(--c-neutral-lightest));

  & .headline {
    text-align: center;
  }

  & .headline :is(h1, h2, h3, h4, h5) {
    color: rgb(var(--c-neutral-lightest));
    font-size: var(--f-size);
    letter-spacing: 3px;
    text-transform: uppercase;
  }

  & .headline.-large::after {
    background: rgb(var(--c-neutral-lightest));
  }
}

/* background image with gradient overlay */
.textmedia-fact__background {
  position: absolute;
  inset: 0;
  z-index: -1;
  grid-column: 1 / -1 !important;
  background: rgb(var(--c-primary-dark));

  & picture,
  & img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }

  &::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(
      90deg,
      rgba(var(--c-primary-dark), 0.94),
      rgba(var(--c-primary-dark), 0.76),
      rgba(var(--c-primary-dark), 0.58)
    );
  }
}

/* facts */
.textmedia-fact {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
}

.textmedia-fact__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
}

.textmedia-fact__item + .textmedia-fact__item {
  border-top: 1px solid rgba(var(--c-neutral-lightest), 0.3);
}

.textmedia-fact__value {
  font-family: var(--f-family-b);
  font-size: var(--f-size-l-4);
  font-weight: var(--f-weight-b);
  line-height: 1.2;
}

.textmedia-fact__label {
  margin-top: 0.5rem;
}

/* logos (e.g. rankings) */
.textmedia-fact__logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.1rem;
}

.textmedia-fact__logo {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 125px;
  height: 70px;
  padding: 0.5rem;
  background: rgb(var(--c-neutral-lightest));
  border-radius: var(--b-radius-s);
  transition: transform 0.25s ease;

  /* no external link icon from gkmb_base */
  &::after {
    content: none !important;
  }

  & img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
  }
}

@media (hover: hover) {
  a.textmedia-fact__logo:hover {
    transform: translateY(-3px);
  }
}

/* =============================================================================
   Media Queries
   ========================================================================== */

/* tablet: 2 columns, an odd last fact spans the full row */
@media (min-width: 640px) {
  .textmedia-fact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 1.5rem;
  }

  .textmedia-fact__item + .textmedia-fact__item {
    border-top: none;
  }

  .textmedia-fact__item:nth-child(2n) {
    border-left: 1px solid rgba(var(--c-neutral-lightest), 0.35);
  }

  .textmedia-fact__item:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(var(--c-neutral-lightest), 0.3);
  }

  .textmedia-fact__logo {
    width: 145px;
    height: 78px;
  }
}

/* desktop: configured column count, separators between the facts of a row */
@media (min-width: 1024px) {
  .textmedia-fact[data-ce-columns="3"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .textmedia-fact[data-ce-columns="4"] {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .textmedia-fact:is([data-ce-columns="3"], [data-ce-columns="4"]) .textmedia-fact__item {
    grid-column: auto;
    padding-top: 1rem;
    border-top: none;
    border-left: 1px solid rgba(var(--c-neutral-lightest), 0.35);
  }

  .textmedia-fact[data-ce-columns="3"] .textmedia-fact__item:nth-child(3n + 1),
  .textmedia-fact[data-ce-columns="4"] .textmedia-fact__item:nth-child(4n + 1) {
    border-left: none;
  }
}
