/*
Theme Name: Актуально
Theme URI: https://aktualno.site
Author: Aktualno Team
Author URI: https://aktualno.site
Description: Сучасна новинна тема для українськомовного сайту Актуально. Адаптивний дизайн, темна тема, стиль BBC/The Verge.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: aktualno
Tags: news, blog, dark-mode, responsive, grid-layout, custom-menu, widgets, featured-images
*/

/* =========================================================
   CSS CUSTOM PROPERTIES (Light & Dark Mode)
   ========================================================= */
:root {
  --color-bg: #ffffff;
  --color-bg-secondary: #f4f5f7;
  --color-bg-card: #ffffff;
  --color-border: #e2e5ea;
  --color-text: #1a1d23;
  --color-text-secondary: #5a6172;
  --color-text-muted: #8c95a6;
  --color-accent: #d63031;
  --color-accent-hover: #b82828;
  --color-accent-light: #fff0f0;
  --color-link: #d63031;
  --color-link-hover: #b82828;
  --color-header-bg: #1a1d23;
  --color-header-text: #ffffff;
  --color-footer-bg: #12141a;
  --color-footer-text: #b0b8c8;
  --color-tag-bg: #f4f5f7;
  --color-tag-text: #5a6172;
  --color-shadow: rgba(0,0,0,0.08);
  --color-shadow-hover: rgba(0,0,0,0.16);
  --color-overlay: rgba(0,0,0,0.55);
  --font-primary: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-serif: 'Georgia', 'Times New Roman', serif;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --transition: 0.22s ease;
  --container-width: 1260px;
  --sidebar-width: 320px;
  --header-height: 64px;
}

[data-theme="dark"] {
  --color-bg: #0f1117;
  --color-bg-secondary: #181c25;
  --color-bg-card: #1e2230;
  --color-border: #2a2f3e;
  --color-text: #e8ecf4;
  --color-text-secondary: #9aa3b8;
  --color-text-muted: #6b738a;
  --color-accent: #ff4757;
  --color-accent-hover: #e03347;
  --color-accent-light: #2a1520;
  --color-link: #ff6b7a;
  --color-link-hover: #ff4757;
  --color-header-bg: #0a0c12;
  --color-header-text: #e8ecf4;
  --color-footer-bg: #07090e;
  --color-footer-text: #6b738a;
  --color-tag-bg: #2a2f3e;
  --color-tag-text: #9aa3b8;
  --color-shadow: rgba(0,0,0,0.4);
  --color-shadow-hover: rgba(0,0,0,0.6);
  --color-overlay: rgba(0,0,0,0.7);
}

/* =========================================================
   RESET & BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

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

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-link); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-link-hover); }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* =========================================================
   TYPOGRAPHY
   ========================================================= */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-text);
}
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.375rem, 3vw, 1.875rem); }
h3 { font-size: clamp(1.125rem, 2vw, 1.375rem); }
h4 { font-size: 1.125rem; }
p { margin-bottom: 1rem; }

/* =========================================================
   LAYOUT
   ========================================================= */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

.site-main { padding: 32px 0 48px; }

.content-area {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 32px;
  align-items: start;
}

@media (max-width: 1024px) {
  .content-area { grid-template-columns: 1fr; }
}

/* =========================================================
   STICKY HEADER
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--color-header-bg);
  color: var(--color-header-text);
  box-shadow: 0 2px 12px var(--color-shadow);
  transition: background var(--transition);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: 16px;
}

/* Logo */
.site-logo a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-header-text);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.site-logo a:hover { color: var(--color-accent); }
.site-logo svg, .site-logo img { height: 36px; width: auto; }

/* Primary Nav */
.primary-nav { display: flex; align-items: center; flex: 1; justify-content: center; }

.primary-nav ul {
  display: flex;
  gap: 4px;
  align-items: center;
}

.primary-nav ul li a {
  color: rgba(255,255,255,0.85);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.primary-nav ul li a:hover,
.primary-nav ul li.current-menu-item a {
  background: rgba(255,255,255,0.12);
  color: #ffffff;
}
.primary-nav ul li.current-menu-item a { color: var(--color-accent); }

/* Category color badges in nav */
.cat-politics a { border-bottom: 2px solid #e74c3c; }
.cat-world a { border-bottom: 2px solid #3498db; }
.cat-tech a { border-bottom: 2px solid #2ecc71; }
.cat-business a { border-bottom: 2px solid #f39c12; }
.cat-sport a { border-bottom: 2px solid #9b59b6; }

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Search toggle */
.search-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.8);
  transition: background var(--transition), color var(--transition);
}
.search-toggle:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* Dark mode toggle */
.dark-mode-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.8);
  transition: background var(--transition), color var(--transition);
}
.dark-mode-toggle:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* Mobile hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.8);
  transition: background var(--transition);
}
.nav-toggle:hover { background: rgba(255,255,255,0.12); }
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Search dropdown */
.search-dropdown {
  display: none;
  position: absolute;
  top: var(--header-height);
  left: 0;
  right: 0;
  background: var(--color-header-bg);
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  z-index: 999;
}
.search-dropdown.active { display: block; }
.search-dropdown .search-form {
  display: flex;
  max-width: 600px;
  margin: 0 auto;
  gap: 8px;
}
.search-dropdown input[type="search"] {
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 1rem;
  outline: none;
}
.search-dropdown input::placeholder { color: rgba(255,255,255,0.45); }
.search-dropdown input:focus { border-color: var(--color-accent); background: rgba(255,255,255,0.15); }
.search-dropdown button[type="submit"] {
  padding: 10px 20px;
  background: var(--color-accent);
  color: #fff;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  transition: background var(--transition);
}
.search-dropdown button:hover { background: var(--color-accent-hover); }

/* =========================================================
   BREAKING NEWS TICKER
   ========================================================= */
.breaking-news {
  background: var(--color-accent);
  color: #fff;
  overflow: hidden;
  height: 36px;
}
.breaking-inner {
  display: flex;
  align-items: center;
  height: 100%;
}
.breaking-label {
  background: rgba(0,0,0,0.25);
  padding: 0 16px;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  height: 100%;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.breaking-ticker {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.breaking-ticker-inner {
  display: flex;
  animation: ticker 30s linear infinite;
  white-space: nowrap;
}
.breaking-ticker-inner a {
  color: #fff;
  font-size: 0.875rem;
  padding: 0 32px;
  display: inline-block;
}
.breaking-ticker-inner a:hover { text-decoration: underline; }
@keyframes ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* =========================================================
   CATEGORY NAV BAR
   ========================================================= */
.category-bar {
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.category-bar::-webkit-scrollbar { display: none; }
.category-bar-inner {
  display: flex;
  align-items: center;
  height: 42px;
  gap: 4px;
  min-width: max-content;
  padding: 0 20px;
}
.category-bar a {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
  color: var(--color-text-secondary);
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.category-bar a:hover,
.category-bar a.active {
  background: var(--color-accent);
  color: #fff;
}

/* =========================================================
   HERO / FEATURED SECTION
   ========================================================= */
.hero-section { padding: 28px 0 0; }

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  grid-template-rows: auto auto;
  gap: 20px;
}

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

/* Main featured card */
.hero-main {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16/9;
  grid-row: 1 / 3;
  background: #1a1d23;
}
.hero-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.hero-main:hover img { transform: scale(1.04); }
.hero-main-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 55%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px;
}
.hero-main .article-category-badge {
  margin-bottom: 10px;
  align-self: flex-start;
}
.hero-main h2 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); color: #fff; margin-bottom: 10px; }
.hero-main h2 a { color: inherit; }
.hero-main h2 a:hover { color: rgba(255,255,255,0.85); }
.hero-main .article-meta { color: rgba(255,255,255,0.7); font-size: 0.82rem; }

/* Secondary hero cards */
.hero-side { display: flex; flex-direction: column; gap: 20px; }

.hero-secondary {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  flex: 1;
  min-height: 160px;
  background: #1a1d23;
}
.hero-secondary img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.hero-secondary:hover img { transform: scale(1.05); }
.hero-secondary-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 65%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
}
.hero-secondary h3 { font-size: 0.975rem; color: #fff; line-height: 1.3; }
.hero-secondary h3 a { color: inherit; }
.hero-secondary h3 a:hover { color: rgba(255,255,255,0.85); }
.hero-secondary .article-meta { color: rgba(255,255,255,0.65); font-size: 0.78rem; margin-top: 4px; }
.hero-secondary .article-category-badge { margin-bottom: 6px; align-self: flex-start; }

/* =========================================================
   SECTION HEADERS
   ========================================================= */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-border);
}
.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text);
  position: relative;
  padding-left: 14px;
}
.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--color-accent);
  border-radius: 2px;
}
.section-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-accent);
  transition: color var(--transition);
}
.section-link:hover { color: var(--color-accent-hover); }

/* =========================================================
   NEWS GRID (Latest)
   ========================================================= */
.news-section { padding: 36px 0; }

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

@media (max-width: 1100px) { .news-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { .news-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .news-grid { grid-template-columns: 1fr; } }

/* Article Card */
.article-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  display: flex;
  flex-direction: column;
}
.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px var(--color-shadow-hover);
  border-color: var(--color-accent);
}

.article-card-thumbnail {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/10;
  background: var(--color-bg-secondary);
  flex-shrink: 0;
}
.article-card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.article-card:hover .article-card-thumbnail img { transform: scale(1.06); }

.article-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.article-card h3 {
  font-size: 0.975rem;
  line-height: 1.4;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card h3 a { color: var(--color-text); }
.article-card h3 a:hover { color: var(--color-accent); }

.article-card-excerpt {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
  flex: 1;
}

/* =========================================================
   ARTICLE META
   ========================================================= */
.article-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}
.article-meta a { color: inherit; }
.article-meta a:hover { color: var(--color-accent); }
.article-meta .separator { opacity: 0.4; }
.article-meta time { display: flex; align-items: center; gap: 4px; }

/* =========================================================
   CATEGORY BADGE
   ========================================================= */
.article-category-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
  background: var(--color-accent);
  transition: opacity var(--transition);
  margin-bottom: 8px;
}
.article-category-badge:hover { opacity: 0.85; color: #fff; }

/* Category-specific colors */
.badge-politics { background: #e74c3c; }
.badge-world    { background: #2980b9; }
.badge-tech     { background: #27ae60; }
.badge-business { background: #e67e22; }
.badge-sport    { background: #8e44ad; }

/* =========================================================
   LIST ARTICLE (Horizontal card with image left)
   ========================================================= */
.article-list-item {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition);
}
.article-list-item:last-child { border-bottom: none; }

.article-list-thumb {
  width: 100px;
  height: 68px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--color-bg-secondary);
}
.article-list-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.article-list-item:hover .article-list-thumb img { transform: scale(1.08); }

.article-list-content { flex: 1; min-width: 0; }
.article-list-content h4 {
  font-size: 0.925rem;
  line-height: 1.35;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-list-content h4 a { color: var(--color-text); }
.article-list-content h4 a:hover { color: var(--color-accent); }

/* =========================================================
   CATEGORY SECTIONS
   ========================================================= */
.category-sections { padding: 0 0 40px; }

.category-section { margin-bottom: 48px; }

.category-section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.category-main-article {
  background: var(--color-bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  transition: transform var(--transition), box-shadow var(--transition);
}
.category-main-article:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px var(--color-shadow-hover);
}
.category-main-article .article-thumbnail {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--color-bg-secondary);
}
.category-main-article .article-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.category-main-article:hover .article-thumbnail img { transform: scale(1.05); }
.category-main-article .article-content { padding: 18px; }
.category-main-article h3 { font-size: 1.1rem; margin-bottom: 10px; }
.category-main-article h3 a { color: var(--color-text); }
.category-main-article h3 a:hover { color: var(--color-accent); }
.category-main-article p {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}

.category-side-articles { display: flex; flex-direction: column; gap: 0; }

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

/* =========================================================
   POPULAR POSTS
   ========================================================= */
.popular-section { padding: 36px 0; background: var(--color-bg-secondary); }

.popular-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
@media (max-width: 1024px) { .popular-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px)  { .popular-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px)  { .popular-grid { grid-template-columns: 1fr; } }

.popular-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  transition: transform var(--transition), box-shadow var(--transition);
}
.popular-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px var(--color-shadow-hover);
}
.popular-card .thumb {
  aspect-ratio: 3/2;
  overflow: hidden;
  background: var(--color-bg-secondary);
}
.popular-card .thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.popular-card:hover .thumb img { transform: scale(1.06); }
.popular-card .body { padding: 12px; }
.popular-card .num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-border);
  line-height: 1;
  margin-bottom: 4px;
}
.popular-card h4 {
  font-size: 0.875rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.popular-card h4 a { color: var(--color-text); }
.popular-card h4 a:hover { color: var(--color-accent); }

/* =========================================================
   SIDEBAR
   ========================================================= */
.sidebar { display: flex; flex-direction: column; gap: 28px; }

.widget {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.widget-title {
  font-size: 0.95rem;
  font-weight: 700;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: relative;
  padding-left: 26px;
}
.widget-title::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 16px;
  background: var(--color-accent);
  border-radius: 2px;
}

.widget-content { padding: 14px 18px; }

/* Recent posts widget */
.widget-recent-post {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}
.widget-recent-post:last-child { border-bottom: none; }
.widget-recent-post .thumb {
  width: 64px;
  height: 46px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--color-bg-secondary);
}
.widget-recent-post .thumb img { width: 100%; height: 100%; object-fit: cover; }
.widget-recent-post .info h5 {
  font-size: 0.825rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 3px;
}
.widget-recent-post .info h5 a { color: var(--color-text); }
.widget-recent-post .info h5 a:hover { color: var(--color-accent); }
.widget-recent-post .info time { font-size: 0.74rem; color: var(--color-text-muted); }

/* Categories widget */
.widget-categories li {
  border-bottom: 1px solid var(--color-border);
}
.widget-categories li:last-child { border-bottom: none; }
.widget-categories li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  font-weight: 500;
  transition: color var(--transition);
}
.widget-categories li a:hover { color: var(--color-accent); }
.widget-categories li a span {
  background: var(--color-tag-bg);
  color: var(--color-text-muted);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 20px;
}

/* Tags widget */
.widget-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.widget-tags a {
  background: var(--color-tag-bg);
  color: var(--color-tag-text);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  transition: background var(--transition), color var(--transition);
}
.widget-tags a:hover { background: var(--color-accent); color: #fff; }

/* =========================================================
   SINGLE POST
   ========================================================= */
.single-post-header { margin-bottom: 24px; }
.single-post-header .article-category-badge { margin-bottom: 12px; }
.single-post-header h1 { margin-bottom: 16px; }
.single-post-header .article-meta { margin-bottom: 16px; }

.post-featured-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 28px;
  aspect-ratio: 16/9;
  background: var(--color-bg-secondary);
}
.post-featured-image img { width: 100%; height: 100%; object-fit: cover; }

.post-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--color-text);
}
.post-content h2 { font-size: 1.5rem; margin: 2rem 0 1rem; }
.post-content h3 { font-size: 1.25rem; margin: 1.75rem 0 0.875rem; }
.post-content p { margin-bottom: 1.25rem; }
.post-content a { color: var(--color-accent); text-decoration: underline; text-underline-offset: 3px; }
.post-content a:hover { color: var(--color-accent-hover); }
.post-content blockquote {
  border-left: 4px solid var(--color-accent);
  padding: 16px 20px;
  margin: 1.5rem 0;
  background: var(--color-accent-light);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--color-text-secondary);
  font-size: 1.05rem;
}
.post-content ul, .post-content ol {
  margin: 0 0 1.25rem 1.5rem;
  list-style: disc;
}
.post-content ol { list-style: decimal; }
.post-content li { margin-bottom: 0.4rem; }
.post-content img {
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
}
.post-content strong { font-weight: 700; }
.post-content em { font-style: italic; }

/* Post tags */
.post-tags { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.post-tags strong { font-size: 0.875rem; color: var(--color-text-secondary); margin-right: 4px; }
.post-tags a {
  background: var(--color-tag-bg);
  color: var(--color-tag-text);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  transition: background var(--transition), color var(--transition);
}
.post-tags a:hover { background: var(--color-accent); color: #fff; }

/* Related posts */
.related-posts { margin-top: 40px; padding-top: 32px; border-top: 2px solid var(--color-border); }
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 640px) { .related-grid { grid-template-columns: 1fr; } }

/* Author box */
.author-box {
  display: flex;
  gap: 16px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 32px 0;
  align-items: flex-start;
}
.author-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--color-border);
}
.author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-info h4 { font-size: 1rem; margin-bottom: 4px; }
.author-info p { font-size: 0.875rem; color: var(--color-text-secondary); margin: 0; }

/* Share buttons */
.share-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 24px 0;
  flex-wrap: wrap;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  transition: opacity var(--transition);
}
.share-btn:hover { opacity: 0.85; color: #fff; }
.share-btn.facebook { background: #1877f2; }
.share-btn.twitter  { background: #1da1f2; }
.share-btn.telegram { background: #0088cc; }
.share-btn.viber    { background: #7360f2; }
.share-label { font-size: 0.875rem; color: var(--color-text-secondary); font-weight: 600; }

/* =========================================================
   COMMENTS
   ========================================================= */
.comments-section { margin-top: 40px; padding-top: 32px; border-top: 2px solid var(--color-border); }
.comments-title { font-size: 1.25rem; margin-bottom: 24px; }

.comment-list { margin-bottom: 32px; }
.comment { padding: 16px 0; border-bottom: 1px solid var(--color-border); }
.comment:last-child { border-bottom: none; }
.comment-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.comment-author-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-border);
  flex-shrink: 0;
}
.comment-author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.comment-author-name { font-weight: 600; font-size: 0.9rem; }
.comment-date { font-size: 0.8rem; color: var(--color-text-muted); }
.comment-body { font-size: 0.925rem; line-height: 1.6; color: var(--color-text-secondary); padding-left: 50px; }
.comment-reply-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--color-accent);
  font-weight: 600;
  padding-left: 50px;
}
.comment-reply-link:hover { color: var(--color-accent-hover); }

.children {
  padding-left: 50px;
  border-left: 2px solid var(--color-border);
  margin-top: 12px;
}

/* Comment form */
.comment-form-section { background: var(--color-bg-secondary); border-radius: var(--radius-md); padding: 24px; }
.comment-form-section h3 { font-size: 1.1rem; margin-bottom: 20px; }
.comment-form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 540px) { .form-row { grid-template-columns: 1fr; } }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.85rem; font-weight: 600; color: var(--color-text-secondary); }
.form-group input, .form-group textarea {
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-card);
  color: var(--color-text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition);
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--color-accent); }
.form-group textarea { resize: vertical; min-height: 100px; }
.btn-submit {
  align-self: flex-start;
  background: var(--color-accent);
  color: #fff;
  padding: 11px 28px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
  transition: background var(--transition);
}
.btn-submit:hover { background: var(--color-accent-hover); }

/* =========================================================
   SEARCH PAGE
   ========================================================= */
.search-header { padding: 28px 0 20px; border-bottom: 1px solid var(--color-border); margin-bottom: 28px; }
.search-query { font-size: 0.95rem; color: var(--color-text-secondary); margin-top: 8px; }
.search-query strong { color: var(--color-accent); }

.search-results-form { margin-bottom: 24px; }
.search-results-form .search-input-wrap {
  display: flex;
  gap: 8px;
  max-width: 520px;
}
.search-results-form input[type="search"] {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-card);
  color: var(--color-text);
  font-size: 0.95rem;
  outline: none;
}
.search-results-form input:focus { border-color: var(--color-accent); }
.search-results-form button {
  padding: 10px 20px;
  background: var(--color-accent);
  color: #fff;
  border-radius: var(--radius-md);
  font-weight: 600;
}
.search-results-form button:hover { background: var(--color-accent-hover); }

.no-results { text-align: center; padding: 60px 20px; }
.no-results h2 { margin-bottom: 12px; }
.no-results p { color: var(--color-text-secondary); }

/* =========================================================
   PAGINATION
   ========================================================= */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 32px 0;
  flex-wrap: wrap;
}
.pagination a, .pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  background: var(--color-bg-card);
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.pagination a:hover { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
.pagination .current { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }

/* =========================================================
   BREADCRUMBS
   ========================================================= */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  padding: 12px 0 0;
}
.breadcrumbs a { color: var(--color-text-secondary); }
.breadcrumbs a:hover { color: var(--color-accent); }
.breadcrumbs .separator { opacity: 0.5; }
.breadcrumbs .current { color: var(--color-text); }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  padding: 48px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-brand .site-logo a { color: #fff; font-size: 1.4rem; }
.footer-brand p {
  margin-top: 12px;
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--color-footer-text);
}
.footer-social {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.08);
  color: var(--color-footer-text);
  transition: background var(--transition), color var(--transition);
}
.footer-social a:hover { background: var(--color-accent); color: #fff; }

.footer-widget-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.footer-links li { margin-bottom: 8px; }
.footer-links a {
  color: var(--color-footer-text);
  font-size: 0.875rem;
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--color-accent); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.35);
  flex-wrap: wrap;
  gap: 8px;
}
.footer-bottom a { color: inherit; }
.footer-bottom a:hover { color: var(--color-accent); }

/* =========================================================
   MOBILE NAV OVERLAY
   ========================================================= */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--header-height);
  background: var(--color-header-bg);
  z-index: 998;
  overflow-y: auto;
  padding: 20px;
}
.mobile-nav.active { display: block; }
.mobile-nav ul { display: flex; flex-direction: column; gap: 4px; }
.mobile-nav ul li a {
  display: block;
  color: rgba(255,255,255,0.85);
  font-weight: 600;
  font-size: 1.1rem;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
.mobile-nav ul li a:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* =========================================================
   RESPONSIVE HELPERS
   ========================================================= */
@media (max-width: 900px) {
  .primary-nav { display: none; }
  .nav-toggle { display: flex; }
}

@media (max-width: 640px) {
  .hero-main-overlay { padding: 16px; }
  .hero-main h2 { font-size: 1.15rem; }
}

/* =========================================================
   UTILITY
   ========================================================= */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.text-muted { color: var(--color-text-muted); }
.text-accent { color: var(--color-accent); }

/* Scroll to top */
.scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
  z-index: 500;
}
.scroll-top.visible { opacity: 1; pointer-events: auto; }
.scroll-top:hover { transform: translateY(-2px); }

/* Progress bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--color-accent);
  z-index: 9999;
  width: 0%;
  transition: width 0.1s;
}

/* =========================================================
   ANIMATIONS
   ========================================================= */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp 0.45s ease forwards; }

/* Pulse on badge */
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(214, 48, 49, 0.4); }
  70%  { box-shadow: 0 0 0 8px rgba(214, 48, 49, 0); }
  100% { box-shadow: 0 0 0 0 rgba(214, 48, 49, 0); }
}
.breaking-label { animation: pulse 2s infinite; }
