/*
Theme Name:   Milwaukee Towing Child
Theme URI:    https://milwaukeetowing.com/
Description:  Astra child theme for Milwaukee Towing. Adds the call and text bars, the AutomotiveBusiness schema, the footer line, and a one click page importer under Tools.
Author:       Milwaukee Towing
Template:     astra
Version:      1.0.0
Text Domain:  milwaukee-towing-child
*/

/* Milwaukee Towing call and text bars.
   The bars print right after <body> (wp_body_open), above the Astra header.
   The free Astra header is not sticky, so the bars stick at the very top of
   the viewport (top: 0). The only offset needed is for the WordPress admin bar
   when an editor is logged in. */
.mt-notice-bars {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 9999;
  width: 100%;
  font-family: inherit;
}

.mt-call-bar,
.mt-text-bar {
  margin: 0;
  text-align: center;
}

.mt-call-bar {
  background: #b10f1c;
  color: #ffffff;
}

.mt-text-bar {
  background: #7e0b14;
  color: #ffffff;
}

.mt-call-bar a,
.mt-text-bar a {
  display: block;
  padding: 0.65rem 1rem;
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
}

.mt-call-bar a:hover,
.mt-call-bar a:focus,
.mt-text-bar a:hover,
.mt-text-bar a:focus {
  color: #ffffff;
  text-decoration: underline;
}

/* Admin bar offsets: 32px on desktop, 46px on tablets. At 600px and below the
   admin bar scrolls away with the page, so the bars go back to top: 0. */
body.admin-bar .mt-notice-bars {
  top: 32px;
}

@media screen and (max-width: 782px) {
  body.admin-bar .mt-notice-bars {
    top: 46px;
  }
}

@media screen and (max-width: 600px) {
  body.admin-bar .mt-notice-bars {
    top: 0;
  }
  .mt-call-bar a,
  .mt-text-bar a {
    font-size: 0.95rem;
    padding: 0.7rem 0.75rem;
  }
}

/* Keep jump links from landing under the sticky bars. */
html {
  scroll-padding-top: 100px;
}

/* Long dropdowns: scroll inside the menu instead of running off the screen.
   Desktop only (Astra switches to the mobile header at 921px). */
@media (min-width: 922px) {
  .main-header-menu .menu-item:hover > .sub-menu,
  .main-header-menu .menu-item.focus > .sub-menu,
  .main-header-menu .menu-item:focus-within > .sub-menu,
  .main-header-menu .menu-item > .sub-menu.toggled-on {
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
  }
}

/* Call link in the main menu, styled as a solid red button. */
.main-header-menu .menu-item.mt-menu-call > .menu-link,
.ast-builder-menu .menu-item.mt-menu-call > .menu-link {
  background: #b10f1c;
  color: #ffffff !important;
  font-weight: 700;
  border-radius: 4px;
  line-height: 1.2;
  padding: 0.6rem 1rem;
}

.main-header-menu .menu-item.mt-menu-call > .menu-link:hover,
.main-header-menu .menu-item.mt-menu-call > .menu-link:focus,
.ast-builder-menu .menu-item.mt-menu-call > .menu-link:hover,
.ast-builder-menu .menu-item.mt-menu-call > .menu-link:focus {
  background: #7e0b14;
  color: #ffffff !important;
}

@media (min-width: 922px) {
  /* The menu labels are the full page titles, so tighten the spacing a little
     to keep the desktop menu on one line where the screen allows. */
  #ast-desktop-header .main-header-menu > .menu-item > .menu-link {
    padding-left: 0.5em;
    padding-right: 0.5em;
    font-size: 14px;
  }
  #ast-desktop-header .main-header-menu {
    justify-content: flex-end;
  }
  #ast-desktop-header .main-header-menu .sub-menu {
    width: 290px;
  }
  #ast-desktop-header .main-header-menu > .menu-item.mt-menu-call {
    display: flex;
    align-items: center;
    margin-left: 0.5rem;
  }
  #ast-desktop-header .main-header-menu > .menu-item.mt-menu-call > .menu-link {
    height: auto;
    line-height: 1.2;
    padding: 0.6rem 1rem;
  }
}

@media (max-width: 921px) {
  .main-header-menu .menu-item.mt-menu-call > .menu-link,
  .ast-builder-menu .menu-item.mt-menu-call > .menu-link {
    display: block;
    text-align: center;
    margin: 0.75rem 1rem;
  }
}

/* Footer line */
.mt-footer-line a {
  text-decoration: underline;
}
.mt-footer-fallback {
  text-align: center;
  padding: 1rem;
}

/* Solid desktop dropdowns so page text never shows through. */
.main-header-menu .sub-menu,
.ast-builder-menu .main-header-menu .sub-menu,
#ast-desktop-header .main-header-menu .sub-menu {
  background: #ffffff;
  opacity: 1;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.main-header-menu .sub-menu .menu-item > .menu-link,
.ast-builder-menu .main-header-menu .sub-menu .menu-item > .menu-link {
  color: #1a1a1a;
  background: #ffffff;
}

.main-header-menu .sub-menu .menu-item > .menu-link:hover,
.main-header-menu .sub-menu .menu-item > .menu-link:focus,
.main-header-menu .sub-menu .menu-item.current-menu-item > .menu-link {
  color: #b10f1c;
  background: #f5f5f5;
}

/* Space around button groups so they do not sit on the next heading. */
.entry-content .wp-block-buttons {
  margin-top: 1.25em;
  margin-bottom: 2em;
}

/* Blog page heading */
.mt-blog-heading {
  margin: 0 0 1.5em;
}
