/*
Theme Name: Пронедра
Description: Тема восстановленного pronedra.ru (дизайн — design/DESIGN.md).
Version: 1.0
Requires PHP: 8.1
Text Domain: pronedra
*/

:root {
  --text: #19191c;
  --black: #000;
  --accent: #f5183f;
  --muted: #8a8a8e;
  --line: #e6e5e2;
  --surface-dark: #19191c;
  --surface-gray: #f5f4f2;
  --surface-lavender: #e3e5fc;
  --footer: #242429;
  --w: 1024px;
  --font: 'Source Sans 3', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Helvetica Neue', Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--text); background: #fff; font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: var(--w); margin: 0 auto; padding: 0 20px; }

/* Шапка — чёрная капсула */
.header-wrap { position: sticky; top: 0; z-index: 50; padding: 10px 0; background: linear-gradient(#fff 70%, rgba(255,255,255,0)); }
.header { display: flex; align-items: center; gap: 24px; background: var(--black); color: #fff; border-radius: 24px;
  padding: 10px 30px 10px 30px; min-height: 64px; box-shadow: 0 0 28px rgba(0,0,0,.16); }
.header .logo { flex: none; display: block; width: 164px; height: 32px; }
.header nav { flex: 1; min-width: 0; display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; cursor: grab; }
.header nav::-webkit-scrollbar { display: none; }
/* прижато вправо, пока всё влезает; не влезает — начинается с первого пункта (justify-content: flex-end прятал начало) */
.header nav > :first-child { margin-left: auto; }
.header nav.dragging { cursor: grabbing; user-select: none; }
.header nav.dragging a { pointer-events: none; }
.header nav a { font-weight: 600; white-space: nowrap; }
.header nav a:hover { color: #ccc; }
.header .search-btn { flex: none; width: 24px; height: 24px; display: grid; place-items: center; }
.burger { display: none; background: none; border: 0; color: #fff; font-size: 24px; }

/* Плавающая кнопка ленты */
.feed-btn { position: fixed; left: 0; top: 160px; z-index: 40; width: 44px; height: 70px; background: var(--surface-gray);
  border-radius: 0 16px 16px 0; display: grid; place-items: center; }
.feed-btn i { position: absolute; top: 22px; right: 12px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

main { padding: 30px 0 60px; }

/* Главная: hero + эксперт */
.top-row { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 20px; }
.hero { position: relative; background: var(--surface-dark); color: #fff; border-radius: 16px; min-height: 360px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px; }
.hero .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .35; }
.hero > *:not(.bg) { position: relative; }
.hero .cat { font-weight: 600; margin-bottom: 8px; }
.hero h2 { font-size: 28px; line-height: 1.2; margin: 0 0 12px; }
.hero time { color: #aaa; }
.expert { background: var(--surface-lavender); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; min-height: 360px; }
.expert .label { font-weight: 600; margin-bottom: 10px; }
.expert h3 { font-size: 21px; line-height: 1.25; margin: 0; flex: 1; }
.expert .who { display: flex; align-items: center; gap: 14px; margin: 18px 0 12px; font-weight: 700; font-size: 17px; }
.expert .who img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.expert time { color: var(--muted); }

/* Карточки сетки */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: var(--surface-gray); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; padding-bottom: 20px; }
.card .img { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; border-radius: 16px; background: #e8e7e4; }
.card .body { padding: 18px 20px 0; display: flex; flex-direction: column; flex: 1; }
.card .cat { font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.card h3 { font-size: 20px; line-height: 1.25; margin: 0 0 10px; flex: 1; }
.card time { color: var(--muted); font-size: 15px; }
.card:hover h3 { color: #444; }

/* Блоки рубрик */
.sections { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px 40px; margin-top: 60px; }
.section h2 { font-size: 22px; margin: 0 0 18px; padding-bottom: 12px; border-bottom: 3px solid var(--text); }
.row { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.row:first-of-type { padding-top: 0; }
.row .t { flex: 1; }
.row h4 { font-size: 17px; line-height: 1.3; margin: 0 0 8px; font-weight: 600; }
.row time { color: var(--muted); font-size: 15px; }
.row img { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; flex: none; }
.more { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; font-size: 18px; font-weight: 600; }

/* Статья */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; }
.crumbs { color: var(--accent); font-weight: 600; margin-bottom: 14px; }
.crumbs a:hover { text-decoration: underline; }
.article h1 { font-size: 36px; line-height: 1.2; color: var(--black); margin: 0 0 22px; font-family: var(--font-body); font-weight: 700; }
.meta { color: var(--muted); margin-bottom: 22px; font-family: var(--font-body); }
.meta .author { color: var(--text); }
.meta .dot { margin: 0 8px; }
.cover img { width: 100%; height: auto; }
.cover figcaption { font-size: 14px; margin-top: 10px; font-family: var(--font-body); }
.lead { font-size: 20px; line-height: 1.5; font-weight: 600; margin: 24px 0; font-family: var(--font-body); }
.content { font-family: var(--font-body); font-size: 18px; line-height: 1.65; margin-top: 24px; }
.content p { margin: 0 0 1.1em; }
.content h2 { font-size: 28px; line-height: 1.2; margin: 1.6em 0 .6em; }
.content h3, .content h4 { font-size: 22px; margin: 1.4em 0 .6em; }
.content a { text-decoration: underline; color: #444; }
.content img { margin: 1em 0; border-radius: 8px; height: auto; }
.content blockquote { margin: 1.4em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.tags a { background: var(--surface-gray); border-radius: 20px; padding: 6px 14px; font-size: 15px; }
.aside .box { background: var(--surface-gray); border-radius: 20px; min-height: 420px; padding: 20px; }
.aside .caption { color: #555; margin-top: 14px; }
.side-latest { margin-top: 30px; }
.ad-side2 { margin-top: 30px; }
.side-latest h3 { font-size: 20px; margin: 0 0 14px; padding-bottom: 10px; border-bottom: 2px solid var(--accent); }
.side-latest .row h4 { font-size: 15px; }
.side-latest .row img { width: 64px; height: 64px; }
.related { margin-top: 50px; }
.related h2 { font-size: 24px; margin: 0 0 18px; }

/* Списки рубрик/поиска */
.page-title { font-size: 34px; margin: 0 0 24px; }
.pager { display: flex; gap: 10px; justify-content: center; margin-top: 40px; }
.pager a, .pager span { padding: 8px 16px; border-radius: 12px; background: var(--surface-gray); }
.pager span { background: var(--text); color: #fff; }
.search-form { display: flex; gap: 10px; margin-bottom: 30px; }
.search-form input { flex: 1; font: inherit; font-size: 18px; padding: 12px 16px; border: 2px solid var(--line); border-radius: 14px; }
.search-form button { font: inherit; font-weight: 600; padding: 0 22px; border: 0; border-radius: 14px; background: var(--text); color: #fff; cursor: pointer; }

/* Подвал */
.footer { background: var(--footer); color: #fff; border-radius: 40px; padding: 45px 40px 40px; margin: 40px auto 20px; max-width: calc(var(--w) - 40px); }
.footer .links { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px 48px; font-size: 20px; font-weight: 700; }
.footer .tree { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px; margin: 36px 0 0; font-size: 15px; }
.footer .tree b { display: block; margin-bottom: 6px; }
.footer .tree a { color: #aaa; display: block; line-height: 1.7; }
.footer .tree a:hover, .footer .links a:hover { color: #fff; opacity: .8; }
.footer .socials { display: flex; justify-content: center; gap: 16px; margin: 36px 0; }
.footer .socials a { width: 44px; height: 44px; border-radius: 12px; background: #111; display: grid; place-items: center; font-weight: 700; }
.footer .disclaimer { color: #8a8a8e; text-align: center; font-size: 15px; line-height: 1.5; }
.footer .copy { color: #8a8a8e; text-align: center; margin-top: 24px; }

@media (max-width: 900px) {
  .top-row, .article-layout { grid-template-columns: 1fr; }
  .grid, .sections { grid-template-columns: 1fr 1fr; }
  .aside { display: none; }
  .header nav > :first-child { margin-left: 0; }
}
@media (max-width: 600px) {
  .grid, .sections { grid-template-columns: 1fr; }
  .article h1 { font-size: 28px; }
  .hero h2 { font-size: 22px; }
  .feed-btn { display: none; }
  .header { padding: 10px 18px; border-radius: 18px; flex-wrap: wrap; row-gap: 8px; }
  .header nav { order: 3; flex-basis: 100%; gap: 18px; padding-bottom: 2px; }
  .header .search-btn { margin-left: auto; }
  .footer { margin: 30px 12px 12px; }
  .footer { border-radius: 24px; padding: 30px 20px; }
}

/* WordPress */
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }
.pager .page-numbers.current { background: var(--text); color: #fff; }
.pager .dots { background: none; }
.content figure { margin: 1em 0; }
.content figcaption, .wp-caption-text { font-size: 14px; color: #555; }
.content iframe, .content video { max-width: 100%; }
.content table { border-collapse: collapse; width: 100%; font-size: 16px; }
.content td, .content th { border: 1px solid var(--line); padding: 6px 10px; }
.alignleft { float: left; margin: 0 20px 10px 0; }
.alignright { float: right; margin: 0 0 10px 20px; }
.aligncenter { margin-left: auto; margin-right: auto; }
.page-desc { color: #555; margin: -12px 0 24px; max-width: 700px; }
.subcats { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 26px; }
.subcats a { background: var(--surface-gray); border-radius: 20px; padding: 6px 14px; font-size: 15px; font-weight: 600; }
.notfound { text-align: center; padding: 60px 0; }
.notfound .code { font-size: 96px; font-weight: 700; line-height: 1; color: var(--accent); }
.smi2-widget-under { margin-top: 40px; }
.footer .counters { display: flex; justify-content: center; gap: 10px; margin-top: 24px; }
/* Персоны */
.person-head { display: flex; align-items: center; gap: 24px; margin-bottom: 24px; }
.person-head h1 { margin: 0; }
.person-photo { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; flex: none; }
.person-initials { display: grid; place-items: center; background: var(--surface-lavender); font-size: 40px; font-weight: 700; }
/* Реклама (template-parts/ads.php) */
.ad-side > * + * { margin-top: 20px; }
.ad-related { margin-top: 40px; }
.persons-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 24px 20px; margin: 10px 0 30px; }
.person-card { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; font-weight: 600; }
.person-card:hover span { color: var(--accent); }
.persons-in-article { margin-top: 30px; }
.person-bio { margin-bottom: 40px; }
.subcats a.active { background: var(--text); color: #fff; }
.related-title { font-size: 24px; margin: 30px 0 18px; }
.expert .who .person-photo { width: 64px; height: 64px; }
