/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Add padding to elements with background color */
.has-background,
[class*="wp-block-"][class*="is-style-section-"],
.wp-block-cover {
  padding: var(--wp--custom--global--spacing--padding--background);
  border-radius: var(--wp--custom--global--border--radius--base);
}

/* Prevent adjacent alignfull blocks from having a margin-top */
.wp-site-blocks > *,
.is-root-container.wp-site-blocks > *,
.alignfull + .alignfull {
  margin-top: 0;
}

/* Prevent padding from affecting the layout */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Add stretched link class name */
.has-stretched-link {
  position: relative;
}

.has-stretched-link a:not(.wp-element-button):before {
  content: "";
  display: block;
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Make gradients compatible with small screens */
@media (max-width: 782px) {
  .wp-block-cover.has-custom-content-position.is-position-bottom-center
    .wp-block-cover__background.has-dark-to-transparent-gradient-background,
  .wp-block-cover.has-custom-content-position.is-position-bottom-center
    .wp-block-cover__background.has-transparent-to-dark-gradient-background {
    background: linear-gradient(
      to top,
      rgba(0, 0, 0, 1),
      rgba(0, 0, 0, 0)
    ) !important;
  }
  .wp-block-cover:not(.has-custom-content-position)
    .wp-block-cover__background.has-dark-to-transparent-gradient-background,
  .wp-block-cover:not(.has-custom-content-position)
    .wp-block-cover__background.has-transparent-to-dark-gradient-background {
    background: rgba(0, 0, 0, 0.2) !important;
  }
}

/* GDPR Consent */
div#gdprc_bar {
  padding-top: var(--wp--preset--spacing--60);
  padding-bottom: var(--wp--preset--spacing--60);
  z-index: 1000;
  border-top: 5px solid var(--wp--preset--color--primary);
  background-color: var(--wp--preset--color--base-variant);
  &::before {
    content: "";
    display: block;
    width: 40%;
    height: 100%;
    background-size: 100%;
    background-image: url(../svg/logo-dots-white.svg);
    background-position: right top;
    background-repeat: no-repeat;
    position: absolute;
    top: 0;
    right: 0;
    z-index: -1;
  }
}


#gdprc_bar .container .gdprc_actions .gdprc_button,
#gdprc_settings .gdprc_actions .gdprc_button {
  display: flex;
  align-items: center;
  gap: 0;
  overflow: hidden;
  background-color: var(--wp--preset--color--primary);
  border-radius: var(--wp--custom--global--border--radius--button);
  border-width: 0;
  color: var(--wp--preset--color--base);
  font-family: var(--wp--custom--global--typography--font-family--button);
  font-size: var(--wp--preset--font-size--medium);
  font-weight: 600;
  line-height: 1.4;
  padding-top: 15px;
  padding-right: 30px;
  padding-bottom: 15px;
  padding-left: 30px;
  text-decoration: none;

  &:hover {
    background-color: var(--wp--preset--color--secondary);
  }
}

#gdprc_bar .container .gdprc_actions .gdprc_button:before,
#gdprc_settings .gdprc_actions .gdprc_button:before,
#gdprc_bar .container .gdprc_actions .gdprc_button:after,
#gdprc_settings .gdprc_actions .gdprc_button:after {
    content: "\e914";
    font-family: "icomoon" !important;
    width: calc(28px + 15px);
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease-in-out;
    font-size: var(--wp--preset--font-size--large);
    font-weight: 100;
}

#gdprc_bar .container .gdprc_actions .gdprc_button:after,
#gdprc_settings .gdprc_actions .gdprc_button:after {
    margin-left: auto;
    padding-left: 15px;
}

#gdprc_bar .container .gdprc_actions .gdprc_button:before,
#gdprc_settings .gdprc_actions .gdprc_button:before {
    margin-left: calc(-28px - 15px);
    opacity: 0;
    padding-right: 15px;
    transform: translateX(-28px);
}

#gdprc_bar .container .gdprc_actions .gdprc_button:hover:before,
#gdprc_settings .gdprc_actions .gdprc_button:hover:before {
    opacity: 1;
    margin-left: 0;
    transform: translateX(0);
}

#gdprc_bar .container .gdprc_actions .gdprc_button:hover:after,
#gdprc_settings .gdprc_actions .gdprc_button:hover:after {
    opacity: 0;
    margin-right: calc(-28px - 15px);
    transform: translateX(28px);
}

div#gdprc_settings {
  border: none;
  border-top: 5px solid var(--wp--preset--color--primary);
}

div#gdprc_settings .gdprc_items {
  border-left: 1px solid var(--wp--preset--color--base-variant);
  border-right: 1px solid var(--wp--preset--color--base-variant);
}

#gdprc_settings .gdprc_header__title {
  font-size: var(--wp--preset--font-size--large);
}

#gdprc_settings .gdprc_header__subtitle {
  line-height: inherit;
}

#gdprc_settings .gdprc_item__toggle__wrapper {
  width: auto;
  right: 0;
}

#gdprc_settings .gdprc_item__toggle__wrapper > label {
  border-radius: 32px;
  width: 51px;
  height: 31px;

  &::after {
    width: 27px;
    height: 27px;
    top: 2px;
    left: 2px;
    border-radius: 50%;
    background: var(--wp--preset--color--base);
    box-shadow: 0 3px 8px 0 rgba(0, 0, 0, .15), 0 3px 1px 0 rgba(0, 0, 0, .06);
  }
}

div#gdprc_settings .gdprc_item__toggle__wrapper input[type=checkbox]:checked:not(:disabled) + label {
  background-color: var(--wp--preset--color--primary);
  border-color: var(--wp--preset--color--primary);
}

div#gdprc_settings .gdprc_item__toggle__wrapper input[type=checkbox]:checked+label:after {
  transform: translateX(20px);
}

div#gdprc_bar .gdprc_link,
div#gdprc_bar .gdprc_link:not(.gdprc_item__link):hover,
div#gdprc_settings .gdprc_link,
div#gdprc_settings .gdprc_link:not(.gdprc_item__link):hover {
  color: var(--wp--preset--color--primary);
}
