/* Responsive CSS for All Phone Sizes */
/* Add this to WordPress Customizer > Additional CSS */

/* Base mobile-first styles */
@media screen and (max-width: 767px) {
    /* Ensure proper sizing and spacing */
    .wp-site-blocks {
        padding: 0 15px;
    }
    
    /* Improve readability on small screens */
    body {
        font-size: 16px;
        line-height: 1.6;
        -webkit-text-size-adjust: 100%;
    }
    
    /* Responsive typography */
    h1 {
        font-size: 28px;
        line-height: 1.3;
        margin-bottom: 15px;
    }
    
    h2 {
        font-size: 24px;
        line-height: 1.3;
        margin-bottom: 15px;
    }
    
    h3 {
        font-size: 20px;
        line-height: 1.4;
        margin-bottom: 12px;
    }
    
    /* Make images responsive */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Improve button sizing for touch */
    .wp-block-button__link,
    button,
    .button,
    input[type="submit"] {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 20px;
        font-size: 16px; /* Prevents zoom on iOS */
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Form elements mobile optimization */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="url"],
    input[type="password"],
    textarea,
    select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
        min-height: 44px;
        width: 100%;
    }
    
    /* Responsive navigation */
    .main-navigation ul {
        flex-direction: column;
    }
    
    .main-navigation li {
        width: 100%;
        border-bottom: 1px solid #eee;
    }
    
    /* Responsive gallery */
    .wp-block-gallery .blocks-gallery-item {
        width: 100% !important;
        margin-bottom: 15px;
    }
    
    /* Responsive tables */
    .wp-block-table table,
    table {
        display: block;
        overflow-x: auto;
    }
    
    /* Proper spacing for content */
    .wp-block-group,
    .wp-block-cover,
    .wp-block-media-text {
        margin-bottom: 20px;
    }
    
    /* Hide elements that don't work well on mobile */
    .desktop-only {
        display: none !important;
    }
    
    /* Show mobile-specific elements */
    .mobile-only {
        display: block !important;
    }
}

/* Small phones (up to 360px) */
@media screen and (max-width: 360px) {
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 21px;
    }
    
    .wp-block-buttons {
        flex-direction: column;
    }
    
    .wp-block-button {
        margin-bottom: 10px;
        width: 100%;
    }
}

/* Medium phones (361px to 414px) */
@media screen and (min-width: 361px) and (max-width: 414px) {
    .wp-block-columns {
        flex-wrap: wrap;
    }
    
    .wp-block-column {
        flex-basis: 100% !important;
        margin-bottom: 20px;
    }
}

/* Large phones (415px to 767px) */
@media screen and (min-width: 415px) and (max-width: 767px) {
    .wp-block-columns {
        flex-wrap: wrap;
    }
    
    .wp-block-column {
        flex-basis: calc(50% - 20px) !important;
        margin-bottom: 20px;
    }
}

/* General mobile improvements (applies to all phone sizes) */
@media screen and (max-width: 767px) {
    /* Prevent horizontal scrolling */
    html, body {
        overflow-x: hidden;
        width: 100%;
    }
    
    /* Improve touch targets */
    a, button {
        min-height: 44px;
        min-width: 44px;
        padding: 10px 5px;
        display: inline-flex;
        align-items: center;
    }
    
    /* Better spacing for content */
    .wp-block-group__inner-container > * {
        margin-bottom: 20px;
    }
    
    /* Full-width alignment for blocks */
    .wp-block[data-align="full"] {
        margin-left: -15px;
        margin-right: -15px;
        width: calc(100% + 30px);
    }
}

/* Fix for specific WordPress blocks on mobile */
@media screen and (max-width: 767px) {
    /* Media & Text block */
    .wp-block-media-text.is-stacked-on-mobile {
        grid-template-columns: 100% !important;
    }
    
    .wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__media {
        margin-bottom: 20px;
    }
    
    /* Cover block */
    .wp-block-cover__inner-container {
        width: 100% !important;
    }
    
    /* Button alignment */
    .wp-block-buttons {
        justify-content: center;
    }
    
    /* Search widget */
    .wp-block-search__button {
        margin-top: 10px;
        width: 100%;
    }
}