/* multi-rss-importer/css/mri-frontend.css */
/*
 * Global Box Sizing
 */
*, *::before, *::after {
    box-sizing: border-box;
}
/*
 * Main Feed Container
 * 3 columns for desktop, responsive down to 2 and 1 column;
 * Equal-height cards on desktop/tablet, auto-height on mobile.
 */
.mri-feed-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Default: 3 columns for standalone display */
    gap: 1.5em; /* Spacing between grid items (rows and columns) */
    grid-auto-rows: 1fr; /* Ensures equal row heights on desktop/tablet */
    align-items: stretch; /* Ensures feed items stretch to fill their grid cell height */
    padding: 10px 0;
    min-width: 0;
}
/*
 * Individual Feed Item Styles (The "Card" for each RSS entry)
 */
.mri-feed-item {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fafafa;
    min-width: 0;
    padding: 1em;
    margin: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
/* Make all direct children (except mri-feed-meta) grow to push the meta to the bottom */
.mri-feed-item > *:not(.mri-feed-meta) {
    flex-grow: 1;
}
.mri-feed-item h3 {
    margin-top: 0;
    margin-bottom: 0.5em;
    font-size: 1em;
    font-weight: 600;
    flex-shrink: 0;
    line-height: 1.3;
}
.mri-feed-item h3 a {
    text-decoration: none;
    color: #333;
    transition: color 0.2s ease-in-out;
}
.mri-feed-item h3 a:hover {
    color: #0073aa;
}
.mri-feed-image {
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    padding: 2px;
    max-width: 100%;
    height: auto;
    object-fit: cover;
    flex-shrink: 0;
}
.mri-feed-item p {
    margin-top: 0;
    margin-bottom: 0.3em;
    line-height: 1.5;
    color: #555;
}
/* This rule is now largely redundant due to .mri-feed-item > *:not(.mri-feed-meta)
    but kept for specificity if needed for other p tags within the item. */
.mri-feed-item p:not(.mri-feed-meta) {
    /* flex-grow: 1; (Can be removed or left, the generic rule covers it) */
}
.mri-feed-meta {
    padding-top: 10px;
    border-top: 1px solid #eee;
    font-size: 1em;
    color: #666;
    text-align: right;
    margin-top: auto;
}
.mri-feed-meta small {
    display: block; /* Can be changed to 'inline-block' or 'flex' if you want custom layout within small */
}
/* --- New styles for separated source title and date --- */
.mri-feed-source-title {
    color: #888;
    /* If you want the title and date on separate lines within the 'small' tag, uncomment this: */
    /* display: block; */
}
.mri-feed-source-title a {
    color: inherit; /* Inherit color from .mri-feed-source-title, or set a specific color */
    text-decoration: none;
}
.mri-feed-date {
    font-size: 0.90em;
    color: #888;
    /* If you want the title and date on separate lines within the 'small' tag, uncomment this: */
    /* display: block; */
    /* margin-top: 3px; */ /* Add some top margin if it's on a new line */
}
.mri-feed-meta a {
    color: #666; /* Default color for links within meta, potentially overridden by .mri-feed-source-title a */
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}
.mri-feed-meta a:hover {
    color: #0073aa;
}
.wp-block-columns {
    gap: 2em;
    margin-top: 20px;
    margin-bottom: 20px;
}
.wp-block-column h2.wp-block-heading {
    margin-top: 0;
    margin-bottom: 1em;
    font-size: 1.5em;
}
/* --- Responsive Adjustments --- */
/* For screens smaller than 992px (e.g., tablets in landscape, smaller desktops) */
@media (max-width: 992px) {
    .mri-feed-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 1em;
    }
    .wp-block-columns {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5em;
    }
    .mri-feed-item {
        padding: 0.8em;
    }
    .mri-feed-item h3 {
        font-size: 1em;
    }
}
/* For screens smaller than 768px (e.g., tablets in portrait, large phones) */
@media (max-width: 768px) {
    .mri-feed-container {
        grid-template-columns: 1fr;
        gap: 0.8em;
        grid-auto-rows: unset; /* Remove forced equal height on mobile */
    }
    .wp-block-columns {
        grid-template-columns: 1fr;
        gap: 1em;
    }
    .mri-feed-item {
        padding: 0.7em;
    }
    .mri-feed-item h3 {
        font-size: 1em;
    }
}
/* For screens smaller than 480px (e.g., most mobile phones) */
@media (max-width: 480px) {
    .mri-feed-container {
        grid-template-columns: 1fr;
        gap: 0.6em;
        grid-auto-rows: unset; /* Remove forced equal height on mobile */
    }
    .mri-feed-item {
        padding: 0.6em;
    }
    .mri-feed-item h3 {
        font-size: 1em;
    }
}
/* Default link hover */
a:hover {
    color: #5799ec;
}
.wp-block-column {
    margin: 0 !important;
    /* If needed, uncomment next line: */
    /* padding: 0 !important; */
}
/* --- Pagination Styles --- */
.mri-pagination {
    display: flex; /* Arrange links in a row */
    justify-content: center; /* Center the pagination links */
    align-items: center;
    grid-column: 1 / -1; /* Spans across all columns in the grid if used within a grid container */
    text-align: center;
    margin-top: 2em;
    padding-top: 1em;
    border-top: 1px solid #eee;
    flex-wrap: wrap; /* Allow links to wrap to the next line on smaller screens */
    gap: 0.5em; /* Space between links */
}
.mri-pagination a.page-numbers { /* Target the anchor tags with class 'page-numbers' */
    display: inline-block;
    padding: 0.3em 0.6em;
    margin: 0; /* Margin handled by gap on flex container */
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-decoration: none;
    color: #555;
    min-width: 2em; /* Ensure consistent width for single-digit numbers */
    text-align: center;
}
.mri-pagination a.page-numbers.current, /* Target current page link */
.mri-pagination a.page-numbers:hover {
    background-color: #0073aa; /* WordPress blue */
    color: #fff;
    border-color: #0073aa;
}