.section {
  padding-block: var(--space-section-y);
  container-type: inline-size;
}

.section__inner {
  padding-inline: var(--space-page-x);
  display: grid;
  gap: var(--space-stack);

  max-width: 90%;
  margin-inline: auto;
}
@media (max-width: 900px) {
  .section__inner.stretch {
    max-width: 100%;
  }

  .section__inner-inline {
    padding-inline: var(--space-page-x);
  }
  .section__col_flip {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .text-image img {
    width: 100%;
    height: auto;
    display: block;
  }
  @media (min-width: 900px) {
    .section__col_flip {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 3rem;
    }

    .text-block--top {
      grid-column: 1;
    }

    .text-block--bottom {
      grid-column: 2;
    }

    .text-image {
      grid-column: 1 / -1;
      justify-self: center;
      margin-top: 2rem;
      transform: translateX(15%);
    }
  }
}

.section__media img {
  display: block;
  width: 100%;
  height: auto;
  margin-inline: auto;
}
.section__content p {
  font-size: clamp(1.1rem, 2.5vw, 1.25rem);
  line-height: 1.6;
  max-width: 60ch;
  margin: 0 auto;
}
.section--intro {
  position: relative;
  width: 100%;
}
.section--intro p {
  font-size: 1.75rem;
  color: var(--c-brand-secondary);
}

.section.section--intro {
  background-color: var(--c-bg-dark);
}
@container (min-width: 900px) {
  .section__inner {
    grid-template-columns: 1fr 1.25fr;
    align-items: center;
    gap: 6rem;
  }

  .section__media img {
    width: 320px;
    margin-inline: 0;
  }

  .section__content p {
    margin: 0;
  }
  .section__media img {
    width: 100%;
  }

  /* Stack intro section vertically on desktop */
  .section--intro .section__inner {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}
@container (min-width: 1300px) {
  .section__content p {
    font-size: 2.1rem;
    line-height: 1.45;
  }
}

.lenis {
  &.lenis-smooth {
    scroll-behavior: auto;

    [data-lenis-prevent] {
      overscroll-behavior: contain;
    }
  }

  &.lenis-stopped {
    overflow: hidden;
  }

  &.lenis-scrolling iframe {
    pointer-events: none;
  }
}

/* Let the boligvælger widget (often an iframe) stay interactive while Lenis is scrolling */
html.lenis.lenis-scrolling #module-bv iframe {
  pointer-events: auto;
}

section {
  display: flex;
  justify-content: center;
  min-height: calc(var(--vh) * 50);
  max-width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.container {
  position: relative;
  max-width: 90%;
  margin: 0 auto;
}

.reveal-text-fade {
  font-kerning: none;
  line-height: 1.4;
}

.image-frame {
  overflow: hidden;
}

.image-frame--video {
  aspect-ratio: 1/0.75;
  width: 100%;
}

.zoom-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center center;
}
.section-full-width-image {
  width: 100%;
  margin: 0 auto;
}
@media (min-width: 900px) {
  .section-full-width-image.w80 {
    width: 80%;
  }
  .image-frame--video {
    aspect-ratio: 16 / 9;
  }
}

.section-reason {
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background-color: var(--c-bg-dark);
  --bg-image: none;
  --bg-blur: 10px;
  --bg-opacity: 0.25;
}

.section-reason .wrapper {
  margin-inline: auto;
}
@media (min-width: 900px) {
  .section-reason .wrapper {
    width: 75vw;
  }
  .cards-wrapper {
    display: flex;
    flex-direction: row;
    gap: 1rem;
  }
  .layout-two-cols-desktop {
    column-count: 2;
    padding: 2rem;
    padding-bottom: 4rem;
    column-gap: 4rem;
  }
}

/* Blurred / faded background image */
.section-reason::before {
  content: "";
  position: absolute;
  inset: -10%; /* lidt større for blur overflow */
  z-index: 0;

  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;

  filter: blur(var(--bg-blur)) saturate(0.8);
  opacity: var(--bg-opacity);

  transform: scale(1.1); /* undgår blur-kanter */
}
.section-reason::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;

  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.6) 0%,
    rgba(0, 0, 0, 0.3) 30%,
    rgba(0, 0, 0, 0.1) 60%,
    rgba(0, 0, 0, 0) 100%
  );
}
.section[data-bg] {
  --bg-fade-strength: 0.85;
  --fade-end: 70%;
}
/* Gradient fade */
.section[data-bg]::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;

  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, var(--bg-fade-strength)) 0%,
    rgba(0, 0, 0, calc(var(--bg-fade-strength) * 0.6)) var(--fade-end),
    rgba(0, 0, 0, 0) 100%
  );
}
.section-reason > * {
  position: relative;
  z-index: 2;
}

.section-reason .card {
  padding: 2rem;
  aspect-ratio: 1/1;
  width: 100%;
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.section-reason .card:nth-child(2) {
  background-position: center center;
}
.section-reason .card:nth-child(3) {
  background-position: center center;
}
.section-reason .card:nth-child(4) {
  background-position: right center;
}

.section-reason h2 {
  font-size: 2.6rem;
}

.section-reason .card-number {
  font-size: 2rem;
  display: block;
}
.section-reason .card h3 {
  max-width: 22ch;
  line-height: 1.4;
}
.section h4 {
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.5;
  padding-bottom: 0.5rem;
  padding-top: 1rem;
}
@media (min-width: var(--breakpoint-desktop)) {
  .section h4 {
    font-size: 1.6rem;
  }
  .card h2 {
    font-size: 1.75rem;
  }
  .card .card-number {
    font-size: 1.25rem;
  }
  .card h3 {
    font-size: 1rem;
  }
}
/* Gradient overlay */
.section-reason .card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;

  /* SMART gradient: darker bottom, lighter top */
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.65) 0%,
    rgba(0, 0, 0, 0.35) 40%,
    rgba(0, 0, 0, 0.15) 70%,
    rgba(0, 0, 0, 0.05) 100%
  );

  z-index: 1;
}
.section-reason .card[data-dark="strong"]::before {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.3));
}

/* Make text sit above overlay */
.section-reason .card > * {
  position: relative;
  z-index: 2;
}

.section-connect {
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.section-connect .wrapper {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  margin-inline: auto;
}

.section-heading {
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 1.25rem;

  align-items: stretch; /* IMPORTANT */
  /*max-width: 720px;*/
}
@media (min-width: 900px) {
  .section-connect .wrapper {
    width: 75vw;
  }

  .cards-wrapper {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.heading-bar {
  background: #c9b27c;
  border-radius: 1px;

  width: 5px;
  height: auto;

  align-self: stretch; /* IMPORTANT */
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3.5rem);
  line-height: 1.4;
  font-weight: 400;
}
.section-heading h3 {
  margin: 0;
  font-size: clamp(1.5rem, 2vw, 2.75rem);
  line-height: 1.4;
  font-weight: 400;
  grid-column: 1 / -1;
}

.section-text {
  /* max-width: 65ch; readable width on mobile */
}

/* Image (left) + text (right) layout */
.img-text-cols {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.img-text-cols .img-annotation {
  display: flex;
  flex-direction: column;
  justify-content: flex-end; /* keep any annotation content at the bottom */
  gap: 0.75rem;
}

.img-text-cols .img-annotation img {
  width: 100%;
  height: auto;
  max-width: 140px; /* requested max-width on the image */
  display: block;
}

.section-text p {
  margin: 0 0 1.25rem;
  line-height: 1.75;
  font-size: 1.3rem;
  text-wrap: pretty;
}
.section-text-smaller p,
.section-text-smaller .txt-size-1 li {
  font-size: 1rem;
}

.section-text p:last-child {
  margin-bottom: 0;
}
.section .split-40-60 {
  flex-direction: column-reverse;
}
.section-text.lead {
  padding-bottom: 1.25rem;
}
.section-text.lead p {
  font-size: 1.5rem;
  font-weight: 800;
}
.section-heading.units {
  padding-bottom: 1.25rem;
}
@media (min-width: 900px) {
  .section-text {
    width: min(60%, 720px);
    margin-left: auto; /* pushes it to the right */
  }

  .img-text-cols {
    display: grid;
    grid-template-columns: minmax(220px, 320px) 1fr;
    align-items: stretch;
    column-gap: 4rem;
  }

  /* Neutralize the global `.section-text` desktop rule inside this layout */
  .img-text-cols .section-text {
    width: auto;
    margin: 0;
  }

  .section-text.lead {
    width: 100%;
    margin-right: auto; /* pushes it to the left */
    margin-left: 0;
    max-width: unset;
    padding-bottom: 4rem;
  }
  .text-image img {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
  }
}
.section ul {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.section li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.75rem;
  line-height: 1.25;
}

.section li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--c-brand-secondary); /* evt. samme røde tråd som dit design */
  font-weight: bold;
}

.section-images {
  display: flex;
  gap: 2rem;
  flex-direction: column;
}

@media (min-width: 900px) {
  .section-images {
    width: 70vw;
    position: relative;
    aspect-ratio: 5/3;
    margin-inline: auto;
  }

  .section-images .media-frame {
    position: absolute;
    width: 60%;
  }

  .section-images .media-frame:nth-child(1) {
    top: 0;
    left: 0;
    z-index: 1;
  }

  .section-images .media-frame:nth-child(2) {
    bottom: 0;
    right: 0;
    z-index: 2;
  }
  .section-images.off-center .media-frame:nth-child(1) {
    left: -5%;
    overflow: hidden;
  }

  .section-images.off-center .media-frame:nth-child(2) {
    right: -5%;
    overflow: hidden;
  }
  .section .split-40-60 {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 4rem;
  }
  .split-40-60 .left-image {
    flex: 0 0 40%;
    display: flex;
  }
  .left-image .image-frame {
    flex: 1;
    height: 100%;
    position: relative;
  }
  .left-image .image-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  .padding-block-dsktp {
    padding-block: var(--space-section-y);
  }
  .padding-block-dsktp-top {
    padding-top: var(--space-section-y);
  }
  .retract-pos-y-1 {
    transform: translateY(calc(var(--space-section-y) * -1));
  }
}

#module-bv {
  width: 100%;
}

@media (min-width: 1400px) {
  #module-bv {
    padding-left: var(--space-page-x);
    padding-right: var(--space-page-x);
  }
}
