/*
Theme Name: Kopypasta Help Center
Theme URI: https://help.kopypasta.ru
Description: Минималистичная тема для базы знаний Kopypasta
Version: 1.0.0
Author: Kopypasta
Text Domain: kopypasta-help
*/

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --bg: #f4f5f9;
  --bg-card: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --shadow-card: 0 0 0 1px rgba(226,232,240,0.8), 0 2px 8px rgba(0,0,0,0.04);
  --radius: 16px;
  --max-width: 820px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

img { max-width: 100%; height: auto; }

/* === Header === */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.92);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  text-decoration: none;
}

.header-logo img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.header-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
  padding: 8px 16px;
  border-radius: 10px;
  background: rgba(99,102,241,0.08);
  transition: background 0.2s;
}

.header-link:hover {
  background: rgba(99,102,241,0.15);
  color: var(--primary-hover);
}

/* === Hero === */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 56px 24px 32px;
  text-align: center;
}

.hero h1 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
}

.hero p {
  font-size: 17px;
  color: var(--text-secondary);
}

/* === Search === */
.search-box {
  max-width: 520px;
  margin: 24px auto 0;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 14px 18px 14px 46px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  font-family: var(--font);
  background: var(--bg-card);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.search-box svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
}

/* === Categories Grid === */
.categories {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 8px 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.category-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: var(--text);
  transition: box-shadow 0.2s, transform 0.15s;
}

.category-card:hover {
  box-shadow: 0 0 0 1px rgba(99,102,241,0.3), 0 4px 16px rgba(0,0,0,0.06);
  transform: translateY(-1px);
  color: var(--text);
}

.category-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 22px;
}

.category-details {
  flex: 1;
  min-width: 0;
}

.category-details h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}

.category-details p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

.category-chevron {
  color: var(--text-secondary);
  flex-shrink: 0;
  opacity: 0.4;
  transition: opacity 0.2s;
}

.category-card:hover .category-chevron {
  opacity: 0.8;
}

/* === Article list (category page) === */
.content-area {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.breadcrumb {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { margin: 0 8px; opacity: 0.5; }

.page-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
}

.page-description {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 28px;
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.article-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.article-item:last-child { border-bottom: none; }

.article-item:hover {
  background: rgba(99,102,241,0.03);
  color: var(--text);
}

.article-item h3 {
  font-size: 15px;
  font-weight: 500;
}

.article-item .chevron {
  color: var(--text-secondary);
  opacity: 0.3;
  flex-shrink: 0;
}

.article-item:hover .chevron { opacity: 0.7; }

/* === Single article === */
.article-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.article-content .entry-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 24px;
  line-height: 1.3;
}

.article-body {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 32px;
  font-size: 15px;
  line-height: 1.75;
}

.article-body h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 28px 0 12px;
  color: var(--text);
}

.article-body h2:first-child { margin-top: 0; }

.article-body h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 24px 0 8px;
}

.article-body p { margin-bottom: 14px; }

.article-body ul, .article-body ol {
  margin: 0 0 14px 24px;
}

.article-body li { margin-bottom: 6px; }

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

.article-body th, .article-body td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}

.article-body th {
  background: var(--bg);
  font-weight: 600;
}

.article-body blockquote {
  border-left: 3px solid var(--primary);
  padding: 12px 18px;
  margin: 16px 0;
  background: rgba(99,102,241,0.04);
  border-radius: 0 8px 8px 0;
  color: var(--text-secondary);
}

.article-body a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-body code {
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

/* === Footer === */
.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
}

.site-footer a {
  color: var(--text-secondary);
  margin: 0 12px;
}

.site-footer a:hover { color: var(--primary); }

/* === Search Results === */
.search-results-info {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* === 404 === */
.not-found {
  text-align: center;
  padding: 80px 24px;
}

.not-found h1 { font-size: 28px; margin-bottom: 12px; }
.not-found p { color: var(--text-secondary); }

/* === Mobile === */
@media (max-width: 640px) {
  .hero { padding: 40px 16px 24px; }
  .hero h1 { font-size: 26px; }
  .categories { padding: 8px 16px 40px; }
  .category-card { padding: 16px; gap: 12px; }
  .content-area, .article-content { padding: 24px 16px 48px; }
  .article-body { padding: 20px; }
  .header-inner { padding: 0; }
}

/* === Platform Icons === */
.platform-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  flex-shrink: 0;
}

.article-platform-icon {
  display: flex;
  align-items: center;
  margin-right: 4px;
}

.article-platform-icon .platform-icon {
  width: 22px;
  height: 22px;
}

.article-header-with-icon {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.article-header-with-icon .entry-title {
  margin-bottom: 0;
}

.article-header-icon .platform-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}
