/* Accessibility and Performance Improvements */

/* Fix contrast issues for better readability */
.social-title,
.header-top {
    color: #ffffff !important;
}

/* Only apply dark color to sub-title if it's NOT explicitly white or on a dark theme section */
.sub-title:not(.text-white) {
    color: #1a1a1a !important;
}

.service-sec15 .sub-title {
    color: #2c3e50 !important;
}

.service-box3_text,
.testi-box_desig,
.blog-box2:not(.style2) a,
.blog-box2:not(.style2) p,
.faq-area .sub-title {
    color: #333333 !important;
}

body.theme-blue3,
body.theme-blue3 p {
    color: #2c3e50 !important;
}

/* Improve heading hierarchy */
.counter-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.testimonial-title {
    font-size: 1rem;
    font-weight: 600;
}

.brand-title {
    font-size: 0.95rem;
    font-weight: 500;
}

/* Optimize image loading */
img {
    max-width: 100%;
    height: auto;
}

/* Add width and height attributes to prevent layout shift */
.mask-icon,
img[src*="title_shape_4.avif"] {
    width: auto;
    height: auto;
    display: inline-block;
}

/* Improve button accessibility */
button:focus,
a:focus {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

/* Better mobile responsiveness */
@media (max-width: 768px) {

    .service-sec15,
    .faq-area,
    .blog-box2 {
        padding: 1rem;
    }

    .sub-title {
        font-size: 0.9rem !important;
    }

    .sec-title {
        font-size: 1.5rem !important;
    }
}

/* Screen reader only utility */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Lazy load optimization */
img[loading="lazy"] {
    content-visibility: auto;
}

/* Reduce cumulative layout shift */
.swiper-wrapper {
    min-height: 300px;
}

.blog-img,
.testi-box_img {
    aspect-ratio: 16/9;
    object-fit: cover;
}

/* Service Page Image Fix */
.blog-grid.style2 .blog-img {
    min-height: 300px;
    height: auto;
    aspect-ratio: auto !important;
}

.blog-grid.style2 .blog-img img {
    min-height: 300px;
    object-fit: cover;
    width: 100%;
    height: 100%;
}

/* --- DARK BACKGROUND CONTRAST FIXES --- */

/* Footer Visibility Fix */
.footer-wrapper p,
.footer-wrapper a,
.footer-wrapper span,
.footer-wrapper .widget_title,
.footer-wrapper li {
    color: #e0e0e0 !important;
}

.footer-wrapper a:hover {
    color: #ffffff !important;
}

/* Service Card 4 (Dark Blue Background) Fix */
.service_card4 .service_card4_text,
.service_card4 .box-title a {
    color: #ffffff !important;
}

/* Blog Box 2 Style 2 (Dark Card) Fix */
.blog-box2.style2 p,
.blog-box2.style2 .box-title a,
.blog-box2.style2 .blog-meta,
.blog-box2.style2 .blog-meta a,
.blog-box2.style2 .line-btn {
    color: #e0e0e0 !important;
}

.blog-box2.style2 .line-btn:hover {
    color: #ffffff !important;
}

/* Generic White Text Helper */
.text-white {
    color: #ffffff !important;
}

/* Specific Footer Overrides (Final Fix) */
.footer-wrapper .about-text,
.footer-wrapper .copyright-text,
.footer-wrapper .copyright-text a {
    color: #e0e0e0 !important;
}

.footer-wrapper .widget_title,
.footer-wrapper .widget_title.text-white,
.footer-wrapper .brand-title {
    color: #ffffff !important;
}