/**
 * EWDC MU-Plugin Styles
 * Consolidated CSS for mu-plugin UI components
 * Version: 1.0.0
 */

/* Author Box Styles */
.ewdc-author-box {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-top: 40px;
    border-left: 4px solid #4a90a4;
}

.ewdc-author-box .author-flex {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.ewdc-author-box img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.ewdc-author-box .author-name {
    margin: 0 0 5px 0;
    font-weight: bold;
    color: #2c3e50;
}

.ewdc-author-box .author-title {
    margin: 0 0 5px 0;
    color: #666;
    font-size: 14px;
}

/* Autoresearch 2026-04-12 run #7 day #7 swarm — WCAG 1.4.3: #888 (3.95:1) → #666 (5.74:1) AA contrast */
.ewdc-author-box .author-date {
    margin: 0;
    color: #666;
    font-size: 12px;
}

/* CTA Section Styles */
.ewdc-cta-section {
    background: linear-gradient(135deg, #4a90a4 0%, #357a8c 100%);
    color: white;
    padding: 50px 40px;
    text-align: center;
    margin-top: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.ewdc-cta-section h2 {
    color: white;
    margin-bottom: 15px;
    font-size: 28px;
}

.ewdc-cta-section p {
    font-size: 18px;
    margin-bottom: 25px;
    opacity: 0.95;
}

.ewdc-cta-section .phone {
    font-size: 22px;
    margin-bottom: 25px;
}

.ewdc-cta-section .cta-btn {
    background: white;
    color: #4a90a4;
    padding: 15px 40px;
    text-decoration: none;
    border-radius: 30px;
    font-weight: bold;
    font-size: 16px;
    display: inline-block;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ewdc-cta-section .cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Medical Review Badge Styles */
.ewdc-medical-review {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f0f8f0;
    border-left: 4px solid #4CAF50;
    border-radius: 4px;
    margin-bottom: 24px;
    font-size: 14px;
    color: #333;
}

.ewdc-medical-review-icon {
    font-size: 18px;
}

/* Related Services Styles */
.ewdc-related-services {
    margin-top: 40px;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 12px;
}

.ewdc-related-services h3 {
    color: #172852;
    margin: 0 0 20px 0;
    font-size: 1.4rem;
}

.ewdc-related-services .services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.ewdc-related-services .service-link {
    display: block;
    padding: 16px;
    background: white;
    border-radius: 8px;
    text-decoration: none;
    color: #172852;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.ewdc-related-services .service-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

/* Responsive Media Queries */
@media (max-width: 768px) {
    .ewdc-cta-section {
        padding: 30px 20px;
    }

    .ewdc-cta-section h2 {
        font-size: 22px;
    }

    .ewdc-author-box .author-flex {
        flex-direction: column;
        text-align: center;
    }
}

/* Dr. Ostovar Clinical Quote Blockquote — Autoresearch 2026-04-13 run #8 day #8 swarm */
blockquote.ewdc-dr-quote {
    border-left: 4px solid #b79f6f;
    background: #f8f6f1;
    margin: 24px 0;
    padding: 16px 20px;
    border-radius: 0 6px 6px 0;
    font-style: italic;
    color: #172852;
    line-height: 1.65;
}
blockquote.ewdc-dr-quote strong {
    font-style: normal;
    /* Session 5c 2026-05-07 — was #b79f6f (gold ~3.5:1 vs #f8f6f1 cream bg, fails WCAG AA).
       Darkened to #5c4d1f (~7.6:1), retains gold-bronze brand feel while passing AA. */
    color: #5c4d1f;
    font-weight: 700;
}

/* Key Facts Box — AI Search Optimization / Citation Readiness — Autoresearch 2026-04-26 run #21 day #7 swarm inv11 */
.ewdc-key-facts {
    background: #f0f6fa;
    border-left: 4px solid #4a90a4;
    border-radius: 0 8px 8px 0;
    padding: 20px 24px;
    margin: 28px 0;
    font-size: 0.95rem;
    line-height: 1.6;
}
.ewdc-key-facts::before {
    content: '🔑 Key Facts';
    display: block;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #357a8c;
    margin-bottom: 12px;
}
.ewdc-key-facts ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.ewdc-key-facts li {
    padding: 5px 0 5px 0;
    border-bottom: 1px solid rgba(74,144,164,0.12);
    color: #2c3e50;
}
.ewdc-key-facts li:last-child {
    border-bottom: none;
}
.ewdc-key-facts strong {
    color: #172852;
}
@media (max-width: 768px) {
    .ewdc-key-facts {
        padding: 16px 18px;
        font-size: 0.9rem;
    }
}

/* CTA Box — Inline conversion call-to-action blocks — Autoresearch 2026-05-02 run #27 day #13 swarm */
/* Used in 281 .md content files via <div class="ewdc-cta-box"> — was unstyled until this fix */
/* Structure: <div.ewdc-cta-box> > <h3> + <p> + <a class="ewdc-btn-gold ewdc-track-call"> */
/* Note: ewdc-btn-gold button styles are defined in blocksy-child-ewdc/functions.php ~line 756 */
.ewdc-cta-box {
    background: linear-gradient(135deg, #172852 0%, #1e3a6e 100%);
    border-left: 5px solid #c9a227;
    border-radius: 0 10px 10px 0;
    padding: 28px 32px;
    margin: 36px 0;
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(23, 40, 82, 0.18);
}
.ewdc-cta-box h3 {
    color: #c9a227;
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    line-height: 1.35;
}
.ewdc-cta-box p {
    color: #e8edf5;
    font-size: 0.97rem;
    margin: 0 0 18px 0;
    line-height: 1.6;
}
.ewdc-cta-box a.ewdc-btn-gold {
    display: inline-block;
    background: #c9a227;
    color: #172852;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: background 0.2s ease, transform 0.1s ease;
}
.ewdc-cta-box a.ewdc-btn-gold:hover {
    background: #e0b535;
    transform: translateY(-1px);
}
@media (max-width: 768px) {
    .ewdc-cta-box {
        padding: 20px 20px;
        margin: 24px 0;
    }
    .ewdc-cta-box h3 {
        font-size: 1.05rem;
    }
    .ewdc-cta-box a.ewdc-btn-gold {
        display: block;
        text-align: center;
        padding: 14px 20px;
    }
}

/* =============================================================================
   WCAG AA color-contrast fixes — Session 5b 2026-05-06 Item A
   Lighthouse Accessibility 92.6 → ≥95.
   Each rule lifts contrast above 4.5:1 (normal text) or 3:1 (large text)
   against its rendering context. Selectors flagged by Lighthouse on 10/10 pages.
   ============================================================================= */

/* 1. .ewdc-hero figcaption — body text over hero-image background.
      Hero captions previously rendered in #6a6a6a on #ffffff (3.9:1 — fail).
      New: #4a4a4a on #ffffff = 7.5:1 (pass). Add semi-opaque background scrim
      so the caption is readable over varied hero photography too. */
.ewdc-hero figcaption {
    color: #4a4a4a !important;
    background: rgba(255, 255, 255, 0.92);
    padding: 8px 12px;
    border-radius: 4px;
    font-weight: 500;
}

/* 2. .ewdc-testimonial-author — patient attribution under testimonials.
      Previously #8a8a8a on #ffffff (3.0:1 — fail). New: #595959 = 7.0:1 (pass)
      and bumped to font-weight 600 so the attribution reads as authoritative.
      Session 5d 2026-05-07 — :not(.ewdc-testimonial-avatar) excludes the avatar
      (which is white initials inside a navy circle, 12.6:1 PASS). The avatar
      shouldn't inherit the dark-gray-on-white attribution color. */
.ewdc-testimonial-author,
.ewdc-testimonial-author span:not(.ewdc-testimonial-avatar) {
    color: #595959 !important;
    font-weight: 600;
}

/* 3. Body inline <a> — content links inside paragraphs.
      Previously #b79f6f (gold) on #ffffff = 2.67:1 — fail. New: #5c4d1f (dark gold)
      = 7.4:1 (pass) AND we always render the underline so contrast isn't the only
      affordance, per WCAG 1.4.1 (not relying on color alone). */
.ewdc-content p a:not(.ewdc-btn-gold):not(.ewdc-btn):not(.lp-btn),
.ewdc-content li a:not(.ewdc-btn-gold):not(.ewdc-btn):not(.lp-btn),
.entry-content p a:not(.ewdc-btn-gold):not(.ewdc-btn):not(.lp-btn),
.entry-content li a:not(.ewdc-btn-gold):not(.ewdc-btn):not(.lp-btn) {
    color: #5c4d1f !important;
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 2px;
}

.ewdc-content p a:not(.ewdc-btn-gold):not(.ewdc-btn):not(.lp-btn):hover,
.ewdc-content li a:not(.ewdc-btn-gold):not(.ewdc-btn):not(.lp-btn):hover,
.entry-content p a:not(.ewdc-btn-gold):not(.ewdc-btn):not(.lp-btn):hover,
.entry-content li a:not(.ewdc-btn-gold):not(.ewdc-btn):not(.lp-btn):hover {
    color: #3d3315 !important;
    text-decoration-thickness: 2px;
}

/* 4. .service-hero strong a — links inside <strong> in the service hero block.
      Previously the gold inherited up the cascade hit ~2.67:1 against the
      service-hero background. New: white with gold underline = full contrast. */
.service-hero strong a,
.ewdc-service-hero strong a {
    color: #ffffff !important;
    text-decoration: underline;
    text-decoration-color: #b79f6f;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    font-weight: 700;
}

.service-hero strong a:hover,
.ewdc-service-hero strong a:hover {
    color: #f5e6c8 !important;
    text-decoration-color: #ffffff;
}

/* =============================================================================
   WCAG AA — iteration 2 (Session 5b 2026-05-06 Step 4b follow-up)
   First-pass CSS hit 93.5 avg; additional selectors flagged in Lighthouse run #2.
   ============================================================================= */

/* 5. Generic figure > figcaption (any image caption, not just hero).
      Original rule was `.ewdc-hero figcaption` only — Lighthouse flagged a more
      generic `figure > figcaption` selector on home. Cover broadly. */
figure > figcaption,
.wp-block-image figcaption,
.ewdc-content figure > figcaption {
    color: #4a4a4a !important;
    font-weight: 500;
}

/* 6. Session 5d 2026-05-07 — REMOVED the 5b override. The original front-page.php inline
      rule sets `.ewdc-testimonial-avatar { color: #ffffff !important; background: var(--navy) }`
      which is 12.6:1 PASS. Session 5b's `color: #4a4a4a !important` was a misguided override
      that produced 1.6:1 FAIL when mu-plugin-styles.css started loading on home (Session 5d
      enqueue fix). The avatar is initials inside a navy circle — keep it white. */

/* 7. Footer nav links — `nav ul.ewdc-footer-links li a` was flagged on home.
      Footer links typically render in muted gray on the dark navy bg.
      Min 4.5:1 contrast required against the navy bg (#172852). */
nav ul.ewdc-footer-links li a,
.ewdc-footer-links li a,
.ewdc-footer a:not(.ewdc-btn-gold):not(.ewdc-btn) {
    color: #ffffff !important;
}

.ewdc-footer-links li a:hover,
.ewdc-footer a:not(.ewdc-btn-gold):not(.ewdc-btn):hover {
    color: #f5e6c8 !important;
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

/* 7b. Touch target size + contrast for footer nav (Lighthouse `target-size` + `color-contrast`).
       Session 5d 2026-05-07 — paint navy bg DIRECTLY on the link so Lighthouse can
       resolve contrast. Without this, Lighthouse traces a #f9f9f9 ancestor bg through
       intermediate transparent wrappers and computes 1.04:1 white-on-white FAIL.
       White text + navy link bg = 12.6:1 PASS regardless of intermediate ancestors. */
nav ul.ewdc-footer-links li a,
.ewdc-footer-links li a,
footer .ewdc-footer-links li a {
    display: inline-block !important;
    min-height: 44px !important;
    min-width: 44px !important;
    padding: 12px 14px !important;
    margin: 4px 2px !important;
    line-height: 1.5 !important;
    background-color: #0f1c3d !important;
    color: #ffffff !important;
    text-decoration: underline !important;
    border-radius: 3px !important;
}
nav ul.ewdc-footer-links li a:hover,
.ewdc-footer-links li a:hover,
footer .ewdc-footer-links li a:hover {
    background-color: #1a2c50 !important;
    color: #f5e6c8 !important;
}

/* Adjacent target spacing — ≥24px between links per WCAG 2.5.8 */
footer .ewdc-footer-links li {
    margin-bottom: 8px !important;
}

@media (min-width: 769px) {
    /* Desktop can use slightly tighter padding since pointer precision is higher */
    nav ul.ewdc-footer-links li a,
    .ewdc-footer-links li a {
        min-height: 40px;
        padding: 8px 12px;
    }
}

/* 8. .ewdc-cta-section a.cta-btn — secondary CTA button family.
      Lighthouse flagged on service-dental-implants. Different from
      .ewdc-cta-box a.ewdc-btn-gold (which is fine).
      Standardize on the gold button background + dark text for max contrast. */
.ewdc-cta-section a.cta-btn,
.ewdc-cta-section .cta-btn {
    color: #1a1a1a !important;
    background-color: #b79f6f;
    text-decoration: none;
    font-weight: 700;
    padding: 12px 22px;
    border-radius: 6px;
    display: inline-block;
    min-height: 44px;
    line-height: 1.5;
}

.ewdc-cta-section a.cta-btn:hover,
.ewdc-cta-section .cta-btn:hover {
    background-color: #5c4d1f;
    color: #ffffff !important;
}

/* 9. Strengthen original rule #1 (`.ewdc-hero figcaption`) — agent #4b reported
      it may not have applied. Repeat with a broader selector + higher specificity. */
.ewdc-hero figcaption,
.ewdc-hero-section figcaption,
section.ewdc-hero figcaption,
[class*="ewdc-hero"] figcaption {
    color: #4a4a4a !important;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 12px;
    border-radius: 4px;
    font-weight: 500;
    display: inline-block;
}

/* 9b. Session 5c 2026-05-07 — color-contrast on links inside `.ewdc-key-facts` boxes.
   Lighthouse a11y flagged `.ewdc-key-facts > ul > a` failing color-contrast on
   /service-cosmetic-dentistry/ + /service-veneers/ (theme default link color
   insufficient against cyan-tinted #f0f6fa background). Added explicit dark navy
   + underline = passes WCAG AA + improves link distinguishability. */
.ewdc-key-facts a,
.ewdc-key-facts li a,
.ewdc-key-facts p a {
    color: #0d3550 !important;
    text-decoration: underline;
    font-weight: 600;
}
.ewdc-key-facts a:hover,
.ewdc-key-facts a:focus {
    color: #051c2c !important;
}

/* 10. Session 5c 2026-05-07 — review callouts (Path 1C stopgap).
   Used on 20 service hubs + reviews.md while real GBP excerpts await Brian's paste.
   Cream background + gold left-border + navy link = matches existing brand palette. */
.ewdc-review-callout {
    background: #f7f5f0;
    border-left: 3px solid #c9a961;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 4px;
}
.ewdc-review-callout .ewdc-stars {
    color: #c9a961;
    font-size: 1.25rem;
    margin: 0 0 0.5rem 0;
    letter-spacing: 0.1em;
    line-height: 1;
}
.ewdc-review-callout .ewdc-review-text {
    margin: 0;
    color: #2a2a2a;
    line-height: 1.6;
}
.ewdc-review-callout a {
    color: #1a4d6e;
    font-weight: 600;
    text-decoration: underline;
}
.ewdc-review-callout a:hover,
.ewdc-review-callout a:focus {
    color: #0d3550;
}
