/**
 * BTFC Spacing Reductions - Custom CSS
 * 
 * Reduces excessive padding and margins between sections
 * Specifically targets menu, CTA banner, and news sections
 * 
 * @package BTFC_Widgets
 */

/* ============================================
   Elementor Section Spacing Reductions
   ============================================ */

/* Reduce default Elementor section padding */
.elementor-section {
    padding-top: 20px !important;
    padding-bottom: 20px !important;
}

/* Further reduce spacing for specific sections */
.elementor-section.elementor-section-boxed {
    padding-top: 15px !important;
    padding-bottom: 15px !important;
}

/* ============================================
   CTA Banner Section Spacing
   ============================================ */

/* Target sections containing CTA banners or ticket purchase widgets */
.elementor-section:has(.btfc-match-cards-widget),
.elementor-section:has([class*="cta"]),
.elementor-section:has([class*="banner"]),
.elementor-section:has([class*="ticket"]) {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Alternative targeting for CTA sections */
.elementor-section[data-element_type="section"]:nth-child(2),
.elementor-section[data-element_type="section"]:nth-child(3) {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

/* ============================================
   Match Reports/News Widget Spacing
   ============================================ */

/* Reduce spacing around match reports widget */
.btfc-match-reports-widget {
    margin-top: 10px !important;
    margin-bottom: 10px !important;
}

/* Reduce spacing around news widgets */
.btfc-news-widget,
.btfc-club-news-widget {
    margin-top: 10px !important;
    margin-bottom: 10px !important;
}

/* ============================================
   Menu to Content Spacing
   ============================================ */

/* Reduce spacing after menu */
.btfc-independent-menu + .elementor-section,
.btfc-independent-menu + .elementor-container,
.btfc-independent-menu + .btfc-container {
    margin-top: 0 !important;
    padding-top: 10px !important;
}

/* ============================================
   General Section Spacing Reductions
   ============================================ */

/* Reduce spacing between all sections */
.elementor-section + .elementor-section {
    margin-top: 0 !important;
    padding-top: 15px !important;
}

/* Reduce container spacing */
.elementor-container {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

/* ============================================
   Theme Override Spacing
   ============================================ */

/* Override theme's main content spacing */
.site-main {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

.content-area {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* ============================================
   Responsive Adjustments
   ============================================ */

/* Mobile adjustments */
@media (max-width: 768px) {
    .elementor-section {
        padding-top: 15px !important;
        padding-bottom: 15px !important;
    }
    
    .elementor-section:has(.btfc-match-cards-widget),
    .elementor-section:has([class*="cta"]),
    .elementor-section:has([class*="banner"]) {
        padding-top: 8px !important;
        padding-bottom: 8px !important;
    }
    
    .btfc-match-reports-widget,
    .btfc-news-widget,
    .btfc-club-news-widget {
        margin-top: 8px !important;
        margin-bottom: 8px !important;
    }
}

/* Tablet adjustments */
@media (max-width: 1024px) and (min-width: 769px) {
    .elementor-section {
        padding-top: 18px !important;
        padding-bottom: 18px !important;
    }
    
    .elementor-section:has(.btfc-match-cards-widget),
    .elementor-section:has([class*="cta"]),
    .elementor-section:has([class*="banner"]) {
        padding-top: 12px !important;
        padding-bottom: 12px !important;
    }
}

/* ============================================
   Specific Widget Spacing
   ============================================ */

/* Match cards widget spacing */
.btfc-match-cards-widget {
    margin: 5px 0 !important;
}

/* Match reports widget spacing */
.btfc-match-reports-widget {
    margin: 5px 0 !important;
}

.btfc-match-reports-title {
    margin-bottom: 15px !important;
}

/* Club news widget spacing */
.btfc-club-news-widget {
    margin: 5px 0 !important;
}

/* ============================================
   Fallback for browsers that don't support :has()
   ============================================ */

/* Fallback targeting for older browsers */
.elementor-section .btfc-match-cards-widget {
    margin-top: 5px !important;
    margin-bottom: 5px !important;
}

.elementor-section .btfc-match-reports-widget {
    margin-top: 5px !important;
    margin-bottom: 5px !important;
}

/* ============================================
   Important Overrides
   ============================================ */

/* Ensure these rules take precedence */
.elementor-section[style*="padding-top"],
.elementor-section[style*="padding-bottom"] {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

/* Override any inline styles */
.elementor-section[style*="margin-top"],
.elementor-section[style*="margin-bottom"] {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* ============================================
   Additional Elementor Overrides
   ============================================ */

/* Override Elementor's default section spacing */
.elementor-section.elementor-section-boxed > .elementor-container {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

/* Override Elementor's default column spacing */
.elementor-column {
    padding-top: 5px !important;
    padding-bottom: 5px !important;
}

/* Override Elementor's default widget spacing */
.elementor-widget {
    margin-bottom: 10px !important;
}

/* ============================================
   WordPress Theme Overrides
   ============================================ */

/* Override WordPress default content spacing */
.entry-content {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Override any theme-specific spacing */
.wp-block-group {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}
