/*
theme name:   ollie child
theme uri:    https://olliewp.com
description:  a child theme for ollie.
author:       olliewp
author uri:   http://example.com
template:     ollie
version:      10
license:      gnu general public license v2 or later
license uri:  http://www.gnu.org/licenses/gpl-2.0.html
tags:         tags: blog, portfolio, entertainment
text domain:  ollie
*/

html {
  --global-header-height: 80px;
  scroll-behavior: smooth;
}

/* Header */
header.global-header {
  height: var(--global-header-height);
  place-content: center;
}

@media (min-width: 767px) {
  .wp-block-navigation-item.has-child .wp-block-navigation__submenu-container {
    min-width: max-content !important;
  }
}

.wp-block-navigation .has-child .wp-block-navigation__submenu-container {
  padding-inline: 0 !important;
}

.wp-block-navigation-item__content {
  padding-inline: 0;
}

html.has-modal-open .global-header {
  left: 0;
  position: fixed;
  right: 0;
  z-index: 9999;

  & .is-menu-open {
    top: calc(0px + var(--wp-admin--admin-bar--height, 0px));
    & .wp-block-navigation__responsive-dialog {
      margin-top: 0;

      & .wp-block-navigation__responsive-container-close {
        background-color: transparent;
      }
    }

    /* & .wp-block-navigation__container > .wp-block-navigation-item > a {
    } */
  }
}

body.page div.entry-content {
  margin-block-start: 0;
}

.entry-content li.wp-block-post {
  margin-bottom: 0;
}
/* Buttons */
.wp-block-buttons {
  @media (max-width: 767px) {
    display: flex;
    flex-direction: column;
    gap: 1rem;

    .wp-block-button {
      width: 100%;
    }
    .wp-block-button__link {
      padding-block: 0.75rem;
    }
  }
}

/* Homepage banner */
.homepage-banner-image img {
  height: 400px;
  object-fit: contain !important;

  @media (max-width: 767px) {
    height: 250px;
    width: calc(100vh + (var(--wp--preset--spacing--medium) * 2));
  }
}

/* Tables */
figure.wp-block-table {
  max-width: var(--wp--style--global--wide-size);

  table {
    table-layout: auto !important;
  }

  @media (max-width: 1024px) {
    max-width: 100%;
    overflow-x: auto;

    /* Slim scrollbar styles */
    scrollbar-width: thin;
    scrollbar-color: #bbb #f5f5f5;

    &::-webkit-scrollbar {
      height: 8px;
      background: #f5f5f5;
    }
    &::-webkit-scrollbar-thumb {
      background: #bbb;
      border-radius: 4px;
    }

    table {
      display: block;
      width: 100%;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;

      /* Slim scrollbar for table */
      scrollbar-width: thin;
      scrollbar-color: var(--wp--preset--color--main)
        var(--wp--preset--color--main-accent);

      &::-webkit-scrollbar {
        height: 8px;
        background: var(--wp--preset--color--main-accent);
      }
      &::-webkit-scrollbar-thumb {
        background: var(--wp--preset--color--main);
        border-radius: 4px;
        border: 2px solid var(--wp--preset--color--border-light);
      }
      &::-webkit-scrollbar-track {
        background: var(--wp--preset--color--main-accent);
      }
    }
  }

  th {
    white-space: nowrap;
  }
  td,
  th {
    min-width: 100px;
    width: auto;
  }
}

/* Seperator */
.wp-block-separator {
  height: 1px;
  border-top: 1px !important;
}

/* Math Example */
.is-style-math-example {
  background-color: var(--wp--preset--color--tertiary);
  padding: 1.25em 2.375em;
  border-radius: 1.24rem;
}

/* Check list */
ul.is-style-list-check-circle li:before {
  background: var(--wp--preset--color--tertiary);
  color: var(--wp--preset--color--main) !important;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  top: -2px;
}
ul.is-style-list-check li:before {
  color: var(--wp--preset--color--primary);
}

/* Posts */
.post-title-head {
  @media (max-width: 767px) {
    .wp-block-post-featured-image {
      max-width: 50px;
    }
  }
}

/* Mxn mods */
.is-style-blur-image-less > .wp-block-cover__image-background {
  filter: blur(15px) !important;
}

.is-style-full-width {
  & img {
    width: 100%;
  }
}

/* Sub Heading */
.is-style-sub-heading {
  color: var(--wp--preset--color--primary);
  font-weight: 600;
  font-size: var(--wp--preset--font-size--base);
}

/* Footer */
footer {
  & a {
    text-decoration: none;
  }
  & a:hover {
    text-decoration: underline;
  }
}

/* Single pot */
.single-post-columns .wp-block-group.has-global-padding {
  padding-inline: 0;
}

/* ==========================================================================
	Form styles
	========================================================================= */
.wpcf7-form {
  --spacing: var(--wp--preset--spacing--medium);
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing);
}
.wpcf7-form .form-field {
  position: relative;
  display: flex;
  flex-direction: column;
}
.wpcf7-form .form-field input,
.wpcf7-form .form-field textarea {
  width: 100%;
  padding-top: 1.5rem;
  padding-bottom: 0.5rem;
  padding-inline: 1rem;
}
.wpcf7-form .form-field input:focus-visible,
.wpcf7-form .form-field textarea:focus-visible {
  outline-color: var(--wp--preset--color--primary);
}
.wpcf7-form .form-field .wpcf7-not-valid-tip {
  position: absolute;
  font-size: 12px;
  top: calc(100% + 0.5rem);
  padding-left: 0.5rem;
}

.wpcf7-form .form-field label {
  --label-height: 20px;
  position: absolute;
  top: calc(0px + var(--label-height) / 1.1);
  left: 1rem;
  z-index: 1;
  display: flex;
  align-items: center;
  height: var(--label-height);
  transition: all 0.2s ease-in-out;
}

.wpcf7-form .form-field.focus label {
  top: 0.3rem;
  font-size: 80%;
}

.wpcf7-form .form-field.form-half {
  width: calc(50% - (var(--spacing) / 2));
}
.wpcf7-form .form-field.form-full {
  width: 100%;
}

@media (max-width: 767px) {
  .wpcf7-form {
    --spacing: var(--wp--preset--spacing--medium);
  }
  .wpcf7-form .form-field.form-half {
    width: 100%;
  }
}

/* Popup Styling */
.popup-outer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0 0 0 / 30%);

  .popup-close {
    cursor: pointer;
    position: absolute;
    top: 1rem;
    right: 2rem;
    background: none;
    border: none;
    box-shadow: none;
    font-size: 2rem;
    padding: 0;
    line-height: 1;
  }

  .popup-inner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 900px;
    background-color: #ffffff;
    border-radius: 2rem;
    padding: 1rem 2rem 3rem 2rem;
    display: grid;
    grid-template-columns: 30% 1fr;
    gap: 1rem;
    align-items: center;

    & img {
      position: relative;
      top: 1.24rem;
    }
  }

  @media (max-width: 900px) {
    .popup-inner {
      max-width: calc(100vw - 2rem);
    }
  }

  @media (max-width: 767px) {
    .popup-inner {
      grid-template-columns: 1fr;
      gap: 0.5rem;

      & img {
        position: static;
        width: 100%;
        max-width: 180px;
        margin-inline: auto;
        top: 0;
      }
    }
  }

  h2 {
    font-size: var(--wp--preset--font-size--large);
  }

  .popup-content {
    width: 100%;
    max-width: 600px;
    margin-inline: auto;
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
  }

  .popup-text {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
  }
}
