/* ============================================================================
   GROUPS PADDING
   Add proper padding to all groups with background colors (NOT header/footer)
   ============================================================================ */

main .wp-block-group.has-background {
  padding-left: max(2rem, 5vw) !important;
  padding-right: max(2rem, 5vw) !important;
  padding-top: 2rem !important;
  padding-bottom: 2rem !important;
}

/* Media text blocks inside groups need proper spacing */
main .wp-block-group.has-background .wp-block-media-text {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* ============================================================================
   FOOTER FULL WIDTH
   Make footer truly full-width (100vw) breaking out of all containers
   ============================================================================ */

footer .wp-block-group.alignfull {
  width: 100vw !important;
  max-width: 100vw !important;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
}

/* Keep inner content centered */
footer .wp-block-group.alignfull > .wp-block-group {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 0;
  padding-right: 0;
}

/* Footer text white on dark background */
footer .has-testimonial-background-color,
footer .has-testimonial-background-color p,
footer .has-testimonial-background-color a {
  color: #ffffff !important;
}

/* Footer social icons white */
footer .wp-block-social-links svg path {
  fill: #ffffff !important;
}

/* ============================================================================
   BACKGROUND OPACITY
   All groups with background colors get opacity for image bleed-through
   Using rgba() instead of opacity to avoid conflict with AOS fade-in
   ============================================================================ */

.has-theme-1-background-color {
  background-color: rgba(244, 243, 235, 0.85) !important;
}

.has-theme-3-background-color {
  background-color: rgba(232, 229, 217, 0.85) !important;
}

.has-theme-5-background-color {
  background-color: rgba(250, 249, 245, 0.85) !important;
}

.has-bg-primary-background-color {
  background-color: rgba(176, 158, 158, 0.85) !important;
}

.has-testimonial-background-color {
  background-color: rgba(91, 85, 85, 0.9) !important;
}

/* ============================================================================
   TEXT COLOR CONTRAST
   Light backgrounds = BLACK text, Dark backgrounds = WHITE text
   BUT: Only apply to groups, NOT to cover blocks (cover blocks have own colors)
   ============================================================================ */

/* Light backgrounds need BLACK text */
.wp-block-group.has-theme-1-background-color,
.wp-block-group.has-theme-1-background-color p,
.wp-block-group.has-theme-1-background-color h1,
.wp-block-group.has-theme-1-background-color h2,
.wp-block-group.has-theme-1-background-color h3,
.wp-block-group.has-theme-1-background-color h4,
.wp-block-group.has-theme-1-background-color h5,
.wp-block-group.has-theme-1-background-color h6,
.wp-block-group.has-theme-1-background-color li,
.wp-block-group.has-theme-1-background-color a,
.wp-block-group.has-theme-3-background-color,
.wp-block-group.has-theme-3-background-color p,
.wp-block-group.has-theme-3-background-color h1,
.wp-block-group.has-theme-3-background-color h2,
.wp-block-group.has-theme-3-background-color h3,
.wp-block-group.has-theme-3-background-color h4,
.wp-block-group.has-theme-3-background-color h5,
.wp-block-group.has-theme-3-background-color h6,
.wp-block-group.has-theme-3-background-color li,
.wp-block-group.has-theme-3-background-color a,
.wp-block-group.has-theme-5-background-color,
.wp-block-group.has-theme-5-background-color p,
.wp-block-group.has-theme-5-background-color h1,
.wp-block-group.has-theme-5-background-color h2,
.wp-block-group.has-theme-5-background-color h3,
.wp-block-group.has-theme-5-background-color h4,
.wp-block-group.has-theme-5-background-color h5,
.wp-block-group.has-theme-5-background-color h6,
.wp-block-group.has-theme-5-background-color li,
.wp-block-group.has-theme-5-background-color a,
.wp-block-group.has-bg-primary-background-color,
.wp-block-group.has-bg-primary-background-color p,
.wp-block-group.has-bg-primary-background-color h1,
.wp-block-group.has-bg-primary-background-color h2,
.wp-block-group.has-bg-primary-background-color h3,
.wp-block-group.has-bg-primary-background-color h4,
.wp-block-group.has-bg-primary-background-color h5,
.wp-block-group.has-bg-primary-background-color h6,
.wp-block-group.has-bg-primary-background-color li,
.wp-block-group.has-bg-primary-background-color a {
  color: #000000 !important;
}

/* Dark backgrounds need WHITE text */
.wp-block-group.has-testimonial-background-color,
.wp-block-group.has-testimonial-background-color p,
.wp-block-group.has-testimonial-background-color h1,
.wp-block-group.has-testimonial-background-color h2,
.wp-block-group.has-testimonial-background-color h3,
.wp-block-group.has-testimonial-background-color h4,
.wp-block-group.has-testimonial-background-color h5,
.wp-block-group.has-testimonial-background-color h6,
.wp-block-group.has-testimonial-background-color li,
.wp-block-group.has-testimonial-background-color a {
  color: #ffffff !important;
}

/* ============================================================================
   COVER BLOCKS - ALWAYS WHITE TEXT (HIGHEST PRIORITY)
   Cover blocks on homepage must have white text, override everything else
   MUST be more specific than group rules to win!
   ============================================================================ */

.wp-block-cover p,
.wp-block-cover a,
.wp-block-cover h1,
.wp-block-cover h2,
.wp-block-cover h3,
.wp-block-cover h4,
.wp-block-cover h5,
.wp-block-cover h6,
.wp-block-group .wp-block-cover p,
.wp-block-group .wp-block-cover a,
.wp-block-group .wp-block-cover h1,
.wp-block-group .wp-block-cover h2,
.wp-block-group .wp-block-cover h3,
.wp-block-group .wp-block-cover h4,
.wp-block-group .wp-block-cover h5,
.wp-block-group .wp-block-cover h6 {
  color: #ffffff !important;
}

/* ============================================================================
   PAGE CONTENT DEFAULT TEXT COLOR
   All page content (EXCEPT cover blocks) should be BLACK for readability
   ============================================================================ */

.entry-content > p:not([style*="color"]),
.entry-content > h1:not([style*="color"]),
.entry-content > h2:not([style*="color"]),
.entry-content > h3:not([style*="color"]),
.entry-content > h4:not([style*="color"]),
.entry-content > h5:not([style*="color"]),
.entry-content > h6:not([style*="color"]),
.entry-content > ul li:not([style*="color"]),
.entry-content > ol li:not([style*="color"]),
.entry-content > details summary:not([style*="color"]) {
  color: #000000;
}

/* ============================================================================
   LINKS INHERIT COLOR FROM PARENT
   Links without explicit color inherit from parent element
   ============================================================================ */

/* Links inherit color from parent (paragraph, heading, etc) */
a:not([style*="color"]) {
  color: inherit;
}

/* Keep text-decoration behavior */
a {
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}
