/* ============================================
   Kadence Theme - Инструменты для учета ставок
   Rose Editorial Palette + Modern Tech Typography
   ============================================ */

/* CSS Variables */
:root {
  --primary: #c2185b;
  --secondary: #7b1f3a;
  --accent: #7c3aed;
  --bg-page: #fdf2f4;
  --text-body: #2d1f1f;
  --header-bg: #7b1f3a;
  --header-text: #ffffff;
  --footer-bg: #2d1f1f;
  --footer-text: #e8e0e0;
  --link: #c2185b;
  --link-hover: #7b1f3a;
  --card-bg: #ffffff;
  --border: #f3d9e0;
  --shadow: rgba(45, 31, 31, 0.08);
  --radius: 10px;
  --gap: 1.5rem;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-body);
  background-color: var(--bg-page);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--link-hover);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-body);
}

h1 { font-size: 2rem; margin-bottom: 1rem; }
h2 { font-size: 1.6rem; margin-bottom: 0.8rem; margin-top: 1.6rem; }
h3 { font-size: 1.3rem; margin-bottom: 0.6rem; margin-top: 1.4rem; }
h4 { font-size: 1.1rem; margin-bottom: 0.5rem; margin-top: 1.2rem; }

p {
  margin-bottom: 1rem;
}

/* ============================================
   Layout Wrapper
   ============================================ */
.kadence-wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
  flex-grow: 1;
}

.kadence-layout {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
}

.kadence-content {
  flex: 1 1 74%;
  max-width: 74%;
  min-width: 0;
}

.kadence-sidebar {
  flex: 1 1 22%;
  max-width: 22%;
  min-width: 0;
}

@media (max-width: 768px) {
  .kadence-content,
  .kadence-sidebar {
    flex: 1 1 100%;
    max-width: 100%;
  }
  .kadence-layout {
    flex-direction: column;
  }
}

/* ============================================
   Header
   ============================================ */
.site-header {
  background-color: var(--header-bg);
  color: var(--header-text);
}

.header-brand {
  text-align: center;
  padding: 1.25rem 1rem;
}

.header-brand a {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 2rem;
  color: var(--header-text);
  letter-spacing: -0.02em;
}

.header-brand a:hover {
  color: #ffccd5;
}

.header-divider {
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.main-nav {
  background-color: rgba(0,0,0,0.12);
}

.main-nav ul {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  list-style: none;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.main-nav li {
  margin: 0;
}

.main-nav a {
  display: block;
  padding: 0.85rem 1.15rem;
  color: var(--header-text);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: relative;
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: 0.5rem;
  left: 1.15rem;
  right: 1.15rem;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.main-nav a:hover::after {
  transform: scaleX(1);
}

.main-nav a:hover {
  color: #ffccd5;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  background-color: var(--footer-bg);
  color: var(--footer-text);
  text-align: center;
  padding: 14px 1rem;
  font-size: 0.85rem;
  margin-top: auto;
}

/* ============================================
   Breadcrumbs
   ============================================ */
.breadcrumb-nav {
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
}

.breadcrumb-nav ul {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  gap: 0.35rem;
  align-items: center;
}

.breadcrumb-nav li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.breadcrumb-nav a {
  color: var(--link);
}

.breadcrumb-nav a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.breadcrumb-nav li:last-child {
  color: #6b4c4c;
  font-weight: 500;
}

/* ============================================
   Hero Section
   ============================================ */
.hero-section {
  margin-top: 1.5rem;
  margin-bottom: 2rem;
}

.hero-banner {
  position: relative;
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  border-radius: var(--radius);
  padding: 3rem 2.5rem;
  color: #fff;
  overflow: hidden;
}

.hero-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 60 60"><circle cx="30" cy="30" r="1.5" fill="rgba(255,255,255,0.12)"/></svg>');
  opacity: 0.6;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 640px;
}

.hero-content h2 {
  font-size: 2rem;
  color: #fff;
  margin-bottom: 0.75rem;
}

.hero-content p {
  font-size: 1.05rem;
  opacity: 0.92;
  margin-bottom: 1.25rem;
  line-height: 1.55;
}

.hero-cta {
  display: inline-block;
  background: #fff;
  color: var(--secondary);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  padding: 0.7rem 1.6rem;
  border-radius: 6px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
  color: var(--secondary);
}

/* ============================================
   Article Cards
   ============================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

@media (max-width: 992px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}

.card-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
}

@media (max-width: 768px) {
  .card-grid-2 {
    grid-template-columns: 1fr;
  }
}

.article-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 8px var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(45, 31, 31, 0.14);
}

.card-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.article-card:hover .card-image img {
  transform: scale(1.05);
}

.card-body {
  padding: 1.1rem 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.card-title a {
  color: var(--text-body);
}

.card-title a:hover {
  color: var(--link);
}

.card-excerpt {
  font-size: 0.88rem;
  color: #5a4545;
  line-height: 1.55;
  margin-bottom: 0.6rem;
  flex-grow: 1;
}

.card-meta {
  font-size: 0.78rem;
  color: #8a6e6e;
  font-weight: 500;
}

/* ============================================
   Sidebar Widgets
   ============================================ */
.widget {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 2px 8px var(--shadow);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.5rem;
}

.widget-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.55rem;
  border-bottom: 2px solid var(--border);
  color: var(--text-body);
}

.widget-list {
  list-style: none;
}

.widget-list li {
  padding: 0.45rem 0;
  border-bottom: 1px solid #f7ecef;
}

.widget-list li:last-child {
  border-bottom: none;
}

.widget-list a {
  font-size: 0.9rem;
  color: var(--text-body);
  display: block;
}

.widget-list a:hover {
  color: var(--link);
}

/* Tag cloud */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

a.tag-link {
  display: inline-block;
  background: var(--bg-page);
  color: var(--link);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

a.tag-link:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* ============================================
   Article Page
   ============================================ */
.article-header {
  margin-bottom: 1.25rem;
}

.article-header h1 {
  font-size: 1.9rem;
  margin-bottom: 0.6rem;
}

.article-date {
  font-size: 0.85rem;
  color: #7a5e5e;
  margin-bottom: 1rem;
  display: block;
}

.featured-image {
  margin-bottom: 1.5rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 14px var(--shadow);
}

.featured-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Article body wrapper - critical for injected content */
.article-body {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-body);
}

.article-body h2 {
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--secondary);
}

.article-body h3 {
  font-size: 1.25rem;
  margin-top: 1.6rem;
  margin-bottom: 0.8rem;
  color: var(--text-body);
}

.article-body h4 {
  font-size: 1.08rem;
  margin-top: 1.4rem;
  margin-bottom: 0.7rem;
}

.article-body p {
  margin-bottom: 1.1rem;
}

/* Drop cap on first paragraph (used selectively) */
.article-body.drop-cap > p:first-child::first-letter {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 3.2rem;
  float: left;
  line-height: 0.8;
  padding-right: 0.6rem;
  padding-top: 0.2rem;
  color: var(--primary);
}

.article-body ul,
.article-body ol {
  margin-bottom: 1.1rem;
  padding-left: 1.5rem;
}

.article-body li {
  margin-bottom: 0.4rem;
}

.article-body ul li {
  list-style-type: disc;
}

.article-body ol li {
  list-style-type: decimal;
}

/* Tables */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 6px var(--shadow);
}

.article-body th,
.article-body td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.article-body th {
  background: var(--secondary);
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
}

.article-body tr:nth-child(even) {
  background: #fff5f7;
}

.article-body tr:hover {
  background: #fce8ed;
}

/* Blockquotes */
.article-body blockquote {
  background: #fff5f7;
  border-left: 4px solid var(--primary);
  padding: 1.1rem 1.4rem;
  margin: 1.25rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: #4a3535;
}

.article-body blockquote p:last-child {
  margin-bottom: 0;
}

/* Infobox */
.article-body .infobox {
  background: linear-gradient(135deg, #fff5f7, #f3e8ff);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.35rem;
  margin: 1.25rem 0;
  position: relative;
}

.article-body .infobox::before {
  content: '💡';
  position: absolute;
  top: -0.6rem;
  left: 1.2rem;
  background: var(--card-bg);
  padding: 0 0.3rem;
  font-size: 1.1rem;
}

.article-body .infobox strong {
  color: var(--secondary);
}

/* Stat block */
.article-body .stat-block {
  background: var(--secondary);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
  text-align: center;
}

.article-body .stat-block .stat-number {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 2.2rem;
  display: block;
  margin-bottom: 0.25rem;
}

.article-body .stat-block .stat-label {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Images & Figures */
.article-body img,
.featured-image img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 0 auto;
  display: block;
}

.article-body figure {
  margin: 1.25rem 0;
  text-align: center;
}

.article-body figure img {
  box-shadow: 0 4px 14px var(--shadow);
}

.article-body figcaption {
  font-size: 0.82rem;
  color: #7a5e5e;
  margin-top: 0.5rem;
  font-style: italic;
}

/* Links inside article */
.article-body a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-body a:hover {
  color: var(--link-hover);
}

/* Highlighted key phrase */
.article-body .highlight {
  background: linear-gradient(120deg, #ffdde4 0%, #ffdde4 100%);
  background-repeat: no-repeat;
  background-size: 100% 40%;
  background-position: 0 88%;
  padding: 0 0.15rem;
  font-weight: 500;
}

/* Pull quote with large quotation marks */
.article-body .pull-quote {
  position: relative;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--secondary);
  padding: 1.5rem 1.5rem 1.5rem 3rem;
  margin: 1.5rem 0;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 2px 10px var(--shadow);
}

.article-body .pull-quote::before {
  content: '"';
  position: absolute;
  top: 0.6rem;
  left: 1rem;
  font-size: 3rem;
  line-height: 1;
  color: var(--primary);
  opacity: 0.4;
}

/* ============================================
   Tags at bottom of article
   ============================================ */
.article-tags {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.article-tags-label {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.6rem;
  display: block;
}

/* ============================================
   Related Articles Block
   ============================================ */
.related-block {
  margin-top: 2rem;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: 0 2px 8px var(--shadow);
}

.related-block-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 1rem;
  color: var(--secondary);
}

.related-list {
  list-style: none;
}

.related-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #f7ecef;
}

.related-list li:last-child {
  border-bottom: none;
}

.related-list a {
  color: var(--text-body);
  font-size: 0.95rem;
}

.related-list a:hover {
  color: var(--link);
}

/* ============================================
   Related Widget (sidebar)
   ============================================ */
.related-widget {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px var(--shadow);
}

.related-widget-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.55rem;
  border-bottom: 2px solid var(--border);
  color: var(--text-body);
}

.related-widget-list {
  list-style: none;
}

.related-widget-list li {
  padding: 0.45rem 0;
  border-bottom: 1px solid #f7ecef;
}

.related-widget-list li:last-child {
  border-bottom: none;
}

.related-widget-list a {
  font-size: 0.88rem;
  color: var(--text-body);
  display: block;
}

.related-widget-list a:hover {
  color: var(--link);
}

/* ============================================
   Category / Listing Page Title
   ============================================ */
.page-title {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: var(--secondary);
}

/* ============================================
   Tag page cards
   ============================================ */
.tag-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

@media (max-width: 992px) {
  .tag-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .tag-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   Utility
   ============================================ */
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mb-1 { margin-bottom: 1rem; }
