/*
Theme Name: BlogPost 4
Theme URI: https://example.com/blogpost4
Author: BlogPost
Description: Универсальная тема для блога. Masonry-сетка, слайдер, тёмная тема, полная настройка через Customizer.
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: blogpost4
Tags: blog, grid-layout, custom-menu, dark-mode, featured-images, translation-ready
Requires at least: 6.0
Requires PHP: 7.4
*/
/* ===== VARIABLES ===== */
:root {
  --accent: #7c5cfc;
  --accent-light: #ede8ff;
  --accent-hover: #6a48e8;
  --text: #1a1a2e;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --bg: #ffffff;
  --bg-gray: #f3f4f6;
  --bg-dark: #1e1e2f;
  --border: #e5e7eb;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --font-body: 'Mulish', -apple-system, sans-serif;
  --font-heading: 'Mulish', -apple-system, sans-serif;
  --max-w: 1200px;
  --header-h: 60px;
}

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

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.95);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.site-logo span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  position: relative;
  top: -2px;
}

.main-nav { display: flex; align-items: center; gap: 8px; }

.main-nav a {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.main-nav a:hover, .main-nav a.active {
  color: var(--accent);
  background: var(--accent-light);
}

.nav-dot {
  display: inline-flex;
  width: 8px; height: 8px;
  background: #ef4444;
  border-radius: 50%;
  margin-right: 4px;
}

.header-actions { display: flex; align-items: center; gap: 12px; }

.page-counter {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-gray);
  padding: 4px 10px;
  border-radius: 20px;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 6px;
  border-radius: 50%;
  transition: all 0.2s;
  display: flex;
  align-items: center;
}

.btn-icon:hover { background: var(--bg-gray); color: var(--text); }

/* ===== BREADCRUMBS ===== */
.breadcrumbs-bar {
  background: var(--bg-gray);
  border-bottom: 1px solid var(--border);
}

.breadcrumbs-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.breadcrumbs a { color: var(--text-secondary); transition: color 0.2s; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { margin: 0 6px; opacity: 0.5; }
.breadcrumbs-nav a { color: var(--accent); font-weight: 600; }

/* ===== SECTION TITLES ===== */
.section-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 900;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title .icon {
  width: 24px; height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

/* ===== HERO SLIDER ===== */
.hero-section { padding: 24px 0; }

.hero-slider {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16/7;
  background: var(--bg-dark);
}

.hero-slide { position: relative; width: 100%; height: 100%; }

.hero-slide-content {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 48px 40px;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  color: #ffd700;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.25;
  max-width: 560px;
  margin-bottom: 14px;
}

.hero-excerpt {
  color: rgba(255,255,255,0.75);
  font-size: 0.95rem;
  max-width: 480px;
}

.hero-dots {
  position: absolute;
  bottom: 20px; left: 40px;
  display: flex;
  gap: 8px;
}

.hero-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: all 0.3s;
}

.hero-dot.active {
  background: var(--accent);
  width: 28px;
  border-radius: 5px;
}

.hero-nav {
  position: absolute;
  bottom: 20px; right: 20px;
  display: flex;
  gap: 8px;
}

.hero-nav button,
.slider-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.hero-nav button:hover,
.slider-btn:hover { background: rgba(255,255,255,0.3); }

/* ===== CATEGORIES GRID ===== */
.categories-section { padding: 32px 0; }

.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.category-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16/9;
  cursor: pointer;
}

.category-card .ph { transition: transform 0.4s ease; }
.category-card:hover .ph { transform: scale(1.05); }

.category-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.65), rgba(0,0,0,0.15));
  display: flex;
  align-items: flex-end;
  padding: 20px;
}

.category-card-name {
  color: #fff;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
}

.cat-count {
  background: rgba(255,255,255,0.25);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
}

/* ===== AD PLACEHOLDER ===== */
.ad-placeholder {
  background: var(--bg-gray);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 32px 0;
  border: 1px dashed var(--border);
}

/* ===== TELEGRAM BANNER ===== */
.telegram-banner {
  background: linear-gradient(135deg, var(--bg-dark) 0%, #2d2b55 100%);
  border-radius: var(--radius);
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 32px 0;
  color: #fff;
}

.telegram-banner p { font-size: 0.9rem; opacity: 0.85; max-width: 520px; line-height: 1.5; }

.telegram-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
  white-space: nowrap;
  border: none;
  cursor: pointer;
}

.telegram-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(124,92,252,0.35);
}

/* ===========================================================
   MASONRY POSTS GRID
   =========================================================== */
.masonry {
  columns: 3;
  column-gap: 24px;
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 24px;
  display: inline-block;
  width: 100%;
}

/* --- Post card base --- */
.m-card {
  background: var(--bg);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: box-shadow 0.3s, transform 0.3s;
}

.m-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.m-card-image {
  overflow: hidden;
}

.m-card-image .ph {
  transition: transform 0.4s;
}

.m-card:hover .m-card-image .ph {
  transform: scale(1.04);
}

/* Image aspect ratios for variety */
.m-card-image.tall   { aspect-ratio: 3/4; }
.m-card-image.wide   { aspect-ratio: 16/9; }
.m-card-image.square { aspect-ratio: 1/1; }
.m-card-image.normal { aspect-ratio: 4/3; }

.m-card-body { padding: 20px; }

.m-card-cat {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.m-card-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 10px;
}

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

.m-card-excerpt {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 16px;
}

.m-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.m-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.m-meta-info { flex: 1; }

.m-meta-author { font-size: 0.8rem; font-weight: 600; }
.m-meta-date { font-size: 0.72rem; color: var(--text-muted); }

.m-meta-link {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.2s;
}

.m-meta-link:hover { background: var(--accent); color: #fff; }

/* --- Quote card (no image) --- */
.m-card-quote {
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 24px;
  transition: box-shadow 0.3s, transform 0.3s;
}

.m-card-quote:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.m-card-quote .quote-cats {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.m-card-quote .quote-text {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 12px;
}

.m-card-quote .quote-excerpt {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* --- Big featured card (full-width image with overlay) --- */
.m-card-featured {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
}

.m-card-featured .ph { transition: transform 0.4s; }
.m-card-featured:hover .ph { transform: scale(1.04); }

.m-card-featured-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent 60%);
}

.m-card-featured-content {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 20px;
  color: #fff;
}

.m-card-featured-content .m-card-cat { color: rgba(255,255,255,0.7); }
.m-card-featured-content .m-card-title { color: #fff; }
.m-card-featured-content .m-card-title a:hover { color: var(--accent-light); }

/* ===== LOAD MORE ===== */
.load-more {
  text-align: center;
  padding: 16px 0 32px;
}

.load-more a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.load-more a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ===== FEATURED CAROUSEL ===== */
.featured-section { padding: 32px 0; }

.featured-carousel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  position: relative;
}

.feat-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16/10;
  cursor: pointer;
}

.feat-card .ph { transition: transform 0.4s; }
.feat-card:hover .ph { transform: scale(1.05); }

.feat-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent 60%);
}

.feat-views {
  position: absolute;
  top: 12px; right: 12px;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.feat-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 16px;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.35;
}

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.2s;
  z-index: 2;
}

.carousel-nav:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.carousel-prev { left: -18px; }
.carousel-next { right: -18px; }

/* ===== CATEGORY HEADER ===== */
.category-header {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin: 32px 0;
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.category-header-image {
  width: 180px;
  height: 220px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.category-header-info { flex: 1; }

.category-header-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.category-header-title {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 900;
}

.category-header-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-gray);
  padding: 4px 14px;
  border-radius: 20px;
  white-space: nowrap;
}

.category-header-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 18px;
  font-style: italic;
}

.subcategory-tags { display: flex; flex-wrap: wrap; gap: 8px; }

.subcategory-tag {
  display: inline-block;
  padding: 7px 18px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.subcategory-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ===== ARTICLE LAYOUT (single page) ===== */
.article-layout {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px 24px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
}

.article-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 16px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.article-meta-item { display: flex; align-items: center; gap: 5px; }
.article-meta-item svg { width: 14px; height: 14px; opacity: 0.6; }

.article-featured-image {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 8px;
  aspect-ratio: 16/9;
}

.image-caption {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: right;
  font-style: italic;
  margin-bottom: 28px;
}

.article-content { font-size: 1.05rem; line-height: 1.75; }

.article-content p { margin-bottom: 1.4em; }

.article-content p:first-of-type::first-letter {
  font-family: var(--font-heading);
  float: left;
  font-size: 3.8em;
  line-height: 0.85;
  margin-right: 10px;
  margin-top: 4px;
  color: var(--accent);
  font-weight: 900;
}

.article-content blockquote {
  border-left: 4px solid var(--accent);
  padding: 16px 24px;
  margin: 24px 0;
  background: var(--accent-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--text-secondary);
}

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 24px; }

.sidebar-ad {
  background: var(--bg-gray);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  border: 1px dashed var(--border);
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-promo {
  background: linear-gradient(135deg, var(--bg-dark) 0%, #2d2b55 100%);
  border-radius: var(--radius);
  padding: 24px;
  color: #fff;
  text-align: center;
}

.sidebar-promo .promo-logo {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 900;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
}

.sidebar-promo .promo-logo span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px; height: 18px;
  border-radius: 5px;
}

.sidebar-promo p { font-size: 0.85rem; opacity: 0.7; margin-top: 12px; }

/* Tags */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 32px 0;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.tag {
  display: inline-block;
  padding: 6px 16px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-gray);
  border-radius: 20px;
  transition: all 0.2s;
}

.tag:hover { background: var(--accent-light); color: var(--accent); }

/* Author box */
.author-box {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: var(--bg-gray);
  border-radius: var(--radius);
  margin: 32px 0;
}

.author-avatar {
  width: 80px; height: 80px;
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-ph {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.author-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.author-name { font-family: var(--font-heading); font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.author-link { font-size: 0.82rem; color: var(--accent); font-weight: 600; }
.author-link:hover { text-decoration: underline; }

/* Share buttons */
.share-section { margin: 28px 0; }
.share-label { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 12px; }
.share-buttons { display: flex; gap: 8px; flex-wrap: wrap; }

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  gap: 6px;
}

.share-btn:hover { transform: translateY(-1px); filter: brightness(1.1); }
.share-btn svg { width: 18px; height: 18px; }
.share-vk { background: #4a76a8; }
.share-tg { background: #26a5e4; }
.share-wa { background: #25d366; }
.share-ok { background: #ee8208; }
.share-threads { background: #000; }

/* Related posts */
.related-section { padding: 40px 0; }

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.related-card {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.3s;
}

.related-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.related-card-image { aspect-ratio: 16/10; overflow: hidden; }
.related-card-image .ph { transition: transform 0.4s; }
.related-card:hover .related-card-image .ph { transform: scale(1.04); }

.related-card-body { padding: 16px; }

.related-card-title {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
}

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

/* ===== FOOTER ===== */
.site-footer {
  background: var(--bg-dark);
  color: rgba(255,255,255,0.7);
  margin-top: 48px;
}

.footer-main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 48px 24px 32px;
  display: flex;
  justify-content: space-between;
  gap: 48px;
}

.footer-brand { max-width: 400px; }

.footer-logo {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 12px;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.footer-logo span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  width: 20px; height: 20px;
  border-radius: 5px;
}

.footer-desc { font-size: 0.85rem; line-height: 1.6; margin-bottom: 20px; }
.footer-socials { display: flex; gap: 8px; }

.footer-socials a {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  transition: all 0.2s;
}

.footer-socials a:hover { transform: translateY(-2px); }
.s-vk { background: #4a76a8; }
.s-ok { background: #ee8208; }
.s-ya { background: #fc3f1d; }
.s-dz { background: #111; }
.s-vc { background: #2787f5; }
.s-tg { background: #26a5e4; }
.s-wa { background: #25d366; }
.s-th { background: #000; }

.footer-nav h3 {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.footer-nav ul { display: flex; flex-direction: column; gap: 10px; }
.footer-nav a { font-size: 0.85rem; transition: color 0.2s; }
.footer-nav a:hover { color: var(--accent); }

.footer-bottom {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.4);
}

/* ===== SCROLL TOP ===== */
.scroll-top {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.3s;
  opacity: 0;
  transform: translateY(10px);
  z-index: 50;
}

.scroll-top.visible { opacity: 1; transform: translateY(0); }
.scroll-top:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ===== PLACEHOLDERS ===== */
.ph {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.ph svg { opacity: 0.3; }

.ph-1 { background: linear-gradient(135deg, #dbeafe, #93c5fd); color: #3b82f6; }
.ph-2 { background: linear-gradient(135deg, #fce7f3, #f9a8d4); color: #ec4899; }
.ph-3 { background: linear-gradient(135deg, #d1fae5, #6ee7b7); color: #10b981; }
.ph-4 { background: linear-gradient(135deg, #fef3c7, #fcd34d); color: #d97706; }
.ph-5 { background: linear-gradient(135deg, #e0e7ff, #818cf8); color: #6366f1; }
.ph-6 { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #92400e; }
.ph-7 { background: linear-gradient(135deg, #cffafe, #22d3ee); color: #0e7490; }
.ph-hero { background: linear-gradient(135deg, #1e1b4b, #312e81, #4338ca); color: rgba(255,255,255,0.15); }
.ph-dark { background: linear-gradient(135deg, #064e3b, #065f46, #047857); color: rgba(255,255,255,0.15); }

/* ===== SVG ICON SHORTHAND ===== */
.ico { width: 14px; height: 14px; flex-shrink: 0; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .masonry { columns: 2; }
  .categories-grid { grid-template-columns: repeat(2, 1fr); }
  .featured-carousel { grid-template-columns: repeat(2, 1fr); }
  .related-grid { grid-template-columns: 1fr; }
  .article-layout { grid-template-columns: 1fr; }
  .category-header { flex-direction: column; }
  .category-header-image { width: 100%; height: 200px; }
  .footer-main { flex-direction: column; gap: 32px; }
  .hero-title { font-size: 1.6rem; }
}

@media (max-width: 600px) {
  .main-nav { display: none; }
  .masonry { columns: 1; }
  .categories-grid,
  .featured-carousel { grid-template-columns: 1fr; }
  .hero-slider { aspect-ratio: 4/3; }
  .hero-title { font-size: 1.3rem; }
  .hero-slide-content { padding: 24px; }
  .telegram-banner { flex-direction: column; gap: 16px; text-align: center; }
  .article-title { font-size: 1.5rem; }
  .share-buttons { flex-wrap: wrap; }
}

/* ===== DARK MODE ===== */
body.dark-mode {
  --text: #e4e4e7;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --bg: #18181b;
  --bg-gray: #27272a;
  --bg-dark: #0f0f12;
  --border: #3f3f46;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.35);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.45);
  --accent-light: #2d2554;
}
body.dark-mode .site-header { background: rgba(24,24,27,0.95); }
body.dark-mode .scroll-top { background: var(--bg-gray); border-color: var(--border); }
body { transition: background 0.3s, color 0.3s; }
.site-header { transition: background 0.3s, border-color 0.3s; }

/* ===== SEARCH OVERLAY ===== */
.search-overlay { position:fixed; inset:0; background:rgba(0,0,0,0.6); backdrop-filter:blur(4px); z-index:999; display:none; align-items:flex-start; justify-content:center; padding-top:120px; }
.search-overlay.active { display:flex; }
.search-overlay-inner { background:var(--bg); border-radius:var(--radius); padding:32px; width:90%; max-width:600px; box-shadow:var(--shadow-lg); }
.search-overlay-inner form { display:flex; gap:12px; }
.search-overlay-inner input[type="search"] { flex:1; padding:14px 20px; border:1px solid var(--border); border-radius:var(--radius-sm); font-size:1rem; font-family:var(--font-body); background:var(--bg-gray); color:var(--text); outline:none; transition:border-color 0.2s; }
.search-overlay-inner input[type="search"]:focus { border-color:var(--accent); }
.search-overlay-inner button[type="submit"] { padding:14px 24px; background:var(--accent); color:#fff; border:none; border-radius:var(--radius-sm); font-weight:600; cursor:pointer; transition:background 0.2s; }
.search-overlay-inner button[type="submit"]:hover { background:var(--accent-hover); }
.search-close { position:absolute; top:24px; right:24px; background:none; border:none; color:#fff; font-size:2rem; cursor:pointer; line-height:1; }

/* Mobile menu toggle */
.menu-toggle { display:none; background:none; border:none; cursor:pointer; color:var(--text-secondary); padding:6px; }

/* WP menu resets */
.main-nav ul { display:flex; align-items:center; gap:8px; list-style:none; margin:0; padding:0; }
.main-nav li { list-style:none; position:relative; }
.main-nav .sub-menu { display:none; position:absolute; top:100%; left:0; background:var(--bg); border:1px solid var(--border); border-radius:var(--radius-sm); box-shadow:var(--shadow-md); padding:8px 0; min-width:200px; z-index:200; flex-direction:column; gap:0; }
.main-nav li:hover > .sub-menu { display:flex; }
.main-nav .sub-menu a { display:block; padding:8px 16px; font-size:0.85rem; text-transform:none; border-radius:0; }
.main-nav .current-menu-item > a, .main-nav .current-menu-ancestor > a, .main-nav .current_page_item > a { color:var(--accent); background:var(--accent-light); }

/* Hero slide transitions */
.hero-slide { position:absolute; width:100%; height:100%; top:0; left:0; opacity:0; transition:opacity 0.6s ease; }
.hero-slide.active { opacity:1; z-index:1; }
.hero-slide-image { position:absolute; inset:0; }
.hero-slide-image img { width:100%; height:100%; object-fit:cover; }
.hero-title a { color:#fff; } .hero-title a:hover { color:var(--accent-light); }

/* Card images */
.m-card-image img, .m-card-featured img, .feat-card img, .category-card img, .related-card-image img { width:100%; height:100%; object-fit:cover; transition:transform 0.4s; }
.m-card:hover .m-card-image img, .m-card-featured:hover img, .feat-card:hover img, .category-card:hover img, .related-card:hover .related-card-image img { transform:scale(1.04); }
.m-card-cat a { color:var(--accent); } .m-card-cat a:hover { text-decoration:underline; }
.feat-caption a { color:#fff; } .feat-caption a:hover { color:var(--accent-light); }
.feat-card { background:var(--bg-dark); }
.category-card { display:block; background:var(--bg-dark); }
.category-header-image img { width:100%; height:100%; object-fit:cover; }

/* Pagination */
.pagination { text-align:center; padding:16px 0 32px; display:flex; justify-content:center; gap:8px; flex-wrap:wrap; }
.pagination a, .pagination span { display:inline-flex; align-items:center; gap:8px; color:var(--text-secondary); font-weight:600; font-size:0.9rem; padding:10px 18px; border-radius:var(--radius-sm); border:1px solid var(--border); transition:all 0.2s; }
.pagination a:hover { border-color:var(--accent); color:var(--accent); background:var(--accent-light); }
.pagination .current { background:var(--accent); color:#fff; border-color:var(--accent); }

/* Widgets */
.widget { background:var(--bg); border:1px solid var(--border); border-radius:var(--radius); padding:24px; }
.widget-title { font-family:var(--font-heading); font-size:1rem; font-weight:700; margin-bottom:16px; }
.widget ul { display:flex; flex-direction:column; gap:8px; }
.widget li a { font-size:0.85rem; color:var(--text-secondary); transition:color 0.2s; }
.widget li a:hover { color:var(--accent); }

/* Comments styling */
.comments-section { margin:40px 0; }
.comment-list { list-style:none; margin:0; padding:0; }
.comment { padding:20px 0; border-bottom:1px solid var(--border); }
.comment .comment-author { display:flex; align-items:center; gap:12px; margin-bottom:10px; }
.comment .comment-author img { width:40px; height:40px; border-radius:50%; }
.comment .fn { font-weight:700; font-size:0.9rem; }
.comment-metadata { font-size:0.75rem; color:var(--text-muted); }
.comment-content { font-size:0.92rem; line-height:1.6; }
.comment-respond { margin-top:32px; }
.comment-form label { display:block; font-size:0.85rem; font-weight:600; margin-bottom:6px; color:var(--text-secondary); }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
  width:100%; padding:12px 16px; border:1px solid var(--border); border-radius:var(--radius-sm);
  font-family:var(--font-body); font-size:0.92rem; background:var(--bg-gray); color:var(--text); margin-bottom:16px;
}
.comment-form input:focus, .comment-form textarea:focus { outline:none; border-color:var(--accent); }
.comment-form .submit { padding:12px 32px; background:var(--accent); color:#fff; border:none; border-radius:var(--radius-sm); font-weight:600; cursor:pointer; }
.comment-form .submit:hover { background:var(--accent-hover); }
.children { margin-left:40px; padding:0; list-style:none; }

/* 404 */
.error-404-page { text-align:center; padding:80px 24px; }
.error-404-page h1 { font-family:var(--font-heading); font-size:6rem; font-weight:900; color:var(--accent); margin-bottom:16px; }
.error-404-page p { font-size:1.1rem; color:var(--text-secondary); margin-bottom:32px; }

/* Responsive overrides */
@media (max-width:600px) {
  .menu-toggle { display:flex; }
  .main-nav.open { display:flex; flex-direction:column; position:absolute; top:var(--header-h); left:0; right:0; background:var(--bg); border-bottom:1px solid var(--border); padding:16px 24px; box-shadow:var(--shadow-md); z-index:100; }
  .main-nav.open ul { flex-direction:column; width:100%; }
  .children { margin-left:20px; }
}
