.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.calendar-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.calendar-link:hover {
    opacity: 0.8;
}

.calendar-icon {
    width: 20px;
    height: 20px;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280; /* Используем цвет из палитры проекта (как .social-link) */
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #111827; /* Используем цвет из палитры проекта (как .social-link:hover) */
}

.filter-mode {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.filter-mode label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.news-date-filter label {
    display: block;
    margin-bottom: 1rem;
}

.news-date-filter label input[type="date"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db; /* Используем цвет из палитры проекта (как .search-input) */
    border-radius: 4px;
    font-size: 1rem;
}

.news-date-filter label input[type="date"]:focus {
    border-color: #3b82f6; /* Используем цвет из палитры проекта (как .search-input:focus) */
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-apply,
.btn-reset {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    border: 1px solid #d1d5db; /* Используем цвет из палитры проекта */
    background: #fff;
    color: #333;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-apply {
    background: #3b82f6; /* Используем цвет из палитры проекта (как .search-submit) */
    color: white;
    border-color: #3b82f6;
}

.btn-apply:hover {
    background: #2563eb; /* Используем цвет из палитры проекта (как .search-submit:hover) */
    border-color: #2563eb;
}

.btn-reset:hover {
    background: #f9fafb; /* Светло-серый фон при наведении */
}

.form-errors {
    color: #d92b2b; /* Используем цвет из палитры проекта (как .badge-breaking) */
    margin-bottom: 1rem;
    padding: 0.5rem;
    background-color: #fef2f2; /* Светло-красный фон для ошибок */
    border-radius: 4px;
    border: 1px solid #fecaca;
}

.active-filter {
    margin-bottom: 1rem;
    padding: 0.5rem;
    background-color: #f9fafb; /* Светло-серый фон */
    border-radius: 4px;
    border: 1px solid #e5e7eb; /* Используем цвет из палитры проекта */
}

.clear-filter {
    margin-left: 0.5rem;
    color: #3b82f6; /* Используем цвет из палитры проекта (как .search-submit) */
    text-decoration: none;
    transition: color 0.2s ease;
}

.clear-filter:hover {
    color: #2563eb; /* Используем цвет из палитры проекта (как .search-submit:hover) */
}

.clear-filter:hover {
    text-decoration: underline;
}

/* News Archive Layout */
.news-archive {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: start;
    margin-top: 1.5rem;
}

@media (min-width: 1280px) {
    .news-archive {
        grid-template-columns: 1fr;
    }
}

/* Articles List */
.articles-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Placeholder and separator for no-photo card — только на десктопе в карточках */
.article-item-image-placeholder,
.article-item-separator {
    display: none;
}

/* Article Item - Horizontal Card */
.article-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.article-item::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 100vw;
    border-bottom: 1px solid #e5e7eb;
}

.article-item:last-child {
    padding-bottom: 0;
}

.article-item:last-child::after {
    border-bottom: none;
}

/* Mobile-first: одна колонка, картинка сверху */
.article-item-link {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    align-items: start;
    text-decoration: none;
    color: inherit;
}

.article-item-image {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.article-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.article-item-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.article-meta {
    font-size: var(--font-size-xs);
    color: #7c7c7c;
    font-weight: 500;
}

.article-title {
    margin: 0;
    font-size: var(--font-size-md);
    font-weight: 600;
    line-height: 1.33;
    width: auto;
    max-width: 100%;
    flex-shrink: 0;
}

.article-item-link:hover .article-title {
    text-decoration: underline;
}

@media (min-width: 768px) {
    .article-item-link {
        grid-template-columns: 240px 1fr;
        gap: 1.5rem;
    }

    .article-item-image {
        width: 240px;
        height: 160px;
        aspect-ratio: auto;
    }

    .article-item-content {
        min-width: 480px;
    }

    .article-title {
        width: 480px;
    }
}

/* Full Width Article Item (no left image) */
.article-item-full .article-item-link {
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.article-item-full .article-item-image {
    display: none;
}

.article-item-full .article-item-content {
    min-width: 0;
}

.article-item-full .article-title {
    width: auto;
    max-width: 100%;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .article-item-full .article-item-content {
        min-width: 744px;
    }

    .article-item-full .article-title {
        width: 744px;
    }
}

/* Desktop: сетка карточек 4 в ряд, карточка 300x360 */
@media (min-width: 1280px) {
    .articles-list {
        display: grid;
        grid-template-columns: repeat(4, 300px);
        gap: 24px;
    }

    .article-item,
    .article-item::after,
    .article-item:last-child::after {
        padding-bottom: 0;
        border-bottom: none;
    }

    .article-item::after {
        content: none;
    }

    .article-item {
        height: 360px;
        background: #fff;
        border: 1px solid #d9d9d9;
        border-radius: 2px;
    }

    .article-item-link {
        display: flex;
        flex-direction: column;
        height: 100%;
        grid-template-columns: unset;
        gap: 0;
    }

    .article-item-image {
        width: 100%;
        height: 200px;
        flex-shrink: 0;
        aspect-ratio: auto;
        border-radius: 2px 2px 0 0;
        overflow: hidden;
    }

    .article-item-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .article-item-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        padding: 16px;
        min-width: 0;
    }

    .article-title {
        font-size: 18px;
        line-height: 24px;
        width: auto;
        max-width: 100%;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .article-meta {
        margin-top: auto;
        padding-top: 0;
    }

    /* Карточка без фото: плейсхолдер 200px, разделитель 1px, затем заголовок и дата */
    .article-item-full .article-item-image-placeholder,
    .article-item-full .article-item-separator {
        display: block;
    }

    .article-item-image-placeholder {
        width: 100%;
        height: 200px;
        flex-shrink: 0;
    }

    .article-item-separator {
        width: calc(100% - 32px);
        margin: 0 16px;
        border: none;
        height: 1px;
        background: #000;
        flex-shrink: 0;
    }

    .article-item-full .article-item-content {
        padding: 16px;
        min-width: 0;
    }

    .article-item-full .article-title {
        width: auto;
        max-width: 100%;
    }
}

@media (max-width: 767px) {
    .calendar-link-text {
        display: none;
    }
}

.page-header .breadcrumbs {
    margin: 0 0 0.5rem;
}

/* Pagination layout for news archive: controls on one line */
.news-archive + .pagination {
    flex-direction: row;
    gap: 1rem;
}

.news-archive + .pagination .pagination-info {
    order: 1; /* между кнопками */
}

.news-archive + .pagination .pagination-link {
    order: 0; /* кнопка "Назад" первой */
}

.news-archive + .pagination .pagination-link:last-of-type {
    order: 2; /* кнопка "Вперёд" последней */
}
