/* Site-wide contrast cleanup: white/light backgrounds use header blue text; dark/blue backgrounds use white text. */
:root {
  --golden-header-blue: #051f3d;
  --golden-white: #ffffff;
}

html, body, .u-body {
  color: var(--golden-header-blue);
}

/* Light/white panels: prevent white-on-white invisible text. */
.u-white,
.u-grey-5,
.u-grey-10,
.u-grey-15,
.u-grey-25,
.u-section-row,
.u-sheet,
.u-layout-cell,
.u-container-style,
.u-text-default,
.u-table,
.u-accordion-content,
.u-tab-content,
.u-group,
.u-repeater-item,
.u-list-item,
.u-nav-popup,
.u-menu-close,
[style*="background: #fff"],
[style*="background:#fff"],
[style*="background-color: #fff"],
[style*="background-color:#fff"],
[style*="background: white"],
[style*="background-color: white"],
[style*="background: rgb(255, 255, 255)"],
[style*="background-color: rgb(255, 255, 255)"] {
  color: var(--golden-header-blue) !important;
}

.u-white :where(h1,h2,h3,h4,h5,h6,p,span,a,li,label,strong,em,small,div),
.u-grey-5 :where(h1,h2,h3,h4,h5,h6,p,span,a,li,label,strong,em,small,div),
.u-grey-10 :where(h1,h2,h3,h4,h5,h6,p,span,a,li,label,strong,em,small,div),
.u-grey-15 :where(h1,h2,h3,h4,h5,h6,p,span,a,li,label,strong,em,small,div),
.u-grey-25 :where(h1,h2,h3,h4,h5,h6,p,span,a,li,label,strong,em,small,div),
.u-sheet :where(h1,h2,h3,h4,h5,h6,p,span,a,li,label,strong,em,small,div),
.u-layout-cell :where(h1,h2,h3,h4,h5,h6,p,span,a,li,label,strong,em,small,div),
.u-accordion-content :where(h1,h2,h3,h4,h5,h6,p,span,a,li,label,strong,em,small,div),
.u-tab-content :where(h1,h2,h3,h4,h5,h6,p,span,a,li,label,strong,em,small,div),
.u-nav-popup :where(a,span,li,p,div) {
  color: var(--golden-header-blue) !important;
}

/* Blue/dark panels: prevent blue-on-blue text. */
.u-black,
.u-grey-80,
.u-grey-90,
.u-palette-1-base,
.u-palette-1-dark-1,
.u-palette-1-dark-2,
.u-palette-1-dark-3,
.u-custom-color-1,
.u-header,
.u-footer,
[style*="background: #051f3d"],
[style*="background:#051f3d"],
[style*="background-color: #051f3d"],
[style*="background-color:#051f3d"],
[style*="background: #0b3a6f"],
[style*="background-color: #0b3a6f"],
[style*="background: rgb(5, 31, 61)"],
[style*="background-color: rgb(5, 31, 61)"] {
  color: var(--golden-white) !important;
}

.u-black :where(h1,h2,h3,h4,h5,h6,p,span,a,li,label,strong,em,small,div),
.u-grey-80 :where(h1,h2,h3,h4,h5,h6,p,span,a,li,label,strong,em,small,div),
.u-grey-90 :where(h1,h2,h3,h4,h5,h6,p,span,a,li,label,strong,em,small,div),
.u-palette-1-base :where(h1,h2,h3,h4,h5,h6,p,span,a,li,label,strong,em,small,div),
.u-palette-1-dark-1 :where(h1,h2,h3,h4,h5,h6,p,span,a,li,label,strong,em,small,div),
.u-palette-1-dark-2 :where(h1,h2,h3,h4,h5,h6,p,span,a,li,label,strong,em,small,div),
.u-palette-1-dark-3 :where(h1,h2,h3,h4,h5,h6,p,span,a,li,label,strong,em,small,div),
.u-custom-color-1 :where(h1,h2,h3,h4,h5,h6,p,span,a,li,label,strong,em,small,div),
.u-header :where(a,span,li,p,div),
.u-footer :where(a,span,li,p,div) {
  color: var(--golden-white) !important;
}

/* Buttons: match text color to button background. */
.u-btn.u-palette-1-base,
.u-btn.u-palette-1-dark-1,
.u-btn[style*="background-color: #051f3d"],
.u-btn[style*="background:#051f3d"] {
  color: var(--golden-white) !important;
}
.u-btn.u-white,
.u-btn[style*="background-color: #fff"],
.u-btn[style*="background:#fff"] {
  color: var(--golden-header-blue) !important;
}

/* Keep form fields readable. */
input, textarea, select, option {
  color: var(--golden-header-blue) !important;
  background-color: #ffffff !important;
}
input::placeholder, textarea::placeholder {
  color: rgba(5,31,61,.68) !important;
}

/* Yellow label/button areas should carry blue text, not white. */
[style*="background: #ff"],
[style*="background-color: #ff"],
[style*="background: yellow"],
[style*="background-color: yellow"],
.roof-type-label,
.roof-form-type-label,
.roof-card-label {
  color: var(--golden-header-blue) !important;
}

/* Testimonial cards: u-custom-color-2 background is dark navy — force white text */
.u-custom-color-2.u-list-item,
.u-custom-color-2.u-repeater-item,
.u-custom-color-2.u-list-item :where(h1,h2,h3,h4,h5,h6,p,span,a,li,div),
.u-custom-color-2.u-repeater-item :where(h1,h2,h3,h4,h5,h6,p,span,a,li,div),
.u-custom-color-2 .u-text,
.u-section-4 .u-custom-color-2 .u-text,
.u-section-4 .u-list-item .u-text {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* Banner/hero titles on image+shading sections: keep white text */
.u-shading .u-sheet :where(h1, h2, h3, h4, h5, h6),
.u-shading .u-sheet .u-text,
.u-shading :where(h1, h2, h3, h4, h5, h6) {
  color: var(--golden-white) !important;
  -webkit-text-fill-color: var(--golden-white) !important;
}
