/* ИнфоПортал 24 - Премиальный мобильный и десктопный дизайн */
:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #161f30;
  --bg-card: rgba(22, 31, 48, 0.85);
  --bg-card-hover: rgba(30, 41, 59, 0.95);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #00ADEF;
  --accent-hover: #0ea5e9;
  --accent-gold: #f59e0b;
  --border-color: rgba(255, 255, 255, 0.09);
  --border-hover: rgba(0, 173, 239, 0.5);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --max-w: 1220px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; transition: all 0.2s ease; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; }

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 16px;
}

/* ШАПКА САЙТА (HEADER) */
.header {
  background: rgba(11, 15, 25, 0.95);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 1px solid var(--border-color);
  width: 100%;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 12px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.22rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  flex-shrink: 0;
}
.logo span.logo-icon { font-size: 1.45rem; }
.logo span.logo-highlight {
  background: linear-gradient(135deg, #00ADEF 0%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* СТРОКА ПОИСКА */
.search-box-wrap {
  flex: 1;
  max-width: 480px;
  position: relative;
  min-width: 0;
}
.search-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 10px 16px 10px 40px;
  border-radius: 25px;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.25s ease;
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 173, 239, 0.25);
}
.search-icon-svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
  pointer-events: none;
}

/* КНОПКИ В ШАПКЕ */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.btn-nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(0, 173, 239, 0.15) 0%, rgba(56, 189, 248, 0.25) 100%);
  border: 1px solid rgba(0, 173, 239, 0.4);
  color: var(--accent);
  padding: 8px 13px;
  border-radius: 20px;
  font-size: 0.86rem;
  font-weight: 700;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-nav-toggle:hover {
  background: var(--accent);
  color: #fff;
}

/* БЛОК АККОРДЕОНА КАТЕГОРИЙ (БЕЗ ГОРИЗОНТАЛЬНОГО СКРОЛЛА) */
.categories-panel {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 0 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  width: 100%;
}
.cat-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}
.cat-panel-title {
  font-size: 0.92rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
}
.cat-panel-btn-close {
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 12px;
}
.cat-panel-btn-close:hover { color: #fff; border-color: var(--accent); }

/* СЕТКА 20 РАЗДЕЛОВ (2-4 КОЛОНКИ, ПОЛНОСТЬЮ ВИДНЫЕ) */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
}
.cat-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(11, 15, 25, 0.6);
  border: 1px solid var(--border-color);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-height: 44px;
  min-width: 0;
  transition: all 0.2s ease;
}
.cat-btn:hover, .cat-btn.is-active {
  background: rgba(0, 173, 239, 0.15);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-2px);
}
.cat-btn-icon { font-size: 1.1rem; flex-shrink: 0; }
.cat-btn-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ГЛАВНЫЙ ЭКРАН (HERO) */
.hero-box {
  padding: 24px 0 16px;
  text-align: center;
  width: 100%;
}
.hero-title {
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 8px;
  color: #fff;
}
.hero-subtitle {
  font-size: 0.98rem;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto;
}

/* СЕТКА СТАТЕЙ */
.section-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 24px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  width: 100%;
}
.section-header-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
  width: 100%;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  min-width: 0;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}
.card-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #111827;
  overflow: hidden;
  width: 100%;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.card:hover .card-thumb img { transform: scale(1.04); }
.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(11, 15, 25, 0.88);
  backdrop-filter: blur(6px);
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid rgba(0, 173, 239, 0.4);
  max-width: 90%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.card-title {
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
  color: #fff;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.card:hover .card-title { color: var(--accent); }
.card-snippet {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
  word-wrap: break-word;
}
.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  padding-top: 10px;
}

/* ХЛЕБНЫЕ КРОШКИ В СТИЛЕ ТОРРЕНТ-ПОРТАЛА */
.breadcrumbs-bar {
  background: var(--bg-secondary);
  border-left: 4px solid var(--accent);
  padding: 10px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 18px 0;
  font-size: 0.86rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}
.breadcrumbs-bar a { color: var(--text-primary); font-weight: 600; }
.breadcrumbs-bar a:hover { color: var(--accent); }

/* СТРАНИЦА СТАТЬИ */
.article-wrap {
  max-width: 820px;
  width: 100%;
  margin: 0 auto 40px;
  min-width: 0;
}
.article-header { margin-bottom: 20px; }
.article-title {
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1.3;
  color: #fff;
  margin-bottom: 12px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.article-meta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.86rem;
  color: var(--text-muted);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}
.article-cover-box {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 20px 0 25px;
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.article-body {
  font-size: 1.08rem;
  line-height: 1.8;
  color: #e2e8f0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.article-body h2 {
  font-size: 1.55rem;
  font-weight: 700;
  color: #fff;
  margin: 32px 0 14px;
  border-left: 4px solid var(--accent);
  padding-left: 12px;
  word-wrap: break-word;
}
.article-body p { margin-bottom: 18px; }
.article-body ul, .article-body ol { margin: 16px 0 20px 24px; }
.article-body li { margin-bottom: 8px; }
.article-body blockquote {
  background: rgba(0, 173, 239, 0.08);
  border-left: 4px solid var(--accent);
  padding: 14px 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  margin: 20px 0;
}

/* ВИДЖЕТ СОЦСЕТЕЙ И ПЕРЕХОДОВ */
.social-action-box {
  background: linear-gradient(135deg, rgba(22, 31, 48, 0.95) 0%, rgba(11, 15, 25, 0.98) 100%);
  border: 1px solid rgba(0, 173, 239, 0.35);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 35px 0;
  text-align: center;
  width: 100%;
}
.social-action-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 6px; }
.social-action-desc { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 18px; }
.social-buttons-flex {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 25px;
  font-size: 0.92rem;
  font-weight: 700;
  min-height: 46px;
  transition: all 0.2s ease;
}
.btn-tg { background: #229ED9; color: #fff; }
.btn-tg:hover { background: #1a8cc4; transform: translateY(-2px); }
.btn-vk { background: #4C75A3; color: #fff; }
.btn-vk:hover { background: #3c5e85; transform: translateY(-2px); }
.btn-dzen { background: #fc3f1d; color: #fff; }
.btn-dzen:hover { background: #e03212; transform: translateY(-2px); }

/* ПЛАВАЮЩИЕ КНОПКИ (SCROLL TO TOP & COPY) */
.floating-tools {
  position: fixed;
  bottom: 24px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 999;
}
.btn-floating {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
  font-size: 1.1rem;
  transition: all 0.2s ease;
}
.btn-floating:hover {
  background: var(--accent);
  transform: scale(1.1);
}

/* ФУТЕР */
.footer {
  margin-top: auto;
  background: #060911;
  border-top: 1px solid var(--border-color);
  padding: 30px 0 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
  width: 100%;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

/* АДАПТИВНОСТЬ ПОД МОБИЛЬНЫЕ УСТРОЙСТВА */
@media (max-width: 1024px) {
  .categories-grid { grid-template-columns: repeat(3, 1fr); }
  .articles-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .header-inner { height: 56px; }
  .logo { font-size: 1.05rem; }
  .hero-title { font-size: 1.6rem; }
  .article-title { font-size: 1.5rem; }
  .categories-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .cat-btn { font-size: 0.76rem; padding: 7px 8px; min-height: 38px; }
  .articles-grid { grid-template-columns: 1fr; gap: 16px; }
  .search-box-wrap { display: none; }
  .search-box-wrap.is-mobile-open {
    display: block;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    max-width: 100%;
    z-index: 199;
  }
  .social-buttons-flex { flex-direction: column; }
  .btn-cta { width: 100%; }
}
