/* Branchen block — industry link grid. Figma 313-7667. Sits on the #efefef body. */
.sun-branchen {
  background: var(--sun-border);                  /* #efefef */
  padding: clamp(48px, 6vw, 80px) 0;
}
.sun-branchen__inner {
  box-sizing: border-box;
  /* Standard 1280 container (24px gutters) — no extra inset. */
  width: min(1280px, 100% - 48px);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* Heading — centered, 48/56, max 800, ~48px gap to grid */
.sun-branchen__head {
  display: flex;
  justify-content: center;
  padding-bottom: 48px;
}
.sun-branchen__heading {
  margin: 0;
  max-width: 800px;
  text-align: center;
  font-family: var(--wp--preset--font-family--brand);
  font-weight: 500;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.17;
  letter-spacing: -0.48px;
  color: #0e1930;
}

/* Grid — 4 columns desktop */
.sun-branchen__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

/* Card — white, title + arrow. Stretched-link (link on the title, ::after covers). */
.sun-branchen__item {
  position: relative;
  box-sizing: border-box;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  gap: 20px;
  padding: 24px;
  background: var(--sun-base);                    /* #fff */
  border-radius: 4px;
  transition: transform .18s ease, box-shadow .18s ease;
}
.sun-branchen__title {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  font-family: var(--wp--preset--font-family--brand);
  font-weight: 500;
  font-size: 24px;
  line-height: 32px;
  color: var(--sun-secondary);                    /* #132140 */
  hyphens: auto;                                  /* long words (Dienstleistungen) may break */
  overflow-wrap: anywhere;                        /* bulletproof: never paint under the arrow */
}
.sun-branchen__card-link { color: inherit; text-decoration: none; }
.sun-branchen__card-link:hover,
.sun-branchen__card-link:focus { text-decoration: none; }
.sun-branchen__card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 4px;
}
/* Brand accent line that grows along the card bottom on hover (same as usecases). */
.sun-branchen__item::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--sun-primary);
  border-radius: 0 0 4px 4px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .3s ease;
}
.sun-branchen__item--linked:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(19, 33, 64, .12);
}
.sun-branchen__item--linked:hover::after { transform: scaleX(1); }
.sun-branchen__card-link:focus-visible::after { outline: 2px solid var(--sun-primary); outline-offset: 2px; }

/* Arrow — right, bluegrey, slides on hover */
.sun-branchen__arrow {
  flex: 0 0 auto;
  display: inline-flex;
  color: var(--sun-bluegrey);                     /* #4f5563 */
}
.sun-branchen .sun-branchen__arrow-icon {
  width: 32px;
  height: 32px;
  transition: transform .18s ease;
}
.sun-branchen__item--linked:hover .sun-branchen__arrow-icon { transform: translateX(4px); }

/* Responsive: 4 → 2 → 1 columns */
@media (max-width: 900px) {
  .sun-branchen__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Narrow cards: step the type down so single long words don't reach the arrow. */
  .sun-branchen__title { font-size: 20px; line-height: 28px; }
  .sun-branchen__item { gap: 12px; }
}
@media (max-width: 520px) {
  .sun-branchen__grid { grid-template-columns: 1fr; }
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .sun-branchen__item,
  .sun-branchen__arrow-icon { transition: none; }
  .sun-branchen__item--linked:hover { transform: none; }
  .sun-branchen__item--linked:hover .sun-branchen__arrow-icon { transform: none; }
}
