/* Category News Grid - Base Styles - Version 1.0.2 */
.cng-grid-container {
    display: grid;
    /* grid-template-columns handled by dynamic-styles.php or defaults below */
    grid-template-columns: 1fr; /* Mobile first: 1 column */
    gap: 30px;
    margin-bottom: 30px;
}

/* Default for 2 columns on larger screens IF dynamic styles set it OR it's the default */
@media (min-width: 768px) {
    .cng-grid-container.cng-grid-columns-2 {
        grid-template-columns: 1fr 1fr;
    }
}
/* Ensure 1 column for single column setting, overriding media query if needed */
.cng-grid-container.cng-grid-columns-1 {
    grid-template-columns: 1fr !important; /* Important to override wider screen defaults */
}


.cng-section {
    /* Add padding or borders if desired for each section block */
    /* border: 1px solid #eee; */
    /* padding: 15px; */
}

.cng-section-title {
    /* color and font-size are set by dynamic-styles.php */
    font-weight: bold;
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #333; /* Default underline color */
    text-transform: uppercase;
    line-height: 1.2;
}

.cng-section-content {
    display: flex;
    flex-direction: column;
}

.cng-featured-post {
    margin-bottom: 20px;
}

.cng-featured-post .cng-featured-image-link img,
.cng-featured-post .cng-featured-image-link .cng-placeholder-image {
    width: 100%;
    height: auto; /* Maintain aspect ratio */
    max-height: 300px; /* Optional: constrain max height */
    object-fit: cover; /* Crop to fit if aspect ratio differs */
    display: block;
    margin-bottom: 10px;
    border-radius: 4px;
}

.cng-featured-title {
    /* font-size is set by dynamic-styles.php */
    font-weight: bold;
    margin-top: 0;
    margin-bottom: 5px;
    line-height: 1.3;
}

.cng-featured-title a {
    /* color is set by dynamic-styles.php */
    text-decoration: none;
    transition: color 0.3s ease;
}
/* Hover color handled by dynamic styles */

.cng-post-meta {
    font-size: 0.85em;
    color: #777;
    margin-bottom: 5px;
}
.cng-post-date {
    /* specific styles for date if needed */
}


/* List Posts General */
.cng-list-posts {
    display: flex;
    flex-direction: column;
    gap: 15px; /* Space between list items */
}

.cng-list-item {
    display: flex;
    gap: 15px; /* Space between image and text content */
    align-items: flex-start; /* Align items to the top */
    padding-bottom: 10px;
    border-bottom: 1px dotted #ddd; /* Dotted line between list items */
}
.cng-list-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* List Item Image Styles based on layout class */
.cng-list-layout-image_left .cng-list-item-image-link img,
.cng-list-layout-image_left_small .cng-list-item-image-link img,
.cng-list-layout-image_left .cng-list-item-image-link .cng-placeholder-list-image,
.cng-list-layout-image_left_small .cng-list-item-image-link .cng-placeholder-list-image {
    height: auto;
    object-fit: cover;
    border-radius: 3px;
    display: block;
}

.cng-list-layout-image_left .cng-list-item-image-link img,
.cng-list-layout-image_left .cng-list-item-image-link .cng-placeholder-list-image {
    width: 100px; /* Default for regular image left */
    max-height: 75px;
}

.cng-list-layout-image_left_small .cng-list-item-image-link img,
.cng-list-layout-image_left_small .cng-list-item-image-link .cng-placeholder-list-image {
    width: 80px;  /* Smaller for 'image_left_small' */
    max-height: 60px;
}

/* When layout is text_only, image link might still be there but no img tag */
.cng-list-layout-text_only .cng-list-item-image-link {
    display: none; /* Hide the image link container if text_only */
}

.cng-list-item-content {
    flex: 1; /* Allow text content to take remaining space */
}
/* If no actual image is present (e.g. placeholder couldn't load or post has no thumb)
   but layout is not text_only, this class is added by PHP.
   You might want to adjust margins if the image space is empty. */
.cng-list-item-content-no-actual-image {
    /* margin-left: 0; /* Example: remove left margin if no image rendered */
}


.cng-list-item-title {
    /* font-size is set by dynamic-styles.php */
    font-weight: normal; /* Or bold if you prefer */
    margin: 0 0 3px 0; /* Reduced bottom margin */
    line-height: 1.4;
}

.cng-list-item-title a {
    /* color is set by dynamic-styles.php */
    text-decoration: none;
    transition: color 0.3s ease;
}
/* Hover color handled by dynamic styles */

/* Placeholder image specific styling (if you use them) */
.cng-placeholder-image {
    background-color: #f0f0f0;
    /* You can add a placeholder icon via CSS background or pseudo-element */
    /* border: 1px dashed #ccc; */
}
.cng-placeholder-list-image {
    /* Specific styles for list placeholder if different from featured */
}


/* Responsive adjustments for very small screens, if needed beyond the grid */
@media (max-width: 480px) {
    .cng-list-layout-image_left .cng-list-item-image-link img,
    .cng-list-layout-image_left .cng-list-item-image-link .cng-placeholder-list-image,
    .cng-list-layout-image_left_small .cng-list-item-image-link img,
    .cng-list-layout-image_left_small .cng-list-item-image-link .cng-placeholder-list-image {
        width: 70px; /* Even smaller on very small screens */
        max-height: 50px;
    }

    .cng-list-item {
        gap: 10px; /* Reduce gap on small screens */
    }

    .cng-featured-title {
        font-size: 16px; /* Example: reduce featured title size */
    }
    .cng-list-item-title {
        font-size: 14px; /* Example: reduce list title size */
    }
}