/* RSF News Page Widget Styles */

/* Featured Post */
.rsf-featured-post {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #000000;
    overflow: hidden;
    /* Transition removed */
    position: relative;
    padding-bottom: 20px;
}

/* Hover effect removed */
.rsf-featured-post:hover {
    /* No shadow on hover */
}

.rsf-featured-content {
    flex: 1;
    padding: 1rem 3rem 0rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.rsf-featured-content-flex {
    display: flex;
    align-items: center;
}

.rsf-featured-image {
    flex: 2;
    position: relative;
    overflow: hidden;
    min-height: 250px; /* Reduced by approximately 25% from 350px */
}

.rsf-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* Transition removed */
}

/* Image hover effect removed */
.rsf-featured-post:hover .rsf-featured-image img {
    /* No scale effect on hover */
}

/* Featured post title */
.rsf-featured-post .rsf-news-title {
    font-size: 32px;
    margin-bottom: 20px;
}

.rsf-featured-excerpt {
    font-size: 18px;
    margin-bottom: 25px;
}

/* Regular Posts Grid */
.rsf-news-container {
    display: grid;
    grid-gap: 1px; /* Small gap to show the grid lines */
    margin-bottom: 30px;
    background-color: #000000; /* This color will show through the gaps as grid lines */
    padding: 0; /* No padding to avoid outer border */
    outline: 1px solid white; /* Hide the outer border by matching the background */
    outline-offset: -1px; /* Ensure the outline covers the edge */
}

/* Column settings */
.rsf-news-container.columns-1 {
    grid-template-columns: 1fr;
}

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

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

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

/* News Item */
.rsf-news-item {
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    border-radius: 0;
    overflow: hidden;
    /* Transition removed */
    height: 100%;
    position: relative;
    padding: 15px;
}

/* Container for news items - position is already set above */

/* No need for individual borders as we're using grid-gap with background color */

/* Hover effect removed */
.rsf-news-item:hover {
    /* No shadow on hover */
}

/* Image */
.rsf-news-image {
    position: relative;
    overflow: hidden;
    width: 100%;
}

.rsf-news-image img {
    width: 100%;
    height: auto;
    display: block;
    /* Transition removed */
}

/* Image hover effect removed */
.rsf-news-item:hover .rsf-news-image img {
    /* No scale effect on hover */
}

/* Content */
.rsf-news-content {
    padding: 0;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.rsf-news-content-flex {
    display: flex;
    align-items: center;
}

/* Category */
.rsf-news-category {
    display: inline-block;
    padding: 3px 10px;
    color: #000000;
    background-color: #ffffff !important;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 15px;
    margin-right: 5px;
    align-self: flex-start;
    border: 1px solid #000000;
    border-radius: 0px;
}

/* Title */
.rsf-news-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 15px 0;
}

.rsf-news-title a {
    color: inherit;
    text-decoration: none;
    /* Transition removed */
}

/* Title hover effect removed */
.rsf-news-title a:hover {
    /* No color change on hover */
}

/* Excerpt */
.rsf-news-excerpt {
    font-size: 16px;
    line-height: 1.6;
    color: #666666;
    margin-bottom: 20px;
    flex-grow: 1;
}

/* Meta */
.rsf-news-meta {
    font-size: 14px;
    color: #888888;
    margin-top: auto;
    padding-top: 15px;
    padding-bottom: 15px;
}

/* Default styles for larger screens */
.rsf-news-meta-left {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rsf-news-meta-right {
    display: none; /* Hide category in meta section on larger screens */
}

.rsf-news-author {
    font-weight: 600;
    margin-right: 10px; /* Add space between author and date */
}

/* Responsive */
@media (max-width: 1024px) {
    .rsf-news-container.columns-4 {
        grid-template-columns: repeat(3, 1fr);
    }

    .rsf-featured-post .rsf-news-title {
        font-size: 28px;
    }
}

@media (max-width: 768px) {
    .rsf-featured-post {
        flex-direction: column;
    }

    .rsf-featured-content {
        order: 2;
        padding: 2rem 1rem 1rem 1rem;
    }

    .rsf-featured-image {
        order: 1;
        height: 300px;
    }

    .rsf-news-container.columns-3,
    .rsf-news-container.columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .rsf-news-title {
        font-size: 20px;
    }

    .rsf-featured-post .rsf-news-title {
        font-size: 24px;
    }

    .rsf-featured-excerpt {
        font-size: 16px;
    }
}

@media (max-width: 576px) {
    .rsf-news-container.columns-2,
    .rsf-news-container.columns-3,
    .rsf-news-container.columns-4 {
        grid-template-columns: 1fr;
    }

    .rsf-featured-content {
        padding: 2rem 1rem 1rem 1rem;
    }

    .rsf-news-item {
        padding: 10px;
    }

    .rsf-news-container {
        grid-gap: 1px; /* Maintain grid lines on mobile */
    }

    .rsf-news-title {
        font-size: 18px;
    }

    .rsf-news-excerpt {
        font-size: 14px;
    }

    .rsf-featured-post .rsf-news-title {
        font-size: 22px;
    }

    .rsf-featured-excerpt {
        font-size: 14px;
        margin-bottom: 15px;
    }

    .rsf-featured-image {
        height: 200px;
    }
}

/* Load More Button */
.rsf-load-more-container {
    text-align: center;
    margin: 30px 0;
    display: block !important; /* Force display */
    visibility: visible !important; /* Force visibility */
}

.rsf-load-more-button {
    display: inline-block !important; /* Force display */
    padding: 12px 30px;
    background-color: #000000;
    color: #fff;
    border: none;
    border-radius: 0px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    visibility: visible !important; /* Force visibility */
    opacity: 1 !important; /* Force opacity */
}

.rsf-load-more-button:hover {
    background-color: #555;
}

.rsf-load-more-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Mobile Layout (580px and below) */
@media (max-width: 580px) {
    /* Regular news items mobile layout */
    .rsf-news-item {
        display: flex;
        flex-direction: row;
        margin-bottom: 20px;
        padding-bottom: 20px;
        border-bottom: 1px solid #e0e0e0;
    }

    .rsf-news-item .rsf-news-image {
        width: 35%;
        min-width: 35%;
        margin-right: 15px;
        margin-bottom: 0;
        height: 50%;
        order: -1; /* Move image to the left */
        aspect-ratio: 1/1; /* Make image square */
        overflow: hidden; /* Hide overflow for square images */
    }

    .rsf-news-item .rsf-news-image img {
        width: 100%;
        height: 100%;
        object-fit: cover; /* Maintain aspect ratio while filling the container */
        object-position: center; /* Center the image */
    }

    .rsf-news-item .rsf-news-content {
        width: 65%;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .rsf-news-item .rsf-news-title {
        font-size: 16px;
        line-height: 1.3;
        margin-top: 0;
        margin-bottom: 8px;
    }

    .rsf-news-item .rsf-news-excerpt {
        display: none;
    }

    /* Only for mobile view (580px and below) */
    .rsf-news-item .rsf-news-meta {
        display: flex;
        flex-direction: column; /* Stack elements vertically */
        width: 100%;
        margin-top: auto;
        padding-bottom: 0px;
    }

    .rsf-news-item .rsf-news-meta-left {
        display: flex; /* Change to block display */
        width: 100%; /* Full width */
        margin-bottom: 5px; /* Add space between left and right sections */
    }

    .rsf-news-item .rsf-news-meta-right {
        display: block; /* Change to block display */
        width: 100%; /* Full width */
        text-align: left; /* Align text to the left */
        margin-top: 15px; /* Add space above */
    }

    /* Override default styles for author and date in mobile view */
    .rsf-news-item .rsf-news-author,
    .rsf-news-item .rsf-news-date {
        display: block; /* Force block display for each element */
        font-size: 12px;
        line-height: 1.4; /* Add some line height for better readability */
        margin-right: 0; /* Remove margin between author and date */
    }

    /* Hide the regular category in mobile view */
    .rsf-news-item .rsf-news-category {
        display: none;
        margin-bottom: 0px;
    }

    /* Show only the mobile category in the meta section */
    .rsf-news-item .rsf-news-meta-right {
        display: block; /* Show in mobile view */
    }

    .rsf-news-item .rsf-news-category-mobile {
        display: inline-block;
        margin-left: 0; /* Align to the left */
        font-size: 11px;
    }
}
