/* Referenzen – Showroom v1.6-Maße, auf dieses Plugin gekapselt. */
/* Nur Referenz-Archiv und einzelne Referenzen: Astra setzt auf #primary
   standardmaessig zusaetzlichen Aussenabstand. Dieser wird hier entfernt,
   damit der Intro-Abstand dem Showroom entspricht. */
main#primary.hwi-reference-template {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: none;
  float: none;
}
.hwi-ref {
  --hwi-ref-text: #222321;
  --hwi-ref-muted: #7f807c;
  --hwi-ref-max: 1330px;
  width: 100vw;
  max-width: 100vw;
  margin-inline: calc(50% - 50vw);
  box-sizing: border-box;
  overflow: hidden;
  background: #fff;
  color: var(--hwi-ref-text);
  font-size: 16px;
  line-height: 1.65;
  text-align: left;
}
.hwi-ref *, .hwi-ref *::before, .hwi-ref *::after { box-sizing: border-box; }
.hwi-ref__container {
  max-width: var(--hwi-ref-max);
  margin-inline: auto;
  padding-inline: clamp(24px, 5.8vw, 88px);
}
/* 01 – Titel links, Bild rechts: Originalraster des Showrooms. */
.hwi-ref__intro {
  display: grid;
  grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr);
  align-items: center;
  gap: clamp(38px, 5vw, 82px);
  padding-top: clamp(78px, 8vw, 130px);
  padding-bottom: clamp(56px, 6vw, 93px);
}
/* Link links oben, parallel zur Oberkante des Titelbildes. H1 bleibt zentriert. */
.hwi-ref__intro-copy {
  position: relative;
  min-width: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hwi-ref__hero { min-width: 0; }
.hwi-ref .hwi-ref__back-link {
  position: absolute;
  top: 0;
  left: 0;
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 12px;
  max-width: 100%;
  color: var(--hwi-ref-text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none !important;
  text-align: left;
}
.hwi-ref .hwi-ref__back-link svg {
  display: block;
  flex: 0 0 29px;
  width: 29px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hwi-ref .hwi-ref__back-link:hover { color: #62635e; }
.hwi-ref .hwi-ref__back-link:focus-visible { outline: 2px solid #242424; outline-offset: 5px; }
.hwi-ref__eyebrow {
  display: block;
  margin-bottom: clamp(21px, 2.4vw, 34px);
  color: var(--hwi-ref-muted);
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.hwi-ref__title {
  color: var(--hwi-ref-text);
  font-size: clamp(42px, 5.2vw, 76px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -.025em;
  margin: 0;
  padding: 0;
  text-transform: none;
  text-align: left;
}
.hwi-ref__media {
  position: relative;
  overflow: hidden;
  width: 100%;
  background: #dad6cf;
}
.hwi-ref__img {
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  object-fit: cover;
}
.hwi-ref__hero-media { aspect-ratio: 1.02; min-height: 400px; }
.hwi-ref__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #dedcd7, #bfbbb4);
  padding: 20px;
  color: #57554f;
  font-size: 14px;
  text-align: center;
}
/* 02 – H2 und unbegrenzte Galerie. Alle Kanten bündig zum Text-Raster. */
.hwi-ref__gallery-section {
  padding-top: clamp(58px, 6.9vw, 104px);
  padding-bottom: clamp(58px, 7vw, 100px);
}
.hwi-ref__section-heading {
  color: var(--hwi-ref-text);
  font-size: clamp(30px, 3.5vw, 46px);
  font-weight: 400;
  letter-spacing: -.025em;
  line-height: 1.2;
  margin: 0;
  padding: 0;
  text-align: left;
  text-transform: none;
}
.hwi-ref__gallery-section > .hwi-ref__section-heading { margin-bottom: clamp(42px, 5vw, 72px); }
.hwi-ref__gallery {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2.2vw, 30px);
  align-items: start;
}
.hwi-ref__gallery-item {
  width: 100%;
  min-width: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  padding: 0;
  margin: 0;
  background: #e7e5e1;
}
.hwi-ref__gallery-item img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.hwi-ref__link-row {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  margin-top: clamp(30px, 3.8vw, 52px);
}
.hwi-ref__text-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  padding: 0 0 12px;
  border-bottom: 1px solid #757671;
  color: var(--hwi-ref-text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  text-decoration: none !important;
  text-align: right;
  transition: gap .2s ease, color .2s ease;
}
.hwi-ref__text-link:hover { gap: 32px; color: #62635e; }
.hwi-ref__text-link:focus-visible, .hwi-ref__archive-card a:focus-visible {
  outline: 2px solid #242424;
  outline-offset: 4px;
}
.hwi-ref__text-link svg {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* 03 – Gleicher Planungsteil wie Showroom v1.6. */
.hwi-ref__final {
  display: grid;
  grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr);
  max-width: 1500px;
  margin: clamp(90px, 10vw, 165px) auto clamp(100px, 10vw, 180px);
  padding-inline: clamp(24px, 5.8vw, 88px);
  align-items: center;
  gap: clamp(36px, 4.5vw, 72px);
}
.hwi-ref__final-copy { min-width: 0; padding-block: 40px; }
.hwi-ref__final-copy > .hwi-ref__section-heading { margin-top: 0; }
.hwi-ref__final-text {
  max-width: 430px;
  margin: clamp(24px, 2.5vw, 36px) 0 clamp(28px, 3vw, 42px);
  color: #555652;
  font-size: clamp(17px, 1.4vw, 19px);
  line-height: 1.8;
}
.hwi-ref__final-text p {
  max-width: none;
  margin: 0 0 1.2em;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}
.hwi-ref__final-text p:last-child { margin-bottom: 0; }
.hwi-ref__final-media { aspect-ratio: 1.2; min-height: 460px; }
/* Gemeinsamer CTA-Link: wie der Planungs-Link des Showrooms. */
.hwi-ref__final-link {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid #757671;
  color: var(--hwi-ref-text);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  text-decoration: none !important;
  transition: gap .2s ease, color .2s ease;
}
.hwi-ref__final-link:hover { gap: 32px; color: #62635e; }
.hwi-ref__final-link:focus-visible { outline: 2px solid #242424; outline-offset: 4px; }
.hwi-ref__final-link svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Übersicht: neuer Showroom-Introblock und Referenzkarten. */
.hwi-ref__archive-intro { text-align: left; }
.hwi-ref__archive-lead {
  max-width: 530px;
  margin: clamp(24px, 3vw, 42px) 0 0;
  color: #4b4b49;
  font-size: clamp(16px, 1.42vw, 20px);
  line-height: 1.8;
  font-weight: 400;
}
.hwi-ref__archive-lead p { margin: 0 0 1.1em; color: inherit; font-size: inherit; line-height: inherit; }
.hwi-ref__archive-lead p:last-child { margin-bottom: 0; }
.hwi-ref__archive-inner { padding-top: clamp(38px, 4vw, 64px); padding-bottom: clamp(100px, 10vw, 180px); }
.hwi-ref__archive-section-heading { margin: 0 0 clamp(36px, 4.5vw, 64px); }

.hwi-ref__archive-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 2.7vw, 40px); margin-top: 0; }
.hwi-ref__archive-card { min-width: 0; }
.hwi-ref__archive-card a { color: inherit; text-decoration: none !important; }
.hwi-ref__archive-image { aspect-ratio: 4 / 3; min-height: 0; }
.hwi-ref__archive-card h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 0 0;
  font-size: clamp(17px, 1.5vw, 22px);
  font-weight: 400;
  line-height: 1.35;
  color: var(--hwi-ref-text);
}
.hwi-ref__archive-name { flex: 1 1 auto; min-width: 0; }
/* Gleicher Pfeil wie die „Mehr erfahren“-Links. */
.hwi-ref__archive-arrow {
  display: block;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .2s ease;
}
.hwi-ref__archive-card a:hover .hwi-ref__archive-arrow { transform: translateX(5px); }
.hwi-ref__pagination { margin-top: 45px; }
@media (max-width: 950px) {
  .hwi-ref__gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hwi-ref__archive-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 780px) {
  .hwi-ref__intro { grid-template-columns: 1fr; gap: 43px; padding-top: 76px; padding-bottom: 52px; }
  .hwi-ref__intro-copy { max-width: 650px; align-self: auto; }
  .hwi-ref .hwi-ref__back-link { position: static; margin-bottom: 48px; }
  .hwi-ref__eyebrow { font-size: 10px; }
  .hwi-ref__archive-lead { max-width: 650px; line-height: 1.7; }
  .hwi-ref__hero-media { min-height: 0; aspect-ratio: 1.36; }
  .hwi-ref__gallery-section { padding-top: 64px; padding-bottom: 64px; }
  .hwi-ref__gallery-section > .hwi-ref__section-heading { margin-bottom: 36px; }
  .hwi-ref__link-row { justify-content: flex-start; }
  .hwi-ref__text-link { justify-content: flex-start; text-align: left; }
  .hwi-ref__final { grid-template-columns: 1fr; gap: 36px; margin-top: 90px; margin-bottom: 100px; }
  .hwi-ref__final-copy { padding-block: 0; }
  .hwi-ref__final-media { min-height: 0; aspect-ratio: 1.18; }
  .hwi-ref__final-text { max-width: 600px; }
}
@media (max-width: 600px) {
  .hwi-ref__gallery, .hwi-ref__archive-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .hwi-ref__container { padding-inline: 24px; }
  .hwi-ref__intro { padding-top: 63px; padding-bottom: 44px; gap: 35px; }
  .hwi-ref__title { font-size: clamp(40px, 12vw, 56px); }
  .hwi-ref__archive-lead { font-size: 16px; }
  .hwi-ref__hero-media { min-height: 330px; aspect-ratio: 1.02; }
  .hwi-ref__gallery-section { padding-top: 58px; }
  .hwi-ref__section-heading { font-size: 30px; }
  .hwi-ref__gallery-item { aspect-ratio: 4 / 3; }
  .hwi-ref__final { padding-inline: 24px; }
  .hwi-ref__final-media { aspect-ratio: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .hwi-ref__text-link, .hwi-ref__final-link, .hwi-ref__archive-arrow { transition-duration: .01ms !important; }
}
