/* Button hover lift effect */
.wp-block-button__link,
.button,
.btn,
input[type="submit"] {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wp-block-button__link:hover,
.button:hover,
.btn:hover,
input[type="submit"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Hide post meta (author names, dates) - STRONGER VERSION */
.entry-meta,
.ast-single-post-meta,
.post-meta,
.entry-header .entry-meta {
    display: none !important;
}

/* Safe H1 optimization only */
h1.wp-block-heading {
    font-display: swap !important;
}

/* Remove only animations */
[class*="ast-animate"] {
    animation: none !important;
}

/* NEW SPEED IMPROVEMENTS */
/* Faster image loading */
img {
    loading: eager !important;
}

/* Faster font loading */
body {
    font-display: swap !important;
}

/* Optimize critical content */
.wp-block-heading {
    font-display: swap !important;
}

.wp-block-image img,
.entry-content img {
    max-width: 100%;
    height: auto;
}

/* Desktop-only container width restrictions (769px and above) */
@media (min-width: 769px) {
    /* General container width for ALL pages including single posts */
    .ast-container,
    .single .ast-container,
    .single-post .ast-container {
        max-width: 1400px;
        margin: 0 auto;
    }
    
    /* Home page specific targeting */
    .home .site,
    .home .ast-container,
    .home .site-content,
    .home .ast-row,
    .home .ast-grid-common-col,
    .home #primary,
    .home .entry-content,
    .home .ast-separate-container .site-content > .ast-container,
    .home .ast-page-builder-template,
    .home .ast-plain-container,
    .home .ast-separate-container .ast-article-single,
    .home body > .site > .ast-container,
    .blog .ast-container,
    .archive .ast-container {
        max-width: 1400px !important;
        margin: 0 auto !important;
    }
    
    /* Single post specific targeting */
    .single .site,
    .single .ast-container,
    .single .site-content,
    .single .ast-row,
    .single #primary,
    .single .entry-content,
    .single .ast-separate-container .site-content > .ast-container,
    .single .ast-separate-container .ast-article-single,
    .single-post .ast-container,
    .single-post .site-content,
    .single-post #primary {
        max-width: 1400px !important;
        margin: 0 auto !important;
    }
    
    /* For block editor/Gutenberg content */
    .home .wp-block-group,
    .home .wp-block-columns,
    .home .wp-site-blocks,
    .home .wp-block-post-content,
    .single .wp-block-group,
    .single .wp-block-columns,
    .single .wp-site-blocks,
    .single .wp-block-post-content {
        max-width: 1400px !important;
        margin: 0 auto !important;
    }
    
    /* If using full-width template */
    .home .ast-full-width-primary #primary,
    .home .ast-full-width-primary .site-content,
    .single .ast-full-width-primary #primary,
    .single .ast-full-width-primary .site-content {
        max-width: 1400px !important;
        margin: 0 auto !important;
    }
    
    /* HERO/FIRST SECTION ALIGNMENT - Desktop only */
    /* Target the first section/hero area to align with content below */
    .home .entry-content > *:first-child,
    .home .wp-block-cover:first-child,
    .home .wp-block-group:first-child,
    .home .entry-content > .wp-block-cover:first-child .wp-block-cover__inner-container,
    .home .entry-content > .wp-block-group:first-child > .wp-block-group__inner-container {
        max-width: 1600px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 40px !important;
        padding-right: 40px !important;
    }
    
    /* If the first section has nested content */
    .home .entry-content > *:first-child .wp-block-columns,
    .home .entry-content > *:first-child .wp-block-column,
    .home .entry-content > *:first-child .wp-block-heading,
    .home .entry-content > *:first-child .wp-block-paragraph,
    .home .entry-content > *:first-child .wp-block-buttons {
        max-width: 100% !important;
    }
    
    /* Ensure subsequent sections maintain their layout */
    .home .entry-content > *:not(:first-child) {
        max-width: 1400px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

/* Mobile responsiveness - wider with proper responsive breakpoints */
@media (max-width: 768px) {
    /* Reset all containers to fill width with minimal padding */
    .home .ast-container,
    .home .site-content,
    .home #primary,
    .home .entry-content,
    .single .ast-container,
    .single .site-content,
    .single #primary,
    .single .entry-content {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 10px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }
    
    /* Override Astra's responsive styles */
    .ast-separate-container .ast-container,
    .ast-plain-container .ast-container,
    .ast-page-builder-template .ast-container,
    .ast-separate-container .site-content > .ast-container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 10px !important;
        margin: 0 !important;
    }
    
    /* MOBILE HERO/FIRST SECTION FIX - More specific selectors */
    .home .entry-content > .wp-block-cover:first-child,
    .home .entry-content > .wp-block-group:first-child,
    .home .wp-block-cover:first-child,
    .home .wp-block-group:first-child {
        min-height: 100vh !important;
        height: 100vh !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background-size: cover !important;
        background-position: center !important;
        background-repeat: no-repeat !important;
        object-fit: cover !important;
        width: 100vw !important;
        max-width: 100vw !important;
        margin-left: calc(50% - 50vw) !important;
        margin-right: calc(50% - 50vw) !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Ensure inner content containers work properly */
    .home .entry-content > .wp-block-cover:first-child .wp-block-cover__inner-container,
    .home .entry-content > .wp-block-group:first-child .wp-block-group__inner-container,
    .home .wp-block-cover:first-child .wp-block-cover__inner-container,
    .home .wp-block-group:first-child .wp-block-group__inner-container {
        width: 100% !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        text-align: center !important;
        padding: 20px !important;
        max-width: none !important;
    }
    
    /* Ensure all blocks fill the available width and fix spacing */
    .home .wp-block-group,
    .home .wp-block-group__inner-container,
    .home .wp-block-cover,
    .home .wp-block-cover__inner-container,
    .home .wp-block-columns,
    .home .wp-block-column,
    .home .wp-block-media-text,
    .home .entry-content > * {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
    
    /* Fix blank space between blocks */
    .home .wp-block-spacer {
        height: 20px !important;
        max-height: 20px !important;
    }
    
    /* Remove excessive margins between sections */
    .home .entry-content > * + * {
        margin-top: 0 !important;
    }
    
    /* Stack columns vertically */
    .home .wp-block-columns {
        flex-direction: column !important;
        gap: 20px !important;
    }
    
    .home .wp-block-column {
        width: 100% !important;
        max-width: 100% !important;
        flex-basis: 100% !important;
    }
    
    /* Fix squeezed images - respect aspect ratio */
    .home img,
    .home .wp-block-image img,
    .home .entry-content img {
        width: auto !important;
        max-width: 100% !important;
        height: auto !important;
        display: block !important;
        margin: 0 auto !important;
    }
    
    /* For images that should be full width */
    .home .wp-block-image.size-full img,
    .home .wp-block-cover img {
        width: 100% !important;
    }
    
    /* Typography optimization for mobile */
    .home h1,
    .home .wp-block-heading.has-text-align-center {
        font-size: 32px !important;
        line-height: 1.2 !important;
        margin-bottom: 20px !important;
    }
    
    .home h2 {
        font-size: 26px !important;
        line-height: 1.3 !important;
        margin-bottom: 15px !important;
    }
    
    .home h3 {
        font-size: 22px !important;
        line-height: 1.3 !important;
        margin-bottom: 15px !important;
    }
    
    .home p,
    .home .wp-block-paragraph {
        font-size: 16px !important;
        line-height: 1.6 !important;
        margin-bottom: 15px !important;
    }
    
    /* Ensure text content has proper spacing */
    .home .wp-block-heading,
    .home .wp-block-paragraph,
    .home .wp-block-buttons {
        padding-left: 0 !important;
        padding-right: 0 !important;
        width: 100% !important;
    }
    
    /* Buttons - responsive sizing */
    .home .wp-block-button {
        width: 100% !important;
        margin: 15px 0 !important;
    }
    
    .home .wp-block-button__link {
        width: 100% !important;
        display: block !important;
        text-align: center !important;
        padding: 12px 20px !important;
        font-size: 16px !important;
    }
    
    /* Fix black area at bottom - likely a cover block */
    .home .wp-block-cover:last-child,
    .home .entry-content > *:last-child {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }
    
    /* Ensure footer appears properly */
    .site-footer {
        margin-top: 0 !important;
        background: transparent !important;
    }
    
    /* Fix any black background issues */
    .home .wp-block-cover.has-black-background-color,
    .home .wp-block-group.has-black-background-color {
        background-color: transparent !important;
    }
    
    /* Fix body and site container */
    body,
    .site {
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: hidden !important;
        background: white !important;
    }
    
    /* Ensure no horizontal scroll */
    html {
        overflow-x: hidden !important;
    }
    
    /* Gallery and media adjustments */
    .home .wp-block-gallery {
        margin: 0 !important;
    }
    
    .home .wp-block-gallery .blocks-gallery-item {
        width: calc(50% - 5px) !important;
        margin: 2.5px !important;
    }
    
    /* Fix figure elements */
    .home figure {
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* Tablet specific adjustments */
@media (min-width: 481px) and (max-width: 768px) {
    .home .ast-container,
    .home .site-content,
    .home #primary,
    .home .entry-content {
        padding: 0 20px !important;
    }
    
    .home h1 {
        font-size: 36px !important;
    }
    
    .home h2 {
        font-size: 30px !important;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .home .ast-container,
    .home .site-content,
    .home #primary,
    .home .entry-content {
        padding: 0 8px !important;
    }
    
    .home h1 {
        font-size: 28px !important;
    }
    
    .home h2 {
        font-size: 24px !important;
    }
    
    .home .wp-block-gallery .blocks-gallery-item {
        width: 100% !important;
        margin: 5px 0 !important;
    }
}

/* Very small devices */
@media (max-width: 360px) {
    .home .ast-container,
    .home .site-content,
    .home #primary,
    .home .entry-content {
        padding: 0 5px !important;
    }
    
    .home h1 {
        font-size: 26px !important;
    }
}