/**
 * Dr. DEEB Site Fixes — CSS
 * Performance, accessibility, SEO, and conversion improvements.
 */

/* =============================================================
   1. SEO — Visually hidden H1 (present for screen readers + SEO)
   ============================================================= */
.drdeeb-seo-h1 {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    /* Screen readers and search engines can still see this */
}

/* =============================================================
   2. STICKY CTA BAR
   ============================================================= */
.drdeeb-sticky-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: linear-gradient(135deg, #1a5276, #2980b9);
    padding: 12px 20px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.drdeeb-sticky-cta.visible {
    transform: translateY(0);
}

.drdeeb-sticky-cta__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.drdeeb-sticky-cta__text {
    color: #ffffff;
    font-size: 16px;
    font-weight: 500;
}

.drdeeb-sticky-cta__btn {
    display: inline-block;
    background: #ffffff;
    color: #1a5276;
    padding: 10px 28px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.drdeeb-sticky-cta__btn:hover,
.drdeeb-sticky-cta__btn:focus {
    background: #eaf2f8;
    transform: scale(1.05);
    color: #1a5276;
    text-decoration: none;
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Don't overlap the mobile call button */
@media (max-width: 640px) {
    .drdeeb-sticky-cta {
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .drdeeb-sticky-cta__text {
        font-size: 14px;
    }

    .drdeeb-sticky-cta__btn {
        font-size: 13px;
        padding: 8px 22px;
    }

    /* Move the WP call button up when sticky CTA is visible */
    .wp-call-button {
        bottom: 70px !important;
    }
}

/* =============================================================
   3. ACCESSIBILITY — Focus indicators
   ============================================================= */
*:focus-visible {
    outline: 3px solid #2980b9;
    outline-offset: 2px;
}

/* Ensure sufficient color contrast on links */
a {
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

/* Minimum touch target size (44x44px) for mobile buttons */
@media (max-width: 1024px) {
    .awb-menu__main-ul a,
    .wp-call-button,
    button,
    input[type="submit"],
    .drdeeb-sticky-cta__btn {
        min-height: 44px;
        min-width: 44px;
    }
}

/* =============================================================
   4. PERFORMANCE — Reduce layout shift from images
   ============================================================= */
img {
    aspect-ratio: attr(width) / attr(height);
    height: auto;
    max-width: 100%;
}

/* Contain intrinsic size for lazy-loaded images */
img[loading="lazy"] {
    content-visibility: auto;
}

/* =============================================================
   5. CTA BUTTON IMPROVEMENTS — Make existing contact buttons more visible
   ============================================================= */
.fusion-button.button-default {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fusion-button.button-default:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* =============================================================
   6. NAVIGATION — Hide empty "Articles" link if section is empty
   ============================================================= */
/* Uncomment the line below if the Articles page has no content yet:
.awb-menu__main-ul li.menu-item a[href*="articles"]:only-child {
    display: none;
}
*/

/* =============================================================
   7. PRINT STYLES — Clean printout for patients
   ============================================================= */
@media print {
    .drdeeb-sticky-cta,
    .wp-call-button,
    .ea11y-widget,
    #wpconsent-banner {
        display: none !important;
    }
}
