/* 
 * Updates CSS - Testing styles and overrides
 * Only loaded when ?testing parameter is present
 */


/* ============================================
    HEADER - New Layout (Testing Mode)
============================================ */

/* Desktop Header Layout */
.testing-mode .header-left-logo .site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.testing-mode .header-left-logo .site-logo {
  flex-shrink: 0;
  text-align: left;
  order: 1;
  width: auto;
}

.testing-mode .site-header-inner .site-nav {
  width: auto;
  order: 1;
}

.testing-mode .site-header-inner.container .site-nav .nav-list .nav-item,
.testing-mode .site-header-inner.container-full .site-nav .nav-list .nav-item {
  margin-right: 0;
}

/* Wrapper for nav and search - groups them together on the right */
.testing-mode .header-left-logo .header-nav-wrapper {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: flex-end;
  order: 2;
}

.testing-mode .header-left-logo .site-nav-new {
  display: flex;
}

.testing-mode .header-left-logo .site-nav-new .nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

/* Large desktop up */
@media screen and (min-width: 1920px) {
  .testing-mode .header-left-logo .header-nav-wrapper {
    gap: 50px;
  }
  .testing-mode .header-left-logo .site-nav-new .nav-list {
    gap: 50px;
  }

  .testing-mode .site-header-inner.container-full .site-nav .nav-list .nav-item .nav-link {
    font-size: 16px;
  }
}

/* Small desktop */
@media screen and (max-width: 1919px) and (min-width: 1600px) {
  .testing-mode .header-left-logo .header-nav-wrapper {
    gap: 40px;
  }
  .testing-mode .header-left-logo .site-nav-new .nav-list {
    gap: 40px;
  }

  .testing-mode .site-header-inner.container-full .site-nav .nav-list .nav-item .nav-link {
    font-size: 14px;
  }
}

/* Even smaller desktop */
@media screen and (max-width: 1599px) and (min-width: 1200px) {
  .testing-mode .header-left-logo .header-nav-wrapper {
    gap: 30px;
  }
  .testing-mode .header-left-logo .site-nav-new .nav-list {
    gap: 30px;
  }

  .testing-mode .site-header-inner.container-full .site-nav .nav-list .nav-item .nav-link {
    font-size: 14px;
  }
}

/* Tablet landscape */
@media screen and (max-width: 1199px) and (min-width: 768px) {
  .testing-mode .header-left-logo .header-nav-wrapper {
    gap: 30px;
  }
  .testing-mode .header-left-logo .site-nav-new .nav-list {
    gap: 30px;
  }

  .testing-mode .site-header-inner.container-full .site-nav .nav-list .nav-item .nav-link {
    font-size: 14px;
  }
}

.testing-mode .header-left-logo .site-nav-new .nav-item {
  margin: 0;
}

.testing-mode .header-left-logo .site-nav-new .nav-link {
  color: #ffffff;
  text-decoration: none;
}

.testing-mode .header-left-logo .header-actions {
  display: flex;
  align-items: center;
  gap: 0;
  order: 2;
  position: relative;
}


/* Hide mobile menu toggle on desktop */
.testing-mode .header-left-logo .mobile-menu-toggle {
  display: none;
}

/* Mobile menu (hidden by default) */
.testing-mode .header-left-logo .mobile-menu {
  display: none;
}

.testing-mode .searchbox:not(.active) .searchbox-submit {
  width: 0;
  padding-inline: 0;
  margin-right: 11px;
}
.testing-mode .searchbox.active .searchbox-input {
  position: absolute;
  z-index: 20;
  right: 38px;
  width: 150px;
}


/* ============================================
   Product Navigation - Clickable Headings
   ============================================ */

.product-nav-wrapper .product-nav h3 a {
  display: block;
  transition: opacity 0.2s ease;
}

.product-nav-wrapper .product-nav h3 a:hover {
  opacity: 0.7;
}

/* Mobile Styles */
@media screen and (max-width: 1023px) {
  .testing-mode .header-left-logo .site-header-inner {
    flex-wrap: nowrap;
  }

  .testing-mode .site-header-inner.container,
  .testing-mode .site-header-inner.container-full {
    height: 75px;
  }

  .testing-mode .header-fixed~.site-wrapper {
    padding-top: 75px;
  }


  .testing-mode .header-left-logo .site-logo {
    flex: 1;
  }

  /* Header nav wrapper on mobile - keeps search and hamburger together on right */
  .testing-mode .header-left-logo .header-nav-wrapper {
    flex: 0 0 auto;
    justify-content: flex-end;
  }

  /* Hide desktop nav on mobile */
  .testing-mode .header-left-logo .site-nav-new {
    display: none;
  }

  /* Header actions side by side on mobile */
  .testing-mode .header-left-logo .header-actions {
    gap: 10px;
  }

  /* Style search button to match hamburger */
  .testing-mode .header-left-logo .searchbox-button {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Show mobile menu toggle */
  .testing-mode .header-left-logo .mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    width: 40px;
    height: 40px;
    position: relative;
    flex-shrink: 0;
  }

  /* Hamburger Icon */
  .testing-mode .header-left-logo .hamburger-icon {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
  }

  .testing-mode .header-left-logo .hamburger-icon span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #ffffff;
    transition: all 0.3s ease;
  }

  /* Hamburger animation when menu is open */
  .testing-mode .header-left-logo .mobile-menu-toggle.active .hamburger-icon span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
  }

  .testing-mode .header-left-logo .mobile-menu-toggle.active .hamburger-icon span:nth-child(2) {
    opacity: 0;
  }

  .testing-mode .header-left-logo .mobile-menu-toggle.active .hamburger-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }

  /* Mobile Menu Dropdown */
  .testing-mode .header-left-logo .mobile-menu {
    position: fixed;
    top: 70px;
    /* Adjust based on header height */
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #001c58;
    /* Dark blue */
    z-index: 998;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }

  .testing-mode .header-left-logo .mobile-menu.active {
    display: block;
    transform: translateX(0);
  }


  .testing-mode .header-left-logo .mobile-nav {
    padding: 30px 20px;
  }

  .testing-mode .header-left-logo .mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .testing-mode .header-left-logo .mobile-nav-item {
    margin: 0;
  }

  .testing-mode .header-left-logo .mobile-nav-link {
    display: block;
    color: #ffffff;
    text-decoration: none;
    font-size: 20px;
    text-transform: uppercase;
  }

  /* Prevent body scroll when mobile menu is open */
  body.mobile-menu-open {
    overflow: hidden;
  }
}

/* Tablet - tighter spacing */
@media screen and (min-width: 1024px) and (max-width: 1280px) {
  .testing-mode .header-left-logo .site-header-inner {
    padding: 15px 30px;
  }

  .testing-mode .header-left-logo .header-nav-wrapper {
    gap: 15px;
  }
}


/* ============================================
   Front Page Section News - New Layout
   ============================================ */

/* Section padding and backgrounds */
.testing-mode.front-page .section-news {
  padding: 40px 0 50px 0;
}

.testing-mode.front-page .section-news-nyheter {
  background: rgba(72, 76, 88, 0.1);
}

.testing-mode.front-page .section-news-references {
  background: #ffffff;
}

/* Hide background graphic */
.testing-mode.front-page .tease-wrapper .background-holder {
  display: none;
}

/* Header with button - flexbox layout */
.testing-mode.front-page .section-news>.container-news>.col-12:first-child .cell {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 30px;
}

.testing-mode.front-page .section-news>.container-news>.col-12:first-child .cell h2 {
  text-align: left;
  margin: 0;
  flex: 1 1 auto;
}

/* Move button from footer to header */
.testing-mode.front-page .section-news .col-footer {
  display: none;
}

.testing-mode.front-page .section-news>.container-news>.col-12:first-child .cell .button {
  margin: 0;
  flex-shrink: 0;
}

/* Stack heading and button on mobile */
@media screen and (max-width: 767px) {
  .testing-mode.front-page .section-news>.container-news>.col-12:first-child .cell {
    flex-direction: column;
    align-items: flex-start;
  }

  .testing-mode.front-page .section-news>.container-news>.col-12:first-child .cell h2 {
    width: 100%;
  }

  .testing-mode.front-page .section-news>.container-news>.col-12:first-child .cell .button {
    width: 100%;
  }
}

/* Convert to grid layout */
.testing-mode.front-page .section-news .container-news {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  padding: 0 20px;
}

@media screen and (min-width: 768px) {
  .testing-mode.front-page .section-news .container-news {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 40px;
  }
}

.testing-mode.front-page .section-news .container-news {
  margin: 0 auto;
}

.testing-mode.front-page .section-news .heading-col {
  padding-inline: 0;
}

.testing-mode.front-page .section-news .heading-col .heading-container {
  max-width: auto;
  width: 100%;
  padding-inline: 0;
}


/* Large desktop up */
@media screen and (min-width: 1920px) {
  .testing-mode.front-page .section-news .container-news {
    max-width: 1493px;
  }
}

/* Small desktop */
@media screen and (max-width: 1919px) and (min-width: 1600px) {
  .testing-mode.front-page .section-news .container-news {
    max-width: 1330px;
  }
}

/* Even smaller desktop */
@media screen and (max-width: 1599px) and (min-width: 1200px) {
  .testing-mode.front-page .section-news .container-news {
    max-width: 1093px;
  }
}

/* Tablet landscape? */
@media screen and (max-width: 1199px) and (min-width: 768px) {
  .testing-mode.front-page .section-news .container-news {
    max-width: 893px;
  }
}

/* Mobile */
@media screen and (max-width: 767px) {}

/* First child (heading + button) spans full width */
.testing-mode.front-page .section-news>.container-news>.col-12:first-child {
  grid-column: 1 / -1;
}

/* Reset tease-wrapper to fit in grid */
.testing-mode.front-page .section-news .tease-wrapper {
  width: 100%;
  max-width: 100%;
  padding: 0;
}

.testing-mode.front-page .section-news .tease-wrapper .container.cell {
  padding: 0;
  max-width: 100%;
}

/* Make tease items stack vertically (image top, content bottom) */
.testing-mode.front-page .section-news .tease-news {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
  transition: transform 0.2s ease;
  overflow: hidden;
}

.testing-mode.front-page .section-news .tease-news .tease-image {
  width: 100%;
  max-width: 100%;
  padding: 0;
  order: 1;
  flex-shrink: 0;
}

.testing-mode.front-page .section-news .tease-news .tease-body {
  width: 100%;
  max-width: 100%;
  order: 2;
  padding: 25px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.testing-mode.front-page .section-news .tease-news .tease-body>p:last-of-type {
  margin-top: auto;
}

/* Entry backgrounds - opposite of section background */
.testing-mode.front-page .section-news-nyheter .tease-news {
  background-color: #ffffff;
}

.testing-mode.front-page .section-news-references .tease-news {
  background-color: rgba(72, 76, 88, 0.1);
}



/* Related References Section */

.testing-mode .related-references .header-top-border {
  margin-bottom: 40px;
}

.testing-mode .back-link-bottom {
  margin-bottom: 40px;
}

.testing-mode .related-references .news-grid {
  margin-top: 0;
}

/* Large desktop */
@media screen and (max-width: 1919px) and (min-width: 1200px) {
  .testing-mode .related-references .tease-body>h3 {
    margin-top: 7px;
    font-size: 2.4em;
  }
}

/* Small desktop */
@media screen and (max-width: 1199px) and (min-width: 768px) {
  .testing-mode .related-references .tease-body>h3 {
    margin-top: 5px;
    font-size: 2em;
  }
}

/* Mobile */
@media screen and (max-width: 767px) {
  .testing-mode .related-references {
    margin-top: 0;
  }

  .testing-mode .related-references .news-grid .news-item {
    padding-inline: 0;
  }
}


/* Make related references look like archive */
.testing-mode .related-references .news-grid .news-item .tease-news {
  padding: 0;
  background-color: #ffffff;
}

.testing-mode .related-references .news-grid .news-item .tease-news .tease-image,
.testing-mode .related-references .news-grid .news-item .tease-news .tease-body {
  width: 100%;
  background-color: #ffffff;
  max-width: 100%;
}

.testing-mode .related-references .news-grid .news-item .tease-news .tease-body {
  -webkit-box-ordinal-group: 3;
  -ms-flex-order: 2;
  order: 2;
}

@media screen and (max-width: 767px) {
  .testing-mode .related-references .news-grid .news-item .tease-news .tease-body {
    padding: 0 18px 9px 18px;
  }
}

.testing-mode .related-references .news-grid .news-item .tease-news .tease-image {
  padding: 0;
  -webkit-box-ordinal-group: 2;
  -ms-flex-order: 1;
  order: 1;
}


/* ============================================
   Front Page Section News - New Layout
   ============================================ */

/* Header with button - flexbox layout */
.testing-mode.front-page .section-news>.container-news>.col-12:first-child .cell {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.testing-mode.front-page .section-news>.container-news>.col-12:first-child .cell h2 {
  text-align: initial;
  margin: 0;
  flex: 1 1 auto;
}

.testing-mode.front-page .section-news>.container-news>.col-12:first-child .cell h2.text-center {
  text-align-last: initial;
}

/* Move button from footer to header */
.testing-mode.front-page .section-news .col-footer {
  display: none;
}

.testing-mode.front-page .section-news>.container-news>.col-12:first-child .cell .button {
  margin: 0;
  flex-shrink: 0;
}

/* Stack heading and button on mobile */
@media screen and (max-width: 767px) {
  .testing-mode.front-page .section-news>.container-news>.col-12:first-child .cell {
    flex-direction: column;
    align-items: flex-start;
  }

  .testing-mode.front-page .section-news>.container-news>.col-12:first-child .cell h2 {
    width: 100%;
  }

  .testing-mode.front-page .section-news>.container-news>.col-12:first-child .cell .button {
    width: 100%;
  }
}

/* Convert to grid layout */
.testing-mode.front-page .section-news .container-news {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}

@media screen and (min-width: 768px) {
  .testing-mode.front-page .section-news .container-news {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* First child (heading + button) spans full width */
.testing-mode.front-page .section-news>.container-news>.col-12:first-child {
  grid-column: 1 / -1;
}

/* Reset tease-wrapper to fit in grid */
.testing-mode.front-page .section-news .tease-wrapper {
  width: 100%;
  max-width: 100%;
}

/* Make tease items stack vertically (image top, content bottom) */
.testing-mode.front-page .section-news .tease-news {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
  background-color: #ffffff;
}

.testing-mode.front-page .section-news .tease-news .tease-image {
  width: 100%;
  max-width: 100%;
  padding: 0;
  order: 1;
}

.testing-mode.front-page .section-news .tease-news .tease-body {
  width: 100%;
  max-width: 100%;
  order: 2;
  padding: 20px;
}

/* Section backgrounds */
.testing-mode.front-page .section-news-nyheter {
  background: rgba(72, 76, 88, 0.1);
}

.testing-mode.front-page .section-news-references {
  background: #ffffff;
}

/* Entry backgrounds - opposite of section background */
.testing-mode.front-page .section-news-nyheter .tease-news {
  background-color: #ffffff;
}

.testing-mode.front-page .section-news-references .tease-news {
  background-color: rgba(72, 76, 88, 0.1);
}