/* ============================================
   BLOG POSTS GRID - FLEXIBLE CONTENT ELEMENT
   Based on design: blog-section.png
   ============================================ */

/* Main Container */
.fce-blog-posts-grid {
    width: 100%;
    padding:0px 0;
}

/* Grid Wrapper */
.fce-bpg-wrapper {
    width: 100%;
}

/* Grid Layout - 3 Columns Desktop */
.fce-bpg-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* Blog Card */
.fce-bpg-card {
    background-color: rgba(23, 46, 74, 1);
    border-radius: 30px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.fce-bpg-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Card Link */
.fce-bpg-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Featured Image */
.fce-bpg-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    border-radius: 30px;
    position: relative;
}

.fce-bpg-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}


/* Card Content */
.fce-bpg-content {
    padding: 40px 40px 30px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Post Date */
.fce-bpg-date {
    font-size: 14px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 12px;
    font-family: 'Poppins', sans-serif;
}

/* Post Title */
.fce-bpg-title {
    font-size: 22px;
    font-weight: 400;
    color: #ffffff;
    margin: 0 0 15px 0;
    line-height: 1.4;
    font-family: 'Poppins', sans-serif;
}

/* Post Excerpt */
.fce-bpg-excerpt {
    font-size: 16px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin-bottom: 20px;
    font-family: 'Poppins', sans-serif;
}

/* Read More Button */
.fce-bpg-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
    transition: gap 0.3s ease, color 0.3s ease;
    margin-top: auto;
    padding-bottom: 10px;
    font-family: 'Poppins', sans-serif;
}

.fce-bpg-button:hover {
    color: rgba(0, 128, 255, 1);
}

.fce-bpg-button-text {
    transition: color 0.3s ease;
}

.fce-bpg-button i {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.fce-bpg-card:hover .fce-bpg-button {
    gap: 12px;
}

.fce-bpg-card:hover .fce-bpg-button i {
    transform: translateX(3px);
}

/* ============================================
   RESPONSIVE - TABLET (2 COLUMNS)
   ============================================ */

@media (max-width: 1024px) {
    .fce-blog-posts-grid {
        padding: 0px;
    }

    /* 2 Columns on Tablet */
    .fce-bpg-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    /* Center last odd item when there are 3, 5, 7, etc posts */
    .fce-bpg-card:last-child:nth-child(odd) {
        grid-column: 1 / -1; /* Span full width */
        width: calc(50% - 12.5px); /* Exact width - half container minus half gap */
        max-width: calc(50% - 12.5px);
        min-width: calc(50% - 12.5px);
        margin: 0 auto; /* Center it */
        justify-self: center; /* Center in grid */
    }

    .fce-bpg-image {
        height: 220px;
    }

    .fce-bpg-content {
        padding: 25px 20px 15px;
    }

    .fce-bpg-title {
        font-size: 20px;
    }

    .fce-bpg-excerpt {
        font-size: 14px;
    }

    .fce-bpg-button {
        padding-bottom: 10px;
    }
}

/* ============================================
   RESPONSIVE - MOBILE (1 COLUMN)
   ============================================ */

@media (max-width: 767px) {
    .fce-blog-posts-grid {
        padding: 10px 0 0;
    }

    /* Wrapper centering on mobile */
    .fce-bpg-wrapper {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        padding: 0;
        overflow: hidden;
        position: relative;
    }

    /* Disable hover effect on mobile */
    .fce-bpg-card:hover {
        transform: none;
        box-shadow: none;
    }

    /* Keep smooth transition for carousel slide animation */
    .fce-bpg-card {
        transition: none;
    }

    /* Disable grid on mobile for Owl Carousel */
    .fce-bpg-grid {
        display: block;
        min-height: 500px; /* Prevent layout shift during carousel initialization */
    }

    /* Owl Carousel card styling */
    .fce-bpg-grid.owl-carousel {
        margin: 0;
        width: 100%;
        padding: 0;
        position: relative;
    }

    .fce-bpg-grid.owl-carousel .owl-stage-outer {
        overflow: hidden;
        padding: 0;
        margin: 0;
    }

    /* Fix height to prevent glitching during transitions */
    .fce-bpg-grid.owl-carousel .owl-stage {
        display: flex;
        align-items: flex-start;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .fce-bpg-grid.owl-carousel .owl-item {
        display: flex;
        justify-content: center;
        align-items: center;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin: 0;
    }

    .fce-bpg-grid.owl-carousel .fce-bpg-card {
        margin: 0 auto 0 1px;
        width: 100%;
        max-width: 100%;
        min-height: 450px; /* Fixed height to prevent jumping */
        display: flex;
        flex-direction: column;
    }

    .fce-bpg-grid.owl-carousel .fce-bpg-card-link {
        display: flex;
        flex-direction: column;
        flex: 1;
        height: 100%;
    }

    .fce-bpg-grid.owl-carousel .fce-bpg-content {
        display: flex;
        flex-direction: column;
        flex: 1;
    }

    /* Force proper width calculation */
    .fce-bpg-grid.owl-carousel.owl-loaded .owl-item {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Remove min-height after carousel loads */
    .fce-bpg-grid.owl-loaded {
        min-height: 0;
    }

    .fce-bpg-image {
        height: 200px;
    }

    .fce-bpg-content {
        padding: 25px 20px 10px;
    }

    .fce-bpg-date {
        font-size: 13px;
        margin-bottom: 10px;
    }

    .fce-bpg-title {
        font-size: 18px;
        margin-bottom: 12px;
    }

    .fce-bpg-excerpt {
        font-size: 14px;
        margin-bottom: 18px;
    }

    .fce-bpg-button {
        font-size: 15px;
        margin-top: auto;
        padding-bottom: 10px;
    }
}

/* ============================================
   SMALL MOBILE
   ============================================ */

@media (max-width: 480px) {
    .fce-bpg-card {
        border-radius: 15px;
    }

    .fce-bpg-image {
        height: 180px;
        border-radius: 15px 15px 0 0;
    }

    .fce-bpg-content {
        padding: 20px 18px 10px;
    }

    .fce-bpg-title {
        font-size: 17px;
    }

    .fce-bpg-excerpt {
        font-size: 15px;
    }

    .fce-bpg-button {
        padding-bottom: 10px;
    }
}

/* ============================================
   OWL CAROUSEL CUSTOM STYLES (MOBILE ONLY)
   ============================================ */

@media (max-width: 767px) {
    /* Owl Carousel Dots - Increase specificity */
    .fc-element.fce-blog-posts-grid .owl-carousel .owl-dots {
        text-align: center;
        margin-top: 15px;
        display: flex;
        gap: 8px;
        justify-content: center;
        align-items: center;
        padding: 10px 0;
    }

    .fc-element.fce-blog-posts-grid .owl-carousel .owl-dot {
        flex-shrink: 0;
        cursor: pointer;
        margin: 0;
    }

    .fc-element.fce-blog-posts-grid .owl-carousel .owl-dot span {
        width: 10px;
        height: 10px;
        background-color: #d1d5db;
        border-radius: 50%;
        display: block;
        transition: all 0.3s ease;
        border: none;
        margin: 0;
    }

    .fc-element.fce-blog-posts-grid .owl-carousel .owl-dot.active span {
        background-color: #3b82f6;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        transform: scale(1.2);
    }

    .fc-element.fce-blog-posts-grid .owl-carousel .owl-dot:hover span {
        opacity: 0.7;
    }
}
