/**
 * All of the CSS for your public-facing functionality should be
 * included in this file.
 */

/* Common Styles */
.nrb-news-wrapper,
.nrb-blogs-wrapper {
    margin: 30px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    width: 100%;
    box-sizing: border-box;
    clear: both;
}

.nrb-news-wrapper::after,
.nrb-blogs-wrapper::after {
    content: "";
    display: table;
    clear: both;
}

.nrb-news-item,
.nrb-blog-item {
    margin-bottom: 30px;
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.nrb-news-item:hover,
.nrb-blog-item:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
}

.nrb-news-image,
.nrb-blog-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.nrb-news-image a,
.nrb-blog-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.nrb-news-image img,
.nrb-blog-image img {
    width: 100%;
    height: 100%;
    display: block;
    transition: transform 0.3s ease;
    object-fit: cover;
}

.nrb-news-item:hover .nrb-news-image img,
.nrb-blog-item:hover .nrb-blog-image img {
    transform: scale(1.05);
}

.nrb-news-content,
.nrb-blog-content {
    padding: 20px;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.nrb-news-title,
.nrb-blog-title {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 20px;
    line-height: 1.4;
}

.nrb-news-title a,
.nrb-blog-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.nrb-news-title a:hover,
.nrb-blog-title a:hover {
    color: #0073aa;
}

.nrb-news-meta,
.nrb-blog-meta {
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
}

.nrb-news-meta span,
.nrb-blog-meta span {
    margin-right: 15px;
}

.nrb-news-meta i,
.nrb-blog-meta i {
    margin-right: 5px;
}

.nrb-news-excerpt,
.nrb-blog-excerpt {
    margin-bottom: 15px;
    color: #555;
    line-height: 1.6;
    flex: 1 1 auto;
}

.nrb-news-readmore,
.nrb-blog-readmore {
    margin-top: auto;
}

.nrb-news-readmore-link,
.nrb-blog-readmore-link {
    display: inline-block;
    padding: 8px 15px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 3px;
    font-size: 14px;
    transition: background 0.3s ease;
}

.nrb-news-readmore-link:hover,
.nrb-blog-readmore-link:hover {
    background: #005177;
    color: #fff;
}

/* Grid Layout */
.nrb-news-grid,
.nrb-blogs-grid {
    display: grid;
    grid-gap: 30px;
    width: 100%;
    grid-auto-rows: auto; /* Changed from 1fr to auto */
    height: auto !important;
    min-height: 0 !important;
}

.nrb-news-grid-2,
.nrb-blogs-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.nrb-news-grid-3,
.nrb-blogs-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.nrb-news-grid-4,
.nrb-blogs-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.nrb-news-grid-item,
.nrb-blog-grid-item {
    display: flex;
    flex-direction: column;
    height: 100%;
    margin-bottom: 0 !important; /* Ensure no extra margin */
}

/* List Layout */
.nrb-news-list-item,
.nrb-blog-list-item {
    display: flex;
    flex-direction: row;
    height: auto;
}

.nrb-news-list-item .nrb-news-image,
.nrb-blog-list-item .nrb-blog-image {
    flex: 0 0 30%;
    max-width: 30%;
    display: flex;
    align-items: stretch;
}

.nrb-news-list-item .nrb-news-image a,
.nrb-blog-list-item .nrb-blog-image a {
    display: flex;
    width: 100%;
}

.nrb-news-list-item .nrb-news-content,
.nrb-blog-list-item .nrb-blog-content {
    flex: 0 0 70%;
    max-width: 70%;
}

/* Search Form */
.nrb-search-container,
.nrb-news-search-container,
.nrb-blogs-search-container {
    margin-bottom: 30px;
    display: flex;
    justify-content: flex-end;
    width: 100%;
    position: relative;
    z-index: 10;
    clear: both;
}

.nrb-search-form {
    display: flex;
    flex-direction: row;
    position: relative;
    max-width: 400px;
    width: 100%;
    background: #f8f8f8;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-left: auto; /* Push to the right */
}

.nrb-search-fields {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 5px;
    width: 100%;
}

.nrb-search-input-wrap {
    flex: 1 1 auto;
}

.nrb-search-date-wrap {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: 5px;
}

.nrb-search-date-wrap label {
    font-size: 14px;
    white-space: nowrap;
}

.nrb-search-button-wrap {
    flex: 0 0 auto;
}

.nrb-search-field {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
}

.nrb-search-date-field {
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
    width: 130px;
}

.nrb-search-submit {
    height: 100%;
    padding: 8px 12px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.3s ease;
    white-space: nowrap;
    margin-left: 5px;
}

.nrb-search-submit:hover {
    background: #005177;
}

@media screen and (max-width: 768px) {
    .nrb-search-container,
    .nrb-news-search-container,
    .nrb-blogs-search-container {
        justify-content: center;
    }

    .nrb-search-form {
        max-width: 100%;
    }

    .nrb-search-fields {
        flex-wrap: wrap;
    }

    .nrb-search-input-wrap {
        flex: 1 1 100%;
        margin-bottom: 5px;
    }

    .nrb-search-date-wrap {
        flex: 1 1 auto;
        margin-left: 0;
    }

    .nrb-search-button-wrap {
        flex: 0 0 auto;
    }
}

/* Responsive Styles */
@media screen and (max-width: 992px) {
    .nrb-news-grid-3,
    .nrb-blogs-grid-3,
    .nrb-news-grid-4,
    .nrb-blogs-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .nrb-news-grid-2,
    .nrb-blogs-grid-2,
    .nrb-news-grid-3,
    .nrb-blogs-grid-3,
    .nrb-news-grid-4,
    .nrb-blogs-grid-4 {
        grid-template-columns: 1fr;
    }

    .nrb-news-list-item,
    .nrb-blog-list-item {
        flex-direction: column;
    }

    .nrb-news-list-item .nrb-news-image,
    .nrb-blog-list-item .nrb-blog-image,
    .nrb-news-list-item .nrb-news-content,
    .nrb-blog-list-item .nrb-blog-content {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .nrb-news-item,
    .nrb-blog-item {
        margin-bottom: 20px;
    }

    .nrb-news-title,
    .nrb-blog-title {
        font-size: 18px;
    }
}

/* Pagination */
.nrb-pagination {
    margin: 30px 0;
    text-align: center;
    width: 100%;
    clear: both;
}

.nrb-pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 3px;
    border: 1px solid #ddd;
    background-color: #fff;
    color: #333;
    text-decoration: none;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.nrb-pagination .page-numbers.current {
    background-color: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.nrb-pagination .page-numbers:hover {
    background-color: #f5f5f5;
    border-color: #ccc;
}

.nrb-pagination .page-numbers.next,
.nrb-pagination .page-numbers.prev {
    padding: 8px 16px;
}

/* Load More Button */
.nrb-load-more-container {
    text-align: center;
    margin: 30px auto;
    width: 100%;
    clear: both;
    display: block;
}

.nrb-load-more-container {
    text-align: center;
    margin-top: 20px !important;
    clear: both;
    width: 100%;
    display: block;
    position: relative;
}

.nrb-load-more-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #0073aa;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
    margin-top: 0;
}

.nrb-load-more-button:hover {
    background-color: #005a87;
}

.nrb-load-more-button.loading {
    opacity: 0.7;
    cursor: wait;
}

.nrb-load-more-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #999;
}

/* Carousel Layout */
.nrb-news-carousel-container,
.nrb-blogs-carousel-container {
    position: relative;
}

.nrb-news-carousel-item,
.nrb-blog-carousel-item {
    margin: 0 15px;
}

.slick-prev,
.slick-next {
    z-index: 1;
}

.slick-prev {
    left: -25px;
}

.slick-next {
    right: -25px;
}

.slick-dots {
    bottom: -40px;
}


/* Add these rules */
.nrb-single-item {
    max-width: 100% !important;
}

.nrb-single-item .nrb-news-item,
.nrb-single-item .nrb-blog-item {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    height: auto; /* Force height to fit content */
    min-height: 0; /* Remove any minimum height */
}

/* For grid layout */
.nrb-single-item.nrb-news-grid,
.nrb-single-item.nrb-blogs-grid {
    grid-template-columns: 1fr !important;
    grid-auto-rows: auto; /* Ensure grid rows fit content */
    height: auto; /* Force container height to fit content */
}

/* Ensure content area fits content */
.nrb-single-item .nrb-news-content,
.nrb-single-item .nrb-blog-content {
    position: absolute;
    bottom: 50px;
    flex: 0 0 auto; /* Prevent flex growing */
    width: 100%;
    height: auto;
    background: #0f0f0f69;
}

.nrb-single-item .nrb-news-content .nrb-news-meta{
    display: none;
}
.nrb-single-item .nrb-news-content .nrb-news-title a{
    color: #fafafa;
}
/**
 * CSS Fix for the Gap Between Posts and Load More Button
 */

/* Fix for the large gap between posts and load more button */
.nrb-news-wrapper.nrb-news-grid,
.nrb-blogs-wrapper.nrb-blogs-grid {
    min-height: auto !important; /* Override any min-height that might be causing the gap */
    height: auto !important;
    margin-bottom: 20px !important; /* Add consistent spacing before the load more button */
    grid-auto-rows: auto !important; /* Ensure grid rows fit content */
}

/* Ensure the load more container doesn't have extra spacing */
.nrb-load-more-container {
    margin-top: 0 !important; /* Remove top margin completely */
}

/* Target specifically when we have 3 or fewer posts */
.nrb-small-post-count {
    grid-auto-flow: row !important;
    grid-auto-rows: auto !important;
}

/* Remove any bottom spacing from the last row of items */
.nrb-news-item:last-child,
.nrb-blog-item:last-child {
    margin-bottom: 0 !important;
}

/* Target any possible wrapper that might be causing the spacing */
.nrb-news-grid-3,
.nrb-blogs-grid-3,
.nrb-news-grid-2,
.nrb-blogs-grid-2,
.nrb-news-grid-1,
.nrb-blogs-grid-1 {
    height: auto !important;
    min-height: 0 !important;
}

/* Force the grid layout to properly collapse when fewer items */
.nrb-exact-post-count-3 {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    grid-gap: 20px !important;
    height: auto !important;
}

.nrb-exact-post-count-2 {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    grid-gap: 20px !important;
    height: auto !important;
}

.nrb-exact-post-count-1 {
    display: block !important;
    height: auto !important;
}

/* Fix for the gap issue */
.nrb-small-post-count::after {
    display: none !important; /* Remove any ::after content that might be creating space */
}

/* Ensure the grid container doesn't have extra space */
.nrb-news-wrapper,
.nrb-blogs-wrapper {
    margin-bottom: 0 !important;
}