/*
Theme Name: Freedom Built CBR
Theme URI: https://freedombuilt.com.au/
Author: the New Best Friend
Author URI: https://newbestfriend.com.au
Requires at least: 6.7.2
Tested up to: 6.7.2
Requires PHP: 8.0
Version: 1.0
Text Domain: freedombuiltCbr-blocks
*/

/* Global box sizing (optional, but recommended) */
*,
*::before,
*::after {
  box-sizing: border-box;
}

footer {
  margin-top: 0 !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}

body {
  --overshoot: linear(0, 0.402 7.4%, 0.711 15.3%, 0.929 23.7%, 1.008 28.2%, 1.067 33%, 1.099 36.9%, 1.12 41%, 1.13 45.4%, 1.13 50.1%, 1.111 58.5%, 1.019 83.2%, 1.004 91.3%, 1); 
  --wiggle: linear(0, 0.739 6.1%, 0.912 8.8%, 0.954 10.1%, 0.967 11.4%, 0.954 12.7%, 0.916 14%, 0.751 16.9%, -0.304 29%, -0.446 31.8%, -0.511 34.5%, -0.517 35.7%, -0.509 37%, -0.455 39.6%, 0.035 51.2%, 0.126 54.4%, 0.171 57.5%, 0.178 59.9%, 0.164 62.5%, 0.025 72.8%, -0.017 78.2%, -0.023 82.8%, -0.004 93%, 0);  
}

img {
  display: block;
}

.hide-on-mobile {
  @media (max-width: 781px) {
    & {
      display: none !important;
    }
  }
}
.hide-on-tablet {
  @media (min-width: 782px) and (max-width: 1009px) {
    & {
      display: none !important;
    }
  }
}
.hide-on-desktop {
  @media (min-width: 1010px) {
    & {
      display: none !important;
    }
  }
}
.d-none {
  display: none !important;
}
.d-block {
  display: block !important;
}

/*
 * CHANGE CONTENT ORDER
 */
.order-1 {
  order: 1;
}
.order-2 {
  order: 2;
}
.order-3 {
  order: 3;
}
@media (max-width: 781px) {
  .order-mobile-1 {
    order: 1;
  }
  .order-mobile-2 {
    order: 2;
  }
  .order-mobile-3 {
    order: 3;
  }
}

.w-100 {
  width: 100%;
  &.wp-block-image > img {
    width: 100%;
  }
}

@media (max-width: 781px) {
  .w-mobile-100 {
    width: 100%;
  }
}

.float-right a:after {
  float: right;
}

.mt-0 {
  margin-top: 0 !important;
}

.position-relative {
  position: relative;
}
.position-absolute {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0 auto;
  width: 100%;
  height: 100%;
  right: 0;
  z-index: 1;
}


iframe {
  width: 100%;
  max-width: unset !important;
  aspect-ratio: 16 / 9;
  height: auto;  
}


/* Fix rotated text for mobile */
@media (max-width: 785px) {
  *.has-text-align-right[style*=writing-mode]:where([style*=vertical-rl]) {
    rotate: 0deg !important;
    text-align: left !important;
    writing-mode: initial !important;
  }
}

.wp-block-navigation__container {
  &:has(*:hover) {
    .wp-block-navigation-item {
      opacity: 0.5;
    }
  }  
  > .wp-block-navigation-item {
    transition: 0.3s ease-out;
    a {
      text-decoration: none !important;
    }
    &:hover, &:focus {
      opacity: 1 !important;
      transition: 0.1s ease;
    }
  }

  &:has(.current-menu-item) > .wp-block-navigation-item {
    opacity: 0.5;
    &.current-menu-item {
      opacity: 1;
    }
  }

}


.wp-block-column:has(+ * .title-style-01) {
    flex-basis: 30% !important;
    margin-right: -5% !important;  
}
.title-style-01 {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    justify-content: space-between;
    padding-block: 0.75em;
    box-sizing: border-box;
    pointer-events: none;
    & > :nth-child(1) {  
    }
    & > :nth-child(2) {
      padding-left: 19%;      
    }
    & > :nth-child(3) {
      text-align: right;
    }    
}

.title-style-02 {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    justify-content: space-between;
    padding-block: 0.75em;
    box-sizing: border-box;
    pointer-events: none;
    & > :nth-child(1) {  
    }
    & > :nth-child(2) {
      text-align: right;
    }
    & > :nth-child(3) {
      text-align: right;
      padding-right: 10%;
    }   
}


.lmb-open {
  overflow: hidden;
}

@media (max-width: 781px) {
  .service-links {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    background: white !important;    
  }
}
@media (min-width: 782px) {
  .service-links {
    & .wp-block-cover {
      & .wp-block-cover__background {
        opacity: 1 !important;
        transition: 0.4s ease-out;
      }
      & .wp-block-cover__inner-container {
        transition: 0.4s ease-out;
        position: relative;
        opacity: 0.5;
      }    
      & .wp-block-button__link {
  /*      position: relative;*/
        opacity: 0;
        transition: 0.4s ease-out;
        background-color: transparent !important;
        border-color: white !important;
        color: white !important;
        &:after {
          content: "";
          display: block;
          width: 50vw;        
          height: 100vh;
          position: absolute;
          top: -50vh;
          left: -25vw;
        }
      }
      &:hover, &:focus-within {
        & .wp-block-cover__inner-container {
          translate: 0 -1em;
          opacity: 1;
        }
        & .wp-block-cover__background {
          opacity: 0.5 !important;
        } 
        & .wp-block-button__link {
          opacity: 1;
          translate: 0 0.5em;
        }     
      }
    }
  }
}

.has-drop-cap:first-letter {
  font-size: 3em !important;
  line-height: 0.75 !important;
  font-weight: 500 !important;
  margin: .05em .1em 0 0 !important;
}

.single-post .entry-content {
  & h2.wp-block-heading {
    margin-top: 3.75rem;
    font-family: var(--wp--preset--font-family--body);
    font-weight: 500;
  }
}


.is-style-masonry {
  display: block !important;
  max-width: 100%;  
  box-sizing: content-box;
  & > figure.wp-block-image {
    position: absolute !important;
    overflow: hidden;
  }
  & img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
}


/* active gallery buttons */
.gallery-buttons > * {
  /*scroll-snap-align: left;*/
  min-width: fit-content;
  white-space: nowrap;
}  
.wp-block-buttons.galleries .wp-block-button {
  transition: 0.4s ease-out opacity;
  & .wp-block-button__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
/*    min-width: fit-content;
    white-space: nowrap;*/
  }  
}
.wp-block-buttons.galleries:has(.wp-block-button:hover) .wp-block-button {
  opacity: 0.5;
  &:hover {
    opacity: 1;
  }
}
.page-template-gallery {  
  .wp-block-buttons.galleries .wp-block-button {
    opacity: 0.5;
  }
  &.page-id-795 .wp-block-button.bathroom,
  &.page-id-774 .wp-block-button.kitchen,
  &.page-id-786 .wp-block-button.living,
  &.page-id-792 .wp-block-button.bedroom,
  &.page-id-1547 .wp-block-button.laundry,
  &.page-id-788 .wp-block-button.exterior,
  &.page-id-1545 .wp-block-button.study
  {
    opacity: 1;
    & img {
      filter: invert(1) drop-shadow(0px 0px 10px #ffffff50);

    }
  }
}


@media (max-width: 781px) {
  .entry-content {
    display: flex;
    flex-direction: column;
  }
  .sticky-link {
    top: unset !important;
    bottom: 0 !important;
    order: 1;
    background: transparent !important;  
    transition: 0.3s ease-out;
  }

  .lmb-open .sticky-link {
    opacity: 0;
    translate: 0 25px;
    pointer-events: none;
  }
}




/* Base State — Hidden (before reveal) */
.reveal-container-elements > *:not(.wp-block-spacer),
.fadeIn-elements > *:not(.wp-block-spacer),
.fadeIn-right,
.scaleDown > img,
.scaleDown > video,
.wp-block-getwid-custom-post-type__wrapper > *:not(.wp-block-spacer),
.fadeInRight > * {
  opacity: 0;
/*  pointer-events: none;*/
}

/* --- Transforms matching old ScrollReveal --- */

/* 1. Vertical Fade-Up (25px) */
.reveal-container-elements > *:not(.wp-block-spacer) {
  transform: translateY(25px);
  transition: opacity 1000ms ease-out, transform 1000ms ease-out;
}

/* 2. Simple Fade (no movement) */
.fadeIn-elements > *:not(.wp-block-spacer) {
  transform: none;
  transition: opacity 1100ms ease-in-out;
}

/* 3. Slide from Right (25px) */
.fadeInRight > * {
  opacity: 0;
  transform: translateX(25px);
  transition: opacity 600ms ease-in-out, transform 600ms ease-in-out;
}

/* 4. Scale Down */
.scaleDown > img,
.scaleDown > video {
  transform: scale(1.2);
  transition: opacity 1000ms ease-out, transform 1000ms ease-out;
}

/* 5. Fade In */
.modalReveal > *:not(.wp-block-cover__background) {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* 6. Short Slide from Right on horizontal scroll (100px) */
.horizontal-elements:not(.gallery-buttons) > * {
  opacity: 0;
  transform: translateX(100px);
  transition: opacity 600ms ease-in-out, transform 600ms ease-in-out;
}

/* Grid container hidden until layout */
.is-style-masonry {
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

/* Prevent transform conflicts — no global "reset" */
.is-style-masonry > * {
  opacity: 0;
  /* no transform here — let MiniMasonry handle it */
  transition: opacity 0.6s ease-out;
}

/* Fade in each item via custom class */
.is-style-masonry > *.is-masonry-visible {
  opacity: 1;
}

.scaleDown {
  overflow: hidden;
  background-color: var(--wp--preset--color--black);
}

/* Reveal Trigger — Matched to ScrollReveal Ending State */
.is-visible:not(.is-masonry-visible) {
  opacity: 1 !important;
  transform: none !important;
/*  pointer-events: auto;*/
}

/* Full-width horizontal scrolling section */
.horizontal-scroll {
  position: relative;
  overflow-x: scroll;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; /* smooth iOS scroll */
  scroll-padding-left: 16px;
  /* Set width to the viewport width */
  /*&:not(.gallery-scroll) {*/
    width: 100vw;
    /* Center the container via left:50% and negative margin */
    left: 50%;
    margin-left: -50vw;
  /*}*/
}

.horizontal-scroll-wrapper {
  position: relative;
  margin: 0;
  & .scroll-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 0.5em;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
/*    transition: opacity 0.3s ease;*/
    & svg {
      display: block;
      width: 24px;
      height: 24px;
    }
    &.left {
      left: 0.5rem;
    }
    &.right {
      right: 0.5rem;
    }

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-out;
    display: flex;

    /* Only show arrows when they are both scrollable AND should be visible */
    &.can-scroll.is-visible {
      opacity: 1;
      pointer-events: auto;
    }
  }
  /* Hover state — always show active arrows when user hovers the scroll wrapper */
  &:hover .scroll-arrow.can-scroll {
    opacity: 1;
    pointer-events: auto;
  }
}

/* The cards grid inside the scrollable section */
.cards:not(.gallery-buttons) {
  gap: 16px;  /* Adjust gap between cards as needed */
  /* Clamp the left padding so on small screens it never goes negative */
  padding-left: max(var(--wp--preset--spacing--50), calc((100vw - 1280px) / 2));
  padding-right: max(var(--wp--preset--spacing--50), calc((100vw - 1280px) / 2));
  width: fit-content;

  > * {
    min-width: 250px;
    scroll-snap-align: center;
  }
  & .wp-block-getwid-video-popup {
    width: 100%;
  }
  & .wp-block-getwid-video-popup__wrapper {
    aspect-ratio: 16/9;
    min-height: unset !important;
  }
  & .wp-block-getwid-video-popup__icon {
    width: 45px;
    height: 45px;
    & i {
      border-width: 10px 0 10px 17.5px;
      margin-left: 2px;
    }
  }
  & .wp-block-image {
    max-width: 100%;
  }
}

.cards.horizontal-elements {
  display: flex;
  gap: 1rem;
  &.gallery-buttons {
    justify-content: center;
    &.is-scrollable {
      justify-content: flex-start; /* when overflowing */
    }    
  }
}


.wp-block-gallery {
  min-height: 50vh;
}

/* Google review badge */

.google-rating-card {
  width: 260px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  text-align: center;
  font-size: 14px;
  color: #333;
}

.google-rating-card::before {
  content: "";
  display: block;
  height: 5px;
  background-color: #34a853; /* Google green */
}

.google-rating-content {
  padding: 16px 12px;
}

.google-rating-content img {
  width: 40px;
  margin-bottom: 8px;
}

.google-rating-content .label {
  font-weight: 600;
  margin-bottom: 6px;
}

.google-rating-content .rating {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  font-size: 20px;
  margin-bottom: 6px;
}

.google-stars {
  display: flex;
  gap: 2px;
}

.google-stars svg {
  width: 18px;
  height: 18px;
  fill: #fbbc04; /* Google star colour */
}

.google-stars svg.empty {
  fill: #ddd;
}

.google-rating-content .review-count {
  font-size: 13px;
  color: #666;
  margin-top: 4px;
}

.google-rating-card a {
  text-decoration: none;
  color: inherit;
  display: block;
}

