/* Runtime repairs for interactions whose original Divi scripts were not archived. */

.et-waypoint,
.et_animated {
  opacity: 1 !important;
}

/* Divi galleries are paginated by JavaScript; reveal the active page only. */
.et_pb_gallery_grid .et_pb_gallery_item {
  display: none;
  /* Divi's page-transition fade is paused for off-screen tiles in headless
     captures, leaving the gallery blank in full-page screenshots. The settled
     state is identical to the end of the original 1s fade. */
  animation: none;
}
.et_pb_gallery_grid .et_pb_gallery_item.gallery-page-active {
  display: block;
}
.et_pb_gallery .et_pb_gallery_pagination {
  display: none;
}
.et_pb_gallery .et_pb_gallery_pagination.is-ready {
  display: block;
}
.et_pb_gallery_pagination ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.et_pb_gallery_pagination li {
  display: inline-block;
  padding: 10px;
}
.et_pb_gallery_pagination a {
  font-size: 16px;
  line-height: 16px;
  color: #999;
}
.et_pb_gallery_pagination a.active {
  color: #056839;
}

/* Slider repair. */
.et_pb_slider .et_pb_slide {
  display: none;
}
.et_pb_slider .et_pb_slide.et-pb-active-slide {
  display: block;
}
.et_pb_slider .et_pb_slide:first-child:not(.et-pb-active-slide) {
  display: none;
}

/* Mobile navigation, using the same markup Divi generates. */
.et_mobile_menu {
  display: none;
}
.mobile_nav.open .et_mobile_menu {
  display: block;
}
.mobile_nav.open .mobile_menu_bar:before {
  content: "\4d";
}
.et_mobile_menu .menu-item-has-children > a {
  font-weight: 700;
}
@media (max-width: 980px) {
  .et_mobile_menu {
    top: 53px;
  }
}

/* Divi's mobile menu arrow; submenus stay closed until their arrow opens them. */
.et_mobile_menu li {
  position: relative;
}
.et_mobile_menu li.menu-item-has-children > a {
  padding-right: 52px;
}
.et_mobile_menu_arrow {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.et_mobile_menu_arrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid #666;
  border-bottom: 2px solid #666;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 0.2s ease;
}
.et_mobile_menu_arrow.et_pb_submenu_opened::before {
  transform: rotate(225deg) translate(-2px, -2px);
}
#main-header .et_mobile_menu li:not(.mobile-submenu-open) > ul.sub-menu {
  display: none !important;
}
#main-header .et_mobile_menu li.mobile-submenu-open > ul.sub-menu {
  display: block !important;
}

/* The archived search glyph is painted by a pseudo-element on a zero-height
   span; give the span a real hit area around the glyph. */
#et_top_search {
  height: 17px;
}
#et_search_icon {
  position: absolute;
  left: 0;
  top: -17px;
  display: block;
  width: 24px;
  height: 24px;
  cursor: pointer;
}
#et_search_icon:focus-visible {
  outline: 2px solid #106d12;
  outline-offset: 2px;
}

/* Search overlay. The archived form needs the height Divi's script sets. */
#main-header .et_search_outer {
  display: none;
}
#main-header .et_search_outer.is-open {
  display: block;
  height: 148px;
  background: #fff;
  z-index: 100001;
}
#main-header .et_search_outer.is-open .et_search_form_container {
  height: 100%;
  opacity: 1;
}
#main-header .et_search_outer.is-open .et-search-form input {
  top: 50%;
  bottom: auto;
  right: 60px;
  width: calc(100% - 90px);
  height: 48px;
  transform: translateY(-50%);
  border-bottom: 1px solid #dddddd;
  font-size: 20px;
}
#main-header .et_search_outer.is-open .et_close_search_field {
  top: 50%;
  bottom: auto;
  right: 30px;
  transform: translateY(-50%);
}
#et_top_search.et_search_opened {
  position: absolute;
  width: 100%;
}

/* Gallery lightbox. */
.legacy-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(0, 0, 0, 0.88);
}
.legacy-lightbox[hidden] {
  display: none;
}
.legacy-lightbox img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
}
.legacy-lightbox-close {
  position: absolute;
  top: 16px;
  right: 22px;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 40px;
  line-height: 1;
  cursor: pointer;
}
.legacy-lightbox-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* The archived Divi mobile menu bar is a span; keep it keyboard reachable. */
.mobile_menu_bar[role="button"] {
  cursor: pointer;
}
.mobile_menu_bar:focus-visible {
  outline: 2px solid #106d12;
  outline-offset: 2px;
}

/* Fixed header state (Divi adds the same class after scrolling). */
#main-header.et-fixed-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99999;
}
body.et_fixed_nav.et_show_nav.et_secondary_nav_enabled.et_header_style_centered #page-container {
  padding-top: 177px;
}

/* Cookie settings modal remains the original inline dialog. */
.cli-modal {
  display: none;
}
.cli-modal.is-open {
  display: block;
}

/* The archived customizer set a white top bar; keep its links legible. */
#top-header a {
  color: rgba(0, 0, 0, 0.6);
}
#top-header a:hover {
  color: #106d12;
  opacity: 1;
}

/* The consent plugin keeps a "manage" tab for later; it is not shown before consent. */
#cookie-law-info-again {
  display: none;
}

/* Keep the recovered hero heading within the phone viewport. */
@media (max-width: 767px) {
  body.home .et_pb_text_0 h1 {
    font-size: 36px !important;
    line-height: 1.15;
  }
  /* The archived module sets 115% width for a desktop bleed; there is no
     mobile margin to absorb it. */
  body.home .et_pb_image_0 {
    width: 100% !important;
  }
}

/* Source-photo gaps: let remaining content use the full row width. */
.legacy-empty-column {
  display: none !important;
}
.et_pb_row.legacy-has-empty-column {
  display: flex !important;
  flex-wrap: wrap;
}
.et_pb_row.legacy-has-empty-column > .et_pb_column:not(.legacy-empty-column) {
  flex: 1 1 0;
  width: auto !important;
  max-width: 100%;
  float: none !important;
}
.et_pb_row.legacy-empty-row {
  display: none !important;
}
.et_pb_section.legacy-dark-surface {
  background-color: #056839 !important;
}
/* Missing page CSS left white CTA labels on a white section. */
.et_pb_button.legacy-contrast-button {
  background-color: #056839 !important;
  border-color: #056839 !important;
  color: #ffffff !important;
}
.et_pb_button.legacy-contrast-button:hover {
  background-color: #024d2a !important;
  border-color: #024d2a !important;
  color: #ffffff !important;
}

/* Archived YouTube embeds show their real video poster until played. */
.legacy-video-poster {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
  line-height: 0;
}
.legacy-video-poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.legacy-video-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 68px;
  height: 48px;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 12px;
  background: #f00;
  cursor: pointer;
  padding: 0;
}
.legacy-video-play span {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-42%, -50%);
  border-style: solid;
  border-width: 11px 0 11px 19px;
  border-color: transparent transparent transparent #fff;
}
.legacy-video-play:hover {
  background: #cc0000;
}
.legacy-video-play:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* The 2021 Etiske retningslinjer header uses an absolute logo container that
   is wider than the viewport once the archived header CSS is applied. */
body.page-id-206270 #main-header .logo_container {
  width: auto;
  left: 30px;
  right: 30px;
}

/* The post-covid button keeps its desktop 26px label on phones, where the
   longest word cannot fit the column. */
@media (max-width: 767px) {
  body.page-id-1403 .et_pb_button_0 {
    font-size: 20px;
    padding-left: 18px;
    padding-right: 18px;
  }
}

/* The archived customizer sets a global white link colour. Light text modules
   need the site's green instead; fullwidth sliders keep white over photos. */
#main-content .et_pb_bg_layout_light .et_pb_text_inner a {
  color: #056839;
}
#main-content .et_pb_bg_layout_light .et_pb_text_inner a:hover {
  color: #106d12;
}
#main-content .et_pb_slider .et_pb_bg_layout_light .et_pb_text_inner a {
  color: #ffffff;
}

/* The archived 2025 page CSS expects the FoU CTA on a dark surface; the
   recovered 2023 section uses the light-green fallback. Give the CTA the
   site's button surface so its white label stays legible. */
body.page-id-163 .et_pb_button_0 {
  background-color: #056839;
  padding: 8px 18px !important;
  border-radius: 3px;
}
body.page-id-163 .et_pb_button_0:hover {
  background-color: #106d12;
  color: #ffffff !important;
}

/* Om prosjektet carries a desktop row set and an accordion duplicate. The
   page-specific et-core CSS for page 163 is not archived for 2023; the
   archived 2025 et-core for the same page ID uses these same breakpoints. */
@media (min-width: 981px) {
  body.page-id-163 .et_pb_row_7,
  body.page-id-163 .et_pb_row_8,
  body.page-id-163 .et_pb_row_9,
  body.page-id-163 .et_pb_row_10 {
    display: none !important;
  }
}
@media (max-width: 980px) {
  body.page-id-163 .et_pb_row_3,
  body.page-id-163 .et_pb_row_4,
  body.page-id-163 .et_pb_row_5,
  body.page-id-163 .et_pb_row_6 {
    display: none !important;
  }
}
