/**
 * WDF — Wave D Brand Contrast (WCAG AA compliance)
 * Loaded via wdf-wave-d-contrast.php.
 * Version: 5.0.0 — 2026-05-14: P3 backlog — `.wdf-dd-footer` dropdown-menu link
 *                  (12px 600 weight, orange-on-dark-green 3.48:1) → #fdcd74 6:1 PASS AA.
 *                  Other audit-flagged P3 partials already handled via size-bump to AA-Large
 *                  threshold in wdf-ada-contrast.css (.wdf-nav-login, .wdfhp-browse-btn,
 *                  .wp-block-post-navigation-link a). #14 .wp-block-post-title-a-in-related-list
 *                  couldn't be reproduced in live DOM — skipped as obsolete.
 * Version: 4.0.2 — 2026-05-14: `body .wdfhp-search-wrap .wdf-search-btn` (raise specificity
 *                  from 2-class to body+2-class to beat the inline wdf-homepage-sections-css
 *                  block that emits .wdfhp-search-wrap .wdf-search-btn !important AFTER us).
 * Version: 4.0.1 — 2026-05-14 staging-audit pass: expanded A1 selector list to 19
 *                  CTA classes (was 8) after grep'ing ALL `background:#d4a853` definitions
 *                  in mu-plugins/. Added .wdfhp-search-wrap .wdf-search-btn (2-class to
 *                  beat inline-style specificity), .wdfhp-hero-card-link, #wdf-popup-submit.
 *                  Paired with wdf-ada-contrast.css :not(.wdf-nav-link--mobile-cta) patch
 *                  to release the mobile-CTA text color to wave-D white.
 * Version: 4.0.0 — 2026-05-14: P2 design decisions A1 + B1 shipped.
 *                  A1 = orange CTA darkened #d4a853 → #c79a45 (7.4:1 PASS AA normal text).
 *                  B1 = logo gradient bottom stop #d4a853 → #fdcd74 via SVG CSS override
 *                  (4.61:1 PASS AA; matches "Locator" wordmark color, palette-unified).
 * Version: 3.0.1 — 2026-05-13 audit pass: closes hero gap fully via :has()
 *                  template-part hide + mb-5/mt-n5 fallback (v3.0.0 mt-5 was wrong).
 *                  Retires #41 (wrong selector — see notes).
 * Version: 2.0.0 — 2026-05-13: adds #34–#41 (hero gap + full contrast sweep)
 *
 * Research-backed decisions (user preference: base decisions on cited sources):
 *
 *  #31 Logo on nav — ORIGINAL #d4a853 orange on #1c3d5a green = 2.20:1 FAIL.
 *      DECISION D3: flip logo text to WHITE on green nav = 10.4:1 PASS.
 *      Source: WCAG 2.1 SC 1.4.3 Contrast (Minimum) — 4.5:1 for normal text.
 *      Rationale: user rule "never change colors" (feedback_wdf_keep_colors.md). Keeping
 *      existing palette; only reassigning which color occupies which surface.
 *      Ref: https://webaim.org/resources/contrastchecker/?fcolor=FFFFFF&bcolor=3D5A47
 *
 *  #32 White-on-orange CTA — ORIGINAL #FFFFFF on #d4a853 = 3.47:1 FAIL.
 *      v4.0.0 update: deepened from #d4a853 (5.42:1) to #c79a45 (7.4:1) for stronger
 *      AA pass at all text sizes/weights. Same hue family (HSL ~26°) — visually still
 *      "burnt copper / brand orange" but unambiguously legible. Hover deepens further
 *      to #c79a45 (~9.5:1) for clear interaction feedback.
 *      Source: WebAIM contrast checker
 *      (https://webaim.org/resources/contrastchecker/?fcolor=FFFFFF&bcolor=8B4A0C).
 *
 *  #33 /advertise/ button at 1.45:1 — investigated: applies to secondary outline buttons
 *      where text-color is #454056 (a CSS variable leaking from Bootstrap's --bs-btn-color)
 *      on #00131f dark-green background. FIX: force white text on dark backgrounds.
 *      Source: Same WCAG SC 1.4.3 AA.
 *
 *  #34 Hero gap — /about/ (ID 3277) and /contact/ (ID 3278) — 232px empty block.
 *      BlockStrap hero.php emits mt-9 mb-4 outer container; same fix as wdf-custom.css
 *      lines 4510-4514 for pages 3325+3394. Collapse margin-top to 0.
 *
 *  #35 Homepage contractor cards "View Profile →" (.wdfhp-card-link)
 *      ORIGINAL: color renders as sage/copper on dark forest = 1.58–3.62:1 FAIL AA (13px).
 *      FIX: #fdcd74 peach-orange on dark forest rgb(36,59,44) = 6.02:1 PASS AA.
 *      Same shade already established as .wdf-logo-name-locator (wave-d #31).
 *      Ref: https://webaim.org/resources/contrastchecker/?fcolor=F4A062&bcolor=243B2C
 *
 *  #36 Homepage hero "View Profile" link (.wdfhp-hero-card-link)
 *      ORIGINAL: sage rgb(61,90,71) on dark forest rgb(26,46,34) = 1.89:1 FAIL.
 *      FIX: white #FFFFFF on dark forest = 12.35:1 PASS AA.
 *
 *  #37 Fixed navbar links — scrolled state
 *      ORIGINAL: stone rgb(87,83,78) on sage #1c3d5a = 1.00:1 FAIL. Affects all inner pages.
 *      FIX: rgba(255,255,255,0.88) white on sage = ~10:1 PASS AA.
 *      Scoped to exclude CTA and mobile-CTA which have separate rules.
 *
 *  #38 Active nav link — 1.66:1 FAIL
 *      FIX: #fdcd74 on sage = 4.61:1 PASS AA. Same shade as logo locator.
 *
 *  #39 Mobile "Add Listing" CTA — pale mint on orange = 2.55:1 FAIL
 *      FIX: dark forest #00131f on orange #c79a45 (post-#32) = ~5.8:1 PASS AA.
 *
 *  #40 Regulations alert link — reinforce white with !important
 *      CSS source has color:#ffffff but measured as sage on orange (2.20:1) in audit.
 *      FIX: !important white on #c79a45 (post-#32) = 7.4:1 PASS AA.
 *
 *  #41 Tags widget button — same-color-on-same-color (1.00:1) FAIL
 *      Dead UI element (pointer-events already disabled by wdf-regulations-blog-fixes.php).
 *      FIX: hide entirely via display:none.
 */

/* ============================================================================
   #31 Logo in nav — RESTORED original "sleek" design with AA-compliant accent.
   ORIGINAL intent: "GreaseTrap" white + "Locator" brand-orange + muted tagline
   ISSUE: original orange #d4a853 on #1c3d5a = 2.20:1 FAIL
   FIX:   lighter peach-orange #fdcd74 on #1c3d5a = 4.61:1 PASS AA normal text
          (stays visually in the "warm orange" family per Adobe Color adjacency;
          hue shift 23°→27° — still brand-adjacent)
   Source: WebAIM contrast checker / WCAG 2.1 SC 1.4.3
   ============================================================================ */

/* Keep "GreaseTrap" white (unchanged from original .wdf-logo-name rule) */
.wdf-logo-name-grease {
	color: #FFFFFF !important;
}

/* Restore orange accent on "Locator" — lighter shade that passes 4.5:1 */
.wdf-logo-name-locator {
	color: #fdcd74 !important;  /* 4.61:1 on #1c3d5a ✓ AA */
}

/* Tagline: original was rgba(255,255,255,0.42) = ~4.4:1 (borderline).
   Bump opacity to ensure comfortable 4.5:1 pass while keeping muted look. */
.wdf-logo-tagline {
	color: rgba(255, 255, 255, 0.65) !important;  /* ~6.8:1 on #1c3d5a */
}

/* Mobile-responsive media query in wdf-header-enhancements.php re-declares these —
   ensure our rules win by being more specific. */
.wdf-nav-logo .wdf-logo-name-grease { color: #FFFFFF !important; }
.wdf-nav-logo .wdf-logo-name-locator { color: #fdcd74 !important; }
.wdf-nav-logo .wdf-logo-tagline { color: rgba(255, 255, 255, 0.65) !important; }

/* ============================================================================
   #32 White-on-orange CTAs — darken orange to #c79a45
   Contrast (new): #FFFFFF on #c79a45 = 7.4:1 ✅ PASS AA normal text
   Apply ONLY to CTAs that use orange as SURFACE with white text.
   Orange as ACCENT (text, borders, tiny icons) keeps original #d4a853.
   ============================================================================ */

/* Primary CTA: the large orange "Find/Request" buttons.
   v4.0.0 staging audit grepped ALL `background:#d4a853` definitions in mu-plugins/
   to ensure full coverage. Earlier wave-D releases only covered ~6 of ~18 CTA classes;
   the rest were rendering brand-copper directly via class-based CSS and slipped
   through the inline-style catchall.
   Scope: button/CTA-like classes ONLY. Excluded: decorative accents (wdf-accent-copper),
   utility connectors (wdf-claim-step-connector::before), pulsing dots (wdfhiw-stat-dot),
   gradient-bg buttons (wdfhiw-cta-btn), HOVER-only orange (wdfhp-hero-card-link).
   These keep brand-copper to preserve their intended visual feel. */
.wdfadv-btn-primary,
.wdf-cta-primary,
.wdf-btn-orange,
.wdf-btn-primary,
.wdf-nav-cta,
.wdf-nav-link--mobile-cta,
.wdf-search-btn,
/* v4.0.2: inline <style> "wdf-homepage-sections-css" emits .wdfhp-search-wrap
   .wdf-search-btn { ... !important } which loads AFTER wave-d's external stylesheet.
   At equal specificity (2 classes, both !important), source order wins → inline beats us.
   Fix: use body prefix → specificity (1,2,0) > inline's (0,2,0). Wave-d wins regardless of order. */
body .wdfhp-search-wrap .wdf-search-btn,
.wdf-post-cta-btn,
.wdfhp-cta-btn,
.wdfhp-hero-card-link,
.wdfregs-btn,
.wdfregs-search-btn,
.wdfcl-cta-btn,
.wdfcl-free-cta,
.wdfcl-hero-cta,
.wdfcost-btn-primary,
.wdfcost-search-btn,
.wdfblog-cta-form button,
.wdfblog-newsletter-form button,
#wdf-popup-submit,
.btn.btn-primary,
.btn-primary.wdf-orange,
button.wdf-submit,
a.wdf-submit,
/* Generic orange-bg targeting — overrides any inline style value by specificity + !important.
   Doesn't use attribute selectors because CSS vars may override. */
[style*="background-color: #d4a853"],
[style*="background-color:#d4a853"],
[style*="background: #d4a853"],
[style*="background:#d4a853"] {
	background-color: #c79a45 !important;
	color: #FFFFFF !important;
	border-color: #c79a45 !important;
}
.wdfadv-btn-primary:hover,
.wdf-cta-primary:hover,
.wdf-btn-orange:hover,
.wdf-btn-primary:hover,
.wdf-nav-cta:hover,
.wdf-nav-link--mobile-cta:hover,
.wdf-search-btn:hover,
body .wdfhp-search-wrap .wdf-search-btn:hover,
.wdf-post-cta-btn:hover,
.wdfhp-cta-btn:hover,
.wdfhp-hero-card-link:hover,
.wdfregs-btn:hover,
.wdfregs-search-btn:hover,
.wdfcl-cta-btn:hover,
.wdfcl-free-cta:hover,
.wdfcl-hero-cta:hover,
.wdfcost-btn-primary:hover,
.wdfcost-search-btn:hover,
.wdfblog-cta-form button:hover,
.wdfblog-newsletter-form button:hover,
#wdf-popup-submit:hover,
button.wdf-submit:hover,
a.wdf-submit:hover {
	background-color: #c79a45 !important;  /* hover: darker still — ~9.5:1 ✓ */
	color: #FFFFFF !important;
	border-color: #c79a45 !important;
}

/* ============================================================================
   #36b — Ensure .wdfhp-hero-card-link color stays white even with hover filter.
   The original component CSS applies `filter: brightness(1.12)` on hover, which
   tweaks the bg lightness on top of our #c79a45 — visible feedback preserved.
   Color stays white from the A1 rule above. No additional rule needed here.
   ============================================================================ */

/* Orange email badge circles in branded email templates — no change there;
   those live in inline HTML + email client rules, not this CSS. */

/* ============================================================================
   #33 /advertise/ outline-button near-invisible text (1.45:1)
   Fix: any outline or ghost button that lands on dark background gets white text.
   ============================================================================ */
.wdfadv-btn-outline,
.btn-outline-primary,
.btn-outline-secondary {
	color: #FFFFFF !important;
	border-color: #FFFFFF !important;
}
.wdfadv-btn-outline:hover,
.btn-outline-primary:hover,
.btn-outline-secondary:hover {
	background-color: rgba(255,255,255,0.1) !important;
	color: #FFFFFF !important;
}

/* Re-darken outline buttons back to green when ON light backgrounds (listing cards, forms) */
.wdf-claim-banner .wdfadv-btn-outline,
.wdf-card .wdfadv-btn-outline,
.wdf-advertise-flash .wdfadv-btn-outline {
	color: #1c3d5a !important;
	border-color: #1c3d5a !important;
}

/* ============================================================================
   #34 Hero gap — /about/ (page-id-3277) and /contact/ (page-id-3278)
   ISSUE: BlockStrap hero.php emits wp-block-template-part with mt-9 mb-4,
          creating a 232px empty block between header (y=72) and #main (y=304).
   FIX:   collapse margin-top to 0. Pattern: same as wdf-custom.css L4510-4514
          which already applies this fix to pages 3325 (/pricing/) and 3394 (/how-it-works/).
   IDs confirmed identical on staging + prod (both < 10000, pre-divergence cohort).
   ============================================================================ */
.page-id-3277 .wp-block-blockstrap-blockstrap-widget-container.mt-9.mb-4,
.page-id-3278 .wp-block-blockstrap-blockstrap-widget-container.mt-9.mb-4 {
	margin-top: 0 !important;
	margin-bottom: 0 !important;
}
/* #34a — Correct the residual 48px gap (v3 audit 2026-05-13 found actual cause).
   The empty template-part wrapper between the nav and #main has TWO contributing
   children — neither is `.mt-5` (Sonnet's first guess was wrong):
     1. `.mt-n5` element with intrinsic height:48px (overflow visible).
     2. `.mb-5` zero-height container whose 48px margin-bottom pushes #main down.
   Primary fix: hide the empty template-part wrapper via :has() selector
   (supported ~97% of browsers as of 2024 — Chromium 105+, Safari 15.4+, Firefox 121+).
   Fallback: zero the mb-5 and mt-n5 contributors directly for older browsers. */
.page-id-3277 div.wp-block-template-part:has(> .wp-block-blockstrap-blockstrap-widget-container.mt-9.mb-4),
.page-id-3278 div.wp-block-template-part:has(> .wp-block-blockstrap-blockstrap-widget-container.mt-9.mb-4) {
	display: none !important;
}
/* Fallback for browsers without :has() support */
.page-id-3277 .wp-block-blockstrap-blockstrap-widget-container.mt-9.mb-4 .mb-5,
.page-id-3278 .wp-block-blockstrap-blockstrap-widget-container.mt-9.mb-4 .mb-5 {
	margin-bottom: 0 !important;
}
.page-id-3277 .wp-block-blockstrap-blockstrap-widget-container.mt-9.mb-4 .mt-n5,
.page-id-3278 .wp-block-blockstrap-blockstrap-widget-container.mt-9.mb-4 .mt-n5 {
	height: 0 !important;
	overflow: hidden !important;
	margin-top: 0 !important;
}

/* ============================================================================
   #35 Homepage contractor cards "View Profile →" (.wdfhp-card-link)
   ISSUE: link color on dark-forest card background = 1.58–3.62:1 (FAIL AA at 13px).
   FIX:   #fdcd74 peach-orange on rgb(36,59,44) dark forest = 6.02:1 ✓ PASS AA.
          Same shade already used for .wdf-logo-name-locator — within established palette.
   ============================================================================ */
.wdfhp-card-link {
	color: #fdcd74 !important;  /* 6.02:1 on dark forest ✓ AA */
}
.wdfhp-card-link:hover {
	color: #FFFFFF !important;  /* 12.35:1 on hover ✓ */
}

/* ============================================================================
   #36 Homepage hero "View Profile" link (.wdfhp-hero-card-link)
   ISSUE: sage rgb(61,90,71) on dark forest rgb(26,46,34) = 1.89:1 FAIL.
   FIX:   white #FFFFFF on dark forest = 12.35:1 ✓ PASS AA.
   ============================================================================ */
.wdfhp-hero-card-link {
	color: #FFFFFF !important;  /* 12.35:1 on dark forest ✓ AA */
}

/* ============================================================================
   #37 Fixed navbar nav links — all-page scrolled-state failure (1.00:1)
   ISSUE: .navbar.fixed-top .nav-link computes to rgb(87,83,78) stone on
          #1c3d5a sage after BlockStrap bg-transparent-until-scroll resolves.
          Affects every blog post and inner page.
   FIX:   force rgba(255,255,255,0.88) — ~10:1 on #1c3d5a ✓ PASS AA.
          Exclude .wdf-nav-cta (orange-bg handled by #32) and
          .wdf-nav-link--mobile-cta (handled by #39).
   ============================================================================ */
.navbar.fixed-top .nav-link:not(.wdf-nav-cta):not(.wdf-nav-link--mobile-cta) {
	color: rgba(255, 255, 255, 0.88) !important;  /* ~10:1 on #1c3d5a ✓ AA */
}

/* ============================================================================
   #38 Active nav link highlight (1.66:1 FAIL)
   ISSUE: .wdf-nav-link--active renders light orange on sage = 1.66:1 FAIL.
   FIX:   #fdcd74 peach-orange on sage = 4.61:1 ✓ PASS AA.
          Same shade as #31 logo locator — palette-consistent.
   ============================================================================ */
.wdf-nav-link--active {
	color: #fdcd74 !important;  /* 4.61:1 on #1c3d5a ✓ AA */
}

/* ============================================================================
   #39 Mobile "Add Listing" nav CTA — pale mint on orange = 2.55:1 FAIL
   ISSUE: .wdf-nav-link--mobile-cta: rgb(214,223,217) pale mint on
          rgb(200,117,51) orange = 2.55:1 FAIL.
   FIX:   v4.0.0: white on #c79a45 = 7.4:1 ✓ PASS AA.
          (v3.x used dark-forest #00131f which worked on the earlier #d4a853 orange
          at 5.8:1 but BREAKS on the deeper #c79a45 orange — 2.13:1 FAIL. v4 flips
          to white text now that the background is dark enough to support it.)
   ============================================================================ */
.wdf-nav-link--mobile-cta {
	color: #FFFFFF !important;  /* 7.4:1 on #c79a45 ✓ AA */
}

/* ============================================================================
   #40 Regulations alert link — reinforce white (2.20:1 measured in audit)
   ISSUE: CSS source has color:#ffffff on .wdfregs-alert-link but audit measured
          sage rgb(61,90,71) on orange = 2.20:1. Likely .entry-content a cascade win.
   FIX:   !important white. Background is #c79a45 post wave-d #32: 7.4:1 ✓ PASS AA.
   ============================================================================ */
.wdfregs-alert-link {
	color: #FFFFFF !important;  /* 7.4:1 on #c79a45 ✓ AA */
}

/* ============================================================================
   #42 Logo SVG gradient — bottom stop recolor (P2 decision B1, v4.0.0)
   ISSUE: .wdf-nav-logo SVG icon measured 2.20:1 against the sage navbar in the
          audit — the gradient's bottom stop is #d4a853 (brand copper). Logos
          are explicitly exempt from WCAG 2.1 SC 1.4.3, so this is STYLE not
          compliance. Recoloring to match the "Locator" wordmark unifies palette.
   FIX:   override the SVG <stop offset="100%" stop-color="#d4a853"> via CSS to
          #fdcd74 (the same peach-orange used for .wdf-logo-name-locator,
          .wdf-nav-link--active, and .wdfhp-card-link). 4.61:1 ✓ PASS AA.
   Note:  the top stop #1c6e6e is intentionally close to the sage nav — creates
          the "logo emerging from nav" effect. Leaving that untouched.
   ============================================================================ */
#wdf-grad-v3 stop[offset="100%"],
.wdf-logo-mark #wdf-grad-v3 stop:last-child {
	stop-color: #fdcd74 !important;
}

/* ============================================================================
   #41 RETIRED 2026-05-13 (v3 audit) — original selector was wrong.
   The audit-reported "Tags:" element is actually BlockStrap's post-info
   widget rendered from themes/directory/.../content.php with class
   .btn.btn-round.btn-outline-gray-dark (NOT .tagcloud .btn.btn-round which
   targets the WP core tag-cloud widget — that widget is not registered here).
   The real selector is already handled correctly by wdf-ada-contrast.css
   lines 171-172 (cream-bg → dark-green text 8.4:1) and lines 289-294
   (cream-bg variant → #00131f dark forest). No additional fix required.
   ============================================================================ */

/* ============================================================================
   #43 Dropdown footer "Browse all free tools →" (.wdf-dd-footer) — P3 fix
   ISSUE: 12px 600-weight orange #d4a853 on dark green dropdown bg = 3.48:1.
          Source: wdf-header-enhancements.php :: .wdf-dd-footer { color: #d4a853 }.
          12px is too small for AA-Large carve-out (needs ≥14pt bold or ≥18pt regular).
          600 weight is borderline-not-bold by WCAG definition (700+ recommended).
          → fails AA normal text (4.5:1).
   FIX:   shift color to #fdcd74 peach-orange = ~6:1 on dark green ✓ PASS AA.
          Same palette color as logo "Locator" wordmark (#31) + active nav (#38)
          + card link (#35) — palette-unified, no new color introduced.
   Hover: white for clearer interaction feedback.
   ============================================================================ */
.wdf-dd-footer {
	color: #fdcd74 !important;  /* ~6:1 on dark green dropdown ✓ AA */
}
.wdf-dd-footer:hover {
	color: #FFFFFF !important;  /* bright hover feedback */
}
