.box {

  --box-1: 100%;
  --box-2: calc((100% - 1em) / 2);
  --box-3: calc((100% - 2em) / 3);
  --box-4: calc((100% - 3em) / 4);

  --box-content-padding: 0.5em;

}
.area.b-border,
.box.b-border {
  border-width: 2px;
  border-style: solid;
  border-radius: var(--default-border-radius);
  border-color: var(--theme-color);
  padding: 1em;
  margin: 1em auto;
}

/* Style aus carousell zurücksetzen! */
.box.b-border a,
.box.b-border a:visited {
  text-decoration: none;
  color: var(--default-text-color);
  text-decoration: underline dotted var(--theme-color);
  text-underline-offset: 0.2rem;
  display: unset;
  flex-direction: unset;
  border-radius: unset;
}

.box.b-border a:active,
.box.b-border a:hover {
  color: var(--theme-color-overlay);
  border-radius: unset;
  text-decoration: underline dotted var(--theme-color-overlay);
  text-underline-offset: 0.2rem;
}

.box top,
.box.b-border h1,
.box.b-border h2,
.box.b-border h3 {
  margin: 0;
  padding: 0;
  font-size: 1.2em; /* Größe von h2 */
}
.box top {
  font-weight: bold;
}
.box.b-border h2 {
  font-size: 1.1em; /* Größe von h3 */
}
.box.b-border h3 {
  font-size: 1em;
}

.box.b-border p {
  margin-top: 0;
  margin-bottom: 0.5em;
}

.box.b-border p:last-child {
    margin-bottom: 0px;
}

.box.flowing {
  display: flex;
  /*display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));*/
  flex-wrap: wrap;   /* sorgt für Umbruch */
  gap: 1em;
  justify-content: center;
}

.box.carousel {

  width: 100%;
  margin: 1em auto;

  display: flex;
  gap: 1em;
  align-items: flex-start; /* verhindert, dass die Kinder sich auf die volle Höhe strecken */

  gap: 1em;
  overflow-x: auto;
  scroll-behavior: smooth;
  anchor-name: --carousel;
  scroll-snap-type: x mandatory;
  /*scroll-marker-group: after;*/
}

.box.with-height {
  align-items: stretch; /* alle flex-Kinder strecken sich auf gleiche Höhe */
}

.box.with-height a,
.box.with-height a:active,
.box.with-height a:visited {
  display: flex;           /* macht das Link-Element zu einem Flex-Container */
  flex-direction: column;  /* damit Inhalt vertikal bleibt */
}

.box.with-height a .card {
  flex: 1;                /* Karte füllt die Höhe des Links */
}

.boxLine {
  display: flex;
  align-items: flex-start;
  flex-direction: row;
  gap: 1em;
}

@media (max-width: 550px) {
  .boxLine {
    flex-direction: column;
    gap: 0em;
  }
}

.boxHead {
    background-color: var(--theme-color);
    height: 45px;
    display: flex;
    align-items: center;      /* vertikal zentrieren */
}

.boxHead .boxHeadSymbol,
.boxHead .boxHeadText {
    display: flex;
    align-items: center; 
}

.boxHead .boxHeadText {
    color: var(--theme-color-overlay);
    font-weight: bold;
    font-size: 1em;
}

.boxHead .boxHeadSymbol svg {
    fill: var(--theme-color-overlay);
    height: 40px;
    width: 40px;
    margin-left: 0.5em; 
    margin-right: 0.5em; 
}

.box:has(.boxHead) {
  padding: 0px;
}

.box:has(.boxHead) > :not(.boxHead) {
  padding: 1em;
}

.carousel::scroll-marker-group {
  display: flex;
  justify-content: center;
  gap: 0.5em;
  padding-bottom: 1em;
}

.card::scroll-marker {
  content: '';
  height: 1em;
  width: 1em;
  background-color: var(--header-grey-dark);
  border-radius: 50%;
}

.card::scroll-marker:target-current {
  background-color: var(--theme-color);
}

.carousel::-webkit-scrollbar {
  display: none;
}

.carousel::scroll-button(right),
.carousel::scroll-button(left) {
  border: none;
  background-color: var(--theme-color);
  color: var(--theme-color-overlay);
  border: 1px solid var(--theme-color-overlay);
  font-size: 1.5rem;
  height: 40px;
  width: 40px;
  border-radius: 50%;
  padding-bottom: .1em;
  cursor: pointer;
  position: fixed;
  position-anchor: --carousel;
}

.carousel::scroll-button(right) {
  position-area: right center;
  translate: -50%;
}

.carousel::scroll-button(left) {
  position-area: left center;
  translate: 50%;
}

.carousel::scroll-button(right) {
  content: '❯'; /* 276F	HEAVY RIGHT-POINTING ANGLE QUOTATION MARK ORNAMENT */
}

.carousel::scroll-button(left) {
  content: "❮"; /* 276E	HEAVY LEFT-POINTING ANGLE QUOTATION MARK ORNAMENT */
}

.carousel::scroll-button(right):disabled,
.carousel::scroll-button(left):disabled {
  visibility: hidden;
}

.box a,
.box a:visited {
  flex: 0 0 var(--box-4);
  display: block;
  text-decoration: none;
  color: var(--default-text-color);
  transition: color 0.2s, background-color 0.2s;
  border-radius: var(--default-border-radius);
  min-height: 100%;
}

.box a:active,
.box a:hover {
  color: var(--theme-color-overlay);
  background-color: var(--theme-color);
  border-radius: var(--default-border-radius);
  min-height: 100%;
}
.box a:hover svg {
  /*
  fill: var(--theme-color-overlay);
  filter: blur(4px);
  */
  filter: drop-shadow(0 0 4px var(--theme-color-overlay))
          drop-shadow(0 0 8px var(--theme-color-overlay));
}

.card {
  scroll-snap-align: start;
  flex: 0 0 var(--box-4);
  height: auto;
  padding: var(--box-content-padding);
  border-width: 2px;
  border-style: solid;
  border-radius: var(--default-border-radius);
  border-color: var(--header-grey-dark);
}

.box.fix-with > * {
  min-width: 300px;
}
.box.same-with > * {
  max-width: 300px;
}

.box.full-with > * {
  flex: 1 1 var(--box-4); /* 4 pro Reihe bei voller Liste */
}

.box.with-1 > * {
  flex: 0 0 var(--box-1);
}

.box.with-2 > * {
  flex: 0 0 var(--box-2);
}

.box.with-3 > * {
  flex: 0 0 var(--box-3);
}

.box.with-4 > * {
  flex: 0 0 var(--box-4);
}

.card.with-picture {
  position: relative;

  padding: 0;
  display: flex;
  flex-direction: column; /* damit Text/Content darunter bleibt */
}

.with-picture .card-picture {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.card.with-picture .card-head {
  position: relative;
  height: 150px;
}
.card-picture svg {
  width: 100%;
  height: 100%;
}
.card.with-picture.height-20ph .card-picture,
.card.with-picture.height-20ph .card-head {
  height: calc(150px * 1.2);
}
.card.with-picture.height-33ph .card-picture,
.card.with-picture.height-33ph .card-head {
  height: calc(150px * 1.333);
}
.card.with-picture.height-50ph .card-picture,
.card.with-picture.height-50ph .card-head {
  height: calc(150px * 1.5);
}

.card.with-picture .card-head .card-title {
  font-size: 1.2em;
  font-weight: bold;
  line-height: 1.5em;
  background-color: rgba(var(--theme-color-rgb), 0.7);
  color: var(--theme-color-overlay);
  text-align: center;
  width: 100%;
  transform: translateY(-100%);
}

.card.with-picture .card-content {
  padding: var(--box-content-padding);
  margin-bottom: var(--box-content-padding);
}

.box.with-1.carousel:has(> :nth-of-type(2)),
.box.with-2.carousel:has(> :nth-of-type(3)),
.box.with-3.carousel:has(> :nth-of-type(4)),
.box.with-4.carousel:has(> :nth-of-type(5)) {
  scroll-marker-group: after;
}

@media (max-width: 900px) {
  .box > *,
  .box.with-4 > * {
    flex: 0 0 var(--box-3);
  }
  .box.carousel:has(> :nth-of-type(4)) {
    scroll-marker-group: after;
  }
}

@media (max-width: 750px) {

  .box > *,
  .box.with-3 > *,
  .box.with-4 > *,
  .box.full-with > * {
    flex: 0 0 var(--box-2);
  }
  .box.carousel:has(> :nth-of-type(3)) {
    scroll-marker-group: after;
  }
}

@media (max-width: 550px) {
  .box > *,
  .box.with-2 > *,
  .box.with-3 > *,
  .box.with-4 > *,
  .box.full-with > * {
    flex: 0 0 var(--box-1);
  }
  .box.carousel:has(> :nth-of-type(2)) {
    scroll-marker-group: after;
  }
}