/* news.css */
:root {
    --news-card-radius: 12px;
    --news-card-shadow: 0 2px 8px rgba(0, 0, 0, .08);
    --news-card-gap: 1.5rem;
}

/* Карточка */
.news-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: var(--news-card-radius);
    box-shadow: var(--news-card-shadow);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform .15s ease, box-shadow .15s ease;
}
.news-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0,0,0,.12);
}
.news-card__cover {
    aspect-ratio: 16 / 9;
    background: #eef;
    overflow: hidden;
}
.news-card__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-card__cover-placeholder { width: 100%; height: 100%; background: linear-gradient(135deg, #e5e7eb, #cbd5e1); }
.news-card__body { padding: 1rem 1.25rem 1.25rem; display: flex; flex-direction: column; gap: .5rem; }
.news-card__title { margin: 0; font-size: 1.1rem; font-weight: 600; line-height: 1.3; }
.news-card__date { font-size: .85rem; color: #6b7280; }
.news-card__excerpt { margin: 0; color: #374151; line-height: 1.4; }
.news-card__footer {
    padding: 0 1.25rem 1.25rem;
    display: flex;
    justify-content: flex-end;
    margin-top: auto;
}
.news-card__more {
    font-weight: 600;
    color: var(--color-primary);
    font-size: .9rem;
}
.news-card:hover .news-card__more {
    text-decoration: underline;
}

/* Список блока */
.news-list { margin: 2rem 0; }
.news-list__title { margin: 0 0 1.5rem; font-size: 2rem; }
.news-list__items { display: grid; gap: var(--news-card-gap); }
.news-list--grid .news-list__items { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.news-list--row .news-list__items { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
@media (max-width: 640px) {
    .news-list--row .news-list__items,
    .news-list--grid .news-list__items { grid-template-columns: 1fr; }
}
.news-list__footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.5rem;
}
.news-list__all-link {
    display: inline-block;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
}
.news-list__all-link:hover { text-decoration: underline; }

/* Индекс */
.news-index { max-width: 1200px; margin: 0 auto; padding: calc(80px + 2rem) 1rem 2rem; }
.news-index__head h1 { margin: 0 0 2rem; font-size: 2.5rem; }
.news-index__items { display: grid; gap: var(--news-card-gap); }
.news-index__items--grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.news-index__items--row  { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
@media (max-width: 640px) { .news-index__items { grid-template-columns: 1fr; } }
.news-index__empty { color: #6b7280; }

/* Пагинация */
.news-pagination { display: flex; gap: .5rem; margin: 2rem 0; flex-wrap: wrap; justify-content: center; }
.news-pagination__item,
.news-pagination__ellipsis {
    padding: .5rem .85rem;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
}
.news-pagination__item { background: #f3f4f6; }
.news-pagination__item:hover { background: #e5e7eb; }
.news-pagination__item--current { background: var(--color-primary); color: #fff; }

/* Статья */
.news-article-wrap { max-width: 900px; margin: 0 auto; padding: calc(80px + 2rem) 1rem 2rem; }
.news-article {
    background: var(--color-white, #fff);
    border: 1px solid var(--color-gray-light, rgba(0, 0, 0, .06));
    border-radius: var(--radius-lg, 20px);
    box-shadow: var(--shadow-card, 0 2px 12px rgba(61, 90, 153, .1));
    padding: 2rem 2.5rem;
    line-height: 1.6;
}
@media (max-width: 640px) {
    .news-article { padding: 1.5rem 1.25rem; }
}
.news-article__title { font-size: 2.25rem; margin: 0 0 1rem; }
.news-article__cover { margin: 1.5rem 0; }
.news-article__cover img { width: 100%; height: auto; border-radius: var(--news-card-radius); display: block; }
.news-article__body h2 { margin: 2rem 0 .75rem; }
.news-article__body h3 { margin: 1.5rem 0 .5rem; }
.news-article__body p { margin: 0 0 1rem; }
.news-article__body ul { list-style: disc; padding-left: 1.5rem; margin: 0 0 1rem; }
.news-article__body ol { list-style: decimal; padding-left: 1.5rem; margin: 0 0 1rem; }
.news-article__body li { margin: .25rem 0; }
.news-article__body blockquote { border-left: 3px solid #d1d5db; padding: .5rem 1rem; margin: 0 0 1rem; color: #4b5563; background: #f9fafb; border-radius: 4px; }
.news-article__body img { max-width: 100%; height: auto; border-radius: var(--news-card-radius); }
.news-article__footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, .06);
}
.news-article__date { font-size: .85rem; color: #6b7280; }

/* Модалка */
.news-modal[hidden] { display: none; }
.news-modal {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: flex-start; justify-content: center;
    padding: 4vh 1rem;
    background: rgba(0,0,0,.6);
    overflow-y: auto;
}
.news-modal__dialog {
    background: #fff; border-radius: var(--news-card-radius);
    max-width: 800px; width: 100%; padding: 2rem; position: relative;
}
.news-modal__close {
    position: absolute; top: .75rem; right: .75rem;
    background: none; border: 0; font-size: 1.5rem; cursor: pointer; color: #6b7280;
}
.news-modal__close:hover { color: #111; }
.news-modal__open-page {
    display: inline-block; margin-top: 1.5rem;
    color: var(--color-primary); text-decoration: none; font-weight: 600;
}
body.news-modal-open { overflow: hidden; }

.news-card--highlighted {
    border: 3px solid var(--highlight-color, #f59e0b);
    box-shadow: 0 0 0 1px var(--highlight-color, #f59e0b),
                0 4px 12px color-mix(in srgb, var(--highlight-color, #f59e0b) 25%, transparent);
}
