/* EZ RSS - Front End Display Styles */
.ezrss-wrapper, .ezrss-feed {
    margin: 20px 0;
    font-family: inherit;
}

.ezrss-list ul {
    padding-left: 20px;
    padding-bottom: 60px;
}

/* Item Titles */
.ezrss-title {
    margin: 10px 0 0 0 !important;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1;
}

.ezrss-title a {
    text-decoration: none;
    color: #2271b1;
    transition: color 0.2s ease;
}

.ezrss-title a:hover {
    color: #135e96;
    text-decoration: underline;
}

/* Meta Data (Source, Author, Date) */
.ezrss-meta {
    font-size: 0.85rem;
    color: #666;
    margin: 2px 0;
}

.ezrss-author {
    font-weight: 500;
    color: #444;
}

.ezrss-feed-name {
    font-weight: 600;
    color: #444;
}

/* Pagination Styling */
.ezrss-pagination {
    display: flex;
    align-items: center;
    gap: 15px;
    margin:25px 0px 20px 30px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.ezrss-pagination .button {
    display: inline-block;
    padding: 6px 14px;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    text-decoration: none;
    color: #2c3338;
    font-size: 13px;
    transition: all 0.2s ease;
}

.ezrss-pagination .button:hover {
    background: #f0f0f1;
    border-color: #c3c4c7;
    color: #2271b1;
}

.ezrss-pagination .page-numbers {
    font-size: 13px;
    color: #646970;
    font-style: italic;
}

/* Media/Card Layouts (Optional prep) */
.ezrss-media .ezrss-item {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.ezrss-thumb img {
    max-width: 150px;
    height: auto;
    border-radius: 4px;
}

/* Fade-in animation for new page loads */
.ezrss-feed {
    animation: ezrssFadeIn 0.6s ease-out;
}

@keyframes ezrssFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ensure the anchor has some "breathing room" at the top of the screen */
#results-top {
    scroll-margin-top: 50px; /* Adjust this based on your site's header height */
}

/* --- MOBILE RESPONSIVE OVERRIDES --- */
@media screen and (max-width: 600px) {
    
    /* 1. Make the pagination flexible and centered */
    .ezrss-pagination {
        flex-direction: column; /* Stack buttons on top of each other */
        gap: 12px;
        text-align: center;
        padding: 20px 10px;
    }

    .ezrss-pagination .button {
        width: 100%; /* Full width buttons for easier tapping */
        padding: 12px;
        font-size: 15px; /* Larger tap target */
        text-align: center;
    }

    .ezrss-pagination .ezrss-page-count {
        order: -1; /* Move "Page X of Y" to the top */
        margin-bottom: 5px;
        font-weight: bold;
    }

    /* 2. Fix the Media layout for small screens */
    .ezrss-media .ezrss-item {
        flex-direction: column; /* Stack image above text */
    }

    .ezrss-media .ezrss-thumb img {
        max-width: 100%;
        width: 100%; /* Make image span full width */
        height: auto;
    }

    /* 3. Adjust Title size for better readability on phones */
    .ezrss-title {
        font-size: 1.1rem;
    }

    /* 4. Increase spacing between list items so they are easier to tap */
    .ezrss-list .ezrss-item {
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 1px solid #f0f0f0;
    }

    /* Remove the bullet separator if there's only one meta item visible */
    .ezrss-meta {
        line-height: 1.6;
    }
}

/* --- Responsive 1 / 2 / 3 column shortcode layouts --- */
.ezrss-wrapper.ezrss-columns-2 > .ezrss-item,
.ezrss-wrapper.ezrss-columns-3 > .ezrss-item {
    min-width: 0;
}

.ezrss-wrapper.ezrss-columns-2:not(.ezrss-layout-list),
.ezrss-wrapper.ezrss-columns-3:not(.ezrss-layout-list) {
    display: grid;
    align-items: start;
    column-gap: 24px;
    row-gap: 20px;
}

.ezrss-wrapper.ezrss-columns-2:not(.ezrss-layout-list) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ezrss-wrapper.ezrss-columns-3:not(.ezrss-layout-list) { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Controls and pagination must span the full grid width. */
.ezrss-wrapper.ezrss-columns-2 > .ezrss-search-wrapper,
.ezrss-wrapper.ezrss-columns-3 > .ezrss-search-wrapper,
.ezrss-wrapper.ezrss-columns-2 > .ezrss-pagination,
.ezrss-wrapper.ezrss-columns-3 > .ezrss-pagination,
.ezrss-wrapper.ezrss-columns-2 > p,
.ezrss-wrapper.ezrss-columns-3 > p {
    grid-column: 1 / -1;
}

/* The List template uses a UL as its item container. */
.ezrss-layout-list.ezrss-columns-2 > .ezrss-list,
.ezrss-layout-list.ezrss-columns-3 > .ezrss-list {
    display: grid;
    align-items: start;
    column-gap: 24px;
    row-gap: 14px;
    padding-left: 20px;
}
.ezrss-layout-list.ezrss-columns-2 > .ezrss-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ezrss-layout-list.ezrss-columns-3 > .ezrss-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.ezrss-source-filter { background-color: #fff; }

@media screen and (max-width: 900px) {
    .ezrss-wrapper.ezrss-columns-3:not(.ezrss-layout-list),
    .ezrss-layout-list.ezrss-columns-3 > .ezrss-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media screen and (max-width: 600px) {
    .ezrss-wrapper.ezrss-columns-2:not(.ezrss-layout-list),
    .ezrss-wrapper.ezrss-columns-3:not(.ezrss-layout-list),
    .ezrss-layout-list.ezrss-columns-2 > .ezrss-list,
    .ezrss-layout-list.ezrss-columns-3 > .ezrss-list {
        grid-template-columns: 1fr;
    }
}

/* Shortcode search controls - 1.1.12 */
.ezrss-search-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}
.ezrss-search-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 420px;
    min-width: 0;
    max-width: 560px;
}
.ezrss-search-input-wrap {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}
.ezrss-search-input-wrap input[type="text"] {
    width: 100%;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.ezrss-search-help-link-row {
    margin: 0 0 6px;
}
.ezrss-search-help-link {
    display: inline-block;
    padding: 4px 2px;
    border: 0;
    background: transparent;
    color: #2271b1;
    cursor: pointer;
    font: inherit;
    font-size: 0.9em;
    text-decoration: none;
}
.ezrss-search-help-link:hover,
.ezrss-search-help-link:focus-visible {
    color: #135e96;
    text-decoration: underline;
}
.ezrss-search-help-link:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}
.ezrss-search-row .ezrss-search-button {
    flex: 0 0 auto;
    height: 40px;
    padding: 4px 12px;
    white-space: nowrap;
}
.ezrss-source-filter-row {
    flex: 0 1 330px;
    min-width: 200px;
    margin: 0;
}
.ezrss-source-filter-row .ezrss-source-filter {
    width: 100%;
    min-height: 40px;
    padding: 7px 32px 7px 9px;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.ezrss-search-help-panel {
    margin-top: 8px;
    padding: 10px 12px;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 4px;
    color: #555;
    font-size: 0.9em;
}
.ezrss-search-help-panel[hidden] { display: none; }
.ezrss-search-help-panel ul {
    margin: 6px 0 0;
    padding-left: 18px;
    list-style: disc;
}
.ezrss-search-error {
    color: #d63638;
    font-size: 0.9em;
    margin-top: 5px;
}
.ezrss-search-clear {
    margin-top: 6px;
    font-size: 0.9em;
}
.ezrss-search-clear a {
    text-decoration: none;
    color: #666;
}
@media screen and (max-width: 600px) {
    .ezrss-search-toolbar {
        flex-wrap: wrap;
        gap: 8px;
    }
    .ezrss-search-row {
        flex: 1 1 100%;
        max-width: none;
        width: 100%;
    }
    .ezrss-source-filter-row {
        flex: 1 1 100%;
        min-width: 0;
        width: 100%;
    }
}
