.cpt-tjeneste-main {
  display: flex;
  flex-direction: column;
}

.cpt-tjeneste-content {
  flex: 1 0 auto;
}

.cpt-tjeneste-top-image-wrap {
  display: flex;
  justify-content: flex-start;
}

.cpt-tjeneste-top-image {
  display: block;
  width: 100%;
  height: auto;
  min-height: 250px;
  object-fit: cover;
  aspect-ratio: 16 / 9;
}

.cpt-tjeneste-intro-wrap {
  display: flex;
  justify-content: flex-end;
}

.cpt-tjeneste-intro-card {
  position: relative;
  z-index: 1;
  width: 100%;
  margin-top: 40px;
  background: var(--color-main);
}

.cpt-tjeneste-title {
  margin-top: 0;
  margin-bottom: 15px;
}

.cpt-tjeneste-text > :first-child {
  margin-top: 0;
}

.cpt-tjeneste-text > :last-child {
  margin-bottom: 0;
}

.cpt-tjeneste-gallery {
  display: grid;
  gap: 24px;
}

.cpt-tjeneste-gallery__item {
  margin: 0;
}

.cpt-tjeneste-gallery__item a {
  display: block;
  text-decoration: none;
}

.cpt-tjeneste-gallery__image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 15 / 10;
  object-fit: cover;
}

.cpt-tjeneste-gallery__caption {
  margin-top: 8px;
  margin-bottom: 0;
  font-size: 0.8rem;
  line-height: 1.4;
}

.cpt-tjeneste-pagination-section {
  display: none;
  margin-top: auto;
}

.cpt-tjeneste-pagination {
  display: grid;
  gap: 18px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.cpt-tjeneste-pagination__item--next {
  text-align: right;
}

.cpt-tjeneste-pagination__link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.cpt-tjeneste-pagination__link:hover,
.cpt-tjeneste-pagination__link:focus-visible {
  text-decoration: none;
}

.cpt-tjeneste-pagination__label {
  font-size: 0.9rem;
  font-weight: 400;
  transition: color 180ms ease;
}

.cpt-tjeneste-pagination__arrow {
  position: relative;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  transition: transform 180ms ease;
}

.cpt-tjeneste-pagination__arrow::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 9px;
  height: 9px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

.cpt-tjeneste-pagination__arrow--right::before {
  transform: translateY(-50%) rotate(45deg);
}

.cpt-tjeneste-pagination__arrow--left::before {
  left: auto;
  right: 0;
  transform: translateY(-50%) rotate(-135deg);
}

.cpt-tjeneste-pagination__link:hover .cpt-tjeneste-pagination__label,
.cpt-tjeneste-pagination__link:focus-visible .cpt-tjeneste-pagination__label {
  color: var(--color-main-alt-font-hover);
}

.cpt-tjeneste-pagination__link--prev:hover .cpt-tjeneste-pagination__arrow,
.cpt-tjeneste-pagination__link--prev:focus-visible .cpt-tjeneste-pagination__arrow {
  transform: translateX(-4px);
}

.cpt-tjeneste-pagination__link--next:hover .cpt-tjeneste-pagination__arrow,
.cpt-tjeneste-pagination__link--next:focus-visible .cpt-tjeneste-pagination__arrow {
  transform: translateX(4px);
}

@media (min-width: 768px) {
  .cpt-tjeneste-pagination-section {
    display: block;
  }

  .cpt-tjeneste-top-image {
    width: 90%;
  }

  .cpt-tjeneste-intro-card {
    width: 80%;
    max-width: 800px;
    margin-top: -80px;
    padding: 50px 0 50px 50px;
  }

  .cpt-tjeneste-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cpt-tjeneste-pagination {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
  }
}

@media (min-width: 992px) {
  .cpt-tjeneste-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
