/*
Theme Name: Multi-Brand Business Theme
Theme URI: 
Author: YohDev
Author URI: 
Description: A flexible WordPress block theme designed for multiple brands and industries. Easily customizable through the WordPress Customizer.
Requires at least: 6.6
Tested up to: 6.6
Requires PHP: 5.7
GitHub Repo: canterpower/cp-blocks
Version: 0.1.59
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: multi-brand-theme
Tags: block-theme, business, customizable, multi-brand
*/

/* Wp overides */
.wp-block-cover .wp-block-embed {
  min-height: 220px;
}

/* Needed for button hover choice in block editor */
.wp-block-button[style*="--wp--button-hover-bg"]:hover .wp-block-button__link {
  background-color: var(--wp--button-hover-bg) !important;
}
.wp-block-button[style*="--wp--button-hover-text"]:hover
  .wp-block-button__link {
  color: var(--wp--button-hover-text) !important;
}

/* remove odd block spacing above footer */
.wp-site-blocks > footer {
  margin-top: 0;
}

iframe {
  max-width: 100%;
}

/* Utility Classes */
/* generator graphic on generx home page (mobile only) */
.home-gen-img {
  position: relative;
  top: 64px;
}

@media (min-width: 767px) {
  .hide-desktop {
    display: none;
  }

  .cp-breadcrumbs .has-legal-font-size {
    font-size: 16px !important;
  }
}

/* Squeeze template specific styles */
.squeeze-menu.has-global-padding,
.squeeze-menu {
  position: sticky;
  top: 0;
  z-index: 999;
}

/* Fix modal centering on squeeze template */
body:has(.squeeze-menu) dialog.cps-portal-modal {
  left: 50% !important;
  transform: translateX(-50%) !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Make the column a vertical flex container */
.wp-block-column.is-style-align-content {
  display: flex;
  flex-direction: column;
}

/* Make inner group fill the column */
.wp-block-column.is-vertically-aligned-stretch > .wp-block-group {
  display: flex;
  flex-direction: column; /* stack heading, paragraph, buttons vertically */
  /* justify-content: space-between; push buttons to bottom */
  height: 100%; /* stretch group to fill column height */
}

/* Heading: fixed 2 lines with ellipsis */
.wp-block-column.is-style-align-content h3 {
  margin-left: 0 !important;
  margin-right: 0 !important;
  margin-bottom: 0 !important;
  min-height: 68px;
  font-size: 28px;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* 2 lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0;
  margin-bottom: 0.5rem; /* adjust as needed */
}

/* Paragraph / content: fixed 6 lines with ellipsis */
.wp-block-column.is-style-align-content p {
  line-height: 1.5rem;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow: hidden;
  margin-top: 0;
  margin-bottom: 1rem;
  flex-grow: 0; /* content does not stretch */
}

.wp-block-column.is-style-align-content .wp-block-buttons {
  margin-top: auto; /* push to bottom */
  padding-top: 1rem;
  display: flex;
  /* flex-direction: column;
  justify-content: flex-end;
  align-items: start; */
}

@media (max-width: 781px) {
  .wp-block-column.is-style-align-content .wp-block-button {
    width: 100% !important;
  }
}

/* Read more link for aligned cols */
.card-read-more-container {
  font-size: 0.9rem;
  margin-top: -12px !important;
  margin-left: 0 !important;
}
.card-read-more-container.open::before {
  content: "...";
  font-size: 1rem;
  margin-right: 0.5rem;
  text-decoration: none !important;
  color: #000 !important;
  border-bottom: none !important;
}

/* Buttons container: push to bottom */
.wp-block-column.is-style-align-content .wp-block-buttons {
  margin-top: auto; /* pushes buttons to the bottom */
  margin-left: 0 !important;
  margin-right: 0 !important;
  min-height: 34px; /* ensures consistent height if needed */
}

/* Optional: individual button height */
.wp-block-column.is-style-align-content .wp-block-button__link {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Make the column a vertical flex container */

/* Adjust footer styles */
.footer-top {
  .service-number {
    font-size: 16px;
    a {
      text-decoration: none;
    }
    a:hover {
      text-decoration: underline;
    }
  }
}
/* Adjust footer styles */

/* Stack layout for small screens - squeeze template only */
@media (max-width: 767px) {
  .wp-block-group.squeeze-menu .wp-block-group.alignwide.small-screen-padding {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
  }

  /* Logo container - first child */
  .wp-block-group.squeeze-menu
    .wp-block-group.alignwide.small-screen-padding
    > .wp-block-group:first-child {
    order: 1;
    width: 100%;
    display: flex;
    justify-content: center;
  }

  /* Logo size */
  .wp-block-group.squeeze-menu .wp-block-site-logo img {
    max-width: 120px;
    height: auto;
  }

  /* Phone and button container - second child */
  .wp-block-group.squeeze-menu .wp-block-group.squeeze-phone-button {
    order: 2;
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    justify-content: center;
    width: auto;
  }
}

@media (max-width: 767px) {
  .hide-mobile {
    display: none !important;
  }
}

.no-padding-group {
  padding: 0;
  margin-block-start: 0;
}

@media (max-width: 768px) {
  .wp-block-columns.is-style-reverse-mobile {
    display: flex;
    flex-direction: column-reverse;
  }
}

@media (min-width: 769px) {
  .wp-block-columns.is-style-reverse-mobile {
    display: flex;
    flex-direction: row;
  }
}

/* Navigation styles are handled in functions.php for frontend only */

/* Hero Pattern Styles */
.cover-hub-hero .wp-block-cover__inner-container {
  position: relative;
  z-index: 2;
}

.col-hub-text {
  z-index: 3;
}

/* Mobile responsiveness for hero */
@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .hide-desktop {
    display: none !important;
  }
}

.footer-bottom {
  a:hover {
    color: var(--wp--preset--color--background);
  }
}

.wp-block-cover {
  margin-block-start: 0;
  margin-block-end: 0;
}

/* .wp-block-columns {
    gap: 64px;
} */

@media (max-width: 767px) {
  .wp-block-columns {
    gap: 24px;
  }

  .footer-top {
    text-align: center;

    .cps-phone-number {
      justify-content: center !important;
    }

    .wp-block-columns {
      flex-direction: column;
      gap: 40px;
    }

    .wp-block-column {
      flex-basis: 100% !important;
      width: 100% !important;
      max-width: 100%;
      position: relative;
    }

    /* Add dividers between sections on mobile */
    .wp-block-column:not(:last-child)::after {
      content: "";
      position: absolute;
      bottom: -20px;
      left: 50%;
      transform: translateX(-50%);
      width: 80px;
      height: 1px;
      background-color: rgb(from var(--wp--preset--color--primary) r g b / 0.4);
    }

    /* Center logo and contact info */
    .wp-block-site-logo,
    .wp-block-paragraph,
    .wp-block-buttons {
      text-align: center;
      justify-content: center;
      margin-left: auto;
      margin-right: auto;
    }

    /* Ensure site logo is centered */
    .wp-block-site-logo img {
      margin: 0 auto;
      display: block;
    }

    /* Center button container */
    .wp-block-buttons {
      display: flex;
      justify-content: center;
    }

    /* Center navigation menus */
    .wp-block-navigation__container {
      width: 100%;
      align-items: center;
      justify-content: center;
      flex-direction: column;

      li {
        line-height: 3rem;
        text-align: center;
      }
    }

    /* Center headings */
    .wp-block-heading {
      text-align: center;
    }

    /* Hide the empty spacer column on mobile */
    .wp-block-column:last-child .wp-block-spacer {
      display: none;
    }
  }

  /* Footer bottom mobile styles */
  .footer-bottom {
    text-align: center;

    .wp-block-group {
      flex-direction: column;
      gap: 20px;
    }

    .wp-block-social-links {
      justify-content: center;
    }

    .wp-block-navigation {
      justify-content: center;
    }

    .wp-block-navigation__container {
      justify-content: center;
      flex-wrap: wrap;
      gap: 20px;
    }
  }
}

/* Tablet styles for footer */
@media (min-width: 768px) and (max-width: 1024px) {
  .footer-top {
    .wp-block-columns {
      gap: 32px;
    }

    .cps-phone-number {
      justify-content: center !important;
    }

    .wp-block-column:first-of-type {
      text-align: center !important;
    }

    .wp-block-site-logo,
    .wp-block-paragraph,
    .wp-block-buttons {
      text-align: center !important;
    }

    .footer-logo {
      align-items: center !important;
    }

    .wp-block-navigation__container {
      justify-content: center;
    }

    .wp-block-buttons {
      justify-content: center;
    }
  }

  .footer-bottom {
    .wp-block-group {
      gap: 24px;
    }
  }
}

.wp-block-button__link:hover {
  background: var(
    --brand-primary,
    var(--wp--preset--color--primary)
  ) !important;
  transform: scale(1.05);
  transition:
    background 0.3s ease,
    transform 0.3s ease;
}

.wp-block-separator {
  width: 100%;
  max-width: 100%;
}

.logo-column {
  position: relative;
  bottom: 32px;
}

.footer-top {
  border-top: 1px solid var(--wp--preset--color--contrast-3);
  border-bottom: 2px solid var(--wp--preset--color--contrast-3);
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);

  .wp-block-navigation-item__content {
    &:hover {
      color: var(--brand-primary, var(--wp--preset--color--primary)) !important;
    }
  }

  .cps-phone-number {
    justify-content: start;
  }
}

.footer-bottom span.wp-block-navigation-item__label {
  color: white;

  &:hover {
    text-decoration: underline;
  }
}

.footer-bottom {
  background-color: var(--wp--preset--color--contrast-3);
}

/* Patterns */
@media (max-width: 768px) {
  .col-hub-text {
    text-align: center;
    max-width: 327px;
    margin: auto !important;
  }
  .footer-logo {
    align-items: center !important;
  }
  /* Full Width Button on mobile */
  .is-style-mobile-full-width {
    width: 100% !important;
  }
}

.cover-hub-hero,
.cp-page-hero {
  min-height: 840px !important; /* Default height for larger screens - Updated to match Ambrose   */
}

@media (max-width: 768px) {
  .cover-hub-hero,
  .cp-page-hero {
    height: auto !important; /* Height for mobile screens */
    padding-top: var(--wp--preset--spacing--cover-padding) !important;
    padding-bottom: var(--wp--preset--spacing--cover-padding) !important;

    .wp-block-columns {
      gap: 24px !important;
    }
  }

  .wp-block-buttons.cta,
  .wp-block-buttons.cta .wp-block-button {
    width: 100% !important;
  }

  .hero-pattern {
    min-height: 200px !important;

    h1,
    p {
      text-align: center;
    }
  }
}

.what-to-expect {
  .wp-block-column {
    max-width: 220px;
    margin: auto;
  }
}

.home-generator {
  position: relative;
  bottom: 100px;
  z-index: 2;
}

/* Carousel/Review Slider Styles */
.wp-block-group.review-slider {
  [class*="slide-"] {
    display: none;
    transition: opacity 0.5s ease-in-out;
  }

  /* Show the active slide using inline JS styling — but this class can help if needed */
  .slide-visible {
    display: flex !important;
  }

  /* Make sure slides behave as flex containers */
  .wp-block-columns {
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
  }

  /* Arrow button styling */
  [class*="to-slide-"] {
    cursor: pointer;
    transition: transform 0.3s ease;
  }

  /* Hide all to-slide-* buttons by default */
  [class*="to-slide-"] {
    display: none;
  }

  /* Show navigation arrows inside the currently visible slide */
  .slide-1[style*="display: flex"] .to-slide-2,
  .slide-1[style*="display: flex"] .to-slide-3,
  .slide-2[style*="display: flex"] .to-slide-1,
  .slide-2[style*="display: flex"] .to-slide-3,
  .slide-3[style*="display: flex"] .to-slide-1,
  .slide-3[style*="display: flex"] .to-slide-2 {
    display: inline-flex;
  }

  [class*="to-slide-"]:hover {
    transform: scale(1.05);
  }

  /* Optional: Responsive tweaks */
  @media (max-width: 768px) {
    br {
      display: none;
    }

    .wp-block-columns {
      flex-direction: column;
    }

    .wp-block-column {
      flex-basis: 100% !important;
    }
  }
}

.brand-phone-number {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--wp--preset--color--contrast-2);
  justify-content: center;
}

.brand-phone-number:hover {
  color: var(--wp--preset--color--tertiary);
}

.number {
  font-size: 16px;
  font-weight: bold;
}

.home-generator {
  position: relative;
  bottom: 100px;
  z-index: 2;
}

/* Carousel/Review Slider Styles */
.wp-block-group.review-slider {
  [class*="slide-"] {
    display: none;
    transition: opacity 0.5s ease-in-out;
  }

  /* Show the active slide using inline JS styling — but this class can help if needed */
  .slide-visible {
    display: flex !important;
  }

  /* Make sure slides behave as flex containers */
  .wp-block-columns {
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
  }

  /* Arrow button styling */
  [class*="to-slide-"] {
    cursor: pointer;
    transition: transform 0.3s ease;
  }

  /* Hide all to-slide-* buttons by default */
  [class*="to-slide-"] {
    display: none;
  }

  /* Show navigation arrows inside the currently visible slide */
  .slide-1[style*="display: flex"] .to-slide-2,
  .slide-1[style*="display: flex"] .to-slide-3,
  .slide-2[style*="display: flex"] .to-slide-1,
  .slide-2[style*="display: flex"] .to-slide-3,
  .slide-3[style*="display: flex"] .to-slide-1,
  .slide-3[style*="display: flex"] .to-slide-2 {
    display: inline-flex;
  }

  [class*="to-slide-"]:hover {
    transform: scale(1.05);
  }

  /* Optional: Responsive tweaks */
  @media (max-width: 768px) {
    br {
      display: none;
    }

    .wp-block-columns {
      flex-direction: column;
    }

    .wp-block-column {
      flex-basis: 100% !important;
    }
  }
}

/* Navigation Hover Styles - Exclude footer bottom */
.wp-block-navigation-item
  a:hover:not(.footer-bottom .wp-block-navigation-item a),
.wp-block-navigation-item__content:hover:not(
    .footer-bottom .wp-block-navigation-item__content
  ),
.wp-block-navigation-link__content:hover:not(
    .footer-bottom .wp-block-navigation-link__content
  ),
.wp-block-navigation a:hover:not(.footer-bottom .wp-block-navigation a),
.wp-block-navigation-block-extended-desktop-block a:hover,
.wp-block-navigation-block-extended-mobile-block a:hover {
  background-color: var(--wp--preset--color--on-surface);
  transition: background-color 0.3s ease;
}

/* Exclude footer-bottom from background hover */
.footer-bottom .wp-block-navigation-item a:hover,
.footer-bottom .wp-block-navigation-item__content:hover,
.footer-bottom .wp-block-navigation-link__content:hover,
.footer-bottom .wp-block-navigation a:hover {
  background-color: transparent;
}

/* Navigation submenu hover styles */
.wp-block-navigation__submenu-container a:hover,
.wp-block-navigation-submenu a:hover {
  background-color: var(--wp--preset--color--on-surface);
}

/* Promo Page Styles*/
.promo-portal .dynamic-phone-number {
  font-size: 24px;
  font-weight: 700;
  color: var(--wp--preset--color--primary);
}
