/*
Theme Name: Modu Base
Author: WebModu
Requires at least: 6.5. 
*/

.chevron-list {
  display: flex;
  flex-direction: column;
  gap: 8px;

  & a {
    text-decoration: none !important;
    color: inherit !important;
  }

  & li::marker {
    content: "› ";
    font-size: 2rem;
    line-height: 1;
  }
}

/* BUTTON */

html {
  scroll-behavior: smooth;
}

.wp-block-button__link,
.webmodu-form__submit {
  transition: background-color 0.1s;
  box-sizing: border-box;
  
  &:hover {
    outline: 2px solid black;
    background-color: white !important;
    color: black !important;
  }
}

/* RESPONSIVE */

.mobile-bg-none {
  @media (max-width: 781px) {
    background: none !important;
  }
}

.tablet-bg-none {
  @media (max-width: 1100px) {
    background: none !important;
  }
}

.mobile-col-reverse {
  @media (max-width: 781px) {
    flex-direction: column-reverse;
  }
}

.tablet-col-reverse {
  @media (max-width: 1100px) {
    flex-direction: column-reverse;
  }
}

/* UTIL */

.flex {
  display: flex !important;
}

.col-reverse {
  flex-direction: column-reverse !important;
}

.skiplink {
  position: absolute;
  top: -100%;
  left: 0;
  width: 100dvw;
  padding: 1rem 0;
  background-color: var(--wp--preset--color--black);
  color: var(--wp--preset--color--white);
  text-align: center;
  z-index: 1000;
  opacity: 0;

  &:focus {
    top: 0;
    opacity: 1;
  }
}

body.logged-in {
  #to-content {
    margin-top: 32px;
  }
}

.in-between {
  transform: translateX(-50%);
  z-index: 1000;
}

@layer webmodu-base {
  /* STYLE */

  .glass {
    backdrop-filter: blur(5px);
    box-shadow:
      -0.1em -0.1em 0.1em #0002,
      0.1em 0.2em 0.2em #0006,
      0.2em 0.4em 0.4em #0006;
    text-shadow: 0 0 1rem rgba(0, 0, 0, 0.2);
  }

  /* UTIL */

  .w-full {
    width: 100%;
  }

  .h-full {
    height: 100%;
  }

  .mb-auto {
    margin-bottom: auto;
  }

  .mt-auto {
    margin-top: auto;
  }

  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
  }

  /* CAROUSEL */

  .webmodu-carousel {
    display: flex;
    align-items: center;
    flex-direction: column;
    overflow: hidden;
    gap: 1rem;
    padding-block: 1rem;
    height: max-content;
  }

  .webmodu-carousel__container {
    width: 100%;
    position: relative;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    height: max-content;
    scroll-snap-type: x mandatory;

    scroll-behavior: smooth;

    @media prefers-reduced-motion {
      scroll-behavior: auto;
    }

    scrollbar-width: none;
    -ms-overflow-style: none;
    &::-webkit-scrollbar {
      display: none;
      width: 0;
      height: 0;
    }
  }

  .webmodu-carousel__body {
    display: flex;
    justify-content: center;
    margin: 0 !important;
    width: 4000px;
    align-items: stretch;
    gap: 1rem;

    & img {
      /* all: unset !important; */
      object-fit: cover;
      /* height: 100% !important; */
      overflow: hidden;
    }

    & > *:not(.webmodu-carousel__control) {
      max-width: 100dvw !important;
      flex-basis: unset !important;
      scroll-snap-align: center;
      margin-top: 0 !important;
      overflow: hidden;
    }
  }

  .webmodu-carousel__controls {
    margin: 0 auto;
    display: flex;
    gap: 8px;
    align-items: center;

    & > button {
      color: black;
      background: transparent;
      padding: 8px;
      border-radius: 4px;
      border: 2px solid black;
      cursor: pointer;
      aspect-ratio: 1/1;
      width: 50px;
      height: auto;

      &:focus,
      &:hover {
        background-color: black;
        color: white;
      }
    }
  }

  /* FORM */

  :root {
    --webmodu-input-height: 36px;
  }

  .webmodu-form__input-label {
    display: block;
    font-size: 1rem;
  }

  .webmodu-form__input {
    margin: 0;
    border: 0;
    box-sizing: border-box;
    background-color: unset;
    padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--20);
    color: unset;
    font-size: 1rem;
    min-height: var(--webmodu-input-height);
    line-height: normal;
    margin-top: 0;
  }

  .webmodu-form__textarea {
    height: 200px;
    font-size: 1rem;
    resize: none;
    min-height: var(--webmodu-input-height);
  }

  .webmodu-form__submit {
    background-color: var(--wp--preset--color--brand-300);
    color: var(--wp--preset--color--black);
    border: 0;
    line-height: normal;
    font-size: 1rem;
    cursor: pointer;
    min-height: var(--webmodu-input-height);
  }

  .webmodu-form__response {
    box-sizing: border-box;
    padding: var(--wp--preset--spacing--40) var(--wp--preset--spacing--30);

    &.hidden {
      display: none;
    }
  }
}
