/* ===================================
   BLOG PAGE SECTION & GRID
   =================================== */

.sre-blog-section {
    padding: 100px 0;
    background-color: #f6f8fb;
}

/* ===================================
   BLOG CARD DESIGN
   =================================== */

/* ===================================
   BLOG CARD DESIGN
   =================================== */

/* Card Wrapper with Drop Shadow (avoids shadow clipping by card's clip-path) */
.sre-blog-card-wrapper {
    position: relative;
    filter: drop-shadow(0 12px 28px rgba(7, 29, 67, 0.08));
    transition: filter 0.4s ease, transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.sre-blog-card-wrapper:hover {
    transform: translateY(-8px);
    filter: drop-shadow(0 20px 40px rgba(7, 29, 67, 0.14));
}

/* Card Container (fixed height ensures equal height across each row) */
.sre-blog-card {
    background-color: #ffffff;
    border-radius: 0 20px 20px 20px;
    clip-path: polygon(45px 0%, 100% 0%, 100% 100%, 0% 100%, 0% 45px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    height: 440px; /* Aligned with service card height */
    border: none;
    transition: none; /* Handled by wrapper now */
}

/* Image Wrapper */
.sre-blog-img-wrap {
    position: relative;
    height: 240px;
    width: 100%;
    overflow: hidden;
    flex-shrink: 0;
    background-color: #071d43;
}

.sre-blog-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Image Zoom (1.05) on Hover */
.sre-blog-card-wrapper:hover .sre-blog-img-wrap img {
    transform: scale(1.05);
}

/* Semi-transparent blue overlay over the image */
.sre-blog-hover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(31, 99, 219, 0.45);
    opacity: 0;
    z-index: 2;
    transition: opacity 0.35s ease-in-out;
}

/* Circular Icon Badge Overlap (moves naturally with card-body because it is a child) */
.sre-blog-card-badge {
    position: absolute;
    left: 28px;
    top: 0; /* Positioned at the top border of the card body */
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background-color: #071d43;
    border: 4px solid #ffffff;
    color: #ffffff;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(7, 29, 67, 0.12);
}

/* Card Body (Positioned absolute to bottom; shifts top edge up on hover) */
.sre-blog-card-body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    top: 230px; /* Aligned for better layout spacing */
    background-color: #ffffff;
    padding: 30px 24px 20px 24px; /* Reduced padding for cleaner fit */
    display: flex;
    flex-direction: column;
    z-index: 5;
    transition: top 0.35s ease-in-out;
    height: auto; /* Allow auto scaling based on top property */
}

/* Metadata (Published Date) */
.sre-blog-meta {
    font-size: 13px;
    color: #718096;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px; /* Reduced margin */
    margin-bottom: 5px; /* Reduced margin */
    font-weight: 500;
}

/* Blog Title */
.sre-blog-card-title {
    font-size: 19px;
    font-weight: 700;
    color: #071d43;
    line-height: 1.35;
    margin: 0 0 8px 0; /* Reduced margin */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s ease-in-out;
}

.sre-blog-card-title a {
    color: inherit;
    text-decoration: none;
}

.sre-blog-card-title a:hover {
    color: #1f63db;
}

/* Description (Single paragraph - restricted max-height in default state, expands on hover) */
.sre-blog-card-desc {
    font-size: 13.5px;
    color: #64748b;
    line-height: 1.5;
    margin: 0 0 10px 0; /* Added bottom margin to separate from button */
    max-height: 40px; /* Limits view to exactly 2 lines in default state */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    transition: max-height 0.35s ease-in-out, color 0.35s ease-in-out;
}

/* "Read More" Link (remain primary blue on hover) */
.sre-blog-card-link {
    font-size: 14.5px;
    font-weight: 700;
    color: #1f63db;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.3s ease-in-out;
    margin-top: auto; /* Pushes to the bottom of the card body container */
}

.sre-blog-card-link i {
    font-size: 16px;
    display: inline-block;
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

/* ===================================
   HOVER ACTIONS
   =================================== */

/* Reveal blue tint on image on hover, active, and touch states */
.sre-blog-card-wrapper:hover .sre-blog-hover-overlay,
.sre-blog-card-wrapper:active .sre-blog-hover-overlay,
.sre-blog-card:hover .sre-blog-hover-overlay,
.sre-blog-card:active .sre-blog-hover-overlay {
    opacity: 1 !important;
}

/* Slide content section upward over the image wrapper on hover, active, and touch states */
.sre-blog-card-wrapper:hover .sre-blog-card-body,
.sre-blog-card-wrapper:active .sre-blog-card-body,
.sre-blog-card:hover .sre-blog-card-body,
.sre-blog-card:active .sre-blog-card-body {
    top: 170px !important;
}

/* Expand description on hover, active, and touch states */
.sre-blog-card-wrapper:hover .sre-blog-card-desc,
.sre-blog-card-wrapper:active .sre-blog-card-desc,
.sre-blog-card:hover .sre-blog-card-desc,
.sre-blog-card:active .sre-blog-card-desc {
    max-height: 120px !important;
    color: #475569 !important;
    -webkit-line-clamp: unset !important;
    display: block !important;
}

/* Arrow shifts right on hover, active, and touch states */
.sre-blog-card-wrapper:hover .sre-blog-card-link i,
.sre-blog-card-wrapper:active .sre-blog-card-link i,
.sre-blog-card:hover .sre-blog-card-link i,
.sre-blog-card:active .sre-blog-card-link i {
    transform: translateX(5px) !important;
}

.sre-blog-card-wrapper:hover .sre-blog-card-link,
.sre-blog-card-wrapper:active .sre-blog-card-link,
.sre-blog-card:hover .sre-blog-card-link,
.sre-blog-card:active .sre-blog-card-link {
    color: #1d5fd8 !important; /* Retains primary blue */
}

/* ===================================
   RESPONSIVE DESIGN ADAPTATIONS
   =================================== */

@media (max-width: 991px) {
    .sre-blog-section {
        padding: 80px 0;
    }
    .sre-blog-card {
        height: 440px; /* Maintained for visual symmetry */
    }
    .sre-blog-card-title {
        font-size: 17px;
    }
}

@media (max-width: 767px) {
    .sre-blog-section {
        padding: 60px 0;
    }
    .sre-blog-card {
        height: 440px; /* Fixed height for clean mobile layout */
    }
}
