/* AB News Plugin Frontend Styles */
html .single-news h4.fl-heading{
    font-size: 18px;
  font-style: normal;
  font-weight: 600;
}
/* Flex Layout */
.news-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}

.news-grid .news-item {
    flex: 0 1 calc(33.333% - 1.5rem); /* 3 columns with gap compensation */
    margin-bottom: 0; /* Remove bottom margin in flex */
    padding: 0; /* Remove padding to accommodate full-width image */
    border: none;
    border-radius: 5px;
    background: #fff;
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 300px; /* Ensure minimum height for consistency */
    overflow: hidden; /* Ensure rounded corners work with image */
}

/* Featured Image Styling */
.news-featured-image {
    width: 100%;
    overflow: hidden;
}

.news-featured-image a {
    display: block;
    line-height: 0;
}

.news-featured-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-featured-image:hover img {
    transform: scale(1.05);
}

/* Content area padding for items with featured image */
.news-item h4,
.news-item .news-subtitle,
.news-item .news-meta,
.news-item .news-excerpt,
.news-item .read-more {
    padding-left: 0;
    padding-right: 0;
}

.news-item h4 {
  color: #333;
  height: 3em;
  line-height: 1.1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: -10px;
  font-weight: bold;
}

.news-item .read-more {
    padding-bottom: 1.5rem;
    margin-bottom: 0;
}

/* Module button margins */
.news-item .fl-module-button {
    margin-left: 0;
    margin-right: 0;
}

.news-item h4 a {
    text-decoration: none;
    color: inherit;
}

.news-item h4 a:hover {
    color: #0073aa;
}

.news-subtitle {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: normal;
    color: #666;
    font-style: italic;
    line-height: 1.4;
}

.news-meta {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #666;
}

.news-date {
    font-weight: bold;
    color: #1E1E1E;
}

.news-content {
    line-height: 1.6;
}

.news-excerpt {
    margin-bottom: 1rem;
    flex-grow: 1; /* Push read more button to bottom */
}

.read-more {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 3px;
    font-size: 0.9rem;
    margin-top: auto; /* Align to bottom of flex container */
    align-self: flex-start; /* Don't stretch full width */
}

.read-more:hover {
    background: #005a87;
    color: #fff;
}

/* News Archive Styles */
.news-archive {
    margin-bottom: 2rem;
}

/* News Filter Styles */
.news-filter {
    margin-bottom: 2rem;
}

.news-year-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: flex-start;
}

.year-filter-btn {
    padding: 0.5rem 1.3rem;
    background: #B3BEB6;
    border: 2px solid #B3BEB6;
    border-radius: 0;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 800;
    color: white;
    transition: all 0.3s ease;
    text-decoration: none;
    outline: none;
}

.year-filter-btn:hover {
    background: #1E1E1E;
    border-color: #1E1E1E;
    color: white;
    transform: translateY(-2px);
}

.year-filter-btn:focus {
    background: #1E1E1E;
    border-color: #1E1E1E;
    color: white;
    outline: none;
    box-shadow: none;
}

.year-filter-btn.active {
    background: #1E1E1E;
    border-color: #1E1E1E;
    color: white;
    box-shadow: 0 2px 8px rgba(30, 30, 30, 0.3);
}

.year-filter-btn.active:hover {
    background: #000000;
    border-color: #000000;
    color: white;
}

.news-loading {
    text-align: center;
    padding: 1rem;
    font-style: italic;
    color: #666;
}

/* Responsive design for filter buttons */
@media (max-width: 768px) {
    .news-year-filter {
        justify-content: flex-start;
    }
    
    .year-filter-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .news-filter {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .year-filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        flex: 1 1 auto;
        min-width: 80px;
    }
}

/* Single News Item Styles */
.single-news .news-meta {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f9f9f9;
    border-left: 4px solid #0073aa;
}

.single-news .news-date {
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .news-grid {
        gap: 1.5rem;
    }
    
    .news-grid .news-item {
        flex: 0 1 calc(50% - 0.75rem); /* 2 columns with gap compensation */
        min-height: 280px;
    }
}

@media (max-width: 768px) {
    .news-grid {
        gap: 1rem;
    }
    
    .news-grid .news-item {
        flex: 0 1 100%; /* 1 column */
        min-height: 250px;
    }
    
    /* Smaller featured images on mobile */
    .news-featured-image img {
        height: 150px;
    }
}

@media (max-width: 480px) {
    .news-grid {
        gap: 0.5rem;
    }
    
    .news-item h4,
    .news-item .news-subtitle,
    .news-item .news-meta,
    .news-item .news-excerpt,
    .news-item .read-more {
        padding-left: 0;
        padding-right: 0;
    }
    
    .news-item h4 {
        font-size: 1.1rem;
        height: 2.8em; /* Adjusted for smaller mobile font */
    }
    
    .news-meta {
        margin-top: 1rem;
    }
    
    .news-item .read-more {
        padding-bottom: 1rem;
    }
    
    /* Even smaller images on very small screens */
    .news-featured-image img {
        height: 120px;
    }
}

/* Non-grid layout (fallback/list view) */
.news-container:not(.news-grid) .news-item {
    flex: none; /* Reset flex */
    width: auto; /* Reset width */
    margin-bottom: 2rem;
    display: block; /* Override flex */
    height: auto; /* Override height */
    min-height: auto; /* Reset min-height */
    padding: 1.5rem; /* Add padding for non-grid items */
    border: none;
    border-radius: 5px;
    background: #fff;
}

/* Featured images in non-grid layout */
.news-container:not(.news-grid) .news-featured-image {
    margin: -1.5rem -1.5rem 1rem -1.5rem; /* Extend to edges */
    border-radius: 5px 5px 0 0;
    overflow: hidden;
}

.news-container:not(.news-grid) .news-excerpt {
    flex-grow: initial; /* Reset flex-grow */
}

.news-container:not(.news-grid) .read-more {
    margin-top: 0; /* Reset margin-top */
}

/* Flexbox utilities for better control */
.news-grid .news-item {
    box-sizing: border-box; /* Ensure padding doesn't break layout */
}

/* Ensure content spacing in flex items */
.news-grid .news-item h4 {
    flex-shrink: 0; /* Don't shrink title */
}

.news-grid .news-item .news-subtitle {
    flex-shrink: 0; /* Don't shrink subtitle */
}

.news-grid .news-item .news-meta {
    flex-shrink: 0; /* Don't shrink meta */
}