/*
Theme Name:  TaskHub Child
Theme URI:   https://taskhub.local
Description: Дочерняя тема для TaskHub на базе GeneratePress
Author:      TaskHub
Author URI:  https://taskhub.local
Template:    generatepress
Version:     1.1.0
License:     GNU General Public License v2 or later
Text Domain: taskhub-child
*/

/* ============================================================
   CSS ПЕРЕМЕННЫЕ — меняй здесь, меняется везде
   ============================================================ */
:root {
  /* База бренда */
  --th-blue:        #2A5BDB;
  --th-blue-light:  #EEF2FF;
  --th-blue-dark:   #1E43B0;

  /* Расширенная палитра (для градиентов и категорий) */
  --th-indigo:      #4F46E5;
  --th-violet:      #7C3AED;
  --th-cyan:        #06B6D4;
  --th-emerald:     #10B981;
  --th-amber:       #F59E0B;
  --th-rose:        #EC4899;

  /* Текст и фон */
  --th-text:        #0F172A;
  --th-text-muted:  #64748B;
  --th-text-light:  #94A3B8;

  --th-bg:          #FFFFFF;
  --th-bg-soft:     #F7F9FC;
  --th-border:      #E8ECF4;

  --th-radius:      10px;
  --th-radius-lg:   16px;

  /* Градиенты */
  --th-grad-brand:  linear-gradient(135deg, #2A5BDB 0%, #6D3BEB 100%);
  --th-grad-cta:    linear-gradient(135deg, #3B6BFF 0%, #8B5CF6 100%);
  --th-grad-soft:   linear-gradient(135deg, #EEF2FF 0%, #F5F0FF 100%);

  --th-font:        'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --th-shadow:      0 10px 30px -12px rgba(31,67,176,0.25);
  --th-shadow-sm:   0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
}

/* ============================================================
   ТИПОГРАФИКА
   ============================================================ */
body {
  font-family: var(--th-font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--th-text);
  background: var(--th-bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--th-text);
  margin-top: 0;
}

h1 { font-size: 2.1rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.2rem; }

p { margin-top: 0; color: var(--th-text-muted); }

a {
  color: var(--th-blue);
  text-decoration: none;
  transition: color 0.15s;
}
a:hover { text-decoration: underline; }

/* Текст с градиентной заливкой — добавь класс "th-grad-text" */
.th-grad-text {
  background: var(--th-grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Видимый фокус с клавиатуры (доступность) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--th-violet);
  outline-offset: 2px;
}

/* ============================================================
   ХЕДЕР
   ============================================================ */
.site-header {
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--th-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px -8px rgba(15,23,42,0.12);
}

.site-header .inside-header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
}

/* Логотип текстовый */
.site-header .site-title a {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--th-text) !important;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 9px;
}

.site-header .site-title a::before {
  content: 'T';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--th-grad-brand);
  color: #fff;
  border-radius: 9px;
  font-size: 16px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 8px 18px -6px rgba(99,102,241,0.55);
}

/* Навигация */
.main-navigation .main-nav ul {
  display: flex;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

.main-navigation .main-nav ul li a {
  display: block;
  padding: 8px 15px;
  font-size: 14px;
  font-weight: 600;
  color: var(--th-text-muted);
  border-radius: var(--th-radius);
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}

.main-navigation .main-nav ul li a:hover,
.main-navigation .main-nav ul li.current-menu-item > a {
  background: var(--th-grad-soft);
  color: var(--th-blue-dark);
}

/* Кнопка CTA: добавь CSS-класс "header-cta" пункту меню */
.main-navigation .main-nav ul li.header-cta > a {
  background: var(--th-grad-cta);
  color: #ffffff !important;
  padding: 9px 20px;
  border-radius: var(--th-radius);
  font-weight: 700;
  margin-left: 8px;
  box-shadow: 0 10px 24px -10px rgba(99,102,241,0.65);
  transition: transform 0.2s cubic-bezier(.22,1,.36,1), box-shadow 0.2s;
}
.main-navigation .main-nav ul li.header-cta > a:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -10px rgba(99,102,241,0.8);
}

/* Мобильный бургер */
.menu-toggle,
button.menu-toggle {
  background: transparent;
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius);
  padding: 6px 12px;
  cursor: pointer;
  color: var(--th-text);
  font-size: 18px;
  transition: border-color 0.15s, color 0.15s;
}
.menu-toggle:hover {
  border-color: var(--th-violet);
  color: var(--th-violet);
}

/* ============================================================
   КОНТЕНТ
   ============================================================ */
.site-content {
  min-height: calc(100vh - 66px - 220px);
}

/* ============================================================
   ФУТЕР
   ============================================================ */
.site-footer {
  position: relative;
  background: linear-gradient(180deg, #FFFFFF 0%, var(--th-bg-soft) 100%);
  border-top: 1px solid var(--th-border);
  margin-top: 80px;
}
/* Тонкая градиентная линия сверху футера */
.site-footer::before {
  content: '';
  position: absolute;
  top: -1px; left: 0; right: 0;
  height: 3px;
  background: var(--th-grad-cta);
  opacity: 0.9;
}

.site-footer .inside-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 24px 24px;
}

/* Нижняя строка копирайта */
.site-footer .copyright-bar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  border-top: 1px solid var(--th-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--th-text-light);
  background: none;
}

/* ============================================================
   КНОПКИ
   ============================================================ */
.btn,
.button,
input[type="submit"],
button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 24px;
  border-radius: var(--th-radius);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(.22,1,.36,1), box-shadow 0.2s, background 0.15s, color 0.15s;
  text-decoration: none;
  border: 1px solid transparent;
  line-height: 1.4;
}

.btn-primary,
input[type="submit"],
button[type="submit"] {
  background: var(--th-grad-cta);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 12px 28px -12px rgba(99,102,241,0.6);
}
.btn-primary:hover,
input[type="submit"]:hover,
button[type="submit"]:hover {
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 18px 36px -12px rgba(99,102,241,0.75);
}

.btn-outline {
  background: #fff;
  color: var(--th-blue-dark);
  border-color: var(--th-border);
}
.btn-outline:hover {
  background: var(--th-grad-soft);
  border-color: transparent;
  text-decoration: none;
  transform: translateY(-2px);
}

/* ============================================================
   КАРТОЧКИ
   ============================================================ */
.th-card {
  position: relative;
  overflow: hidden;
  background: var(--th-bg);
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius-lg);
  padding: 22px;
  transition: transform 0.25s cubic-bezier(.22,1,.36,1), box-shadow 0.25s, border-color 0.25s;
}
.th-card:hover {
  transform: translateY(-5px);
  border-color: transparent;
  box-shadow: 0 22px 40px -18px rgba(15,23,42,0.25);
}
/* Верхний градиентный акцент — добавь класс "th-card--accent" */
.th-card--accent::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--th-grad-brand);
}

/* ============================================================
   БЕЙДЖИ КАТЕГОРИЙ — градиентная заливка
   ============================================================ */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 30px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #fff;
}
.badge-blue   { background: linear-gradient(135deg, #3B6BFF, #6D3BEB); }
.badge-green  { background: linear-gradient(135deg, #10B981, #06B6D4); }
.badge-orange { background: linear-gradient(135deg, #F59E0B, #EC4899); }
.badge-purple { background: linear-gradient(135deg, #7C3AED, #EC4899); }

/* Мягкие бейджи (если нужна тихая версия) — класс "badge--soft" */
.badge--soft.badge-blue   { background: #EEF2FF; color: #1E43B0; }
.badge--soft.badge-green  { background: #ECFDF5; color: #047857; }
.badge--soft.badge-orange { background: #FFF7ED; color: #C2410C; }
.badge--soft.badge-purple { background: #FAF5FF; color: #7E22CE; }

/* ============================================================
   ПОЯВЛЕНИЕ ПО СКРОЛЛУ (утилита для всего сайта)
   Навешивается JS из functions.php. Без JS — всё видно сразу.
   ============================================================ */
[data-rv] { opacity: 1; }
html.thx-js [data-rv] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .8s cubic-bezier(.22,1,.36,1), transform .8s cubic-bezier(.22,1,.36,1);
  transition-delay: calc(var(--d, 0) * 90ms);
}
html.thx-js [data-rv].thx-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html.thx-js [data-rv] { opacity: 1 !important; transform: none !important; transition: none !important; }
  .btn, .th-card, .header-cta > a { transition: none !important; }
}

/* ============================================================
   АДАПТИВ
   ============================================================ */
@media (max-width: 768px) {
  .site-header .inside-header {
    min-height: 58px;
    padding: 0 16px;
  }

  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }

  .site-footer .inside-footer {
    padding: 36px 16px 16px;
  }

  .site-footer .copyright-bar {
    flex-direction: column;
    gap: 8px;
    text-align: center;
    padding: 16px;
  }
}
