/* bento/bento.css */
/*
 * Bento-Raster: asymmetrische Kacheln. Nutzt nur Grundwerte des Kerns (Farben, Abstände, Rundung, Linie) und
 * funktioniert so mit jedem Theme. Am Handy untereinander, ab Tablet zweispaltig, ab 960 px das gewählte Muster.
 */
.bento {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bento__tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bento__media {
  overflow: hidden;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--color-dark) 4%, transparent);
}

.bento__media img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.4s ease;
}

.bento__tile:hover .bento__media img {
  transform: scale(1.015);
}

.bento__body {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  padding-top: 18px;
}

.bento__tile:not(.bento__tile--image) .bento__body {
  padding-top: 0;
}

.bento__number {
  margin: 0;
  color: var(--color-accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.bento__title {
  margin: 0;
  color: var(--heading-color);
  font-family: var(--font-heading);
  font-size: clamp(1.15rem, 1.6vw, 1.4rem);
  line-height: 1.25;
}

.bento__text {
  color: var(--color-muted);
}

.bento__text > :first-child {
  margin-top: 0;
}

.bento__text > :last-child {
  margin-bottom: 0;
}

.bento__link {
  align-self: flex-start;
  margin-top: 0.4em;
}

/* Hat eine Kachel einen Link, ist die ganze Kachel anklickbar (Bild, Titel, Text) – ohne zweiten Link im HTML */
.bento__tile {
  position: relative;
}

.bento__link::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.bento__link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 4px;
}

/* Rahmen: feine Linien (Kacheln stoßen aneinander), einzeln umrandet oder ohne */
.bento--linien {
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.bento--linien .bento__tile {
  padding: clamp(22px, 3vw, 36px);
  background: var(--color-light);
}

.bento--rahmen .bento__tile {
  padding: clamp(20px, 2.5vw, 30px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.bento--ohne {
  gap: clamp(24px, 3vw, 40px);
}

:is(.jx-bg--dark, .jx-bg--accent, .jx-bg--image) .bento--linien {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.18);
}

:is(.jx-bg--dark, .jx-bg--accent, .jx-bg--image) .bento--linien .bento__tile {
  background: transparent;
}

:is(.jx-bg--dark, .jx-bg--accent, .jx-bg--image) :is(.bento__text, .bento__number) {
  color: inherit;
}

@media (min-width: 640px) {
  .bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bento > :first-child {
    grid-column: 1 / -1;
  }
}

@media (min-width: 960px) {
  .bento {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .bento > * {
    grid-column: span 4;
  }

  /* Groß links: 1 groß (2 Reihen hoch) + 2 daneben, danach Drittel */
  .jx-v--standard .bento > :nth-child(1) {
    grid-column: span 7;
    grid-row: span 2;
  }

  .jx-v--standard .bento > :nth-child(2),
  .jx-v--standard .bento > :nth-child(3) {
    grid-column: span 5;
  }

  .jx-v--standard .bento > :nth-child(1) .bento__media {
    flex: 1;
  }

  .jx-v--standard .bento > :nth-child(1) .bento__media img {
    height: 100%;
    object-fit: cover;
  }

  /* Groß oben: 1 über die volle Breite, darunter Drittel */
  .jx-v--oben .bento > :nth-child(1) {
    grid-column: 1 / -1;
  }

  /* Projekte: 8 + 4, dann 6 + 6 (wiederholt sich) */
  .jx-v--projekte .bento > :nth-child(4n + 1) {
    grid-column: span 8;
  }

  .jx-v--projekte .bento > :nth-child(4n + 2) {
    grid-column: span 4;
  }

  .jx-v--projekte .bento > :nth-child(4n + 3),
  .jx-v--projekte .bento > :nth-child(4n + 4) {
    grid-column: span 6;
  }

  /* Wechselnd: breit/schmal, dann schmal/breit */
  .jx-v--wechselnd .bento > :nth-child(4n + 1),
  .jx-v--wechselnd .bento > :nth-child(4n + 4) {
    grid-column: span 7;
  }

  .jx-v--wechselnd .bento > :nth-child(4n + 2),
  .jx-v--wechselnd .bento > :nth-child(4n + 3) {
    grid-column: span 5;
  }
}

