/* Newspaper Hemeroteca Styles */

:root {
    --nh-primary-color: #007a4b;
    /* Actualidad Castellón Green */
    --nh-accent-color: #4db2ec;
    --nh-bg-color: #ffffff;
    --nh-border-color: #eeeeee;
}

.nh-hemeroteca-container {
    margin-bottom: 50px;
    clear: both;
}

.nh-widget-box {
    margin-bottom: 40px;
}

.nh-calendar-wrapper {
    background: var(--nh-bg-color);
    padding: 30px;
    border: 1px solid var(--nh-border-color);
    border-radius: 5px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.nh-calendar-wrapper .td-block-title {
    margin-bottom: 15px;
    text-align: left;
}

.nh-subtitle {
    font-size: 15px;
    color: #666;
    margin-bottom: 30px;
    text-align: left;
    line-height: 1.4;
}

#nh-calendar-container {
    display: inline-block;
    margin-bottom: 30px;
    max-width: 100%;
}

.nh-action-bar {
    margin-top: 10px;
}

#nh-search-btn {
    background-color: var(--nh-button-bg-custom, #222);
    color: #fff;
    border: none;
    padding: 15px 45px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 2px;
    letter-spacing: 0.5px;
}

#nh-search-btn:hover {
    background-color: var(--nh-primary-color);
    box-shadow: 0 4px 15px rgba(0, 122, 75, 0.3);
}

/* Results Formatting */
.nh-results-header {
    margin-bottom: 30px;
}

.nh-results-container {
    clear: both;
    display: block;
    width: 100%;
}

.nh-result-item {
    margin-bottom: 30px !important;
    padding-bottom: 30px !important;
    border-bottom: 1px solid #f0f0f0;
    overflow: hidden;
    /* Fix overlap */
    display: block;
    clear: both;
}

.nh-result-item:last-child {
    border-bottom: none;
}

/* Results Formatting - Custom Layout (Text Left, Image Right) */
.nh-results-container {
    padding-top: 20px;
    clear: both;
}

.nh-custom-result {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid #eeeeee;
    align-items: flex-start;
}

.nh-custom-result:last-child {
    border-bottom: none;
}

.nh-result-content {
    flex: 1;
    order: 1;
}

.nh-result-image {
    width: 35%;
    min-width: 250px;
    order: 2;
}

.nh-result-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 2px;
}

.nh-result-title {
    font-size: 24px;
    line-height: 1.2;
    margin: 0 0 10px 0;
    font-weight: 700;
}

.nh-result-title a {
    color: var(--nh-primary-color) !important;
    text-decoration: none;
    transition: color 0.3s ease;
}

.nh-result-title a:hover {
    color: #222 !important;
}

.nh-result-meta {
    margin-bottom: 15px;
}

.nh-result-date {
    font-size: 13px;
    color: #888;
    text-transform: uppercase;
    font-weight: 600;
}

.nh-result-excerpt {
    font-size: 15px;
    color: #444;
    line-height: 1.6;
}

/* Pagination Fix */
.nh-results-container .page-nav {
    margin-top: 20px;
    padding: 20px 0;
    text-align: center;
    border-top: 1px solid #eee;
}

/* Responsive */
@media (max-width: 767px) {
    .nh-custom-result {
        flex-direction: column;
    }

    .nh-result-content {
        order: 2;
    }

    .nh-result-image {
        order: 1;
        width: 100%;
    }

    .nh-result-title {
        font-size: 20px;
    }
}

/* Flatpickr Customization - Green Theme */
.flatpickr-calendar {
    border: none !important;
    box-shadow: none !important;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover {
    background: var(--nh-primary-color) !important;
    border-color: var(--nh-primary-color) !important;
    color: #fff !important;
}

.flatpickr-day.inRange {
    background: rgba(0, 122, 75, 0.1) !important;
    box-shadow: -5px 0 0 rgba(0, 122, 75, 0.1), 5px 0 0 rgba(0, 122, 75, 0.1) !important;
}

.flatpickr-months .flatpickr-month {
    color: #222 !important;
    fill: #222 !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months:hover {
    background: transparent !important;
}

/* Responsive fixes */
@media (max-width: 480px) {
    .nh-calendar-wrapper {
        padding: 15px;
    }

    #nh-search-btn {
        width: 100%;
    }
}