/*
Theme Name: SEARCH Homeless Services
Theme URI:
Author: 5+8
Author URI:
Description: Custom Wordpress block theme for SEARCH Homeless Services
Requires at least: 6.8
Tested up to: 7.1.3
Requires PHP: 5.7+
Version:  1.2.2
License: Unlicensed
Text Domain: shs
Tags: wordpress, block theme
*/

html {
  font-size: 20px;
  scroll-behavior: smooth;
  text-underline-offset: 0.15em;
}

body .wp-block-navigation__responsive-container-open:not(.always-shown) {
  display: block !important;
}
body .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
  display: none !important;
}

nav.header-nav {
  justify-content: right;
}

@media (min-width: 1080px) {
  body .wp-block-navigation__responsive-container-open:not(.always-shown) {
    display: none !important;
  }
  body .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
    display: block !important;
  }

  nav.header-nav {
    justify-content: left;

    ul.header-nav > li.wp-block-navigation-item {
      padding-top: 1em;
      padding-bottom: 1em;
      > a {
        transform: color 0.3s ease-in-out;
        &:hover {
          color: var(--wp--preset--color--light-blue);
        }
      }
    }

    .wp-block-navigation-submenu > li {
      font-size: 0.85em !important;
      transition: all 0.3s ease-in-out;
      &:hover {
        background-color: var(--wp--preset--color--teal-blue);
        color: white;
      }
    }
  }
}

.wp-block-navigation .wp-block-navigation-item.home-link {
  .home & {
    display: none;
  }

  @media screen and (min-width: 1080px) {
    display: none;
  }
}

.wp-block-button__link {
  transition: all 0.3s ease;
  &:hover {
    background-color: var(--wp--preset--color--light-blue);
  }
  &.has-light-blue-background-color:hover,
  .has-light-blue-background-color &:hover {
    background-color: white !important;
    color: var(--wp--preset--color--teal-blue) !important;
  }
}

ul.wp-block-list li + li,
ol.wp-block-list li + li {
  margin-top: 0.5em;
}

.hide {
  display: none !important;
}

.clicker {
  cursor: pointer;
  user-select: none;
}

.text-balance {
  text-wrap: balance;
}

@media screen and (max-width: 781px) {
  .mobile-centered {
    text-align: center !important;
  }
}

.wp-block-separator.is-style-thin {
  border-top-width: 1px;
}

.large-gap.wp-block-media-text {
  column-gap: 4em;
}

.home-hero {
  h1 {
    font-size: 8.4vw;
    text-wrap: balance;
    @media screen and (min-width: 1080px) {
      font-size: 90px;
    }
  }
}

@media screen and (min-width: 601px) {
  .wp-block-media-text.offset-image:not(.has-media-on-the-right) {
    min-height: 600px;
    position: relative;
    figure {
      height: 100%;
      img {
        position: relative;
        left: -5vw;
        height: 100%;
        width: 100%;
        object-fit: contain;
      }
    }
    &.image-bottom {
      figure {
        bottom: 0;
      }
    }
  }

  .wp-block-media-text.offset-image.has-media-on-the-right {
    figure {
      width: 50%;
      position: absolute;
      bottom: 0;
      right: -5vw;
    }
  }
}

@media screen and (max-width: 781px) {
  .wp-block-columns.mobile-reversed {
    .wp-block-column:nth-child(1n) {
      order: 2;
    }
    .wp-block-column:nth-child(2n) {
      order: 1;
    }
  }
}

@media screen and (min-width: 782px) {
  .wp-block-columns.offset-image > .wp-block-column {
    figure img {
      position: relative;
    }

    &:first-child figure img {
      left: -6vw;
    }

    &:nth-child(2) figure img {
      right: -6vw;
    }
  }

  .sticky-column {
    position: sticky;
    top: 1.5rem;
  }
}

h2.text-over {
  font-size: 1.5rem;
  align-items: center;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  line-height: 1;
  text-align: center;
  strong {
    display: block;
    font-size: 20vw;
    line-height: 1.2;
  }

  @media screen and (min-width: 1000px) {
    text-align: left;
    display: flex;
    gap: 1em;
    margin-bottom: -0.32em;
    strong {
      font-size: 7rem;
      line-height: 1;
    }
  }
}

div.boxed {
  position: relative;
  border: 3px solid var(--wp--preset--color--teal-blue);
  padding: 3rem 6vw;
  text-align: center;
  h2 {
    margin-top: 0;
  }
  .label {
    position: absolute;
    top: 0;
    color: var(--wp--preset--color--teal-blue);
    text-transform: uppercase;
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--wp--preset--color--base);
    transform: translate(-50%, -50%);
    padding: 0 0.5em;
    left: 50%;
    line-height: 1;
    letter-spacing: 0.2em;
    section.has-cream-background-color & {
      background: var(--wp--preset--color--cream);
    }
  }
}

.help-grid {
  @media screen {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
  @media screen and (min-width: 651px) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  @media screen and (min-width: 1001px) {
    grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
  }

  .hover-scale:hover {
    transform: scale(1.1);
    z-index: 1;
    figcaption {
      opacity: 1;
    }
  }

  figure {
    box-sizing: border-box;
    position: relative;
    min-height: 10rem;
    padding: 1rem;
    figcaption {
      margin: 0;
      font-size: 1.5rem;
      color: var(--wp--preset--color--teal-blue);
      font-weight: 700;
      opacity: 0.77;
      transition: opacity 300ms ease-in-out;
    }
    > a,
    > img {
      position: absolute;
      bottom: 1rem;
      right: 1rem;
    }
    img {
      height: 5rem;
      max-height: 4rem;
      max-width: 4rem;
    }
  }
}

.wp-block-cb-carousel-v2 {
  .cb-button-prev,
  .cb-button-next {
    width: 3rem;
    height: 3rem;
    translate: 0 -50%;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    color: white;
    border: 1px solid white;
    transition: background 300ms ease-in-out;
    &:after {
      color: white;
      font-size: 1.7em;
    }

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

  .wp-block-image img {
    width: 100%;
    height: auto;
  }

  &.video-carousel .swiper-slide {
    transition:
      scale 300ms ease-in-out,
      filter 300ms ease-in-out;
    &:not(.swiper-slide-active) {
      pointer-events: none;
      scale: 0.95;
      filter: brightness(0.5);
    }
  }
}

.hover-caption {
  position: relative;
  figcaption {
    opacity: 0;
    transition: opacity 300ms ease-in-out;

    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    margin: 0;
    padding: 1rem;
    color: var(--wp--preset--color--base);

    background-color: var(--wp--preset--color--light-blue);

    font-size: 0.85rem;
    text-align: center;
    text-wrap: balance;
    text-wrap: pretty;

    display: flex;
    align-items: center;
    justify-content: center;
  }
  &:hover {
    figcaption {
      opacity: 1;
    }
  }
}

.hover-stack {
  position: relative;
  figure {
    max-width: 130px;
    height: 130px;
    img {
      max-width: 100%;
      max-height: 100%;
    }
  }
  > div {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity 300ms ease-in-out;
    padding: 1em;
    background: var(--wp--preset--color--light-blue);
    justify-content: center;
    text-wrap: balance;
    text-wrap: pretty;
  }
  &:hover div {
    opacity: 1;
  }

  .wp-block-button .wp-block-button__link {
    background: var(--wp--preset--color--base);
    color: var(--wp--preset--color--light-blue);
    &:hover {
      background: var(--wp--preset--color--teal-blue);
      color: var(--wp--preset--color--base);
    }
  }
}

.hover-scale {
  transition: transform 300ms ease-in-out;
  &:hover {
    transform: scale(1.05);
  }
}

.giant-text {
  font-size: 5em;
  letter-spacing: initial;
  vertical-align: middle;
  line-height: 1;
  + span {
    vertical-align: middle;
    margin-top: 1em;
    display: inline-block;
  }

  @media screen and (max-width: 781px) {
    font-size: 22vw;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0px, 0px, 0px, 0px);
  white-space: nowrap;
  border-width: 0px;
}

mark.padded {
  padding-left: 0.25em;
  padding-right: 0.25em;
}

.because-column {
  position: relative !important;
  padding-top: 4em !important;
  padding-bottom: 4.5em !important;
  margin: 0 !important;
  text-wrap: balance;
  figure {
    position: absolute !important;
    top: 0;
    left: 50%;
    translate: -50% -50%;
  }
}

.value-row {
  figure {
    width: 135px;
    height: auto;
  }
}

.program-grid {
  column-gap: 2%;
  row-gap: 2em;
  justify-content: center;
  h3 {
    font-size: 1.2em !important;
  }
  > * {
    flex-basis: 32%;
  }

  figure,
  img {
    width: 100%;
    height: auto;
  }

  @media (max-width: 768px) {
    > * {
      flex-basis: 45%;
    }
  }
  @media (max-width: 480px) {
    > * {
      flex-basis: 100%;
    }
  }
}

.item-listing {
  gap: 0;

  > * {
    display: block;
    width: 100%;
    margin: 0;
    padding-top: var(--wp--preset--spacing--50);
    padding-bottom: var(--wp--preset--spacing--50);
    border-bottom: 1px solid var(--wp--preset--color--light-blue);

    &:first-child {
      padding-top: 0;
    }

    &:last-child {
      padding-bottom: 0;
      border-bottom: none;
    }
  }
}

.happening-listing > div {
  padding-top: var(--wp--preset--spacing--60);
  padding-bottom: var(--wp--preset--spacing--60);
  border-bottom: 2px solid var(--wp--preset--color--light-blue);
  width: 100%;

  &:first-child {
    padding-top: 0;
  }
}

details {
  --icon-size: 0.8rem;
  --icon-line-width: 2px;

  padding-bottom: 1.3em;
  border-bottom: 1px solid rgba(0, 0, 0, 0.3);

  summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1em;
    position: relative;
    /*& > *:first-child {
      flex-basis: 600px;
      text-wrap: balance;
    }*/
  }

  summary::marker,
  summary::-webkit-details-marker {
    content: "";
    display: none;
  }

  summary::before,
  summary::after {
    content: "";
    flex-shrink: 0;
    display: block;
    background-color: var(--wp--preset--color--light-blue);
  }

  summary::before {
    position: absolute;
    right: calc((var(--icon-size) / 2) - (var(--icon-line-width) / 2));
    height: var(--icon-size);
    width: var(--icon-line-width);
    transition: transform 0.4s ease-in-out;
  }

  summary::after {
    height: var(--icon-line-width);
    width: var(--icon-size);
    transition: transform 0.1s 0.3s ease-in-out;
  }

  &[open] summary::before,
  &[open] summary::after {
    transform: rotate(135deg);
  }
}

#hope-home {
  opacity: 1;
  transition: opacity 0.4s ease-in-out;
  display: inline-block;

  &.fade-out {
    opacity: 0 !important;
  }
}

.big-quote {
  position: relative;
  &:before {
    content: "\0022";
    position: absolute;
    top: -0.3rem;
    left: -1.8rem;
    font-size: 15rem;
    line-height: 1rem;
    opacity: 0.2;
    color: var(--wp--preset--color--light-blue);
  }
}

h3.line-through {
  text-transform: uppercase;
  color: var(--wp--preset--color--light-blue);
  font-size: 1.2em;
  font-weight: 600;
  letter-spacing: 0.1em;
  margin-bottom: 1.5em;
  display: flex;
  &:before,
  &:after {
    content: "";
    flex-grow: 1;
    height: 2px;
    background-color: var(--wp--preset--color--light-blue);
    margin: auto 0.5em;
  }
}

@media screen and (min-width: 782px) {
  .key-image {
    translate: 0 -6em;
  }
}

@media screen and (max-width: 781px) {
  .key-image img {
    max-height: 50vh;
    width: auto !important;
  }
}

.blackbaud-donation-form,
.blackbaud-event-registration-form {
  max-width: none !important;
}

.contact-form {
  --row-gap: 1em;

  font-size: 1em;
  color: var(--wp--preset--color--teal-blue);

  label {
    display: block;
    &:not(.plain-label) > div {
      transform: translate(0, 100%);
      transition: transform 200ms ease-in-out;
      &.populated {
        transform: translate(0, 0);
      }
    }
  }

  select,
  input:not([type="submit"]):not([type="radio"]):not([type="checkbox"]) {
    font-family: var(--wp--preset--font-family--body);
    font-size: 1em;
    box-sizing: border-box;
    background: transparent;
    padding: 0.3em 0.2em;
    border: none;
    border-bottom: 2px solid var(--wp--preset--color--teal-blue);
  }

  input:not([type="submit"]):not([type="radio"]):not([type="checkbox"]) {
    width: 100%;
  }

  .wp-block-button {
    margin-top: calc(var(--row-gap) * 2);
  }

  button,
  input[type="submit"] {
    font-size: 1em;
    width: auto;
  }

  .wpcf7-list-item {
    margin: 0;
    display: block;
  }

  .group-label {
    margin: 0 0 0.5em;
  }

  .bottom-label {
    font-size: 0.8em;
  }

  .form-row {
    @media (max-width: 999px) {
      label + label {
        margin-top: var(--row-gap);
      }
    }
    &:not(.no-flex) {
      @media (min-width: 1000px) {
        display: flex;
        flex-direction: row;
        gap: 2em;
        > * {
          flex: 1 1;
        }
      }
    }
    + .form-row {
      margin-top: var(--row-gap);
    }
  }
}

.wp-lightbox-overlay {
  /*figure.has-custom-border {
    border-radius: 0.75em;
    overflow: hidden;
  }
  img {
    border-radius: 0 !important;
  }*/

  &,
  .wp-lightbox-container,
  .lightbox-image-container,
  figure {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    aspect-ratio: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 2vh 2vw !important;
    box-sizing: border-box !important;
  }

  img,
  .lightbox-image-container img,
  .wp-lightbox-container img {
    width: auto !important;
    height: auto !important;
    max-width: 90vw !important;
    max-height: 88vh !important;
    object-fit: contain !important;
    aspect-ratio: auto !important;
    margin: auto !important;
  }

  .scrim {
    background-color: rgba(18, 18, 18, 0.85) !important;
  }

  button svg {
    fill: #ffffff !important;
    stroke: #ffffff !important;
    width: 3em;
    height: 3em;
  }

  button .wp-lightbox-close-icon svg {
    width: 2em !important;
    height: 2em !important;
  }
}

.masonry-gallery {
  figure {
    border-radius: 0.6rem;
    overflow: hidden;
  }
}

.masonry-row .wp-block-image {
  margin: 0 !important;
  width: auto !important;
  flex: 0 0 auto !important;
  height: 230px !important;
}

.masonry-row .wp-block-image img,
.masonry-row .wp-block-image a,
.masonry-row .wp-block-image figure {
  height: 100% !important;
  width: auto !important;
  display: block !important;
  max-width: none !important;
}

.custom-masonry-scroller {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  overflow: hidden;
  padding-bottom: 0.5em;
  width: 100%;
  scroll-behavior: smooth !important;
}

.masonry-row .wp-block-image {
  position: relative !important;
}

.masonry-row .wp-block-image button.lightbox-trigger {
  right: 0.5em !important;
  top: 0.5em !important;
  left: auto !important;
  bottom: auto !important;

  position: absolute !important;
  transform: none !important;
}

.masonry-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.5em;
  width: max-content;

  justify-content: center !important;
}

.wp-block-image:hover button.lightbox-trigger,
.wp-block-image:hover .lightbox-trigger {
  opacity: 1 !important;
  visibility: visible !important;
}

button.lightbox-trigger:focus,
button.lightbox-trigger:focus-visible,
.lightbox-trigger:focus,
.lightbox-trigger:focus-visible {
  opacity: 1 !important;
  visibility: visible !important;
  outline: 2px solid var(--wp--preset--color--light-blue) !important;
}

.marquee-track {
  display: flex !important;
  gap: 0.5em;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  width: max-content !important;
}

.row-1-track {
  animation: scrollLeft 40s linear infinite;
}

.row-2-track {
  animation: scrollRight 40s linear infinite;
}

@keyframes scrollLeft {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

@keyframes scrollRight {
  0% {
    transform: translateX(-50%);
  }
  100% {
    transform: translateX(0);
  }
}

.marquee-track:hover {
  animation-play-state: paused;
}

.paged-gallery {
  overflow: hidden;
  justify-content: center;

  &.wp-block-gallery.has-nested-images.columns-5 figure.wp-block-image:not(#individual-image) {
    flex-grow: 0;
    @media (min-width: 600px) and (max-width: 768px) {
      width: calc(33% - var(--wp--style--unstable-gallery-gap, 16px) * 0.8);
    }

    @media (min-width: 769px) and (max-width: 1024px) {
      width: calc(25% - var(--wp--style--unstable-gallery-gap, 16px) * 0.8);
    }
  }

  .wp-block-image {
    border-radius: 0.5em;
    overflow: hidden;
    img {
      width: 100%;
      aspect-ratio: 1 / 1;
      object-fit: cover;
    }
  }
}

.paging-button {
  &.disabled {
    background-color: var(--wp--preset--color--light-gray);
    pointer-events: none;
  }

  &.active {
    background-color: var(--wp--preset--color--light-blue);
    pointer-events: none;
  }
}

.bottom-house {
  position: absolute;
  right: -3%;
  height: 85%;
  width: auto;
  bottom: 0;
  img {
    height: 100%;
    width: auto;
  }
}

.bottom-house-solo {
  position: relative;
  margin-right: -50vw !important;
  padding-right: 50vw !important;

  figure {
    position: absolute;
    bottom: 100%;
    left: -3.65ch;
  }

  @media screen and (max-width: 781px) {
    display: none;
  }
}

aside.wp-block-template-part + footer.wp-block-template-part,
main + aside.wp-block-template-part {
  margin-top: 0 !important;
}

.newsletter-signup {
  input {
    border: none;
    background: none;
    color: var(--wp--preset--color--base);
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: 1;

    outline: none;

    &[type="email"],
    &[type="text"] {
      color: var(--wp--preset--color--base);
      padding-bottom: 0.25em;
      border-bottom: 2px solid var(--wp--preset--color--base);
      width: 100%;
      box-sizing: border-box !important;
      &::placeholder {
        color: inherit;
        font-size: 0.8em;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        opacity: 0.5;
      }
    }
    &[type="submit"],
    &[type="button"] {
      font-size: 0.75em;
      text-transform: uppercase;
      letter-spacing: 0.1em;
      padding: 0.25em 1.5em 0.5em;
      background-color: var(--wp--preset--color--base);
      transition: all 0.3s ease;
      color: var(--wp--preset--color--light-blue);
      border-radius: 1em;
      cursor: pointer;
      &:hover {
        background-color: var(--wp--preset--color--teal-blue);
        color: white;
      }
    }
  }
  .wpcf7-form-control-wrap {
    display: block;
    margin-bottom: 1em;
  }
  .wpcf7-spinner {
    vertical-align: middle;
  }
  .wpcf7-response-output {
    border: none;
    padding: 0;
  }
}

.site-footer {
  overflow-x: clip;
  margin-top: 0;
  .footer-badges img {
    max-height: 63px;
    width: auto !important;
  }

  .right-side {
    position: relative;
    margin-right: -50vw !important;
    padding-right: 50vw !important;
    @media screen and (max-width: 781px) {
      margin-left: -50vw !important;
      padding-left: 50vw !important;
    }
  }

  .footer-nav {
    a {
      text-decoration: none;
      &:hover {
        text-decoration: underline;
      }

      @media screen and (min-width: 782px) and (max-width: 907px) {
        font-size: 0.8em;
      }
    }
  }

  .BBFormContainer[data-bbox-part-id="30883814-eb7c-42b3-96a6-9b10c106d2bf"] {
    font-size: inherit;
    padding: 0 !important;
    .BBFormSection {
      legend,
      .BBFormSubSectionHeading {
        display: none;
      }
    }
    .BBFormSignupFieldWide {
      float: none;
      width: 100%;
      margin-bottom: 1.5em;
      > input {
        box-sizing: border-box;
        width: 100%;
        border: none;
        background: none;
        border-bottom: 2px solid white;
        color: white;
        font-family: var(--wp--preset--font-family--body);
        font-weight: 900;
        &::placeholder {
          text-transform: uppercase;
          letter-spacing: 0.1em;
          font-size: 0.9em;
          color: white;
          opacity: 0.5;
        }
        &:focus {
          box-shadow: none;
          background: none;
        }
      }
    }
    .BBFormSubmitbutton {
      background: white;
      border: none;
      box-shadow: none;
      color: var(--wp--preset--color--light-blue);
      font-size: 1em;
      border-radius: 1.3em;
      text-transform: uppercase;
      padding: 0.2em 2em;
      font-weight: bold;
      font-family: var(--wp--preset--font-family--body);
      transition: 200ms ease-in-out;
      &:hover {
        color: white;
        background-color: var(--wp--preset--color--teal-blue);
      }
    }
    #reCAPTCHADisclosure {
      font-size: 0.8em;
    }
  }
}
