/* КультФонд: лента материалов категории и страница материала (новости, блог, практические материалы).
   Цвета — переменные --cf-m-* (variables.css, блок «Полезные материалы»). */

.cf-news-page { width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw); position: relative; background: var(--cf-paper); color: var(--cf-ink); font-family: var(--cf-font); font-size: 16px; line-height: 1.5; font-variant-numeric: lining-nums tabular-nums; }
html:has(.cf-news-page), body:has(.cf-news-page) { overflow-x: clip; }
.cf-content-section:has(.cf-news-page) { padding-block: 0; }

.cf-news-page :where(h1,h2,h3,p) { margin: 0; }
.cf-news-page a { color: inherit; text-decoration: none; }
.cf-news-page img { display: block; max-width: 100%; }
.cf-news-page :where(a,button):focus-visible { outline: 3px solid var(--cf-gold); outline-offset: 3px; }
.cf-news-page .cf-container.container-xxl { max-width: 1320px; padding-inline: 24px; } /* как у контейнера шаблона */
.cf-news-page .cf-kicker { display: block; margin-bottom: 15px; color: var(--cf-m-intro-kicker); font-size: 10px; font-weight: 600; letter-spacing: 2px; }

/* Первый экран */
.cf-n-intro { padding: 24px 0 35px; text-align: center; background: var(--cf-m-intro-background); color: var(--cf-white); border-bottom: 1px solid var(--cf-m-intro-line); }
.cf-n-intro .cf-breadcrumbs { gap: 10px; margin-bottom: 25px; color: var(--cf-m-crumbs); text-align: left; font-size: 12px; line-height: 1.5; }
.cf-n-intro .cf-breadcrumbs a { text-decoration: underline; text-underline-offset: 3px; }
.cf-n-intro h1 { max-width: 1050px; margin: 12px auto 0; color: inherit; font-size: clamp(32px, 4vw, 50px); font-weight: 600; line-height: 1.12; letter-spacing: -1.5px; }
.cf-n-intro-desc { max-width: 750px; margin: 16px auto 0; color: var(--cf-m-intro-copy); font-size: 16px; line-height: 1.6; }
.cf-n-intro-desc p { margin: 0; }
.cf-n-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 10px; color: var(--cf-m-story-meta); font-size: 12px; line-height: 1.4; }
.cf-n-meta--hero { justify-content: center; margin: 16px 0 0; color: var(--cf-m-intro-copy); font-size: 14px; }

/* Лента */
.cf-n-body { padding-top: 30px; padding-bottom: 50px; }
.cf-n-list.row { --bs-gutter-x: 24px; --bs-gutter-y: 24px; }
.cf-n-empty { padding: 40px 0; color: var(--cf-m-copy); text-align: center; }
.cf-n-card { display: flex; flex-direction: column; width: 100%; overflow: hidden; border: 1px solid var(--cf-m-card-line); border-radius: 18px; background: var(--cf-m-card-background); box-shadow: var(--cf-m-card-shadow); }
.cf-n-media { display: block; overflow: hidden; aspect-ratio: 16 / 10; background: var(--cf-m-column-background); }
.cf-n-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.cf-n-card:hover .cf-n-media img { transform: scale(1.04); }
.cf-n-text { display: flex; flex: 1 1 auto; flex-direction: column; align-items: flex-start; padding: 24px 26px 26px; }
.cf-n-card h2 { margin-bottom: 12px; color: var(--cf-m-heading); font-size: 21px; font-weight: 700; line-height: 1.3; letter-spacing: -.2px; }
.cf-n-card h2 a:hover { color: var(--cf-m-link-hover); }
.cf-n-intro-text { margin-bottom: 20px; color: var(--cf-m-copy); font-size: 14px; line-height: 1.65; }
.cf-news-page .cf-n-card .btn.cf-btn, .cf-news-page .cf-n-back.btn { display: inline-flex; align-items: center; justify-content: space-between; gap: 22px; min-height: 48px; margin-top: auto; padding: 11px 18px; border: 1px solid var(--cf-blue-button-line); border-radius: 10px; background: var(--cf-blue-gradient); color: var(--cf-white); box-shadow: var(--cf-blue-button-shadow); font-size: 14px; font-weight: 600; transition: transform .2s; }
.cf-news-page .cf-n-card .btn.cf-btn:hover, .cf-news-page .cf-n-back.btn:hover { transform: translateY(-3px); background: var(--cf-blue-button-hover); color: var(--cf-white); }

/* Крупная первая карточка */
.cf-n-card--lead { flex-direction: row; }
.cf-n-card--lead .cf-n-media { position: relative; flex: 0 0 48%; aspect-ratio: auto; min-height: 340px; }
.cf-n-card--lead .cf-n-media img { position: absolute; inset: 0; }
.cf-news-page .cf-n-card--lead .btn.cf-btn { margin-top: 8px; }
.cf-n-card--lead .cf-n-text { justify-content: center; padding: 34px 38px; background: var(--cf-m-column-background); }
.cf-n-card--lead h2 { font-size: clamp(26px, 2.6vw, 34px); letter-spacing: -.6px; }
.cf-n-card--lead .cf-n-intro-text { font-size: 15px; }
.cf-n-card--lead.cf-n-card--noimg .cf-n-text { flex: 1 1 100%; }

/* Пагинация */
.cf-n-pagination { margin-top: 36px; display: flex; justify-content: center; }
.cf-n-pagination ul { margin: 0; }

/* Страница материала */
.cf-n-article { max-width: 860px; margin: 0 auto; }
.cf-n-figure { margin: 0 0 30px; overflow: hidden; border: 1px solid var(--cf-m-card-line); border-radius: 18px; box-shadow: var(--cf-m-card-shadow); }
.cf-n-figure img { width: 100%; height: auto; max-height: 540px; object-fit: cover; }
.cf-n-content { color: var(--cf-m-copy); font-size: 17px; line-height: 1.75; }
.cf-n-content > :first-child { margin-top: 0; }
.cf-n-content p { margin: 0 0 1.1em; }
.cf-n-content h2, .cf-n-content h3, .cf-n-content h4 { margin: 1.6em 0 .6em; color: var(--cf-m-heading); font-weight: 700; line-height: 1.25; letter-spacing: -.3px; }
.cf-n-content h2 { font-size: 28px; }
.cf-n-content h3 { font-size: 22px; }
.cf-n-content h4 { font-size: 18px; }
.cf-news-page .cf-n-content a { color: var(--cf-blue); text-decoration: underline; text-underline-offset: 3px; }
.cf-news-page .cf-n-content a:hover { color: var(--cf-m-link-hover); }
.cf-n-content ul, .cf-n-content ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.cf-n-content li { margin-bottom: .4em; }
.cf-n-content img { max-width: 100%; height: auto; border-radius: 12px; }
.cf-n-content blockquote { margin: 1.5em 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--cf-m-intro-line); color: var(--cf-m-heading); font-size: 19px; font-style: italic; }
.cf-n-content table { display: block; max-width: 100%; margin: 0 0 1.2em; overflow-x: auto; border-collapse: collapse; }
.cf-n-content th, .cf-n-content td { padding: 9px 12px; border: 1px solid var(--cf-m-story-line); }
.cf-n-back { margin-top: 40px; gap: 12px; }

/* Ссылка-возврат в конце текста материала («Вернуться в раздел …») оформляется кнопкой */
.cf-news-page .cf-n-content > p:last-child > a:only-child { display: inline-flex; align-items: center; gap: 12px; min-height: 48px; margin-top: 18px; padding: 11px 20px; border: 1px solid var(--cf-blue-button-line); border-radius: 10px; background: var(--cf-blue-gradient); color: var(--cf-white); box-shadow: var(--cf-blue-button-shadow); font-size: 14px; font-weight: 600; line-height: 1.35; text-decoration: none; transition: transform .2s; }
.cf-news-page .cf-n-content > p:last-child > a:only-child::before { content: "\2190"; font-size: 18px; line-height: 1; }
.cf-news-page .cf-n-content > p:last-child > a:only-child:hover { transform: translateY(-3px); background: var(--cf-blue-button-hover); color: var(--cf-white); text-decoration: none; }
/* если ссылка-возврат уже есть в тексте — встроенную кнопку не дублируем */
.cf-n-article:has(.cf-n-content > p:last-child > a:only-child) .cf-n-back { display: none; }

@media (max-width: 991.98px) {
  .cf-news-page .cf-container.container-xxl { padding-inline: 24px; }
  .cf-n-card--lead { flex-direction: column; }
  .cf-n-card--lead .cf-n-media { flex: none; aspect-ratio: 16 / 10; min-height: 0; }
  .cf-n-card--lead .cf-n-media img { position: static; }
  .cf-n-card--lead .cf-n-text { padding: 24px 26px 26px; }
}
@media (max-width: 575.98px) {
  .cf-news-page .cf-container.container-xxl { padding-inline: 20px; }
  .cf-n-intro { padding-bottom: 26px; }
  .cf-n-body { padding-top: 22px; padding-bottom: 36px; }
  .cf-n-text { padding: 20px; }
  .cf-n-content { font-size: 16px; }
  .cf-n-content h2 { font-size: 24px; }
  .cf-news-page .cf-n-back.btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .cf-n-media img, .cf-news-page .btn { transition: none; }
}

/* Буквица и метки (макет feature) */
.cf-n-content--dropcap > p:first-of-type::first-letter { float: left; margin: 6px 12px 0 0; color: var(--cf-m-heading); font-size: 4.2em; font-weight: 700; line-height: .85; }
.cf-n-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 0; padding: 0; list-style: none; }
.cf-news-page .cf-n-tags a { display: inline-block; padding: 6px 14px; border: 1px solid var(--cf-m-card-line); border-radius: 999px; background: var(--cf-m-card-background); color: var(--cf-m-heading); font-size: 13px; }
.cf-news-page .cf-n-tags a:hover { color: var(--cf-m-link-hover); }

/* Страница с правой (левой) колонкой модулей: без растяжки на всё окно, шапка — карточкой */
.cf-content-section:has(.cf-sidebar):has(.cf-news-page) { padding-block: 32px 56px; }
.cf-content-section .row:has(> .cf-sidebar) .cf-news-page { width: auto; max-width: none; margin-left: 0; background: none; }
.cf-content-section .row:has(> .cf-sidebar) .cf-news-page .cf-container.container-xxl { max-width: none; padding-inline: 0; }
.cf-content-section .row:has(> .cf-sidebar) .cf-n-intro { padding: 22px 28px 30px; border: 1px solid var(--cf-m-intro-line); border-radius: 18px; }
.cf-content-section .row:has(> .cf-sidebar) .cf-n-intro h1 { font-size: clamp(28px, 3vw, 40px); }
.cf-content-section .row:has(> .cf-sidebar) .cf-n-body { padding-bottom: 0; }
@media (min-width: 1200px) {
  .cf-content-section .row:has(> .cf-sidebar) .cf-n-list > .col-xl-4 { flex: 0 0 50%; width: 50%; }
}
@media (min-width: 992px) and (max-width: 1199.98px) {
  .cf-content-section .row:has(> .cf-sidebar) .cf-n-card--lead { flex-direction: column; }
  .cf-content-section .row:has(> .cf-sidebar) .cf-n-card--lead .cf-n-media { flex: none; aspect-ratio: 16 / 10; min-height: 0; }
  .cf-content-section .row:has(> .cf-sidebar) .cf-n-card--lead .cf-n-media img { position: static; }
}
