/* Reset all margins and padding for slideshow and its containers */
body > .full-width-content,
.page-content,
.page-body,
.page-body > *:first-child,
.slideshow-widget,
.slideshow-widget *,
.ss-slides,
.ss-slide,
.ss-slide .hero-img {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1;
}

/* Slideshow widget base */
.slideshow-widget {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    position: relative;
    top: -1px;
    overflow: hidden;
}

/* Enhanced slideshow captions */
.slideshow-widget .slide-caption {
    background: rgba(0, 0, 0, 0.6);
    padding: 1.5rem 2rem !important;
    border-radius: 8px;
    max-width: 90%;
    margin: 0 auto;
    backdrop-filter: blur(5px);
}

.slideshow-widget .slide-caption h1,
.slideshow-widget .slide-caption h2,
.slideshow-widget .slide-caption h3 {
    color: #fff !important;
    margin-top: 0 !important;
    margin-bottom: 1rem !important;
    line-height: 1.3 !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5) !important;
}

.slideshow-widget .slide-caption p {
    color: rgba(255, 255, 255, 0.9) !important;
    margin-bottom: 0.5rem !important;
    font-size: 1.1rem !important;
    line-height: 1.6 !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5) !important;
}

/* Position-specific adjustments */
.slideshow-widget.cap-top .slide-caption {
    margin-top: 2rem !important;
    margin-bottom: auto !important;
}

.slideshow-widget.cap-middle .slide-caption {
    margin: 1rem auto !important;
}

.slideshow-widget.cap-bottom .slide-caption {
    margin-top: auto !important;
    margin-bottom: 2rem !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .slideshow-widget .slide-caption {
        padding: 1rem 1.25rem !important;
        max-width: 95%;
    }
    
    .slideshow-widget .slide-caption h1 {
        font-size: 1.5rem !important;
    }
    
    .slideshow-widget .slide-caption p {
        font-size: 1rem !important;
    }
}

/* Slideshow slides and images */
.ss-slides,
.ss-slide {
    display: block !important;
    width: 100% !important;
}

.ss-slide .hero-img {
    width: 100% !important;
    height: auto !important;
    min-height: 500px !important;
    object-fit: cover !important;
    display: block !important;
}

/* Slide caption styling - positioned absolutely over the slide */
.slide-caption {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    color: #fff;
    z-index: 10;
    text-align: center;
    padding: 0 20px;
    box-sizing: border-box;
}

.slide-caption h1,
.slide-caption h2,
.slide-caption h3 {
    margin: 0 0 15px 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
    font-size: 2.5rem !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.slide-caption p {
    margin: 0 auto !important;
    padding: 0 !important;
    font-size: 1.2rem !important;
    line-height: 1.4 !important;
    max-width: 800px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* Reset header spacing */
.site-header {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Ensure no extra space around the slideshow */
.full-width-content {
    margin: 0 !important;
    padding: 0 !important;
}

/* Services widget spacing fixes */
.iboost-services-widget {
    margin: 0 !important;
    padding: 4rem 0 !important;
    width: 100% !important;
    overflow: visible !important;
    min-height: auto !important;
    position: relative;
    z-index: 1;
}

.iboost-services-widget .services-header {
    margin: 0 auto 2.5rem !important;
    padding: 0 15px !important;
    max-width: 1200px;
    text-align: center;
}

.iboost-services-widget .services-row {
    display: grid;
    grid-template-columns: repeat(var(--service-cols), 1fr);
    gap: 2rem;
    margin: 0 auto !important;
    padding: 0 15px !important;
    max-width: 1400px;
    box-sizing: border-box;
    overflow: visible !important;
    position: relative;
    z-index: 2;
}

/* Responsive grid */
@media (max-width: 1200px) {
    .iboost-services-widget .services-row {
        max-width: 100%;
        padding: 0 30px !important;
    }
}

@media (max-width: 991px) {
    .iboost-services-widget .services-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        padding: 0 1rem !important;
    }
    
    .iboost-services-widget .service-card {
        margin-bottom: 1.5rem !important;
    }
}

@media (max-width: 767px) {
    .iboost-services-widget .services-row {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 1.25rem !important;
        display: flex !important;
        flex-direction: column;
    }
    
    .iboost-services-widget {
        padding: 2rem 0 !important;
    }
    
    .iboost-services-widget .service-card {
        margin-bottom: 1.5rem !important;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .iboost-services-widget .service-content {
        padding: 1.5rem !important;
    }
    
    /* Ensure proper spacing between stacked cards */
    .iboost-services-widget .service-card:not(:last-child) {
        margin-bottom: 2rem !important;
    }
}

/* Service card styling */
.iboost-services-widget .service-card {
    margin: 0 0 2rem 0 !important;
    height: auto;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    overflow: visible;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #1a2035;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    z-index: 1;
}

.iboost-services-widget .service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* Fix image container */
.iboost-services-widget .service-image-container {
    height: 200px;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0;
    overflow: hidden;
    background-color: #141c2e;
}

.iboost-services-widget .service-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin: 0;
    padding: 0;
    display: block;
}

.iboost-services-widget .service-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2rem !important;
    background: #1a2035;
    line-height: 1.7;
    height: 100%;
    box-sizing: border-box;
}

/* Ensure consistent height for all cards in a row */
.iboost-services-widget .services-row {
    align-items: stretch;
}

/* Add some space above the services section */
#our-services {
    scroll-margin-top: 80px;
}

/* Ensure proper spacing after the services section */
.iboost-services-widget + .section {
    padding-top: 2rem;
}

/* Fix for grid layout */
.iboost-services-widget .services-row {
    grid-auto-rows: 1fr;
}

/* Ensure cards don't get cut off */
.iboost-services-widget .service-card > * {
    overflow: visible !important;
}

/* Mobile-specific fixes */
@media (max-width: 767px) {
    .iboost-services-widget .service-card {
        height: auto !important;
        min-height: auto !important;
    }
    
    .iboost-services-widget .services-row {
        display: flex !important;
        flex-direction: column;
    }
    
    /* Ensure content has proper spacing */
    .iboost-services-widget .service-content {
        height: auto !important;
    }
    
    /* Fix for any potential horizontal scrolling */
    .iboost-services-widget {
        width: 100% !important;
        overflow-x: hidden !important;
    }
}

/* Improved typography and spacing */
.main-content {
    line-height: 1.8;
    color: #e0e0e0;
}

.main-content p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.8;
}

.main-content h2, 
.main-content h3, 
.main-content h4 {
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    line-height: 1.3;
    color: #ffffff;
}

.main-content h2 {
    font-size: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.main-content ul, 
.main-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.main-content li {
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

/* Section spacing */
.section {
    padding: 4rem 0;
}

/* Container padding */
.container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .main-content p {
        font-size: 1rem;
        line-height: 1.7;
    }
    
    .main-content h2 {
        font-size: 1.75rem;
    }
    
    .section {
        padding: 3rem 0;
    }
}

.iboost-services-widget .service-button {
    margin: 1.5rem auto 0;
    display: block;
    text-align: center;
    width: auto;
    min-width: 150px;
}
