/*
 * Fixes for the backend full site editor
 * This file is subject to change, depending on backend code changes.
 */

/* General HTML */
body {
  max-width: 100%;
}

.main {
  padding-top: var(--wp--style--root--padding-top);
  padding-bottom: var(--wp--style--root--padding-bottom);
}

.wp-block-freeform.block-library-rich-text__tinymce {
  a {
    color: var(--wp--preset--color--pastel-blue);
  }

  &:active,
  &:hover {
    color: var(--wp--preset--color--pastel-red);
  }

  blockquote {
    border-left: transparent;
  }
}

pre code {
  background-color: transparent;
}

input[type="color"],
input[type="date"],
input[type="datetime-local"],
input[type="datetime"],
input[type="email"],
input[type="month"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="text"],
input[type="time"],
input[type="url"],
input[type="week"],
select,
textarea {
  background-color: var(--almost-white);
  border: 1px solid var(--wp--preset--color--primary-semitransparent);
  border-radius: 0.5em;
}

textarea.editor-post-title__input:focus {
  background-color: transparent;
}
/* */

/* Layout */
.no-sidebar.wp-block-columns {
  margin-block-start: 0;
}

/* Header */
.header-column {
  z-index: 100;
}

.site-header .mxs-header {
  margin-top: 0;
}

.mxs-slide-down-header {
  z-index: 100 !important;
}
/* */

/* Navigation / Header Navigation */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__submenu-container,
.wp-block-navigation,
.wp-block-navigation .wp-block-page-list,
.wp-block-navigation__container.is-layout-flex,
.wp-block-navigation__responsive-container-content {
  gap: 0;
}

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

.wp-block-navigation.has-background {
  background-color: transparent !important;
}

.is-style-tabs .wp-block-navigation-item.has-background,
.is-style-wide-tab .wp-block-navigation-item,
.is-style-wide-tab .wp-block-navigation-item.has-background {
  background-color: transparent !important;
}

.is-style-wide-tab.is-vertical .wp-block-navigation-item {
  background-color: transparent;
}

.is-style-flat-nav.wp-block-navigation:not(.has-background) {
  background-color: var(--wp--preset--color--tertiary) !important;
}

a.wp-block-navigation-item__content {
  border-bottom: transparent;
}

.has-child {
  .wp-block-navigation-link .wp-block-navigation-link__content {
    border-radius: 0 0 0 16px;
    margin: 0;

    &:hover,
    &:active {
      background-color: var(--wp--preset--color--black) !important;
    }
  }
}

.is-style-tabs .open-on-click > .wp-block-navigation-item__content:first-child {
  border-top-right-radius: 0;
}

.wp-block-navigation:not(.is-style-flat-nav).has-background.has-accent-1-background-color,
.wp-block-navigation:not(.is-style-flat-nav).has-background.has-accent-2-background-color,
.wp-block-navigation:not(.is-style-flat-nav).has-background.has-accent-3-background-color,
.wp-block-navigation:not(.is-style-flat-nav).has-background.has-accent-4-background-color,
.wp-block-navigation:not(.is-style-flat-nav).has-background.has-accent-5-background-color,
.wp-block-navigation:not(.is-style-flat-nav).has-background.has-accent-6-background-color,
.wp-block-navigation:not(.is-style-flat-nav).has-background.has-accent-7-background-color,
.wp-block-navigation:not(.is-style-flat-nav).has-background.has-accent-8-background-color,
.wp-block-navigation:not(.is-style-flat-nav).has-background.has-text-dark-background-color,
.wp-block-navigation:not(.is-style-flat-nav).has-background.has-text-light-background-color {
  background-color: transparent !important;
}

.wp-block-search__button.wp-element-button {
  border-width: 1px;
  border-radius: 0.5em;
  color: var(--wp--preset--color--black);
  min-width: auto !important;
  padding: 0.25em 0.25em;
}

.wp-block-search__button-inside .wp-block-search__input {
  background-color: transparent;
  border: transparent;
}

.is-style-search-header .wp-block-search__button.wp-element-button {
  background-color: var(--almost-white) !important;
  border-color: var(--wp--preset--color--primary-semitransparent);
  padding: 0.25em 0.5em;
}

@media (min-width: 600px) {
  .is-style-wide-tab .wp-block-navigation-item .wp-block-navigation__container {
    background-color: transparent;
  }

  .wp-block-navigation__submenu-container {
    border-radius: 0 0 0 16px;
  }
}

@media (min-width: 1366px) {
  .wp-block-post-navigation-link:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }

  .wp-block-post-navigation-link:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }
}
/* */

/* Entry Meta */
.entry-meta.is-layout-flex {
  gap: 0.5rem;
}

/* Featured Image */
.wp-block-post-featured-image img {
  border-radius: 16px;
}
/* */

/* Blocks */
.wp-block-post-template > li {
  clear: both;
}

.wp-block-calendar {
  text-align: center;
}

.wp-block-calendar tbody td,
.wp-block-calendar th {
  padding: 0.25em;
}

.wp-block-calendar table:where(:not(.has-text-color)) td,
.wp-block-calendar table:where(:not(.has-text-color)) th {
  border-color: var(--medium-gray);
}

.wp-block-categories {
  ul {
    padding-left: 1rem;
  }
}

.wp-block-code {
  border: transparent;
}

.wp-block-cover.is-style-rounded,
.wp-block-cover.is-style-rounded-full {
  margin-left: var(--wp--style--root--padding-left);
  margin-right: var(--wp--style--root--padding-right);
}

.header-hero .wp-block-cover.is-style-rounded,
.header-hero .wp-block-cover.is-style-rounded-full {
  margin: 0 1.5em;
}

ul.wp-block-list .wp-block-list-item {
  > div {
    display: inline-block;
  }
}

.wp-block-pullquote {
  border-top: transparent;
  border-bottom: transparent;
}

.wp-block-query-pagination > .wp-block-query-pagination-next,
.wp-block-query-pagination > .wp-block-query-pagination-numbers,
.wp-block-query-pagination > .wp-block-query-pagination-previous {
  margin: 0;
}

.wp-block-quote {
  border-left: transparent;
}

.wp-block-site-title {
  color: var(--wp--custom--color--site-title-fg);
}

@media (min-width: 1366px) {
  .mxs-post-links.is-layout-flow .wp-block-post-navigation-link:first-child {
    margin-left: 20% !important;
  }

  .mxs-post-links.is-layout-flow .wp-block-post-navigation-link:last-child {
    margin-right: 20% !important;
  }

  .wp-block-query-pagination {
    margin: 0 auto !important;
  }
}
/* */

/* Style Book overrides */
.edit-site-style-book__example {
  .wp-block-navigation {
    .mxs-dark-theme-bg & {
      border-top: 1px solid var(--white-25pcnt);
      border-bottom: 1px solid var(--white-25pcnt);
    }

    .mxs-light-theme-bg & {
      border-top: 1px solid var(--black-25pcnt);
      border-bottom: 1px solid var(--black-25pcnt);
    }
  }

  .wp-block-archives,
  .wp-block-categories,
  .wp-block-list,
  .wp-block-page-list,
  .wp-block-rss {
    li {
      list-style-type: none;
    }

    li::before {
      margin-right: 0.5rem;
      vertical-align: middle;

      .mxs-dark-theme-bg & {
        content: url(../images/list-bullet-light.svg);
      }

      .mxs-light-theme-bg & {
        content: url(../images/list-bullet-dark.svg);
      }
    }
  }
}

/* Alignments */
.wp-block-cover.is-style-rounded,
.wp-block-cover.is-style-rounded-full {
  width: auto;
}

.wp-block-gallery.alignfull {
  margin-left: 3em !important;
  margin-right: 3em !important;
  width: calc(100% - 3em);
}

@media (min-width: 1366px) {
  .is-layout-constrained,
  .is-layout-flow {
    > .alignleft {
      margin-inline-start: 20% !important;
    }

    > .alignright {
      margin-inline-end: 20% !important;
    }

    > .wp-block-search.alignleft {
      margin-inline-start: 1.5em !important;
    }

    > .wp-block-search.alignright {
      margin-inline-end: 1.5em !important;
    }

    > .is-style-search-header.alignleft {
      margin-inline-start: 0 !important;
    }

    > .is-style-search-header.alignright {
      margin-inline-end: 0 !important;
    }
  }

  .wp-block-post-featured-image.alignleft {
    margin-left: 0;
  }

  .wp-block-post-featured-image.alignright {
    margin-right: 0;
  }
}
/* */
