/* ============================================================
   NDS04ka Theme — главный файл стилей
   Цветовая схема: оранжевый акцент, тёмно-серые блоки, белый фон
   ============================================================ */

/* ---------- CSS-переменные (цвета и размеры) ---------- */
:root {
  --accent:        #FF6600;
  --accent-hover:  #E05500;
  --accent-light:  #FFF3E8;
  --dark:          #2D2D2D;
  --dark-2:        #3A3A3A;
  --text:          #1A1A1A;
  --text-muted:    #6B6B6B;
  --bg:            #FFFFFF;
  --bg-light:      #F7F7F7;
  --bg-dark:       #2D2D2D;
  --border:        #E5E5E5;
  --yellow:        #FFD600;
  --radius:        10px;
  --radius-sm:     6px;
  --shadow:        0 2px 12px rgba(0,0,0,.08);
  --shadow-hover:  0 6px 24px rgba(0,0,0,.14);
  --transition:    .22s ease;
  --font:          'Inter', 'Segoe UI', Arial, sans-serif;
  --container:     1200px;
}

/* ---------- Сброс и база ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }
h1,h2,h3,h4,h5,h6 { line-height: 1.3; font-weight: 700; }

/* ---------- Контейнер ---------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================================
   ШАПКА (header.php)
   ============================================================ */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
}
.header-container {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

/* Логотип */
.site-branding { flex-shrink: 0; }
.site-title { font-size: 1.4rem; }
.site-title a { color: var(--text); font-weight: 800; }
.site-title a:hover { color: var(--accent); }
.custom-logo { height: 44px; width: auto; }

/* Навигация */
.main-navigation { flex: 1; }
.main-navigation ul {
  display: flex;
  gap: 6px;
}
.main-navigation ul li a {
  color: var(--text);
  font-size: .95rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
.main-navigation ul li a:hover,
.main-navigation ul li.current-menu-item > a {
  background: var(--bg-light);
  color: var(--accent);
}

/* Кнопка CTA в шапке */
.header-cta { flex-shrink: 0; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-hover); }
.btn:active { transform: translateY(0); }

/* Основная CTA (чёрная с жёлтым) */
.btn-primary {
  background: var(--dark);
  color: var(--yellow);
}
.btn-primary:hover { background: #111; color: var(--yellow); }

/* Акцентная (оранжевая) */
.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover { background: var(--accent-hover); color: #fff; }

/* Контурная */
.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}
.btn-outline:hover { background: var(--accent); color: #fff; }

/* Интенсивы */
.btn-intensives {
  background: var(--dark);
  color: var(--yellow);
  width: 100%;
  justify-content: center;
  margin-top: 12px;
}
.btn-intensives:hover { background: #111; color: var(--yellow); }

/* SOS */
.btn-sos {
  background: var(--accent);
  color: #fff;
  width: 100%;
  justify-content: center;
  margin-top: 10px;
}
.btn-sos:hover { background: var(--accent-hover); color: #fff; }

/* ============================================================
   БАННЕР
   ============================================================ */
.site-banner {
  background: var(--bg-dark);
  padding: 44px 0;
  position: relative;
  overflow: hidden;
}

/* Декоративные полупрозрачные линии на фоне */
.site-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 40px,
      rgba(255,255,255,.03) 40px,
      rgba(255,255,255,.03) 41px
    );
  pointer-events: none;
}

.banner-inner {
  display: flex;
  align-items: center;
  gap: 40px;
}
.banner-text { flex: 1; }
.banner-tag {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 14px;
}
.banner-title {
  font-size: clamp(1.3rem, 3vw, 2rem);
  color: #fff;
  margin-bottom: 12px;
}
.banner-desc {
  color: rgba(255,255,255,.72);
  font-size: .97rem;
  margin-bottom: 22px;
  max-width: 480px;
}

/* Персонаж-маскот */
.banner-figure { flex-shrink: 0; }
.banner-mascot {
  width: 96px;
  height: 96px;
  background: var(--accent);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: mascot-float 3s ease-in-out infinite;
}
.mascot-icon {
  font-size: 3rem;
  color: #fff;
  font-weight: 900;
  line-height: 1;
  user-select: none;
}

@keyframes mascot-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

/* ============================================================
   СТРОКА ПОИСКА (только мобиль)
   ============================================================ */
.search-mobile-bar {
  display: none;
  padding: 14px 0;
  background: var(--bg-light);
  border-bottom: 1px solid var(--border);
}

/* ---------- Форма поиска ---------- */
.search-form {
  display: flex;
  gap: 0;
}
.search-field {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  font-size: .9rem;
  outline: none;
  transition: border-color var(--transition);
}
.search-field:focus { border-color: var(--accent); }
.search-submit {
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
  transition: background var(--transition);
}
.search-submit:hover { background: var(--accent-hover); }

/* ============================================================
   ОСНОВНАЯ СЕТКА: САЙДБАР + СТАТЬИ
   ============================================================ */
.layout-wrap {
  padding-top: 36px;
  padding-bottom: 48px;
}
.layout-main {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  align-items: start;
}

/* ============================================================
   САЙДБАР
   ============================================================ */
.sidebar { display: flex; flex-direction: column; gap: 20px; }

/* Базовый виджет */
.widget {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.widget-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text);
}

/* Рубрики */
.category-list li + li { margin-top: 2px; }
.category-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
  font-size: .9rem;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
.category-list a:hover { background: var(--accent-light); color: var(--accent); }
.cat-count {
  font-size: .78rem;
  color: var(--text-muted);
  background: var(--bg-light);
  padding: 2px 7px;
  border-radius: 20px;
}

/* Интенсивы */
.widget-intensives {
  background: var(--bg-dark);
  border-color: transparent;
  color: #fff;
}
.widget-intensives .widget-title { color: #fff; margin-bottom: 6px; }
.intensives-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.intensives-icon { font-size: 1.2rem; }
.intensives-desc { font-size: .83rem; color: rgba(255,255,255,.65); margin-bottom: 14px; }
.intensives-list { display: flex; flex-direction: column; gap: 8px; }
.intensives-list a {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: rgba(255,255,255,.88);
  font-size: .88rem;
  line-height: 1.4;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.07);
  transition: background var(--transition), color var(--transition);
}
.intensives-list a:hover { background: rgba(255,255,255,.15); color: #fff; }
.intensive-num {
  flex-shrink: 0;
  font-size: .72rem;
  font-weight: 700;
  color: var(--yellow);
  background: rgba(255,214,0,.15);
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 1px;
}

/* SOS-чат */
.widget-sos {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}
.sos-inner { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.sos-icon { font-size: 1.8rem; margin-bottom: 2px; }
.widget-sos .widget-title { color: #fff; margin-bottom: 0; }
.sos-desc { font-size: .85rem; color: rgba(255,255,255,.85); }
.btn-sos { background: #fff; color: var(--accent); }
.btn-sos:hover { background: var(--yellow); color: var(--dark); }

/* ============================================================
   СЕТКА СТАТЕЙ
   ============================================================ */
.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
  position: relative;
  padding-bottom: 10px;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 40px; height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

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

/* Карточка статьи */
.post-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition), transform var(--transition);
}
.post-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.post-card__thumb { display: block; overflow: hidden; }
.post-card__thumb img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  transition: transform .4s ease;
}
.post-card:hover .post-card__thumb img { transform: scale(1.04); }

.post-card__body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}

/* Теги-рубрики */
.post-card__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.post-tag {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--accent);
  background: var(--accent-light);
  padding: 3px 9px;
  border-radius: 20px;
  transition: background var(--transition), color var(--transition);
}
.post-tag:hover { background: var(--accent); color: #fff; }

.post-card__title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
}
.post-card__title a { color: var(--text); }
.post-card__title a:hover { color: var(--accent); }

.post-card__excerpt { font-size: .88rem; color: var(--text-muted); flex: 1; }

.post-card__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .8rem;
  color: var(--text-muted);
}

.post-card__link {
  font-size: .85rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: auto;
}
.post-card__link:hover { color: var(--accent-hover); }

/* Кнопка «Все статьи» */
.posts-more-wrap {
  margin-top: 28px;
  display: flex;
  justify-content: center;
}

/* Нет статей */
.no-posts {
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-light);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

/* ============================================================
   ПОДВАЛ (footer.php)
   ============================================================ */
.site-footer {
  background: var(--bg-dark);
  color: rgba(255,255,255,.8);
  padding: 48px 0 24px;
  position: relative;
  overflow: hidden;
}

/* Декоративные линии в подвале */
.site-footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 60px,
      rgba(255,255,255,.02) 60px,
      rgba(255,255,255,.02) 61px
    );
  pointer-events: none;
}

.footer-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  position: relative;
}

.footer-left { display: flex; flex-direction: column; gap: 12px; }

.footer-logo a { color: #fff; font-size: 1.3rem; font-weight: 800; }
.footer-logo .custom-logo { filter: brightness(0) invert(1); height: 36px; }

.footer-description p { font-size: .9rem; color: rgba(255,255,255,.6); line-height: 1.6; }

.site-info p { font-size: .8rem; color: rgba(255,255,255,.4); margin-top: 8px; }

.footer-right {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-content: start;
}

/* Виджеты в подвале */
.footer-widget-area .widget-title {
  color: rgba(255,255,255,.9);
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 12px;
}
.footer-widget-area a { color: rgba(255,255,255,.6); font-size: .88rem; display: block; margin-bottom: 6px; }
.footer-widget-area a:hover { color: #fff; }

/* ============================================================
   СТРАНИЦА СТАТЬИ (single.php / page.php)
   ============================================================ */
.single-layout,
.page-layout {
  max-width: 780px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}
.entry-header { margin-bottom: 28px; }
.entry-title { font-size: clamp(1.5rem, 4vw, 2.2rem); margin-bottom: 12px; }
.entry-meta { font-size: .85rem; color: var(--text-muted); display: flex; gap: 16px; flex-wrap: wrap; }
.entry-content { font-size: 1rem; line-height: 1.8; color: var(--text); }
.entry-content p { margin-bottom: 1.2em; }
.entry-content h2 { font-size: 1.4rem; margin: 2em 0 .7em; }
.entry-content h3 { font-size: 1.15rem; margin: 1.6em 0 .6em; }
.entry-content ul, .entry-content ol { padding-left: 1.6em; margin-bottom: 1.2em; }
.entry-content li { margin-bottom: .4em; }
.entry-content blockquote {
  border-left: 4px solid var(--accent);
  padding: 12px 20px;
  background: var(--accent-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.4em 0;
  color: var(--dark);
}
.entry-content code {
  background: var(--bg-light);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: .9em;
}
.entry-content pre {
  background: var(--bg-dark);
  color: rgba(255,255,255,.9);
  padding: 18px 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 1.2em;
}

/* Комментарии */
.comments-area { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border); }
.comments-title { font-size: 1.1rem; margin-bottom: 20px; }

/* ============================================================
   ПОИСК, АРХИВ, 404
   ============================================================ */
.archive-layout,
.search-layout,
.error-404-layout {
  padding: 40px 20px 60px;
  max-width: var(--container);
  margin: 0 auto;
}
.page-title { font-size: 1.6rem; margin-bottom: 24px; }
.not-found .page-title { font-size: 5rem; color: var(--accent); }

/* ============================================================
   МОБИЛЬНОЕ МЕНЮ (гамбургер)
   ============================================================ */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 4px;
  background: none;
  border: none;
  cursor: pointer;
  order: 3;
}
.mobile-menu-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .22s, opacity .22s;
}
.mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-header.is-scrolled { box-shadow: 0 2px 16px rgba(0,0,0,.12); }

@media (max-width: 767px) {
  .mobile-menu-toggle { display: flex; }
  .main-navigation {
    display: none;
    position: absolute;
    top: 56px; left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 20px rgba(0,0,0,.1);
    padding: 10px 0;
    z-index: 99;
  }
  .main-navigation.is-open { display: block; }
  .main-navigation ul { flex-direction: column; gap: 0; }
  .main-navigation ul li a { border-radius: 0; padding: 12px 20px; }
}

/* ============================================================
   АНИМАЦИИ ПОЯВЛЕНИЯ (js добавляет класс .is-visible)
   ============================================================ */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .5s ease, transform .5s ease;
}
.fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   АДАПТИВ — планшет (< 1024px)
   ============================================================ */
@media (max-width: 1023px) {
  .layout-main {
    grid-template-columns: 240px 1fr;
    gap: 20px;
  }
  .posts-grid {
    grid-template-columns: 1fr;
  }
  .footer-container {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .footer-right {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============================================================
   АДАПТИВ — мобиль (< 768px)
   ============================================================ */
@media (max-width: 767px) {
  /* Шапка */
  .header-container { gap: 12px; height: 56px; }
  .main-navigation { display: none; }
  .header-cta .btn-primary { padding: 8px 14px; font-size: .82rem; }

  /* Баннер */
  .site-banner { padding: 28px 0; }
  .banner-inner { flex-direction: column; gap: 20px; text-align: center; }
  .banner-mascot { width: 72px; height: 72px; margin: 0 auto; }
  .mascot-icon { font-size: 2.2rem; }
  .banner-desc { max-width: 100%; }

  /* Мобильный поиск */
  .search-mobile-bar { display: block; }
  .widget-search { display: none; }

  /* Колонки → одна колонка */
  .layout-main { grid-template-columns: 1fr; }
  .sidebar { order: 2; }
  .posts-area { order: 1; }

  /* Подвал */
  .footer-right { grid-template-columns: 1fr; }
}

/* ============================================================
   УТИЛИТЫ
   ============================================================ */
.screen-reader-text {
  clip: rect(1px,1px,1px,1px);
  clip-path: inset(50%);
  height: 1px; width: 1px;
  overflow: hidden; white-space: nowrap;
  position: absolute;
}
.screen-reader-text:focus {
  clip: auto; clip-path: none;
  width: auto; height: auto;
  position: static;
  background: var(--bg);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: rgba(255,255,255,.8);
  text-decoration: none;
  font-size: .9rem;
  border-bottom: 1px dashed rgba(255,255,255,.25);
  width: fit-content;
}

.footer-links a:hover {
  color: #fff;
  border-bottom-color: rgba(255,255,255,.55);
}