.il-popup-gallery a:not(:first-child) {
  display: none;
}

.il-reference-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.portfolio-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
}

.portfolio-filter button {
  border: 1px solid currentColor;
  background: transparent;
  padding: 8px 16px;
}

.portfolio-filter button.active {
  font-weight: 700;
}

.il-more-images img,
.il-reference-card img {
  max-width: 100%;
  height: auto;
}

.gallery-card.style2 .il-icon-btn.icon-btn {
  top: 35px;
  right: 5px;
  left: unset;
  width: auto;
  height: 30px;
  padding: 0 10px;
  border-radius: 20px;
  line-height: 30px;
  --btn-size: 30;
}

.gallery-card .box-text {
  margin-bottom: 0;
}

.gallery-card .box-text p {
  margin-bottom: 0;
  color: var(--theme-color);
}

/* Startseiten-Slider: Farben und Abstände passend zu Sutter Holzbau. */
.il-sutter-reference-slider {
  --il-slider-ink: #332217;
  --il-slider-accent: var(--theme-color, #f4c400);
  --il-slider-muted: rgba(51, 34, 23, 0.24);
}

.il-sutter-reference-slider .project-box2 {
  position: relative;
}

/* Die gesamte Kachel führt zur Referenzübersicht. */
.il-sutter-reference-slider .project-box2 .il-reference-overview-link {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: block;
}

.il-sutter-reference-slider .project-box2 .il-reference-overview-link:focus-visible {
  outline: 3px solid var(--il-slider-accent);
  outline-offset: -3px;
}

.il-sutter-reference-slider .project-box2 .box-img {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #f7f4ee;
}

.il-sutter-reference-slider .project-box2 .box-img img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.il-sutter-reference-slider .project-box2 .box-wrapp {
  gap: 20px;
  align-items: flex-end;
}

.il-sutter-reference-slider .project-box2 .box-content {
  margin-top: 28px;
}

.il-sutter-reference-slider .project-box2 .box-content .box-title,
.il-sutter-reference-slider .project-box2 .box-content .box-title a {
  color: var(--il-slider-ink);
  font-family: var(--title-font);
  font-size: clamp(1.65rem, 2.5vw, 2.5rem);
}

.il-sutter-reference-slider .project-box2:hover .box-content .box-title,
.il-sutter-reference-slider .project-box2:focus-within .box-content .box-title {
  color: var(--il-slider-accent);
}

.il-sutter-reference-slider .project-box2 .box-text,
.il-sutter-reference-slider .project-box2 .box-text p {
  color: var(--il-slider-ink);
}

.il-sutter-reference-slider .project-box2 .box-number {
  color: var(--il-slider-muted);
  font-size: clamp(2.75rem, 5vw, 5.5rem);
  line-height: 0.9;
}

@media (max-width: 575.98px) {
  .il-sutter-reference-slider .project-box2 .box-wrapp {
    flex-direction: row;
    align-items: flex-end;
  }

  .il-sutter-reference-slider .project-box2 .box-content {
    margin-top: 20px;
  }
}

.il-sutter-reference-detail {
  --il-reference-accent: var(--theme-color, #f2c300);
  --il-reference-ink: var(--title-color, #171717);
  --il-reference-muted: #6c6863;
  --il-reference-surface: #f7f4ee;
  padding-top: clamp(32px, 6vw, 80px);
}

.il-reference-intro {
  margin-bottom: clamp(48px, 7vw, 88px);
}

.il-reference-hero-image {
  aspect-ratio: 7 / 5;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--il-reference-surface);
}

.il-reference-hero-image__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.il-reference-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  min-height: 300px;
  padding: clamp(30px, 4vw, 58px);
  background: var(--il-reference-surface);
}

.il-reference-details--without-image {
  max-width: 900px;
  min-height: 0;
  margin: 0 auto;
  text-align: center;
}

.il-reference-kicker,
.il-reference-content__kicker {
  margin: 0 0 8px;
  color: var(--il-reference-accent);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  line-height: 1.4;
  text-transform: uppercase;
}

.il-reference-title {
  margin: 0;
  color: var(--il-reference-ink);
  font-size: clamp(2rem, 3.8vw, 3.8rem);
  line-height: 1.06;
}

.il-reference-meta {
  margin: clamp(26px, 4vw, 44px) 0 0;
  padding: 0;
  border-top: 1px solid rgb(23 23 23 / 14%);
}

.il-reference-meta > div {
  padding: 16px 0;
  border-bottom: 1px solid rgb(23 23 23 / 14%);
}

.il-reference-meta dt {
  margin-bottom: 4px;
  color: var(--il-reference-muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.il-reference-meta dd {
  margin: 0;
  color: var(--il-reference-ink);
  font-size: 0.98rem;
  line-height: 1.5;
}

.il-reference-gallery {
  margin: 0 0 clamp(64px, 9vw, 112px);
}

.il-reference-gallery__viewport {
  position: relative;
  overflow: hidden;
  background: var(--il-reference-surface);
  touch-action: pan-y;
}

.il-reference-gallery__track {
  display: flex;
  width: 100%;
  transition: transform 480ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.il-reference-gallery__slide {
  position: relative;
  flex: 0 0 100%;
  aspect-ratio: 7 / 5;
  margin: 0;
  overflow: hidden;
}

.il-reference-gallery__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
}

.il-reference-gallery__slide figcaption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  margin: 0;
  padding: 38px 22px 16px;
  color: #fff;
  font-size: 0.9rem;
  background: linear-gradient(transparent, rgb(0 0 0 / 70%));
}

.il-reference-gallery__arrow {
  position: absolute;
  z-index: 2;
  top: 50%;
  display: grid;
  width: 52px;
  height: 52px;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  color: #171717;
  background: rgb(255 255 255 / 92%);
  box-shadow: 0 8px 28px rgb(0 0 0 / 16%);
  cursor: pointer;
  place-items: center;
  transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.il-reference-gallery__arrow:hover,
.il-reference-gallery__arrow:focus-visible {
  color: #171717;
  background: var(--il-reference-accent);
  transform: translateY(-50%) scale(1.06);
}

.il-reference-gallery__arrow span {
  margin-top: -4px;
  font-size: 2.4rem;
  line-height: 1;
}

.il-reference-gallery__arrow--prev {
  left: 22px;
}

.il-reference-gallery__arrow--next {
  right: 22px;
}

.il-reference-gallery__counter {
  position: absolute;
  z-index: 2;
  right: 18px;
  bottom: 18px;
  padding: 7px 12px;
  border-radius: 999px;
  color: #fff;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  background: rgb(0 0 0 / 68%);
}

.il-reference-gallery__thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  padding: 2px 2px 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.il-reference-gallery__thumb {
  flex: 0 0 116px;
  height: 78px;
  padding: 3px;
  overflow: hidden;
  border: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  opacity: 0.62;
  transition: border-color 180ms ease, opacity 180ms ease;
}

.il-reference-gallery__thumb:hover,
.il-reference-gallery__thumb:focus-visible,
.il-reference-gallery__thumb.is-active {
  border-color: var(--il-reference-accent);
  opacity: 1;
}

.il-reference-gallery__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.il-reference-gallery.is-single .il-reference-gallery__arrow,
.il-reference-gallery.is-single .il-reference-gallery__counter,
.il-reference-gallery.is-single .il-reference-gallery__thumbs {
  display: none;
}

.il-reference-photo-credit {
  margin: 6px 0 0;
  color: var(--il-reference-muted);
  font-size: 0.78rem;
  line-height: 1.5;
  text-align: right;
}

.il-reference-main {
  align-items: flex-start;
  margin-bottom: clamp(56px, 8vw, 96px);
}

.il-reference-content {
  margin: 0;
}

.il-reference-content h2 {
  max-width: 820px;
  margin: 0 0 24px;
  color: var(--il-reference-ink);
  font-size: clamp(1.9rem, 3.5vw, 3.5rem);
  line-height: 1.1;
}

.il-reference-content__text {
  color: var(--body-color, #4f4b47);
  font-size: clamp(1rem, 1.35vw, 1.12rem);
  line-height: 1.8;
}

.il-reference-content__text > :last-child {
  margin-bottom: 0;
}

.il-reference-why {
  width: 100%;
}

.il-reference-testimonial {
  max-width: 1100px;
  margin: 0 auto clamp(64px, 9vw, 120px);
  padding: clamp(36px, 6vw, 72px);
  background: var(--il-reference-surface);
}

.il-reference-testimonial__header {
  margin-bottom: clamp(28px, 4vw, 48px);
  text-align: center;
}

.il-reference-testimonial__header h2 {
  margin: 0;
  color: var(--il-reference-ink);
  font-size: clamp(1.9rem, 4vw, 3.5rem);
  line-height: 1.08;
}

.il-reference-testimonial__header h2 span {
  color: var(--il-reference-accent);
}

.il-reference-testimonial__card {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
  padding: 0;
  border: 0;
}

.il-reference-testimonial__quote {
  width: 52px;
  margin: 0 auto 22px;
}

.il-reference-testimonial__quote img {
  display: block;
  width: 100%;
  height: auto;
}

.il-reference-testimonial__text {
  color: var(--il-reference-ink);
  font-size: clamp(1.08rem, 2vw, 1.35rem);
  line-height: 1.7;
  text-align: center;
}

.il-reference-testimonial__text > :last-child {
  margin-bottom: 0;
}

.il-reference-testimonial__profile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 28px;
  font-style: normal;
  text-align: left;
}

.il-reference-testimonial__portrait {
  flex: 0 0 60px;
  width: 60px;
  height: 60px;
  overflow: hidden;
  border-radius: 50%;
}

.il-reference-testimonial__portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.il-reference-testimonial__profile cite,
.il-reference-testimonial__profile span {
  display: block;
}

.il-reference-testimonial__profile cite {
  color: var(--il-reference-ink);
  font-weight: 700;
  font-style: normal;
}

.il-reference-testimonial__profile span {
  color: var(--il-reference-muted);
  font-size: 0.9rem;
}

@media (max-width: 1199px) {
  .il-reference-details {
    min-height: 0;
  }
}

@media (max-width: 767px) {
  .il-sutter-reference-detail {
    padding-top: 24px;
  }

  .il-reference-gallery__slide {
    aspect-ratio: 4 / 3;
  }

  .il-reference-gallery__arrow {
    width: 42px;
    height: 42px;
  }

  .il-reference-gallery__arrow--prev {
    left: 10px;
  }

  .il-reference-gallery__arrow--next {
    right: 10px;
  }

  .il-reference-gallery__counter {
    right: 10px;
    bottom: 10px;
  }

  .il-reference-gallery__thumb {
    flex-basis: 92px;
    height: 64px;
  }

  .il-reference-testimonial {
    padding-right: 22px;
    padding-left: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .il-reference-gallery__track,
  .il-reference-gallery__arrow,
  .il-reference-gallery__thumb {
    transition: none;
  }
}


/* Reference detail: previous / overview / next navigation. */
.il-sutter-reference-detail .il-reference-navigation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  padding: clamp(28px, 4vw, 48px) 0;
  background: #F4F4F4;
  box-shadow: 0 0 0 100vmax #F4F4F4;
  clip-path: inset(0 -100vmax);
}
.il-sutter-reference-detail .il-reference-testimonial:has(+ .il-reference-navigation) {
  margin-bottom: 0;
}
.il-reference-navigation .il-reference-navigation__link {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  max-width: 100%;
  padding: 10px 12px;
  color: #111;
  text-decoration: none;
  border-radius: 4px;
  overflow-wrap: anywhere;
  transition: background-color .2s ease;
}
.il-reference-navigation .il-reference-navigation__link:hover {
  color: #111;
  background-color: var(--theme-color, #FFE500);
}
.il-reference-navigation__label {
  font-size: 15px;
  line-height: 1.4;
}
.il-reference-navigation__title {
  font-size: clamp(16px, 1.5vw, 20px);
  font-weight: 700;
  line-height: 1.3;
}
.il-reference-navigation__next {
  text-align: right;
}
.il-reference-navigation .il-reference-navigation__all {
  display: inline-block;
  padding: 14px 24px;
  border: 1px solid #111;
  border-radius: 999px;
  background-color: #111;
  color: #fff;
  font-size: 16px;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease;
}
.il-reference-navigation .il-reference-navigation__all:hover {
  background-color: var(--theme-color, #FFE500);
  color: #111;
}
.il-reference-navigation a:focus-visible {
  outline: 3px solid #111;
  outline-offset: 4px;
}
@media (max-width: 575.98px) {
  .il-sutter-reference-detail .il-reference-navigation {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
  .il-reference-navigation__overview {
    grid-column: 1 / -1;
    grid-row: 1;
    text-align: center;
  }
  .il-reference-navigation__previous { grid-column: 1; }
  .il-reference-navigation__next { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
  .il-reference-navigation a { transition: none !important; }
}

/* Let the grey navigation meet the preceding content and the next section. */
.il-sutter-reference-detail .il-reference-main:has(+ .il-reference-navigation) {
  margin-bottom: 0;
}
.frame-type-ilsutter_referencedetail:has(.il-reference-navigation) {
  --ak-space-after: 0px;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Referenzdetail: obere Galerie ueber die gesamte Inhaltsbreite. */
.il-sutter-reference-detail.il-sutter-reference-detail--gallery-top .il-reference-gallery--hero {
  margin: 0 0 clamp(28px, 4vw, 52px);
  padding: 0;
  background: transparent;
  box-shadow: none;
  clip-path: none;
}

.il-sutter-reference-detail--gallery-top .il-reference-gallery--hero .il-reference-gallery__viewport {
  background: #f4f4f4;
}

.il-sutter-reference-detail--gallery-top .il-reference-gallery--hero .il-reference-gallery__slide {
  height: clamp(540px, 42vw, 900px);
  aspect-ratio: auto;
}

.il-sutter-reference-detail--gallery-top .il-reference-gallery--hero .il-reference-gallery__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.il-sutter-reference-detail--gallery-top .il-reference-gallery--hero figcaption {
  padding-right: 100px;
  padding-left: 22px;
}

.il-sutter-reference-detail--gallery-top .il-reference-gallery--hero:focus-visible {
  outline: 3px solid var(--theme-color, #ffe500);
  outline-offset: 4px;
}

/* Nach dem Projekttext wieder Abstand zur Kundenstimme bzw. Navigation. */
.il-sutter-reference-detail.il-sutter-reference-detail--gallery-top .il-reference-main {
  margin-bottom: clamp(64px, 7vw, 104px);
}

.il-sutter-reference-detail--gallery-top .il-reference-project-data {
  margin-top: 28px;
}

@media (max-width: 767.98px) {
  .il-sutter-reference-detail--gallery-top .il-reference-gallery--hero .il-reference-gallery__slide {
    height: clamp(280px, 70vw, 460px);
  }

  .il-sutter-reference-detail--gallery-top .il-reference-gallery--hero figcaption {
    padding-left: 14px;
    font-size: 0.8rem;
    line-height: 1.4;
  }
}

/* Referenzuebersicht: Aktionen dauerhaft oben rechts, Text weiter beim Hover. */
.il-sutter-reference-list .gallery-card.style2 .box-img .il-icon-btn.icon-btn {
  top: 20px;
  right: 20px;
  bottom: auto;
  left: auto;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  min-height: 40px;
  max-width: calc(100% - 40px);
  margin: 0;
  padding: 8px 16px;
  border: 1px solid #171717;
  border-radius: 999px;
  background: #171717;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  opacity: 1;
  visibility: visible;
  transform: none;
  box-shadow: 0 2px 10px rgb(0 0 0 / 15%);
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

/* Der direkte Link fuehrt zur Detailseite; Galerielinks liegen im Popup-Wrapper. */
.il-sutter-reference-list .gallery-card.style2 .box-img > .il-icon-btn.icon-btn {
  background: var(--theme-color, #ffe500);
  border-color: var(--theme-color, #ffe500);
  color: #171717;
}

.il-sutter-reference-list .gallery-card.style2 .box-img .il-icon-btn.icon-btn:hover {
  background: #fff;
  border-color: #fff;
  color: #171717;
}

.il-sutter-reference-list .gallery-card.style2 .box-img .il-icon-btn.icon-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px #171717;
}

/* Obere Zierecke fuer eine ruhige Darstellung weiterhin ausgeblendet. */
.il-sutter-reference-list .gallery-card.style2 .shape .dot:nth-child(-n+2) {
  display: none;
}

.il-sutter-reference-list .gallery-card.style2 .shape {
  pointer-events: none;
}

@media (max-width: 575.98px) {
  .il-sutter-reference-list .gallery-card.style2 .box-img .il-icon-btn.icon-btn {
    top: 14px;
    right: 14px;
    left: auto;
    max-width: calc(100% - 28px);
    min-height: 44px;
    padding: 8px 14px;
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .il-sutter-reference-list .gallery-card.style2 .box-img .il-icon-btn.icon-btn {
    transition: none;
  }
}
