/* ===================================
   HOME BLOG LOOP BLOCK STYLES
   =================================== */

/* Main block container - ISOLATED to prevent conflicts */
.wp-block-acf-atax-home-blog-loop .home-blog-loop-section {
    width: 100%;
    padding: 80px 20px 80px 20px; /* 80px top/bottom padding as requested */
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    background: white; /* White background for the section */
}

/* Content container - 1200px wide as requested */
.home-blog-loop-container {
    max-width: 1200px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Left align content */
    gap: 64px; /* Space between header and blog posts section */
    padding: 0; /* No side padding - main container controls it */
    position: relative;
    z-index: 2;
}

/* Header Container - White background, left-aligned */
.home-blog-loop-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Left align all content */
    gap: 16px; /* Space between elements */
    padding: 0; /* No padding - main container controls it */
    text-align: left; /* Left align text */
    width: 100%;
}

/* Blog label */
.home-blog-loop-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color, #354477); /* Primary blue text */
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
    font-family: 'Montserrat', sans-serif;
}

/* Main title */
.home-blog-loop-main-title {
    font-size: 48px; /* Large title as per design */
    font-weight: 700; /* Bold */
    line-height: 1.2;
    color: var(--primary-color, #354477); /* Primary blue color */
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    text-align: left; /* Left align */
    word-wrap: break-word;
}

/* Subtitle */
.home-blog-loop-subtitle {
    font-size: 16px;
    font-weight: 400; /* Regular weight */
    line-height: 1.5;
    color: var(--primary-color, #354477); /* Primary blue text */
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    text-align: left; /* Left align */
    max-width: 600px; /* Limit width for readability */
}

/* CTA Button */
.home-blog-loop-cta {
    display: flex;
    justify-content: flex-start; /* Left align button */
    width: 100%;
    margin: 0; /* No margin - gap handles spacing */
    padding: 0; /* No side padding - main container controls it */
}

/* Blog Posts Section - Blue background box */
.home-blog-loop-posts-section {
    width: 100%;
    background: var(--primary-color, #354477); /* Blue background */
    border-radius: 24px; /* Rounded corners for the box */
    padding: 32px; /* Internal padding */
    position: relative;
    z-index: 2;
}

/* Blog Cards Container */
.home-blog-loop-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Three equal columns */
    gap: 32px; /* Space between blog cards */
    width: 100%;
    padding: 0; /* No side padding - main container controls it */
}

/* Individual Blog Card */
.home-blog-card {
    background: white;
    border-radius: 16px; /* Rounded corners for cards */
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.home-blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

/* Blog Card Image Container */
.home-blog-card-image {
    position: relative;
    width: 100%;
    height: 200px; /* Fixed height for consistency */
    overflow: hidden;
}

.blog-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    backface-visibility: hidden;
}

/* Blog Card Content - White background */
.home-blog-card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: white; /* White background */
    position: relative;
}

/* Category Tags */
/* Base category style - primary blue background with white text */
.home-blog-card-category {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    align-self: flex-start;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--primary-color, #354477); /* Primary blue background */
    color: white; /* White text */
}

/* All category slugs use primary blue - catch-all for any category */
.home-blog-card-category[class*="category-"] {
    background: var(--primary-color, #354477);
    color: white;
}

/* Specific category classes - all use primary blue */
.home-blog-card-category-advice,
.home-blog-card-category-guide,
.home-blog-card-category-update,
.home-blog-card-category-taxes {
    background: var(--primary-color, #354477);
    color: white;
}

/* Blog Card Title */
.home-blog-card-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--primary-color, #354477);
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    word-wrap: break-word;
}

/* Blog Card Description */
.home-blog-card-description {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--primary-color, #354477); /* Primary blue text */
    margin: 0;
    font-family: 'Montserrat', sans-serif;
}

/* Blog Card Link */
.home-blog-card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-color, #354477); /* Primary blue text */
    text-decoration: underline;
    font-weight: 600;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    transition: opacity 0.3s ease;
    align-self: flex-start;
}

.home-blog-card-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.blog-card-link-icon {
    width: 12px;
    height: 12px;
    display: block;
}

/* ===================================
   RESPONSIVE DESIGN - GLOBAL FRAMEWORK
   =================================== */

/* Tablet (768px-1150px) - Layout optimization, columns stack */
@media (max-width: 1150px) {
    .home-blog-loop-grid {
        grid-template-columns: repeat(2, 1fr); /* Two columns on tablet */
        gap: 24px; /* Reduced gap for tablet */
    }
    
    .home-blog-loop-posts-section {
        padding: 40px 30px; /* Reduced padding on tablet */
    }
}

/* Mobile (0px-767px) - Stacked layout, mobile optimization */
@media (max-width: 767px) {
    .wp-block-acf-atax-home-blog-loop .home-blog-loop-section {
        padding: 48px 16px 48px 16px; /* Reduced mobile padding */
    }
    
    .home-blog-loop-container {
        gap: 48px; /* Reduced gap for mobile */
    }
    
    .home-blog-loop-header {
        gap: 20px; /* Reduced gap for mobile */
    }
    
    /* Main title exception - 48px → 36px for mobile readability */
    .home-blog-loop-main-title {
        font-size: 36px; /* Mobile title scaling */
    }
    
    .home-blog-loop-subtitle {
        font-size: 16px; /* Smaller subtitle on mobile */
    }
    
    .home-blog-loop-posts-section {
        padding: 30px 20px; /* Reduced padding on mobile */
        border-radius: 16px; /* Smaller radius on mobile */
    }
    
    .home-blog-loop-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: 24px; /* Reduced gap for mobile */
    }
    
    .home-blog-card-image {
        height: 180px; /* Slightly smaller on mobile */
    }
    
    .home-blog-card-content {
        padding: 20px; /* Reduced padding on mobile */
        gap: 14px; /* Reduced gap on mobile */
    }
}
