/**
 * Frontend styles for the theme
 *
 * Enqueued in the frontend and the WordPress editor.
 */
@layer utilities;

/* Add padding to elements with background color */
.has-background:not(.wp-element-button):not(.wp-block-sowmedia-icon),
[class*="is-style-section-"] {
  padding: var(--wp--custom--global--spacing--padding--background);
  border-radius: var(--wp--preset--border-radius--md);
}

/* Add simple hover effect to text links */
p>a,
li>a {
  transition: opacity 0.3s ease;

  &:hover {
    opacity: 0.8;
  }
}

header.wp-block-template-part+.wp-block-cover.is-style-hero {
  margin-block-start: 0px;
}

@media (min-width: 965px) {
  .wp-block-navigation .has-child:not(.open-on-click):hover>.wp-block-navigation__submenu-container {
    min-width: 450px;
  }

  .wp-block-navigation .wp-block-navigation-item {
    background-color: transparent;
  }

  .wp-block-navigation.items-justified-right .wp-block-navigation__container .has-child .wp-block-navigation__submenu-container,
  .wp-block-navigation.items-justified-right .wp-block-page-list>.has-child .wp-block-navigation__submenu-container,
  .wp-block-navigation.items-justified-space-between .wp-block-page-list>.has-child:last-child .wp-block-navigation__submenu-container,
  .wp-block-navigation.items-justified-space-between>.wp-block-navigation__container>.has-child:last-child .wp-block-navigation__submenu-container {
    left: 0px;
    padding: 18px;
    background-image: url('/wp-content/themes/qterra/assets/css/block/core/../../../img/qterra-illustrations-line.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: 241px 110px;
  }

  .wp-block-navigation.items-justified-right .wp-block-navigation__container .has-child:nth-of-type(2) .wp-block-navigation__submenu-container {
    background-position: 241px -109px;
  }

  .wp-block-navigation.items-justified-right .wp-block-navigation__container .has-child:last-of-type .wp-block-navigation__submenu-container {
    background-position: 241px -109px;
    right: 0px;
    left: unset;
  }

  .wp-block-navigation a.wp-block-navigation-item__content:hover {
    color: #ffb81c;
  }

  header .navigatie {
    .current-menu-item>a {
      color: #e74809 !important;
      &::after {
        content: '';
        display: block;
        position: absolute;
        width: 50px;
        height: 2px;
        background-color: #e74809;
        bottom: 1px;
      }
      &:hover {
        color: #e74809!important;
        cursor: default;
      }
      .wp-block-navigation__submenu-container &{
        &::after {
          bottom: 7px;
        }
      }
    }

    .current-menu-ancestor>a {
      color: #fe8e01 !important;

      &:hover {
        color: #ffb81c !important;
      }
    }
  }
}

@media (max-width: 965px) {
  .only-desktop {
    display: none !important;
  }

  header .navigatie {
    .wp-block-navigation {
      gap: 0px !important;
    }

    .wp-block-navigation__container {
      display: none !important;
    }

    #modal-2.has-modal-open .wp-block-navigation__overlay-container .wp-block-navigation__container {
      display: flex !important;
    }

    .wp-block-navigation__responsive-container-open {
      display: flex !important;

      svg {
        height: 30px;
        width: 30px;
      }
    }
  }

  .wp-block-navigation {
    .wp-block-navigation__container {
      gap: 8px !important;

      .wp-block-navigation-item__content {
        font-size: var(--wp--preset--font-size--normal) !important;
      }
    }

    .wp-block-navigation-item.has-child.open-always.wp-block-navigation-submenu {
      gap: 16px !important;

      .wp-block-navigation__submenu-container {
        gap: 4px !important;
        padding: 0px 16px 32px 0px !important;

        .wp-block-navigation-item__content {
          font-size: var(--wp--preset--font-size--small) !important;
        }

      }
    }
  }
}

.wp-block-group.alignfull:has(.is-style-slider-mobile-grid),
.wp-block-group.alignfull:has(.is-style-slider) .wp-block-group.alignfull:has(.is-style-slider-mobile) {
  overflow: hidden;
}


/* Navigation container */
.slider-nav {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  width: 100%;
  margin-top: var(--wp--preset--spacing--60);
}

.slider-nav--hidden {
  display: none;
}

/* Arrows */
.slider-arrow {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  line-height: 1;
  font-size: 17px;
  background: var(--wp--preset--color--contrast);
  color: var(--wp--preset--color--base);
}

.slider-arrow--prev {
  justify-self: start;
}

.slider-arrow--next {
  justify-self: end;
}

.slider-arrow:disabled {
  cursor: default;
  background: var(--wp--preset--color--midtone);
}

/* Dots */
.slider-dots {
  justify-self: center;
  display: flex;
  gap: 4px;
}

.slider-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #fff;
  border: 1px solid var(--wp--preset--color--contrast);
  cursor: pointer;
}

.slider-dot.is-active {
  background-color: var(--wp--preset--color--primary);
}

/* Mobile Grid Slider */
.editor-styles-wrapper .wp-block-query.is-style-slider ul.wp-block-post-template,
.editor-styles-wrapper .wp-block-query.is-style-slider-mobile-grid ul.wp-block-post-template {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: var(--wp--preset--spacing--50, 24px);
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.editor-styles-wrapper .wp-block-query.is-style-slider ul.wp-block-post-template>li {
  flex: 0 0 calc((100% - (4 * var(--wp--preset--spacing--50, 24px))) / 5);
  min-width: calc((100% - (4 * var(--wp--preset--spacing--50, 24px))) / 5);
  scroll-snap-align: start;
}

.editor-styles-wrapper .wp-block-query.is-style-slider ul.wp-block-post-template:active {
  cursor: grabbing;
}

@media screen and (max-width: 767px) {
  .wp-block-post-template.keen-slider:has(.ks-page) {
    width: 100%;
    overflow: hidden;
  }
}