/**
 * XL Marketing Blog Display - Frontend Styles
 * Version: 1.1.1
 */

/* Main Container */
.wlc-blog-container {
    width: 100%;
    padding: 20px 0;
    margin: 0;
    font-family: 'Roboto', sans-serif;
    box-sizing: border-box;
}

.wlc-blog-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
}

/* Apply box-sizing to all elements */
.wlc-blog-container *,
.wlc-blog-container *::before,
.wlc-blog-container *::after {
    box-sizing: border-box;
}

/* Ensure our styles take precedence over theme or Elementor styles */
.wlc-blog-container img {
    height: auto; /* Reset default */
}

.wlc-blog-container .wlc-blog-image {
    height: 250px !important;
    min-height: 250px !important;
    max-height: 250px !important;
}

/* Additional attribute selectors for maximum specificity */
img[class*="wlc-blog-image"],
img.wlc-blog-image,
.wlc-blog-card img {
    height: 250px !important;
    min-height: 250px !important;
    max-height: 250px !important;
    object-fit: cover !important;
}

/* Direct override for Elementor's img styling with maximum specificity */
html body.elementor-page .elementor .elementor-element .elementor-widget-container img.wlc-blog-image,
.elementor-page img.wlc-blog-image,
.elementor img.wlc-blog-image,
.elementor-widget-container img.wlc-blog-image,
.elementor-section img.wlc-blog-image,
.elementor-column img.wlc-blog-image,
.elementor-element img.wlc-blog-image,
body img.wlc-blog-image {
    height: 250px !important;
    min-height: 250px !important;
    max-height: 250px !important;
    object-fit: cover !important;
}

/* Ultimate override with attribute selectors and :not pseudo-class */
html body img[class*="wlc-blog-image"]:not([style*="height:auto"]),
html body .elementor img[class*="wlc-blog-image"]:not([style*="height:auto"]),
html body .elementor-widget-container img[class*="wlc-blog-image"]:not([style*="height:auto"]),
html body .wlc-blog-card img:not([style*="height:auto"]) {
    height: 250px !important;
    min-height: 250px !important;
    max-height: 250px !important;
    object-fit: cover !important;
}

/* Extreme specificity override - using multiple classes and attributes */
html body div.elementor div.elementor-inner div.elementor-section-wrap div.elementor-section div.elementor-container div.elementor-row div.elementor-column div.elementor-column-wrap div.elementor-widget-wrap div.elementor-widget div.elementor-widget-container img.wlc-blog-image {
    height: 250px !important;
    min-height: 250px !important;
    max-height: 250px !important;
    object-fit: cover !important;
}

/* Target our custom data attribute */
img[data-wlc-fixed-height="250"],
.elementor img[data-wlc-fixed-height="250"],
.elementor-widget-container img[data-wlc-fixed-height="250"],
html body .elementor img[data-wlc-fixed-height="250"] {
    height: 250px !important;
    min-height: 250px !important;
    max-height: 250px !important;
    object-fit: cover !important;
}

.wlc-blog-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 36px;
    color: #333333;
    font-weight: 500;
}

/* Blog Grid */
.wlc-blog-grid {
    display: grid;
    gap: 30px;
    margin-bottom: 40px;
    width: 100%;
    align-items: stretch;
}

/* Column Configuration */
.wlc-columns-1 {
    grid-template-columns: 1fr;
}

.wlc-columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.wlc-columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.wlc-columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Responsive Columns - Only for very small screens */
@media (max-width: 480px) {
    .wlc-columns-2,
    .wlc-columns-3,
    .wlc-columns-4 {
        grid-template-columns: 1fr;
    }
}

/* Blog Card */
.wlc-blog-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    margin: 0;
    position: relative;
    min-height: 450px; /* Set minimum height for consistency */
}

.wlc-blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.wlc-blog-image {
    width: 100%;
    height: 250px !important; /* Added !important to override Elementor's default height: auto */
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Override Elementor's default image styling */
.elementor .wlc-blog-image,
.elementor-widget-container .wlc-blog-image,
.elementor-section .wlc-blog-image,
.elementor-column .wlc-blog-image,
.elementor-element .wlc-blog-image {
    height: 250px !important;
    max-height: none !important;
    min-height: 250px !important;
}

.wlc-blog-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.wlc-blog-date {
    font-size: 14px;
    color: #888;
    margin-bottom: 10px;
    display: block;
    font-weight: 500;
}

.wlc-blog-heading {
    font-size: 1.4rem;
    font-weight: 500;
    margin-bottom: 12px;
    color: #333;
    line-height: 1.3;
    min-height: 3.6rem; /* Approximately 2 lines of text */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wlc-blog-excerpt {
    font-size: 16px;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
    flex-grow: 1;
    min-height: 4.5rem; /* Approximately 3 lines of text */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wlc-blog-link {
    color: #23a244;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    margin-top: auto;
    transition: all 0.2s ease;
    padding: 8px 0;
    position: relative;
}

.wlc-blog-link:hover {
    color: #1c8035;
    text-decoration: underline;
}

/* View More Button */
.wlc-view-more-container {
    text-align: center;
    margin: 30px 0;
}

.wlc-view-more-top {
    margin-bottom: 30px;
}

.wlc-view-more-bottom {
    margin-top: 30px;
}

.wlc-view-more-button {
    display: inline-block;
    background-color: #23a244;
    color: white;
    padding: 12px 30px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.wlc-view-more-button:hover {
    background-color: #1c8035;
}

/* Pagination */
.wlc-pagination {
    margin: 40px 0 20px;
    text-align: center;
}

.wlc-pagination .page-numbers {
    display: inline-block;
    padding: 0;
    margin: 0;
    list-style: none;
}

.wlc-pagination .page-numbers li {
    display: inline-block;
    margin: 0 3px;
}

.wlc-pagination .page-numbers a,
.wlc-pagination .page-numbers span {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background-color: #f5f5f5;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.wlc-pagination .page-numbers .current {
    background-color: #23a244;
    color: white;
}

.wlc-pagination .page-numbers a:hover {
    background-color: #e0e0e0;
}

/* No Blogs Message */
.wlc-no-blogs-message {
    background-color: #fff;
    border-radius: 8px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    max-width: 600px;
    margin: 0 auto;
}

.wlc-no-blogs-icon {
    margin-bottom: 20px;
}

.wlc-no-blogs-title {
    font-size: 24px;
    color: #333;
    margin-bottom: 15px;
}

.wlc-no-blogs-text {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 0;
}