/* ===================================
   SERVICE BOX ONE BLOCK STYLES
   =================================== */

/* Main block container - ISOLATED to prevent conflicts */
.wp-block-acf-atax-service-box-one .service-box-one-section {
    width: 100%;
    max-width: 100vw;
    margin: 0 auto;
    padding: 72px 80px 64px 80px;  /* Main container controls all side spacing */
    display: flex;
    flex-direction: column;
    gap: 54px;
    overflow-x: hidden;
    box-sizing: border-box;
    background: var(--primary-color, #354477); /* Primary blue background */
    position: relative; /* For background logo positioning */
}

/* Background logo watermark - 8% opacity, bottom right corner */
.service-box-one-background-logo {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 80%;
    opacity: 0.08;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.service-box-one-background-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    object-position: bottom right; 
    display: block;
    position: relative; 
    top: 400px; 
    left: 250px;
}

/* Main container - 1280px max-width as per design */
.service-box-one-container {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 54px;
    position: relative;
    z-index: 2; /* Above background logo */
}

/* Header section with main title - SEPARATE CONTAINER */
.service-box-one-header {
    text-align: center;
    width: 100%;
}

.service-box-one-main-title {
    font-size: 48px; /* Updated: changed from 24px to 48px as per user request */
    font-weight: 700; /* Bold */
    line-height: 1.2;
    color: white; /* White text on blue background */
    margin: 0; /* No margin - gap handles spacing */
    font-family: 'Montserrat', sans-serif;
    word-wrap: break-word;
    hyphens: auto;
}

/* Paragraph below title */
.service-box-one-paragraph {
    font-size: 16px;
    font-weight: 500; /* Medium weight */
    line-height: 1.6;
    color: white; /* White text on blue background */
    margin: 0; /* No margin - gap handles spacing */
    font-family: 'Montserrat', sans-serif;
    word-wrap: break-word;
    hyphens: auto;
    max-width: 800px !important;
    margin: auto;
    margin-top: 16px;
}

/* Two-column content area - SEPARATE CONTAINER */
.service-box-one-content {
    display: flex;
    align-items: stretch; /* Changed from flex-start to stretch to ensure equal heights */
    gap: 80px; /* Horizontal spacing between columns */
}

/* Left column - Text content */
.service-box-one-text-column {
    flex: 1.5;
    display: flex;
    flex-direction: column;
    gap: 32px; /* Vertical spacing between content blocks only */
}

/* Content blocks container */
.service-box-one-content-blocks {
    display: flex;
    flex-direction: column;
    gap: 32px; /* Updated: exactly 32px gap between text blocks as per design */
}

/* Individual content block */
.service-box-one-content-block {
    display: flex;
    flex-direction: column; /* Updated: vertical alignment as per design */
    align-items: flex-start;
    gap: 16px; /* Vertical spacing between icon, title, and paragraph */
}

/* Checkmark icon */
.service-box-one-icon {
    flex-shrink: 0; /* Prevent icon from shrinking */
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Updated: align to left for vertical layout */
    margin: 0;
}

.service-box-one-icon .checkmark-icon {
    width: 27px; /* Same size as other blocks */
    height: 27px;
    display: block;
    filter: brightness(0) saturate(100%) invert(77%) sepia(29%) saturate(2476%) hue-rotate(359deg) brightness(103%) contrast(107%);
}

/* Content text area */
.service-box-one-block-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px; /* Vertical spacing between title and description */
}

/* Content block title */
.service-box-one-block-title {
    font-size: 16px; /* Updated: changed from 24px to 16px as per design */
    font-weight: 700; /* Bold */
    line-height: 1.3;
    color: white; /* White text on blue background */
    margin: 0; /* No margin - gap handles spacing */
    font-family: 'Montserrat', sans-serif;
    word-wrap: break-word;
    hyphens: auto;
}

/* Content block description */
.service-box-one-block-description {
    font-size: 16px; /* Updated: changed from 16px to 16px (already correct) */
    line-height: 1.3; /* Updated: changed from 1.6 to 1.3 (130%) as per design */
    color: rgba(255, 255, 255, 0.9); /* Slightly transparent white for better readability */
    margin: 0; /* No margin - gap handles spacing */
    font-family: 'Montserrat', sans-serif;
    font-weight: 500; /* Updated: changed from 400 to 500 (Medium) as per design */
    word-wrap: break-word;
}

/* CTA button container - SEPARATE CONTAINER at bottom */
.service-box-one-cta {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 0; /* No margin - gap handles spacing */
}

/* Right column - Image - MUST MATCH TEXT COLUMN HEIGHT */
.service-box-one-image-column {
    flex: 1;
    display: flex;
    align-items: stretch; /* Changed from flex-start to stretch */
    justify-content: center;
    position: relative; /* For absolute positioned image */
    overflow: hidden; /* Hide overflow to maintain column height */
    min-height: 0; /* Allow flex item to shrink */
}

.service-box-one-image-wrapper {
    width: 100%;
    height: 100%; /* Take full height of parent */
    position: relative; /* Container for absolute positioned image */
    min-height: 100%; /* Ensure wrapper takes full height */
}

.service-box-one-image {
    width: 100%;
    height: 100%; /* Take full height of wrapper */
    position: absolute; /* Absolute positioned to fill entire column */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    object-fit: cover; /* Scale and crop to fit container */
    border-radius: 12px; /* Slightly rounded corners */
    display: block;
}

/* ===================================
   RESPONSIVE DESIGN - GOLDEN STANDARD FRAMEWORK
   =================================== */

/* ===================================
   BREAKPOINT STRATEGY:
   - 1600px+: Desktop default (full layout)
   - 1151px-1600px: Laptop (reduced gaps only, same fonts)
   - 768px-1150px: Tablet (columns stack, mobile layout)
   - 0px-767px: Mobile (stacked layout, reduced padding)
   =================================== */

/* Laptop (1151px-1600px) - Same layout, reduced gaps only */
@media (max-width: 1600px) {
    .wp-block-acf-atax-service-box-one .service-box-one-section {
        padding: 72px 80px 64px 80px; /* Reduced top padding */
        gap: 40px; /* Reduced gap */
    }
    
    .service-box-one-content {
        gap: 60px; /* Scaled down from 80px */
    }
    
    .service-box-one-background-logo {
        width: 80%; /* Maintain 80% width for responsive scaling */
    }
    
    /* Adjust logo positioning for laptop */
    .service-box-one-background-logo img {
        top: 350px; /* Scaled down from 400px */
        left: 200px; /* Scaled down from 250px */
    }
}

/* Tablet (768px-1150px) - Columns stack, layout transformation */
@media (max-width: 1150px) {
    .wp-block-acf-atax-service-box-one .service-box-one-section {
        padding: 64px 32px 64px 32px;
        gap: 40px;
    }
    
    .service-box-one-container {
        max-width: 100%;
        padding: 0; /* No side padding - main container controls it */
    }
    
    .service-box-one-content {
        gap: 50px; /* Further reduce gap */
        flex-direction: column; /* Stack columns on tablet */
        text-align: start;
        align-items: stretch; /* Ensure full width on tablet */
    }
    
    .service-box-one-image-column {
        height: 400px; /* Fixed height for tablet to prevent image hiding */
        flex: none; /* Don't flex on tablet */
    }
    
    .service-box-one-background-logo {
        width: 80%; /* Maintain 80% width for responsive scaling */
    }
    
    /* Adjust logo positioning for tablet */
    .service-box-one-background-logo img {
        top: 250px; /* Scaled down from 400px */
        left: 100px; /* Scaled down from 250px */
    }

    .service-box-one-container {
        gap: 32px;
    }
}

/* Mobile (0px-767px) - Stacked layout, mobile optimization */
@media (max-width: 767px) {
    .wp-block-acf-atax-service-box-one .service-box-one-section {
        padding: 48px 16px 48px 16px; /* Proper mobile padding with bottom */
        gap: 30px;
    }
    
    .service-box-one-container {
        gap: 40px; /* Scaled down from 54px for mobile */
        padding: 0; /* No side padding - main container controls it */
    }
    
    .service-box-one-content {
        flex-direction: column; /* Stack columns on mobile */
        gap: 40px;
        text-align: start;
        align-items: stretch; /* Ensure full width on mobile */
    }
    
    .service-box-one-text-column {
        gap: 28px; /* Scaled down from 32px for mobile */
    }
    
    .service-box-one-image-column {
        align-items: stretch; /* Stretch to full width on mobile */
        min-height: 250px; /* Fixed height for mobile to prevent image hiding */
        flex: none; /* Don't flex on mobile */
    }
    
    .service-box-one-image-wrapper {
        border-radius: 8px; /* Slightly smaller border radius on mobile */
    }
    
    .service-box-one-content-block {
        align-items: start; /* Center on mobile */
        gap: 14px; /* Scaled down from 16px for mobile */
        text-align: start;
    }
    
    .service-box-one-background-logo {
        width: 80%; /* Maintain 80% width for responsive scaling */
        opacity: 0.05; /* Even more subtle on mobile */
    }
    
    /* Adjust logo positioning for mobile */
    .service-box-one-background-logo img {
        top: 200px; /* Scaled down from 400px */
        left: 50px; /* Scaled down from 250px */
    }

    .service-box-one-main-title {
        font-size: 36px; /* Updated: changed from 24px to 48px as per user request */
    }
    
}

/* ===================================
   ALIGNMENT SUPPORT
   =================================== */

/* Wide alignment support */
.wp-block-acf-atax-service-box-one .service-box-one-section.alignwide {
    max-width: var(--wide-width, 1280px);
}

/* Full width alignment support */
.wp-block-acf-atax-service-box-one .service-box-one-section.alignfull {
    max-width: 100%;
}

/* ===================================
   OVERFLOW PROTECTION & TEXT HANDLING
   =================================== */

/* Prevent text overflow on all screen sizes */
.wp-block-acf-atax-service-box-one .service-box-one-main-title,
.wp-block-acf-atax-service-box-one .service-box-one-paragraph,
.wp-block-acf-atax-service-box-one .service-box-one-block-title,
.wp-block-acf-atax-service-box-one .service-box-one-block-description {
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    max-width: 100%;
}

/* Ensure containers don't cause horizontal scroll */
.wp-block-acf-atax-service-box-one .service-box-one-section {
    max-width: 100%;
    overflow: hidden;
}

/* Handle very long words or URLs */
.wp-block-acf-atax-service-box-one .service-box-one-content {
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Ensure grid containers don't overflow */
.wp-block-acf-atax-service-box-one .service-box-one-container {
    min-width: 0;
    overflow-x: hidden;
}
