/* News Section Styles - Use tertiary-dark */
.news-section {
    background-color: var(--tertiary-dark);
    /* Keep padding specific if needed, or remove if base .section has it */
    /* padding: 60px 0; */ 
    color: var(--text-light);
}

/* News Filters - Use dark-green */
.news-filters {
    margin-bottom: 40px;
    background-color: var(--halverstown-dark-green);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 0; /* Remove extra margin inside filters */
    padding: 0; /* Remove extra padding inside filters */
    background-color: transparent; /* Inherit from news-filters */
    border-radius: 0;
    align-items: center;
    justify-content: center;
}

.filter-group {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}

/* Fancy Select Styles - Keep specific component style */
.fancy-select {
    position: relative;
    width: 100%;
}

.fancy-select select {
    width: 100%;
    padding: 12px 40px 12px 15px;
    background-color: var(--halverstown-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--text-light);
    font-size: 16px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fancy-select select:focus {
    outline: none;
    border-color: var(--halverstown-yellow);
    box-shadow: 0 0 0 2px rgba(255, 236, 0, 0.2);
}

.select-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--halverstown-yellow);
    pointer-events: none;
}

/* Search Input Styles - Keep specific component style */
.search-input {
    position: relative;
    width: 100%;
}

.search-input input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    background-color: var(--halverstown-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--text-light);
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-input input:focus {
    outline: none;
    border-color: var(--halverstown-yellow);
    box-shadow: 0 0 0 2px rgba(255, 236, 0, 0.2);
}

.search-input input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--halverstown-yellow);
    pointer-events: none;
}

/* Reset Button Styles - Keep specific layout/positioning */
.filter-reset-group {
    max-width: none;
    /* Ensure it aligns nicely */
    margin-left: auto; 
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
    transition: opacity 0.3s ease;
}

/* News Card - Use dark-green */
.news-card {
    background-color: var(--halverstown-dark-green);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    height: 100%;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.news-card-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.news-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

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

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

.news-date-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: var(--halverstown-yellow);
    border-radius: 5px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.date-day {
    font-size: 18px;
    font-weight: bold;
    color: var(--halverstown-dark-green);
}

.date-month {
    font-size: 14px;
    text-transform: uppercase;
    color: var(--halverstown-dark-green);
}

.news-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--halverstown-dark-green);
}

.news-categories {
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.category-badge {
    background-color: var(--halverstown-yellow);
    color: var(--halverstown-dark-green);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.news-content h3 {
    font-size: 20px;
    margin-bottom: 15px;
    line-height: 1.4;
    color: var(--text-light); /* Ensure heading is light */
}

.news-excerpt {
    color: var(--text-light);
    opacity: 0.9;
    margin-bottom: 20px;
    flex-grow: 1;
    font-size: 15px;
    line-height: 1.6;
}

/* Pagination - Assuming base styles exist, keep specific overrides if any */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 40px 0 20px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
    background-color: var(--halverstown-dark-green);
    color: var(--text-light);
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background-color: var(--halverstown-yellow);
    color: var(--halverstown-dark-green);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.pagination .current {
    background-color: var(--halverstown-yellow);
    color: var(--halverstown-dark-green);
    font-weight: 700;
}

/* Empty State - Use dark-green */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background-color: var(--halverstown-dark-green);
    border-radius: 8px;
}

.empty-state i {
    font-size: 48px;
    color: var(--halverstown-yellow);
    margin-bottom: 20px;
}

.empty-state h3 {
    color: var(--halverstown-yellow);
    margin-bottom: 15px;
    font-size: 24px;
}

.empty-state p {
    color: var(--text-light);
    opacity: 0.9;
    margin-bottom: 25px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Subscribe Section - Use secondary-dark */
.subscribe-section {
    background-color: var(--secondary-dark);
    padding: 60px 0;
    color: var(--text-light);
}

.subscribe-section .section-header {
    text-align: center;
    margin-bottom: 30px;
}

.subscribe-section .section-header h2 {
    color: var(--halverstown-yellow);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.subscribe-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.subscribe-content p {
    margin-bottom: 25px;
    font-size: 18px;
}

.subscribe-form .form-group {
    display: flex;
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.subscribe-form input {
    flex: 1;
    padding: 15px;
    border: none;
    font-size: 16px;
    background-color: var(--text-light); /* Ensure input background is light for contrast */
    color: var(--halverstown-dark); /* Ensure input text is dark */
}

.subscribe-form input::placeholder {
    color: #6c757d; /* Standard placeholder color */
}

.subscribe-form input:focus {
    outline: 2px solid var(--halverstown-yellow); /* Yellow focus ring */
    outline-offset: 2px;
}

.form-disclaimer {
    color: var(--text-light);
    opacity: 0.8;
}

/* Article Modal - Style Corrections */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.modal-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: rgba(18, 18, 18, 0.85); /* Use dark overlay */
    backdrop-filter: blur(5px);
}

#article-modal .modal-container { /* Increased specificity */
    position: relative;
    width: 90%;
    max-width: 1200px;
    margin: 40px auto;
    max-height: 90vh;
    background-color: #0F1419 !important; /* Force dark background */
    border-radius: 8px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    animation: modalFadeIn 0.3s ease;
}

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

#article-modal .modal-content { /* Increased specificity */
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 1100px !important;
}

#article-modal .modal-header { /* Increased specificity */
    padding: 20px 25px;
    background-color: var(--halverstown-dark-green) !important; /* Force dark green header */
    position: relative;
}

#article-modal .modal-header h2 { /* Increased specificity */
    margin: 0 0 8px 0;
    font-size: 24px;
    line-height: 1.3;
    padding-right: 30px;
    color: var(--halverstown-yellow) !important; /* Force yellow title */
}

#article-modal .modal-meta { /* Increased specificity */
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    color: var(--text-light) !important; /* Force light text for meta */
    font-size: 14px;
}

#article-modal .modal-meta .category-badge { /* Increased specificity */
     background-color: var(--halverstown-yellow) !important;
    color: var(--halverstown-dark-green) !important;
    padding: 3px 8px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
}

#article-modal .modal-close { /* Increased specificity */
    position: absolute;
    right: 0px !important;
    top: 0px !important;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-light) !important; /* Force light close button */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

#article-modal .modal-close:hover { /* Increased specificity */
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--halverstown-yellow) !important;
}

#article-modal .modal-body { /* Increased specificity */
    padding: 30px;
    overflow-y: auto;
    max-height: calc(80vh - 160px) !important;/* Adjust based on header height */
    color: var(--text-light) !important; /* Force light text */
    line-height: 1.7;
    font-size: 16px;
    background-color: var(--halverstown-dark) !important; /* Force dark background */
}

#article-modal .modal-body p { /* Increased specificity */
    margin-bottom: 20px;
    color: var(--text-light) !important; /* Force light text */
}

#article-modal .modal-body ul, 
#article-modal .modal-body ol { /* Increased specificity */
    margin-bottom: 20px;
    padding-left: 25px;
    color: var(--text-light) !important; /* Force light text */
}

#article-modal .modal-body li { /* Increased specificity */
    margin-bottom: 10px;
    color: var(--text-light) !important; /* Force light text */
}

#article-modal .modal-body a { /* Increased specificity */
    color: var(--halverstown-blue) !important; /* Use defined blue for links */
    text-decoration: underline;
    transition: color 0.2s ease;
}

#article-modal .modal-body a:hover { /* Increased specificity */
    color: var(--halverstown-yellow) !important;
}

#article-modal .modal-body strong { /* Increased specificity */
    color: var(--text-light) !important; /* Force light bold text */
    font-weight: 600;
}

#article-modal #modal-content { /* Increased specificity */
    width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

#article-modal #modal-content img { /* Increased specificity */
    max-width: 100%;
    height: auto;
    margin: 25px 0;
    border-radius: 8px;
    display: block;
}

/* Loading State */
.news-grid.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.news-grid.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 236, 0, 0.3);
    border-radius: 50%;
    border-top-color: var(--halverstown-yellow);
    animation: spin 1s ease-in-out infinite;
    z-index: 10;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Responsive Styles */
@media (max-width: 768px) {
    
    .section-header h2,
    .subscribe-section .section-header h2 {
        font-size: 2rem;
    }

    .filter-form {
        flex-direction: column;
        gap: 15px;
    }

    .filter-group {
        width: 100%;
        max-width: none;
    }
    
    .filter-reset-group {
        margin-left: 0;
        width: 100%;
    }

    .filter-reset-group a {
        width: 100%;
    }

    .news-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .modal-container {
        width: 95%;
        margin: 20px auto;
        max-height: 85vh;
    }
    
    .modal-header h2 {
        font-size: 20px;
    }
    
    .modal-body {
        padding: 20px;
        font-size: 15px;
        max-height: calc(85vh - 100px);
    }
    
    .subscribe-form .form-group {
        flex-direction: column;
    }
    
    .subscribe-form input {
        width: 100%;
        border-radius: 4px 4px 0 0;
    }
    
    .subscribe-form .btn-primary {
        width: 100%;
        border-radius: 0 0 4px 4px;
    }
} 