/* ==========================================================
   OFFERS NAVIGATION (Angebote)
   The service pages' offer cards with a list of them on the left, which stays in view while the
   cards are scrolled through; on phones (Figma "Leistungsseite SEO mobile") the list is an
   accordion: a row opens its card under it (script.js; without it the cards stand one under the
   other). The parts, all in the pattern:

     .offers-scroll-area      the section (#angebote-seo)
       .offers-layout         its two columns
         .offers-nav          the list: .offers-nav-item > .offers-nav-row > .offers-nav-label > a,
                              and a .offers-nav-divider (the line under the row)
         .offers-content      the cards: .offers-section (#angebot-…, what the links point to)
   The label's link covers its whole row. script.js marks the card in view on the list (.is-active:
   a dot and bold). The parts in the blocks are Von Block composite classes: what places each of them
   on its own (the sticky list, the cards' scroll margin…) is in its definition (Von Block settings
   → Composite Classes); here is what changes with the script's classes, and the phone layout
   (below Von Block's sm breakpoint, 768px).
   ========================================================== */

/* The row (a flex row by its classes; its padding the composite's) is not positioned, so the
   link's ::after covers the whole item (offers-nav-item is) */
.offers-scroll-area .offers-nav-row {
  box-sizing: border-box;
  transition: gap 180ms ease;
}

/* A line between the rows, none under the last */
.offers-scroll-area .offers-nav-item:last-child .offers-nav-divider {
  display: none;
}

.offers-scroll-area .offers-nav-label {
  margin: 0;
  transition: color 180ms ease, font-weight 180ms ease;
}

.offers-scroll-area .offers-nav-label a {
  color: inherit;
  text-decoration: none;
}

.offers-scroll-area .offers-nav-label a::after {
  content: "";
  position: absolute;
  inset: 0;
}

/* The orange arrow at the end of a row nudges right on hover; no margin of its own (an image
   block's 1em below would make the row taller) */
.offers-scroll-area .offers-nav-row figure {
  flex-grow: 0;
  flex-shrink: 0;
  flex-basis: auto;
  margin: 0;
  transition: transform 180ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .offers-scroll-area .offers-nav-item:is(:hover, :focus-within) .offers-nav-row figure {
    transform: translateX(4px);
  }
}

.offers-scroll-area .offers-nav-item.is-active > .offers-nav-row {
  justify-content: flex-start;
  gap: 14px;
}

.offers-scroll-area .offers-nav-item.is-active > .offers-nav-row::before {
  content: "";
  display: block;
  flex-grow: 0;
  flex-shrink: 0;
  flex-basis: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--mcg-color-primary-action);
}

.offers-scroll-area .offers-nav-item.is-active .offers-nav-label {
  text-align: left;
  font-weight: 700;
}

.offers-scroll-area .offers-nav-item.is-active .offers-nav-row figure {
  margin-left: auto;
}

/* Phones: the cards one under the other (their own classes keep them within the page's margin);
   with script.js the list instead, an accordion (.is-accordion): a row opens its card under it
   (.is-open, the card moved into its item), its arrow turned down */
@container (max-width: 768px) {
  .offers-scroll-area .offers-layout {
    display: block;
  }

  /* (Otherwise the list is hidden from md down: its class mcg-md-display-none) */
  .offers-scroll-area.is-accordion .offers-nav {
    display: block;
    position: static;
    margin-right: var(--m1, 20px);
  }

  .offers-scroll-area.is-accordion .offers-nav-item,
  .offers-scroll-area.is-accordion .offers-nav-row,
  .offers-scroll-area.is-accordion .offers-nav-divider {
    width: 100%;
  }

  /* The link covers its row only: the open card below it has links of its own */
  .offers-scroll-area.is-accordion .offers-nav-row {
    position: relative;
  }

  .offers-scroll-area.is-accordion .offers-nav-item {
    cursor: auto;
  }

  .offers-scroll-area.is-accordion .offers-nav-item .offers-section {
    display: none;
    width: 100%;
    margin: 0 0 20px;
  }

  .offers-scroll-area.is-accordion .offers-nav-item.is-open .offers-section {
    display: block;
  }

  .offers-scroll-area.is-accordion .offers-nav-row figure {
    transition: transform 180ms ease;
  }

  .offers-scroll-area.is-accordion .offers-nav-item.is-open .offers-nav-row figure {
    transform: rotate(90deg);
  }

  /* No "card in view" dot in the accordion: every row as the others */
  .offers-scroll-area.is-accordion .offers-nav-item.is-active > .offers-nav-row {
    justify-content: space-between;
    gap: 0;
  }

  .offers-scroll-area.is-accordion .offers-nav-item.is-active > .offers-nav-row::before {
    content: none;
  }

  .offers-scroll-area.is-accordion .offers-nav-item.is-active .offers-nav-label {
    font-weight: 400;
  }
}
