/* --- Grid System (Uses Variables from Shortcode) --- */
.wcl-container {
    display: grid !important;
    gap: 20px !important;
    box-sizing: border-box;
    /* Default (Desktop) */
    grid-template-columns: repeat(var(--col-desk, 3), 1fr) !important;
}

/* Tablet Breakpoint (Usually < 1024px) */
@media (max-width: 1024px) {
    .wcl-container {
        grid-template-columns: repeat(var(--col-tab, 2), 1fr) !important;
    }
}

/* Mobile Breakpoint (Usually < 768px) */
@media (max-width: 768px) {
    .wcl-container {
        grid-template-columns: repeat(var(--col-mob, 1), 1fr) !important;
    }
}

/* --- General Item Styles --- */
.wcl-post-item { 
    border: 1px solid #ddd; 
    overflow: hidden; 
    position: relative; 
    background: #fff; 
    display: flex;       
    flex-direction: column; 
    height: 100%;        
}

.wcl-image img { 
    width: 100%; 
    height: 200px;       
    display: block; 
    object-fit: cover; 
}
.wcl-content { 
    padding: 15px; 
    flex: 1;             
    display: flex; 
    flex-direction: column; 
}

.wcl-meta { font-size: 0.85em; color: #888; margin-bottom: 5px; }
.wcl-title { margin: 5px 0 10px; font-size: 1.2em; line-height: 1.3; }
.wcl-title a { text-decoration: none; color: #333; }
.wcl-desc { flex-grow: 1; margin-bottom: 15px; } 

/* --- LAYOUT 2: Overlay Specific --- */
.wcl-layout_2 .wcl-post-item { border: none; height: 300px; display: block; }
.wcl-overlay-card {
    width: 100%; height: 100%;
    background-size: cover; background-position: center;
    position: relative;
}
.wcl-overlay-card::before {
    content: ''; position: absolute; top:0; left:0; right:0; bottom:0;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.9));
}
.wcl-overlay-content {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 20px; color: #fff; z-index: 2;
}
.wcl-layout_2 .wcl-title a { color: #fff; }
.wcl-layout_2 .wcl-meta { color: #ddd; }

/* --- LAYOUT 3: Alternating Specific --- */
.wcl-layout_3 .wcl-post-item { border: none; margin-bottom: 0; display: block; height: auto; }
.wcl-layout_3 .wcl-alt-wrapper {
    display: flex; align-items: center; gap: 20px;
    border: 1px solid #eee; 
    background: #fff;
}
.wcl-layout_3 .wcl-image img { height: 100%; min-height: 200px; }
.wcl-layout_3 .wcl-image { flex: 1; }
.wcl-layout_3 .wcl-content { flex: 1; }

/* Reverse every even item */
.wcl-layout_3 .wcl-post-item:nth-child(even) .wcl-alt-wrapper {
    flex-direction: row-reverse;
}

/* --- BUTTONS & PAGINATION --- */
.wcl-readmore { display: inline-block; margin-top: auto; text-decoration: none; font-weight: 600; }
.wcl-link-style { color: #2271b1; border-bottom: 2px solid transparent; }
a.wcl-link-style:hover {
    color: #2271b1;
}
.wcl-btn-style { background-color: #2271b1; color: #fff !important; padding: 8px 16px; border-radius: 4px; font-size: 0.9em; text-align: center; }
.wcl-btn-style:hover { background-color: #135e96; }

.wcl-pagination { margin-top: 30px; text-align: center; display: flex; justify-content: center; gap: 5px; grid-column: 1 / -1; }
.wcl-pagination a, .wcl-pagination span { padding: 8px 12px; border: 1px solid #ddd; color: #333; text-decoration: none; background: #fff; border-radius: 4px; }
.wcl-pagination span.current { background: #2271b1; color: #fff; border-color: #2271b1; }

/* --- EXTRA RESPONSIVE FIXES --- */
@media (max-width: 768px) {
    .wcl-layout_3 .wcl-alt-wrapper, 
    .wcl-layout_3 .wcl-post-item:nth-child(even) .wcl-alt-wrapper {
        flex-direction: column;
    }
    .wcl-layout_3 .wcl-image img { width: 100%; height: 200px; }
}




/* --- Grid System (Updated with !important) --- */
.wcl-container {
    display: grid !important;
    gap: 20px !important;
    box-sizing: border-box;
}

/* Force Columns */
.wcl-cols-1 { grid-template-columns: 1fr !important; }
.wcl-cols-2 { grid-template-columns: repeat(2, 1fr) !important; }
.wcl-cols-3 { grid-template-columns: repeat(3, 1fr) !important; }
.wcl-cols-4 { grid-template-columns: repeat(4, 1fr) !important; }

/* --- General Item Styles --- */
.wcl-post-item {
    border: 1px solid #ddd;
    overflow: hidden;
    position: relative;
    background: #fff;
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 20px;
}

.wcl-image img { 
    width: 100%; 
    height: 200px;       /* Force uniform image height */
    display: block; 
    object-fit: cover; 
}
.wcl-content { 
    padding: 15px; 
    flex: 1;             /* Pushes read more to bottom */
    display: flex; 
    flex-direction: column; 
}

.wcl-meta { font-size: 0.85em; color: #888; margin-bottom: 5px; }
.wcl-title { margin: 5px 0 10px; font-size: 1.2em; line-height: 1.3; }
.wcl-title a { text-decoration: none; color: #333; }
.wcl-desc { flex-grow: 1; margin-bottom: 15px; } /* Ensures buttons align at bottom */

/* --- LAYOUT 2: Overlay Specific --- */
.wcl-layout_2 .wcl-post-item { border: none; height: 300px; display: block; }
.wcl-overlay-card {
    width: 100%; height: 100%;
    background-size: cover; background-position: center;
    position: relative;
}
.wcl-overlay-card::before {
    content: ''; position: absolute; top:0; left:0; right:0; bottom:0;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.9));
}
.wcl-overlay-content {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 20px; color: #fff; z-index: 2;
}
.wcl-layout_2 .wcl-title a { color: #fff; }
.wcl-layout_2 .wcl-meta { color: #ddd; }

/* --- LAYOUT 3: Alternating Specific --- */
/* Note: Layout 3 usually looks best in 1 column, but this allows Grids now */
.wcl-layout_3 .wcl-post-item { border: none; margin-bottom: 0; display: block; height: auto; }
.wcl-layout_3 .wcl-alt-wrapper {
    display: flex; align-items: center; gap: 20px;
    border: 1px solid #eee; /* Added border so it looks good in grid */
    background: #fff;
}
.wcl-layout_3 .wcl-image img { height: 100%; min-height: 200px; }
.wcl-layout_3 .wcl-image { flex: 1; }
.wcl-layout_3 .wcl-content { flex: 1; }

/* Reverse every even item */
.wcl-layout_3 .wcl-post-item:nth-child(even) .wcl-alt-wrapper {
    flex-direction: row-reverse;
}

/* --- BUTTONS & PAGINATION --- */
.wcl-readmore { display: inline-block; margin-top: auto; text-decoration: none; font-weight: 600; }
.wcl-link-style {
    color: #c8102e;
    border-bottom: 2px solid transparent;
    font-weight: 400;
}
.wcl-btn-style { background-color: #2271b1; color: #fff !important; padding: 8px 16px; border-radius: 4px; font-size: 0.9em; text-align: center; }
.wcl-btn-style:hover { background-color: #135e96; }

.wcl-pagination { margin-top: 30px; text-align: center; display: flex; justify-content: center; gap: 5px; grid-column: 1 / -1; /* Centered in grid */ }
.wcl-pagination a, .wcl-pagination span { padding: 8px 12px; border: 1px solid #ddd; color: #333; text-decoration: none; background: #fff; border-radius: 4px; }
.wcl-pagination span.current { background: #2271b1; color: #fff; border-color: #2271b1; }

/* --- MOBILE RESPONSIVE --- */
@media (max-width: 768px) {
    .wcl-cols-2, .wcl-cols-3, .wcl-cols-4 { grid-template-columns: 1fr !important; }
    
    .wcl-layout_3 .wcl-alt-wrapper, 
    .wcl-layout_3 .wcl-post-item:nth-child(even) .wcl-alt-wrapper {
        flex-direction: column;
    }
    .wcl-layout_3 .wcl-image img { width: 100%; height: 200px; }
}


.resource-card {
    background: #fff;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 20px;
}
.resource-image img {
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    min-height: 250px;
    object-fit: cover;
    object-position: right;
    image-rendering: auto;
    width: 100%;
    height: auto;
    display: block;
}
.resource-image img {
    width: 100%;
    height: auto;
    display: block;
}
.resource-meta {
    font-size: 13px;
    color: #c8102e;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
}
.resource-title {
    font-size: 18px;
    margin: 0 0 10px;
    line-height: 1.2;
}
.resource-title a {
        color: #0f517f;
        text-decoration: none;
        font-size: 26px !important;
        font-weight: 600;
        line-height: 1.2;
    }
.resource-title a:hover {
    color: #c8102e;
    }    
    .resource-excerpt {
    font-size: 14px;
    color: #555;
    padding-bottom: 15px;
}
a.resource-read-more {
    font-size: 18px;
    color: #c8102e;
}




