/* =========================================================
   Astra Theme: Mobile Logo/Title + Equal Button Widths
   Only these two changes.
========================================================= */

:root {
  /* Increase this if your longest button text does not fit */
  --phc-button-width: 320px;

  /* Mobile header sizing */
  --phc-mobile-logo-width: 52px;
  --phc-mobile-title-size: 18px;
}

/* =========================================================
   1. Make buttons equal length
   Applies to normal content/footer buttons, not menu buttons.
========================================================= */

.site-content .wp-block-button__link,
.site-content .wp-element-button,
.site-content .ast-button,
.site-content a.button,
.site-content input[type="submit"],
.site-footer .wp-block-button__link,
.site-footer .wp-element-button,
.site-footer .ast-button,
.site-footer a.button,
.site-footer input[type="submit"] {
  width: var(--phc-button-width) !important;
  max-width: calc(100vw - 32px) !important;
  box-sizing: border-box !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  text-align: center !important;
  line-height: 1.2 !important;
  white-space: normal !important;
}

/* =========================================================
   2. Astra mobile logo/title fix
========================================================= */

@media (max-width: 921px) {

  /* Prevent left header area from overlapping the menu button */
  .ast-header-break-point .ast-builder-grid-row.ast-builder-grid-row-has-sides {
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
  }

  .ast-header-break-point .site-header-primary-section-left,
  .ast-header-break-point .site-header-section-left,
  .ast-header-break-point .ast-builder-layout-element[data-section="title_tagline"] {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  /* Keep logo and title aligned neatly */
  .ast-header-break-point .site-branding,
  .ast-header-break-point .ast-site-identity,
  .ast-mobile-header-wrap .site-branding,
  .ast-mobile-header-wrap .ast-site-identity {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    min-width: 0 !important;
    max-width: calc(100vw - 85px) !important;
  }

  /* Logo container */
  .ast-header-break-point .site-logo-img,
  .ast-header-break-point .custom-logo-link,
  .ast-mobile-header-wrap .site-logo-img,
  .ast-mobile-header-wrap .custom-logo-link {
    width: var(--phc-mobile-logo-width) !important;
    max-width: var(--phc-mobile-logo-width) !important;
    flex: 0 0 var(--phc-mobile-logo-width) !important;
  }

  /* Actual logo image */
  .ast-header-break-point .site-branding img,
  .ast-header-break-point .custom-logo-link img,
  .ast-header-break-point .site-logo-img img,
  .ast-header-break-point img.custom-logo,
  .ast-mobile-header-wrap .site-branding img,
  .ast-mobile-header-wrap .custom-logo-link img,
  .ast-mobile-header-wrap .site-logo-img img,
  .ast-mobile-header-wrap img.custom-logo,
  .ast-mobile-header-wrap .astra-logo-svg {
    width: var(--phc-mobile-logo-width) !important;
    max-width: var(--phc-mobile-logo-width) !important;
    height: auto !important;
    max-height: var(--phc-mobile-logo-width) !important;
    object-fit: contain !important;
  }

  /* Remove Astra's extra spacing beside inline logo */
  .ast-logo-title-inline .site-logo-img {
    padding-right: 0 !important;
  }

  /* Title wrapper */
  .ast-header-break-point .ast-site-title-wrap,
  .ast-mobile-header-wrap .ast-site-title-wrap {
    min-width: 0 !important;
    max-width: calc(100vw - var(--phc-mobile-logo-width) - 100px) !important;
    flex: 1 1 auto !important;
  }

  /* Site title */
  .ast-header-break-point .site-title,
  .ast-header-break-point .site-title a,
  .ast-mobile-header-wrap .site-title,
  .ast-mobile-header-wrap .site-title a {
    font-size: var(--phc-mobile-title-size) !important;
    line-height: 1.12 !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    hyphens: none !important;
  }

  /* If you use a tagline/site description */
  .ast-header-break-point .site-description,
  .ast-mobile-header-wrap .site-description {
    font-size: 12px !important;
    line-height: 1.15 !important;
    margin: 0 !important;
  }

  /* Keep mobile menu button from being squeezed */
  .ast-header-break-point .site-header-primary-section-right,
  .ast-mobile-header-wrap .site-header-primary-section-right {
    flex-shrink: 0 !important;
  }
}

/* Extra-small phones */
@media (max-width: 380px) {
  :root {
    --phc-mobile-logo-width: 46px;
    --phc-mobile-title-size: 16px;
  }
}
/* Prevent wrapping on one specific button */
.phc-nowrap-button .wp-block-button__link,
.phc-nowrap-button .wp-element-button {
  white-space: nowrap !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}
@media only screen and (max-width: 767px) {
  body.home .wp-block-uagb-container.uagb-block-d9a7b1dc {
    min-height: 240px !important;
    height: 240px !important;
    max-height: 240px !important;
    padding-top: 0px !important;
    padding-bottom: 0px !important;
    overflow: hidden !important;
    background-size: cover !important;
    background-position: center center !important;
  }

  body.home .wp-block-uagb-container.uagb-block-d9a7b1dc .uagb-container-inner-blocks-wrap {
    min-height: 0 !important;
    height: 100% !important;
    max-height: 240px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  body.home .wp-block-uagb-container.uagb-block-d9a7b1dc .wp-block-spacer {
    height: 10px !important;
  }
}
