/* EduДом - Основные стили */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f8fb;
  --card: #ffffff;
  --text: #0f172a; /* slate-900 */
  --muted: #475569; /* slate-600 */
  --line: #e2e8f0; /* slate-200 */
  --primary: #2563eb; /* blue-600 */
  --primary-700: #1d4ed8;
  --accent: #f59e0b; /* amber-500 */
  --accent-600: #d97706;
  --success: #10b981; /* emerald-500 */
  --chip: #eef2ff; /* indigo-50 */
  --chip-text: #3730a3; /* indigo-800 */
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius: 16px;
  /* secondary button tokens */
  --btn-secondary-bg: transparent;
  --btn-secondary-text: #1F2937;
  --btn-secondary-border: #1F2937;
  --btn-secondary-bg-hover: #1F2937;
  --btn-secondary-text-hover: #ffffff;
}

[data-theme="dark"] {
  --bg: #0b1020;
  --bg-soft: #0f172a;
  --card: #0f172a;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --line: #1f2937;
  --primary: #60a5fa;
  --primary-700: #3b82f6;
  --accent: #fbbf24;
  --accent-600: #f59e0b;
  --chip: #111827;
  --chip-text: #c7d2fe;
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
  /* secondary button tokens (dark) */
  --btn-secondary-bg: rgba(255,255,255,0.08);
  --btn-secondary-text: #ffffff;
  --btn-secondary-border: rgba(255,255,255,0.4);
  --btn-secondary-bg-hover: #ffffff;
  --btn-secondary-text-hover: #0B1220;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; overflow-x: hidden; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { width: min(1200px, 100% - 32px); margin: 0 auto; }

/* Основной контейнер */
main {
  min-height: calc(100vh - 200px);
  padding-bottom: 20px;
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 2000;
  pointer-events: auto;
  backdrop-filter: saturate(120%) blur(10px);
  background: color-mix(in oklab, var(--bg) 90%, transparent);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.3s ease;
}
.nav, .nav *, header a { pointer-events: auto; }

body.admin-bar header { top: 32px; }
@media (max-width: 782px) {
  body.admin-bar header { top: 46px; }
}
.nav { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.brand { display:flex; align-items:center; gap:12px; font-weight: 800; letter-spacing: .3px; }
.logo {
  width: 40px; height: 40px; border-radius: 12px; display:grid; place-items:center;
  background: radial-gradient(120px 60px at 20% 10%, #60a5fa 0%, transparent 60%),
              radial-gradient(120px 60px at 80% 90%, #fbbf24 0%, transparent 60%),
              linear-gradient(135deg, #22d3ee, #6366f1);
  color:#fff; font-family: Nunito, Inter, system-ui; font-size: 20px; box-shadow: var(--shadow);
}
.nav ul { display:flex; gap: 18px; list-style:none; margin:0; padding:0; }
.nav a { color: var(--muted); font-weight: 500; }
.nav a:hover { color: var(--text); }

/* Скрываем пункт меню «Платформы» в главной навигации (быстро и безопасно) */
.nav a[href*="/platforms/"] { display: none !important; }

.actions { display:flex; align-items:center; gap:10px; }
.btn { display:inline-flex; align-items:center; gap:10px; border:1px solid var(--line); background: var(--card);
       padding:10px 14px; border-radius: 12px; font-weight:600; box-shadow: var(--shadow); cursor: pointer; }
.btn:hover{ transform: translateY(-1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color:#fff; }
.btn-primary:hover { background: var(--primary-700); }
.icon { width: 18px; height: 18px; display:inline-block; }

/* Secondary button ("Свежие статьи") */
.btn-secondary {
  display:inline-block;
  padding: 12px 20px;
  border-radius: 12px;
  border: 2px solid var(--btn-secondary-border);
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
  font-weight: 700;
  line-height: 1;
  transition: color .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: var(--btn-secondary-bg-hover);
  color: var(--btn-secondary-text-hover);
  border-color: var(--btn-secondary-bg-hover);
  box-shadow: 0 0 0 3px rgba(59,130,246,.3);
  text-decoration: none;
  outline: none;
}
.btn-secondary:focus { outline: none; }

/* Hero secondary -> make it primary (конкретный id) */
#btn-latest {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 20px;
  border-radius: 12px;
  font-weight: 600;
  background: var(--primary) !important;
  color: #fff !important;
  border: 1px solid var(--primary) !important;
  transition: background .2s, border-color .2s, color .2s, box-shadow .2s;
}
#btn-latest:hover,
#btn-latest:focus-visible {
  background: var(--primary-700) !important;
  border-color: var(--primary-700) !important;
  color: #fff !important;
  box-shadow: 0 6px 24px rgba(29, 78, 216, .3);
}
[data-theme="dark"] #btn-latest {
  background: var(--primary);
  border-color: var(--primary);
}

/* Скрыть кнопку "Свежие статьи" только на архиве гайдов */
body.post-type-archive-guide #btn-latest { display: none !important; }
[data-theme="dark"] #btn-latest {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Поднимаем хедер над hero, чтобы ссылки кликабельно работали */
header, .site-header, .header { position: sticky; z-index: 60; }
.hero, .hero:before, .hero:after { position: relative; z-index: 1; }
.site-header a { pointer-events: auto; }

/* --- Fix header clickability over hero (safety) --- */
.site-header, header.site-header, .header, header { position: relative; z-index: 2000; }
.hero::before,
.hero::after,
.hero .hero__overlay,
.hero .hero-overlay,
.hero .search-overlay { pointer-events: none !important; }
.hero .search-wrap input,
.hero .search-wrap button,
.hero .search { pointer-events: auto; }
.hero { position: relative; z-index: 1; }

/* Пробиваем кликабельность ссылки на архив "Гайды" в главной навигации */
.main-nav a[href*="/guides"],
.menu a[href*="/guides"],
.nav a[href*="/guides"] {
  position: relative;
  z-index: 1001;
  pointer-events: auto !important;
}

/* hide "Платформы" в разных навигациях (без правки меню) */
.main-nav a[href*="platform"],
.menu a[href*="platform"],
#menu-main a[href*="platform"],
.nav a[href*="/platform"],
.nav a[href*="/platforms"],
.mobile-menu a[href*="platform"],
footer a[href*="/platform"],
footer a[href*="/platforms"],
.fgrid a[href*="/platform"],
.fgrid a[href*="/platforms"] {
  display: none !important;
}

/* Mobile */
.menu-toggle { display: none; }
@media (max-width: 880px) {
  .nav ul { display:none; }
  .menu-toggle { display: inline-flex; }
}

/* Мобильное меню: скрыто на десктопе, без горизонтального скролла */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 320px;
  height: 100vh;
  background: var(--card);
  border-left: 1px solid var(--line);
  z-index: 1000;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

@media (max-width: 880px) {
  .mobile-menu { display: block; }
  .mobile-menu.active { transform: translateX(0); }
}

.mobile-menu-content {
  padding: 80px 24px 24px;
}

.mobile-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-menu li {
  margin: 0;
  padding: 0;
}

.mobile-menu a {
  display: block;
  padding: 16px 0;
  color: var(--text);
  font-weight: 500;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.mobile-menu a:hover,
.mobile-menu .current-menu-item a {
  color: var(--primary);
}

.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Активные состояния меню */
.nav .current-menu-item a,
.nav .current-menu-ancestor a,
.nav .current_page_item a,
.nav .current_page_ancestor a {
  color: var(--text);
  font-weight: 600;
}

/* Sticky header эффекты */
header {
  transition: box-shadow 0.3s ease;
}

header.scrolled {
  box-shadow: 0 2px 20px rgba(15, 23, 42, 0.1);
}

[data-theme="dark"] header.scrolled {
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

/* Hero */
.hero {
  position: relative; margin-top: 6px; overflow: clip; border-radius: calc(var(--radius) * 1.25);
  background: linear-gradient( to bottom, rgba(2,6,23,0.25), rgba(2,6,23,0.55) ), url('https://obrazovanieblog8.wordpress.com/wp-content/uploads/2025/09/assets_task_01k47by8bqfgas4267dfnpw1bz_1756889121_img_0.webp') center/cover no-repeat;
  color: #fff; box-shadow: var(--shadow);
}
.hero-inner { padding: clamp(32px, 5vw, 72px); }
.kicker { display:inline-block; padding:6px 10px; background: rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.2);
          border-radius: 999px; font-size: 12px; letter-spacing: .3px; text-transform: uppercase; }
.hero h1 { font-family: Nunito, Inter, system-ui; font-size: clamp(28px, 5vw, 48px); line-height: 1.1; margin: 14px 0 10px; }
.hero p { max-width: 750px; font-size: clamp(16px, 2.2vw, 18px); opacity:.95; }
.hero-cta { display:flex; gap:12px; margin-top: 18px; flex-wrap: wrap; }
.trust { display:flex; gap:18px; align-items:center; margin-top: 18px; font-size: 14px; opacity:.95; }
.trust .dot { width:8px; height:8px; background: #22c55e; border-radius:50%; box-shadow:0 0 0 4px rgba(34,197,94,.2); }

/* Chips */
.chips { display:flex; flex-wrap: wrap; gap:10px; margin-top: 18px; }
.chip { background: var(--chip); color: var(--chip-text); padding:8px 12px; border-radius: 999px; border:1px solid color-mix(in oklab, var(--chip-text) 20%, transparent);
        font-weight:600; font-size: 13px; }

/* Sections */
section { padding: 28px 0; }
.section-title { display:flex; align-items:baseline; justify-content:space-between; gap:10px; margin-bottom:14px; }
.section-title h2 { font-family: Nunito, Inter; font-size: clamp(20px, 3.2vw, 28px); margin:0; }
.section-title a { color: var(--primary); font-weight: 600; }

/* Cards Grid */
.grid { display:grid; gap: 18px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 992px) { .grid.cols-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid.cols-3 { grid-template-columns: 1fr; } }

.card { background: var(--card); border:1px solid var(--line); border-radius: var(--radius); overflow:hidden; box-shadow: var(--shadow); display:flex; flex-direction: column; }
.card-media { aspect-ratio: 16/9; background: linear-gradient(135deg, #93c5fd, #a7f3d0); position:relative; overflow:hidden; }
.card-media img { width:100%; height:100%; object-fit:cover; }
.badge { position:absolute; top:12px; left:12px; background: color-mix(in oklab, var(--primary) 80%, white); color:#fff; font-weight:700;
         padding:6px 10px; border-radius: 999px; font-size:12px; letter-spacing:.3px; box-shadow: var(--shadow); }
.card-body { padding: 16px; display:flex; flex-direction:column; gap:8px; }
.meta { color: var(--muted); font-size: 13px; display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.title { font-weight: 800; font-size: 18px; line-height: 1.35; }
.card-footer { margin-top:auto; display:flex; align-items:center; justify-content:space-between; padding: 0 16px 16px; }
.link { color: var(--primary); font-weight: 700; display:inline-flex; gap:8px; align-items:center; }

/* List (Latest) */
.list { display:grid; gap: 12px; }
.item { border:1px solid var(--line); background: var(--card); border-radius: 14px; padding: 12px; display:grid; grid-template-columns: 140px 1fr; gap: 14px; box-shadow: var(--shadow); }
.thumb { width:100%; height:100px; border-radius: 10px; overflow:hidden; background: linear-gradient(135deg, #fce7f3, #dbeafe); }
.item h3 { margin: 2px 0 6px; font-size: 18px; }
.item p { margin: 0; color: var(--muted); font-size: 14px; }
@media (max-width: 640px) { .item { grid-template-columns: 1fr; } .thumb { height: 160px; } }

/* Newsletter */
.cta { background: linear-gradient(180deg, color-mix(in oklab, var(--primary) 7%, transparent), color-mix(in oklab, var(--accent) 5%, transparent));
       border:1px solid var(--line); border-radius: calc(var(--radius) * 1.2); padding: clamp(18px, 3vw, 28px); box-shadow: var(--shadow); }
.cta h3 { margin: 0 0 8px; font-size: clamp(18px, 2.6vw, 24px); font-family: Nunito, Inter; }
.form { display:flex; gap: 10px; flex-wrap: wrap; }
.input { flex:1; min-width: 220px; padding: 12px 14px; border:1px solid var(--line); border-radius: 12px; background: var(--bg);
         color: var(--text); font-size: 15px; }

/* Footer */
footer { 
  border-top:1px solid var(--line); 
  margin-top: 28px; 
  padding: 28px 0; 
  background: var(--bg-soft);
  position: relative;
  z-index: 1;
}
.fgrid { display:grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 18px; }
.fgrid h4 { margin: 0 0 8px; font-family: Nunito; }
.fgrid a { color: var(--muted); }
.social { display:flex; gap: 10px; margin-top: 12px; }
.social a { width: 36px; height: 36px; border-radius: 10px; border:1px solid var(--line); display:grid; place-items:center; background: var(--card); }
@media (max-width: 880px) { .fgrid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .fgrid { grid-template-columns: 1fr; } }

/* Пагинация */
.pagination { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.pagination a, .pagination span { 
  padding: 8px 12px; 
  border: 1px solid var(--line); 
  background: var(--card); 
  border-radius: 8px; 
  font-weight: 500;
  box-shadow: var(--shadow);
}
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination a:hover { background: var(--bg-soft); }

/* Специальные стили для single-guide */
.guide-single .guide-content { 
  font-size: 16px; 
  line-height: 1.7; 
}
.guide-single .guide-content h2,
.guide-single .guide-content h3,
.guide-single .guide-content h4 {
  font-family: Nunito, Inter;
  margin-top: 32px;
  margin-bottom: 16px;
}
.guide-single .guide-content p {
  margin-bottom: 16px;
}
.guide-single .guide-content ul,
.guide-single .guide-content ol {
  margin-bottom: 16px;
  padding-left: 24px;
}
.guide-single .guide-content li {
  margin-bottom: 8px;
}

/* Стили для страницы статей */
.articles-hero {
  background: linear-gradient(135deg, rgba(37,99,235,.15), rgba(245,158,11,.12));
  color: var(--text);
}

.articles-hero.with-bg {
  color: #fff;
}

.articles-hero.with-bg .kicker {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
}

.articles-hero.with-bg h1,
.articles-hero.with-bg p {
  color: #fff;
}

/* Карточки статей */
.article-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.12);
}

[data-theme="dark"] .article-card:hover {
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

/* Стили для просмотров */
.views-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.views-count .icon {
  width: 12px;
  height: 12px;
}

/* Улучшенная пагинация для статей */
.articles-pagination {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.articles-pagination .pagination {
  justify-content: center;
}

/* Адаптивность для карточек статей */
@media (max-width: 992px) {
  .grid.cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .grid.cols-3 {
    grid-template-columns: 1fr;
  }
  
  .articles-hero .hero-inner {
    padding: clamp(24px, 4vw, 48px);
  }
  
  .articles-hero h1 {
    font-size: clamp(24px, 4.5vw, 36px);
  }
}

/* Стили для страницы семейного образования */
.family-hero {
  background: linear-gradient(135deg, rgba(37,99,235,.15), rgba(245,158,11,.12));
  color: var(--text);
}

.family-hero.with-bg {
  color: #fff;
}

.family-hero.with-bg .kicker {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
}

.family-hero.with-bg h1,
.family-hero.with-bg p {
  color: #fff;
}

/* Контентные блоки */
.family-content {
  margin-top: 24px;
}

.content-blocks {
  display: grid;
  gap: 24px;
}

.content-block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.content-block h2 {
  font-family: Nunito, Inter;
  font-size: clamp(20px, 3vw, 24px);
  margin: 0 0 16px 0;
  color: var(--text);
}

.content-block p {
  margin: 0;
  line-height: 1.6;
  color: var(--muted);
}

/* Список с иконками */
.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.feature-list .icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--primary);
}

/* Адаптивность для страницы семейного образования */
@media (max-width: 640px) {
  .family-hero .hero-inner {
    padding: clamp(24px, 4vw, 48px);
  }
  
  .family-hero h1 {
    font-size: clamp(24px, 4.5vw, 36px);
  }
  
  .content-blocks {
    gap: 16px;
  }
  
  .content-block {
    padding: 20px;
  }
  
  .content-block h2 {
    font-size: clamp(18px, 4vw, 22px);
  }
}

/* Стили для страницы рейтинга */
.rating-hero {
  background: linear-gradient(135deg, rgba(37,99,235,.15), rgba(245,158,11,.12));
  color: var(--text);
}

.rating-hero .trust {
  margin-top: 24px;
  font-size: 16px;
  font-weight: 500;
}

.rating-hero .trust .dot {
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

/* Стили для заглушки рейтинга */
.rating-placeholder {
  text-align: center;
  padding: 64px 0;
  color: var(--muted);
}

.rating-placeholder h2 {
  font-family: Nunito, Inter;
  font-size: clamp(24px, 4vw, 32px);
  margin-bottom: 16px;
  color: var(--text);
}

.rating-placeholder p {
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 32px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.rating-placeholder .btn-group {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Адаптивность для страницы рейтинга */
@media (max-width: 640px) {
  .rating-hero .hero-inner {
    padding: clamp(24px, 4vw, 48px);
  }
  
  .rating-hero h1 {
    font-size: clamp(24px, 4.5vw, 36px);
  }
  
  .rating-placeholder {
    padding: 48px 0;
  }
  
  .rating-placeholder .btn-group {
    flex-direction: column;
    align-items: center;
  }
}

/* Helper */
.sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
