/* =============================================
   KADENCE — Новости Спорта Ярославля
   ============================================= */

:root {
  --c-primary:    #059669;
  --c-secondary:  #047857;
  --c-accent:     #0891b2;
  --c-bg:         #ecfdf5;
  --c-text:       #064e3b;
  --c-header-bg:  #047857;
  --c-footer-bg:  #064e3b;
  --c-link:       #059669;
  --c-link-hover: #047857;
  --c-card-bg:    #ffffff;
  --c-border:     #a7f3d0;
  --c-muted:      #6b7280;
  --c-light:      #f0fdf4;
  --font:         'Nunito', sans-serif;
  --radius:       8px;
  --shadow:       0 2px 10px rgba(5,150,105,.10);
  --shadow-h:     0 6px 20px rgba(5,150,105,.18);
  --max-w:        1200px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.65;
  background: var(--c-bg);
  color: var(--c-text);
}

img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

a {
  color: var(--c-link);
  text-decoration: none;
  transition: color .2s;
}
a:hover { color: var(--c-link-hover); }

/* ── Layout ────────────────────────────────── */

.kadence-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

.page-wrap { padding-bottom: 40px; }

.content-grid {
  display: grid;
  grid-template-columns: 20% 1fr 20%;
  gap: 28px;
  padding-top: 26px;
  align-items: start;
}

/* ── Header — HERO BANNER ─────────────────── */

.site-header { position: sticky; top: 0; z-index: 200; }

.site-hero {
  background: linear-gradient(135deg, var(--c-header-bg) 0%, #065f46 100%);
  min-height: 160px;
  display: flex;
  align-items: center;
  padding: 24px 0;
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
}

.logo-img { flex-shrink: 0; }

.hero-text { flex: 1; }

.site-name {
  display: block;
  font-family: var(--font);
  font-weight: 800;
  font-size: 46px;
  color: #fff;
  line-height: 1.15;
  letter-spacing: -.5px;
}
.site-name:hover { color: #d1fae5; }

.site-tagline {
  font-size: 18px;
  color: #a7f3d0;
  margin-top: 6px;
}

.main-nav {
  background: #065f46;
  border-top: 1px solid rgba(167,243,208,.25);
}
.main-nav .kadence-wrap { display: flex; align-items: center; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  color: #d1fae5;
  font-size: 22px;
  margin-left: auto;
}

.nav-list {
  display: flex;
  list-style: none;
}
.nav-list li a {
  display: block;
  padding: 11px 16px;
  color: #d1fae5;
  font-family: var(--font);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .6px;
  transition: background .2s, color .2s;
}
.nav-list li a:hover,
.nav-list li a.active {
  background: var(--c-primary);
  color: #fff;
}

/* ── Footer — CENTERED NAV ────────────────── */

.site-footer {
  background: var(--c-footer-bg);
  color: #a7f3d0;
  padding: 36px 0 28px;
  text-align: center;
  margin-top: 48px;
}
.footer-name {
  display: block;
  font-weight: 800;
  font-size: 17px;
  color: #fff;
  margin-bottom: 14px;
}
.footer-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin-bottom: 18px;
}
.footer-nav a {
  color: #a7f3d0;
  font-size: 13px;
  font-weight: 700;
  transition: color .2s;
}
.footer-nav a:hover { color: #fff; }
.footer-copy {
  font-size: 12px;
  color: #6ee7b7;
}

/* ── Breadcrumb ───────────────────────────── */

.breadcrumb-nav {
  padding: 14px 0 4px;
  font-size: 13px;
  color: var(--c-muted);
}
.breadcrumb-nav a { color: var(--c-primary); }
.breadcrumb-nav a:hover { text-decoration: underline; }
.breadcrumb-nav .bc-sep { margin: 0 6px; color: #9ca3af; }
.breadcrumb-nav .bc-current { color: var(--c-muted); }

/* ── Sidebars ─────────────────────────────── */

.kadence-sidebar-left,
.kadence-sidebar-right {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.kadence-widget {
  background: var(--c-card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  padding: 18px;
  box-shadow: var(--shadow);
}
.kadence-widget h3 {
  font-family: var(--font);
  font-weight: 800;
  font-size: 13px;
  color: var(--c-text);
  text-transform: uppercase;
  letter-spacing: .7px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--c-primary);
}

.sidebar-nav-list li a {
  display: block;
  padding: 7px 4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--c-text);
  border-bottom: 1px solid var(--c-border);
  transition: color .2s, padding-left .2s;
}
.sidebar-nav-list li:last-child a { border-bottom: none; }
.sidebar-nav-list li a:hover { color: var(--c-primary); padding-left: 8px; }

.categories-list li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--c-text);
  border-bottom: 1px solid var(--c-border);
  transition: color .2s, padding-left .2s;
}
.categories-list li:last-child a { border-bottom: none; }
.categories-list li a:hover { color: var(--c-primary); padding-left: 8px; }
.categories-list .cat-count {
  background: var(--c-light);
  color: var(--c-primary);
  font-size: 11px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 12px;
}

.recent-posts-list { display: flex; flex-direction: column; gap: 10px; }
.recent-post-item a {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--c-text);
  line-height: 1.4;
  transition: color .2s;
}
.recent-post-item a:hover { color: var(--c-primary); }
.rp-date { display: block; font-size: 11px; color: var(--c-muted); margin-top: 2px; }

/* ── Cards (homepage + categories) ──────────── */

.section-title {
  font-family: var(--font);
  font-weight: 800;
  font-size: 20px;
  color: var(--c-text);
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--c-primary);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.cards-grid-2col { grid-template-columns: repeat(2, 1fr); }

.article-card {
  background: var(--c-card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow .2s, transform .2s;
}
.article-card:hover {
  box-shadow: var(--shadow-h);
  transform: translateY(-3px);
}
.card-img-wrap { overflow: hidden; height: 155px; }
.card-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.article-card:hover .card-img-wrap img { transform: scale(1.06); }

.card-body { padding: 13px; }
.card-cat {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--c-accent);
  margin-bottom: 5px;
}
.card-body h2,
.card-body h3 {
  font-family: var(--font);
  font-weight: 800;
  font-size: 14px;
  line-height: 1.35;
  margin-bottom: 7px;
}
.card-body h2 a,
.card-body h3 a {
  color: var(--c-text);
  transition: color .2s;
}
.card-body h2 a:hover,
.card-body h3 a:hover { color: var(--c-primary); }
.card-excerpt {
  font-size: 12px;
  line-height: 1.5;
  color: #4b5563;
  margin-bottom: 9px;
}
.card-meta { font-size: 11px; color: var(--c-muted); }

/* ── Category header ─────────────────────── */

.category-header {
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  color: #fff;
  border-radius: var(--radius);
  padding: 26px 28px;
  margin-bottom: 22px;
}
.category-header h1 {
  font-family: var(--font);
  font-weight: 800;
  font-size: 28px;
  margin-bottom: 6px;
}
.category-header p { font-size: 15px; opacity: .9; }

/* ── Article page ─────────────────────────── */

.article-container {
  background: var(--c-card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  padding: 28px 30px;
  box-shadow: var(--shadow);
}
.article-title {
  font-family: var(--font);
  font-weight: 800;
  font-size: 30px;
  line-height: 1.25;
  color: var(--c-text);
  margin-bottom: 10px;
}
.article-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--c-muted);
}
.meta-date { font-weight: 700; color: var(--c-primary); }
.meta-cat {
  background: var(--c-accent);
  color: #fff;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.article-featured-img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 24px;
}

/* ── Article body content ─────────────────── */

.article-body {
  font-size: 16px;
  line-height: 1.78;
  color: var(--c-text);
}
.article-body h2 {
  font-family: var(--font);
  font-weight: 800;
  font-size: 22px;
  color: var(--c-text);
  margin: 28px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--c-border);
}
.article-body h3 {
  font-family: var(--font);
  font-weight: 700;
  font-size: 18px;
  color: var(--c-secondary);
  margin: 22px 0 10px;
}
.article-body p { margin-bottom: 16px; }
.article-body ul,
.article-body ol {
  margin: 12px 0 18px 24px;
}
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li { margin-bottom: 6px; padding-left: 4px; }
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.article-body thead { background: var(--c-primary); color: #fff; }
.article-body th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.article-body td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--c-border);
}
.article-body tbody tr:nth-child(even) { background: var(--c-light); }
.article-body tbody tr:hover { background: #d1fae5; }
.article-body blockquote {
  border-left: 4px solid var(--c-primary);
  background: var(--c-light);
  padding: 14px 20px;
  margin: 20px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--c-secondary);
  font-size: 15px;
}
.article-body .infobox {
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  border-left: 4px solid var(--c-accent);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 20px 0;
  font-size: 14px;
}
.article-body .infobox::before {
  content: 'На заметку';
  display: block;
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: 5px;
  letter-spacing: .5px;
}
.article-body .stat-block {
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  color: #fff;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 20px 0;
  text-align: center;
}
.article-body .stat-block .stat-number {
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
  display: block;
  margin-bottom: 6px;
}
.article-body .stat-block .stat-label {
  font-size: 14px;
  opacity: .9;
}
.article-body a { color: var(--c-link); text-decoration: underline; text-underline-offset: 3px; }
.article-body a:hover { color: var(--c-link-hover); }
.article-body img { border-radius: var(--radius); margin: 20px auto; }

/* ── Article tags section ─────────────────── */

.article-tags-section {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.tags-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--c-muted);
}

/* ── Related posts ────────────────────────── */

.related-posts {
  margin-top: 34px;
  padding-top: 22px;
  border-top: 2px solid var(--c-border);
}
.related-posts-title {
  font-family: var(--font);
  font-weight: 800;
  font-size: 17px;
  color: var(--c-text);
  margin-bottom: 16px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.related-card {
  background: var(--c-bg);
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  overflow: hidden;
  transition: box-shadow .2s;
}
.related-card:hover { box-shadow: var(--shadow); }
.related-card img { width: 100%; height: 95px; object-fit: cover; }
.related-body { padding: 10px; }
.related-body a {
  font-size: 13px;
  font-weight: 700;
  color: var(--c-text);
  display: block;
  line-height: 1.35;
  transition: color .2s;
}
.related-body a:hover { color: var(--c-primary); }
.related-date { font-size: 11px; color: var(--c-muted); display: block; margin-top: 3px; }

/* ── Tag pills ────────────────────────────── */

a.tag-pill {
  display: inline-block;
  background: #d1fae5;
  color: var(--c-secondary);
  padding: 3px 11px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--c-border);
  transition: background .2s, color .2s, border-color .2s;
}
a.tag-pill:hover {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
}

/* ── Tag page ─────────────────────────────── */

.tag-page-header {
  background: linear-gradient(135deg, var(--c-secondary), var(--c-accent));
  color: #fff;
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 22px;
}
.tag-page-header h1 {
  font-family: var(--font);
  font-weight: 800;
  font-size: 26px;
}

/* ── Responsive ───────────────────────────── */

@media (max-width: 1024px) {
  .content-grid { grid-template-columns: 22% 1fr 22%; gap: 20px; }
  .site-name { font-size: 36px; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .content-grid { grid-template-columns: 1fr; }
  .kadence-sidebar-left { order: 3; }
  .main-content-area { order: 1; }
  .kadence-sidebar-right { order: 2; }
  .cards-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .site-name { font-size: 26px; }
  .site-tagline { font-size: 14px; }
  .nav-toggle { display: block; }
  .nav-list { display: none; flex-direction: column; width: 100%; }
  .nav-list.is-open { display: flex; }
  .nav-list li a { padding: 10px 16px; font-size: 14px; }
  .article-title { font-size: 22px; }
  .article-featured-img { height: 200px; }
  .article-container { padding: 18px 16px; }
  .category-header { padding: 18px 20px; }
  .category-header h1 { font-size: 22px; }
}
