:root {
  --bg-color: #ffffff;
  --text-color: #333333;
  --accent-color: #007acc;
  --border-color: #e0e0e0;
  --card-bg: #f8f9fa;
  --font-family-primary: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-family-secondary: 'Source Serif Pro', Georgia, serif;
  --bloqwot-bg: #d8d8d8;
  /* Если нужен шрифт с засечками */
}

[data-theme="dark"] {
  --bg-color: #1a1a1a;
  --text-color: #ffffff;
  --accent-color: #4da6ff;
  --border-color: #404040;
  --card-bg: #2d2d2d;
  --bloqwot-bg: #2d2d2d;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family-primary);
  font-size: 1rem;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
}

h1 {
  text-align: center;
}

h1,
h2,
h3,
h4 {
  color: var(--accent-color);
  margin: 1rem 0;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header & Navigation */
.header {
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.theme-btn {
  background: none;
  border: 1px solid var(--border-color);
  padding: 0.5rem;
  cursor: pointer;
  border-radius: 4px;
}

.theme-btn.active {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

/* Common elements */
img {
  max-width: 100%;
  height: auto;
}

p {
  margin: 2.5rem 0;
}

a {
  color: var(--accent-color);
  text-decoration: none;
}

/* Main content & Articles */
.main {
  display: grid;
  grid-template-columns: 1fr;
  column-gap: 4dvw;
  margin: 2rem 0;
}

aside{
  border-left: 1px solid var(--border-color);
  padding-left: 1rem;
}

ul{
  padding-left: 2rem;
}
.article_main {
  max-width: 1000px;
  margin: 0 auto;
}

.articles-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.article-card {
  background: var(--card-bg);
  /* border-radius: 8px; */
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  border: 1px solid var(--border-color);
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.article-preview {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.article-content {
  padding: 1.5rem;
  color: var(--text-color);
}

.article-title {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.article-description {
  opacity: 0.8;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.article-meta {
  display: flex;
  justify-content: space-evenly;
  font-size: 0.875rem;
  opacity: 0.7;
  max-width: 90vw;
  margin: 3rem auto 0.5rem;
}

.article-tags {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Modern blockquote with shadow */
blockquote {
  font-family: var(--font-family-secondary);
  font-style: italic;
  font-size: 1.1em;
  line-height: 1.7;
  margin: 2rem 0;
  padding: 2.5rem;
  background: var(--bloqwot-bg);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  position: relative;
  transition: transform 0.3s, box-shadow 0.3s;
}

blockquote:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: var(--accent-color);
}

blockquote::before {
  content: "“";
  font-family: var(--font-family-secondary);
  font-size: 4em;
  color: var(--accent-color);
  position: absolute;
  left: 1rem;
  top: 0.5rem;
  opacity: 0.3;
}

/* Строгие стили для списков в статьях */
.article-content ul {
  margin: 2rem 0;
  padding: 0;
  list-style: none;
}

.article-content li {
  margin-bottom: 1rem;
  padding: 1rem 1rem 1rem 2.5rem;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  position: relative;
  transition: border-color 0.3s ease;
}

.article-content li:hover {
  border-color: var(--accent-color);
}

.article-content li::before {
  content: "—";
  position: absolute;
  left: 1rem;
  top: 1rem;
  color: var(--accent-color);
  font-weight: 500;
}

.article-content li p {
  margin: 0;
  line-height: 1.6;
  color: var(--text-color);
  font-size: 0.95em;
}

.article-content li:last-child {
  margin-bottom: 0;
}

/* Альтернативный вариант с точками */
.article-content ul.dotted-list li::before {
  content: "•";
  color: var(--accent-color);
  font-size: 1.2em;
}

/* Для упорядоченных списков */
.article-content ol {
  margin: 2rem 0;
  padding: 0;
  list-style: none;
  counter-reset: list-counter;
}

.article-content ol li {
  margin-bottom: 1rem;
  padding: 1rem 1rem 1rem 3rem;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  position: relative;
  counter-increment: list-counter;
}

.article-content ol li::before {
  content: counter(list-counter);
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  background: var(--accent-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8em;
  font-weight: 600;
}

.article-content ol li p {
  margin: 0;
  line-height: 1.6;
  color: var(--text-color);
  font-size: 0.95em;
}

.pagination {
  padding: 1rem 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-color);
  transition: all 0.3s ease;
  flex: 1;
  max-width: 35%;
  margin-top: 2rem;
}

/* Pages */
.about-content,
.contacts-content,
.tags-page {
  max-width: 800px;
  margin: 0 auto;
}

.about-content h2,
.contacts-content h2 {
  margin: 2rem 0 1rem;
  color: var(--accent-color);
}

/* Tags */
.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tag {
  background: var(--accent-color);
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.tag:hover {
  background: var(--text-color);
  transform: translateY(-1px);
}

/* Search Modal */
.search-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 100px;
}

.search-container {
  display: flex;
  width: 90%;
  max-width: 600px;
  gap: 1rem;
}

#search-input {
  flex: 1;
  padding: 1rem;
  font-size: 1.2rem;
  border: none;
  border-radius: 8px;
  background: white;
  color: #333;
}

#search-close {
  background: white;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  padding: 0 1rem;
  border-radius: 8px;
  color: #333;
}

.hidden {
  display: none;
}

/* Search Results */
#search-results {
  max-height: 60vh;
  overflow-y: auto;
  margin-top: 1rem;
  background: var(--bg-color);
  border-radius: 8px;
  padding: 1rem;
  width: 90%;
  max-width: 600px;
}

.search-no-results {
  text-align: center;
  padding: 2rem;
  color: var(--text-color);
  opacity: 0.7;
}

.search-result {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.search-result:last-child {
  border-bottom: none;
}

.search-result h4 {
  margin: 0 0 0.5rem 0;
}

.search-result h4 a {
  color: var(--accent-color);
  text-decoration: none;
}

.search-result h4 a:hover {
  color: var(--accent-color);
}

.search-result-description {
  margin: 0 0 0.5rem 0;
  opacity: 0.8;
  font-size: 0.9rem;
}

.search-result-tags {
  font-size: 0.8rem;
  opacity: 0.7;
}

/* ===== МОБИЛЬНОЕ МЕНЮ ===== */

/* Кнопка бургер-меню */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--accent-color);
  border: none;
  cursor: pointer;
  z-index: 1001;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.3s ease;
}

/* Полоски бургера */
.mobile-menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: white;
  transition: all 0.3s ease;
  transform-origin: center;
}

/* Анимация бургера при активном состоянии */
.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: scale(0);
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Мобильное меню */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--bg-color);
  z-index: 1000;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 0;
  visibility: hidden;
}

.mobile-menu.active {
  transform: translateX(0);
  visibility: visible;
}

/* Шапка мобильного меню */
.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-color);
  position: sticky;
  top: 0;
  z-index: 1001;
}

.mobile-menu-brand a {
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--text-color);
  text-decoration: none;
}

.mobile-menu-close {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--text-color);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.3s;
}

.mobile-menu-close:hover {
  background: var(--border-color);
}

/* Навигационные ссылки */
.mobile-nav-links {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  gap: 0.5rem;
}

.mobile-nav-link {
  padding: 1rem 1.5rem;
  text-decoration: none;
  color: var(--text-color);
  border-radius: 8px;
  transition: all 0.3s ease;
  border: 1px solid transparent;
  font-size: 1.1rem;
  background: var(--card-bg);
}

.mobile-nav-link:hover {
  background: var(--accent-color);
  color: white;
  transform: translateX(5px);
}

/* Поиск в мобильном меню */
.mobile-search {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.mobile-search .search-container {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.mobile-search-input {
  flex: 1;
  padding: 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-color);
  color: var(--text-color);
  font-size: 1rem;
  transition: border-color 0.3s;
}

.mobile-search-input:focus {
  outline: none;
  border-color: var(--accent-color);
}

.mobile-search-button {
  padding: 0.875rem 1.25rem;
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 500;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mobile-search-button:hover {
  background: var(--text-color);
  transform: translateY(-1px);
}

/* Действия в мобильном меню */
.mobile-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  margin-top: auto;
  border-top: 1px solid var(--border-color);
}

/* Кнопка установки приложения */
.mobile-install-button {
  display: none;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #007acc, #4da6ff);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mobile-install-button:hover {
  background: linear-gradient(135deg, #0066b3, #3d8ce6);
  transform: translateY(-1px);
}

/* Кнопки темы в мобильном меню */
.mobile-theme-switcher {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-theme-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-color);
  font-size: 1rem;
}

.mobile-theme-btn:hover {
  background: var(--bg-color);
  border-color: var(--accent-color);
}

.mobile-theme-btn.active {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

/* Body lock when menu open */
body.menu-open {
  overflow: hidden;
}

/* Медиа-запрос для мобильных устройств */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex !important;
  }

  .nav-links,
  .nav-controls {
    display: none !important;
  }
}

/* На десктопе показываем обычную навигацию */
@media (min-width: 769px) {

  .nav-links,
  .nav-controls {
    display: flex !important;
  }

  .mobile-menu-toggle {
    display: none !important;
  }
}



/* Footer */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  margin-top: 2rem;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.footer-nav{
  margin-right: 1rem;
  display: flex;
  gap: 1rem;
}

/* Responsive Design */
@media (min-width: 768px) {
  .main {
    grid-template-columns: 3fr 1fr;
  }

  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-content {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 15px;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .nav-links,
  .nav-controls {
    display: none;
  }

  .logo {
    margin-right: 60px;
  }

  .article-preview {
    height: 150px;
  }

  .article-content {
    padding: 0.3rem;
  }

  /* Mobile search modal */
  .search-modal {
    padding-top: 80px;
  }

  .search-container {
    width: 95%;
  }

  #search-input {
    font-size: 1rem;
    padding: 0.8rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 10px;
  }

  .articles-grid {
    gap: 1rem;
  }

  .article-preview {
    height: 120px;
  }

  .article-tags {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    display: grid;
    gap: 5px;
  }


  .mobile-menu-toggle {
    top: 0.75rem;
    right: 0.75rem;
    width: 45px;
    height: 45px;
  }

  .mobile-menu {
    padding: 70px 1rem 1rem;
  }

  /* Mobile search adjustments */
  #search-input {
    font-size: 0.9rem;
    padding: 0.7rem;
  }

  #search-close {
    font-size: 1.5rem;
    padding: 0 0.8rem;
  }
}

/* Menu animations */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.mobile-nav-links a {
  animation: slideInLeft 0.3s ease forwards;
  opacity: 0;
}

.mobile-nav-links a:nth-child(1) {
  animation-delay: 0.1s;
}

.mobile-nav-links a:nth-child(2) {
  animation-delay: 0.15s;
}

.mobile-nav-links a:nth-child(3) {
  animation-delay: 0.2s;
}

.mobile-nav-links a:nth-child(4) {
  animation-delay: 0.25s;
}

/* Body lock when menu open */
body.menu-open {
  overflow: hidden;
}


/* ====== ПОДЕЛИТЬСЯ ====== */
.social-share__btn i {
  width: 20px;
  text-align: center;
  margin-bottom: 2rem;
}


/* ===== КРИТИЧЕСКИЕ СТИЛИ ДЛЯ СОДЕРЖАНИЯ СТАТЕЙ ===== */

/* Основной контент статьи */
.content {
    max-width: 100%;
    overflow-x: hidden;
}

/* Контейнер для контента внутри main */
.main .content {
    width: 100%;
    overflow-x: hidden;
}


/* Особенно для параграфов */
.article-content p {
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    line-height: 1.6;
    hyphens: auto;
}

/* Для заголовков */
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Для списков */
.article-content ul,
.article-content ol {
    max-width: 100%;
    overflow-wrap: break-word;
}

/* Для блоков кода */
.article-content pre {
    max-width: 100%;
    overflow-x: auto;
}

/* Для мобильных устройств - более агрессивные переносы */
@media (max-width: 768px) {
    .article-content {
        word-break: break-word;
    }
    
    .article-content p {
        word-break: break-word;
    }
    
    .content {
        padding: 0 0.3rem;
    }
}

/* Принудительное ограничение ВСЕГО контента */
.content * {
    max-width: 100% !important;
    box-sizing: border-box !important;
}




.reset-button {
    all: unset;
    background: none;
    border: none;
    padding: 0;
    margin: 0 2rem 0 0;
    font: inherit;
    cursor: pointer;
    display: inline-block;
}

.reset-button:focus {
    outline: none;
}


/* Стили для улучшенного поиска */
.search-short-query-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 8px 12px;
    margin: 10px 0;
    font-size: 0.9em;
    color: #856404;
}

.search-results-header {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.search-result {
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 12px;
    background: #fff;
    transition: all 0.2s ease;
}

.search-result:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

.search-result-title {
    margin: 0 0 8px 0;
    font-size: 1.1em;
}

.search-result-title a {
    color: #333;
    text-decoration: none;
}

.search-result-title a:hover {
    color: #007bff;
}

.search-result-description {
    color: #666;
    margin: 8px 0;
    font-size: 0.95em;
    line-height: 1.4;
}

.search-result-excerpt {
    color: #777;
    margin: 8px 0;
    font-size: 0.9em;
    line-height: 1.4;
    font-style: italic;
}

.search-result-tags {
    margin: 8px 0;
}

.search-tag {
    display: inline-block;
    background: #f8f9fa;
    color: #495057;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    margin-right: 6px;
    border: 1px solid #dee2e6;
}

.search-result-meta {
    font-size: 0.8em;
    color: #888;
    margin-top: 8px;
}

.search-result-meta span {
    margin-right: 12px;
}

mark {
    background-color: #fff3cd;
    color: #856404;
    padding: 1px 2px;
    border-radius: 2px;
}

.search-no-results {
    text-align: center;
    padding: 30px;
    color: #666;
}

.search-suggestions {
    margin: 15px 0 10px 0;
    font-size: 0.95em;
}

.search-suggestions-list {
    text-align: left;
    max-width: 300px;
    margin: 0 auto;
    font-size: 0.9em;
    color: #777;
}

.search-suggestions-list li {
    margin: 5px 0;
}

/* Стилизация стандартного audio элемента */
/* Продвинутый аудиоплеер */
.audio-player-advanced {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  margin: 2rem 0;
  font-family: var(--font-family-primary);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.audio-player-advanced::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-color), #4da6ff);
}

.audio-player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.audio-player-title {
  font-weight: 600;
  color: var(--text-color);
  font-size: 1.1rem;
  margin: 0;
}

.audio-player-duration {
  font-size: 0.875rem;
  color: var(--text-color);
  opacity: 0.7;
}

.audio-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.play-btn {
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.play-btn:hover {
  background: var(--text-color);
  transform: scale(1.05);
}

.progress-container {
  flex: 1;
  position: relative;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border-color);
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
}

.progress {
  height: 100%;
  background: var(--accent-color);
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s ease;
}

.volume-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.volume-btn {
  background: none;
  border: none;
  color: var(--text-color);
  cursor: pointer;
  font-size: 16px;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.volume-btn:hover {
  background: var(--border-color);
}

.volume-slider {
  width: 80px;
  height: 4px;
  background: var(--border-color);
  border-radius: 2px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: var(--accent-color);
  border-radius: 50%;
  cursor: pointer;
}

.time-display {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-color);
  opacity: 0.7;
  margin-top: 0.5rem;
}