/**
 * CanterPower Blocks — enhancement CSS.
 *
 * Only what theme.json cannot express lives here: responsive layout fixes,
 * the review-slider carousel, hero heights, navigation hover, footer chrome,
 * the squeeze-template modal, and card read-more clamping. Design tokens
 * (colors, fonts, spacing, radii) belong in theme.json, not here.
 */

/* --- WordPress overrides --- */
.wp-block-cover .wp-block-embed {
  min-height: 220px;
}

/* Button hover color choice from the editor (button-hover.js). */
.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%;
}

.wp-block-cover {
  margin-block-start: 0;
  margin-block-end: 0;
}

.wp-block-separator {
  width: 100%;
  max-width: 100%;
}

/* --- Utility classes --- */
.home-gen-img {
  position: relative;
  top: 64px;
}

.no-padding-group {
  padding: 0;
  margin-block-start: 0;
}

/* Full-bleed CanterPower sections butt directly against each other.
 *
 * Each cp-* block root carries its own vertical padding, so the layout's
 * default block gap between them renders as a 24px seam of page background.
 * Between two light sections that is invisible; either side of a dark one —
 * the hero, the CTA band — it reads as a white stripe.
 *
 * Core sets the gap with `:root :where(.is-layout-flow|constrained) > *`,
 * specificity (0,1,0), so a class + element rule wins without !important.
 * This relies on every theme block rendering a `<section class="cp-…">` root;
 * keep that convention when adding blocks. Editors dropping ordinary core
 * blocks into the page keep their normal spacing.
 */
.wp-block-post-content > section[class*="cp-"],
.no-padding-group > section[class*="cp-"] {
  margin-block-start: 0;
}

@media (min-width: 767px) {
  .hide-desktop {
    display: none;
  }
  .cp-breadcrumbs .has-legal-font-size {
    font-size: 16px !important;
  }
}

@media (max-width: 767px) {
  .hide-mobile {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .hide-desktop {
    display: none !important;
  }
}

/* --- Reverse-on-mobile columns (block style) --- */
@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;
  }
}

/* --- Mobile-full-width button (block style) --- */
@media (max-width: 768px) {
  .is-style-mobile-full-width {
    width: 100% !important;
  }
}

/* --- Aligned-content columns (equal-height cards) --- */
.wp-block-column.is-style-align-content {
  display: flex;
  flex-direction: column;
}

.wp-block-column.is-vertically-aligned-stretch > .wp-block-group {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.wp-block-column.is-style-align-content h3 {
  margin-left: 0 !important;
  margin-right: 0 !important;
  min-height: 68px;
  font-size: 28px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.wp-block-column.is-style-align-content p {
  line-height: 1.5rem;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 0;
  margin-bottom: 1rem;
  flex-grow: 0;
}

.wp-block-column.is-style-align-content .wp-block-buttons {
  margin-top: auto;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-top: 1rem;
  min-height: 34px;
  display: flex;
}

@media (max-width: 781px) {
  .wp-block-column.is-style-align-content .wp-block-button {
    width: 100% !important;
  }
}

.wp-block-column.is-style-align-content .wp-block-button__link {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Card "read more" toggle (aligned-column-read-more.js). */
.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;
}

/* --- Hero patterns --- */
.cover-hub-hero .wp-block-cover__inner-container {
  position: relative;
  z-index: 2;
}
.col-hub-text {
  z-index: 3;
}

.cover-hub-hero,
.cp-page-hero {
  min-height: 840px !important;
}

@media (max-width: 768px) {
  .cover-hub-hero,
  .cp-page-hero {
    height: auto !important;
    padding-top: var(--wp--preset--spacing--cover-padding) !important;
    padding-bottom: var(--wp--preset--spacing--cover-padding) !important;
  }
  .cover-hub-hero .wp-block-columns,
  .cp-page-hero .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;
  }
  .hero-pattern h1,
  .hero-pattern p {
    text-align: center;
  }

  .col-hub-text {
    text-align: center;
    max-width: 327px;
    margin: auto !important;
  }
}

.what-to-expect .wp-block-column {
  max-width: 220px;
  margin: auto;
}

.home-generator {
  position: relative;
  bottom: 100px;
  z-index: 2;
}

.logo-column {
  position: relative;
  bottom: 32px;
}

/* --- Navigation hover (front end only; footer bottom excluded) --- */
.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;
}

.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;
}

.wp-block-navigation__submenu-container a:hover,
.wp-block-navigation-submenu a:hover {
  background-color: var(--wp--preset--color--on-surface);
}

.wp-block-button__link:hover {
  background: var(--wp--preset--color--primary) !important;
  transform: scale(1.05);
  transition: background 0.3s ease, transform 0.3s ease;
}

/* --- Footer --- */
.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);
}
.footer-top .service-number {
  font-size: 16px;
}
.footer-top .service-number a {
  text-decoration: none;
}
.footer-top .service-number a:hover {
  text-decoration: underline;
}
.footer-top .wp-block-navigation-item__content:hover {
  color: var(--wp--preset--color--primary) !important;
}
.footer-top .cps-phone-number {
  justify-content: start;
}

.footer-bottom {
  background-color: var(--wp--preset--color--contrast-3);
}
.footer-bottom a:hover {
  color: var(--wp--preset--color--background);
}
.footer-bottom span.wp-block-navigation-item__label {
  color: #fff;
}
.footer-bottom span.wp-block-navigation-item__label:hover {
  text-decoration: underline;
}

@media (max-width: 767px) {
  .wp-block-columns {
    gap: 24px;
  }

  .footer-top {
    text-align: center;
  }
  .footer-top .cps-phone-number {
    justify-content: center !important;
  }
  .footer-top .wp-block-columns {
    flex-direction: column;
    gap: 40px;
  }
  .footer-top .wp-block-column {
    flex-basis: 100% !important;
    width: 100% !important;
    max-width: 100%;
    position: relative;
  }
  .footer-top .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);
  }
  .footer-top .wp-block-site-logo,
  .footer-top .wp-block-paragraph,
  .footer-top .wp-block-buttons {
    text-align: center;
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
  }
  .footer-top .wp-block-site-logo img {
    margin: 0 auto;
    display: block;
  }
  .footer-top .wp-block-buttons {
    display: flex;
    justify-content: center;
  }
  .footer-top .wp-block-navigation__container {
    width: 100%;
    align-items: center;
    justify-content: center;
    flex-direction: column;
  }
  .footer-top .wp-block-navigation__container li {
    line-height: 3rem;
    text-align: center;
  }
  .footer-top .wp-block-heading {
    text-align: center;
  }
  .footer-top .wp-block-column:last-child .wp-block-spacer {
    display: none;
  }

  .footer-bottom {
    text-align: center;
  }
  .footer-bottom .wp-block-group {
    flex-direction: column;
    gap: 20px;
  }
  .footer-bottom .wp-block-social-links {
    justify-content: center;
  }
  .footer-bottom .wp-block-navigation {
    justify-content: center;
  }
  .footer-bottom .wp-block-navigation__container {
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
  }

  .footer-logo {
    align-items: center !important;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .footer-top .wp-block-columns {
    gap: 32px;
  }
  .footer-top .cps-phone-number {
    justify-content: center !important;
  }
  .footer-top .wp-block-column:first-of-type {
    text-align: center !important;
  }
  .footer-top .wp-block-site-logo,
  .footer-top .wp-block-paragraph,
  .footer-top .wp-block-buttons {
    text-align: center !important;
  }
  .footer-top .footer-logo {
    align-items: center !important;
  }
  .footer-top .wp-block-navigation__container {
    justify-content: center;
  }
  .footer-top .wp-block-buttons {
    justify-content: center;
  }
  .footer-bottom .wp-block-group {
    gap: 24px;
  }
}

/* --- Phone number --- */
.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;
}

/* --- Squeeze / landing template --- */
.squeeze-menu.has-global-padding,
.squeeze-menu {
  position: sticky;
  top: 0;
  z-index: 999;
}

body:has(.squeeze-menu) dialog.cps-portal-modal {
  left: 50% !important;
  transform: translateX(-50%) !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

@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;
  }
  .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;
  }
  .wp-block-group.squeeze-menu .wp-block-site-logo img {
    max-width: 120px;
    height: auto;
  }
  .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;
  }
}

/* --- Review slider / carousel (carousel.js) --- */
.wp-block-group.review-slider [class*="slide-"] {
  display: none;
  transition: opacity 0.5s ease-in-out;
}
.wp-block-group.review-slider .slide-visible {
  display: flex !important;
}
.wp-block-group.review-slider .wp-block-columns {
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
}
.wp-block-group.review-slider [class*="to-slide-"] {
  cursor: pointer;
  transition: transform 0.3s ease;
  display: none;
}
.wp-block-group.review-slider .slide-1[style*="display: flex"] .to-slide-2,
.wp-block-group.review-slider .slide-1[style*="display: flex"] .to-slide-3,
.wp-block-group.review-slider .slide-2[style*="display: flex"] .to-slide-1,
.wp-block-group.review-slider .slide-2[style*="display: flex"] .to-slide-3,
.wp-block-group.review-slider .slide-3[style*="display: flex"] .to-slide-1,
.wp-block-group.review-slider .slide-3[style*="display: flex"] .to-slide-2 {
  display: inline-flex;
}
.wp-block-group.review-slider [class*="to-slide-"]:hover {
  transform: scale(1.05);
}
@media (max-width: 768px) {
  .wp-block-group.review-slider br {
    display: none;
  }
  .wp-block-group.review-slider .wp-block-columns {
    flex-direction: column;
  }
  .wp-block-group.review-slider .wp-block-column {
    flex-basis: 100% !important;
  }
}

/* --- Promo / portal page --- */
.promo-portal .dynamic-phone-number {
  font-size: 24px;
  font-weight: 700;
  color: var(--wp--preset--color--primary);
}

/* --- Blog: archive grid + single post ------------------------------------
   templates/home.html, archive.html, index.html (grid) and single.html.

   The Playbook's global `box-sizing: border-box` was never ported to this
   theme, so any `width: 100%` + padding rule overflows its track. Both blocks
   below scope their own reset rather than relying on a global one. */
.cp-blog, .cp-blog *, .cp-blog *::before, .cp-blog *::after,
.cp-post, .cp-post *, .cp-post *::before, .cp-post *::after {
  box-sizing: border-box;
}

/* Masthead — shared by the archive and the single post. */
.cp-blog__masthead,
.cp-post__masthead {
  padding: var(--wp--preset--spacing--70) var(--wp--preset--spacing--50);
  text-align: center;
}
.cp-blog__eyebrow,
.cp-post__cats {
  margin: 0 0 var(--wp--preset--spacing--20);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}
.cp-post__cats a {
  color: var(--wp--preset--color--primary);
  text-decoration: none;
}
.cp-blog__heading,
.cp-post__title {
  margin: 0 auto;
  max-width: 20ch;
  line-height: 1.05;
}
.cp-post__title {
  max-width: 24ch;
}
.cp-blog__lead {
  margin: var(--wp--preset--spacing--30) auto 0;
  max-width: 60ch;
  line-height: 1.7;
}
.cp-post__meta {
  margin-top: var(--wp--preset--spacing--30);
  gap: var(--wp--preset--spacing--30);
  justify-content: center;
  color: var(--wp--preset--color--contrast-3);
}

/* Card grid. `columnCount` gives core's grid layout a fixed track count, which
   does not collapse on its own — the media queries below do that. */
.cp-blog__query {
  padding: var(--wp--preset--spacing--70) var(--wp--preset--spacing--50);
  max-width: var(--wp--style--global--wide-size, 1200px);
  margin-inline: auto;
}
.cp-blog__grid {
  gap: var(--wp--preset--spacing--50);
}
.cp-blog__grid > li {
  display: flex;
  flex-direction: column;
  background: var(--wp--preset--color--white);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cp-blog__grid > li:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.1);
}
.cp-blog__thumb {
  margin: 0;
}
.cp-blog__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cp-blog__date {
  margin: var(--wp--preset--spacing--30) var(--wp--preset--spacing--30) 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.cp-blog__card-title {
  margin: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30) 0;
  line-height: 1.15;
}
.cp-blog__card-title a {
  color: var(--wp--preset--color--text);
  text-decoration: none;
}
.cp-blog__card-title a:hover {
  color: var(--wp--preset--color--primary);
}
/* Pushes "Read More" to the card foot so every card in a row ends level. */
.cp-blog__excerpt {
  margin: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30)
    var(--wp--preset--spacing--30);
  line-height: 1.7;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}
.cp-blog__excerpt .wp-block-post-excerpt__more-text {
  margin: auto 0 0;
  padding-top: var(--wp--preset--spacing--20);
}
.cp-blog__excerpt a {
  color: var(--wp--preset--color--primary);
  font-weight: 700;
  text-decoration: none;
}
.cp-blog__excerpt a:hover {
  text-decoration: underline;
}
.cp-blog__empty {
  padding: var(--wp--preset--spacing--60) 0;
  color: var(--wp--preset--color--contrast-2);
}
.cp-blog__pagination {
  margin-top: var(--wp--preset--spacing--60);
  gap: var(--wp--preset--spacing--30);
}
.cp-blog__pagination a {
  color: var(--wp--preset--color--text);
  text-decoration: none;
  font-weight: 700;
}
.cp-blog__pagination a:hover {
  color: var(--wp--preset--color--primary);
}

/* Single post. */
.cp-post__body {
  padding: var(--wp--preset--spacing--70) var(--wp--preset--spacing--50);
}
.cp-post__hero-image {
  margin: 0 0 var(--wp--preset--spacing--50);
}
.cp-post__hero-image img {
  width: 100%;
  border-radius: 10px;
  display: block;
}
.cp-post__body :where(p, li) {
  line-height: 1.8;
}
.cp-post__body :where(h2, h3, h4) {
  font-family: var(--wp--preset--font-family--barlow-condensed);
  margin-top: var(--wp--preset--spacing--50);
}
.cp-post__tags {
  margin-top: var(--wp--preset--spacing--50);
  padding-top: var(--wp--preset--spacing--30);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}
.cp-post__more {
  padding-top: var(--wp--preset--spacing--60);
}
.cp-post__more-heading {
  text-align: center;
  margin: 0;
}
.cp-post__more .cp-blog__query {
  padding-top: var(--wp--preset--spacing--40);
}

@media (max-width: 900px) {
  .cp-blog__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .cp-blog__grid {
    grid-template-columns: 1fr;
  }
  .cp-blog__masthead,
  .cp-post__masthead,
  .cp-blog__query,
  .cp-post__body {
    padding-left: var(--wp--preset--spacing--30);
    padding-right: var(--wp--preset--spacing--30);
  }
}
