* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #1a1a1a;
  line-height: 1.6;
  min-height: 100vh;
}

.wrapper {
  background: #fff;

  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.header {
  padding: 24px 0;
  border-bottom: 2px solid #f0f0f0;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: bold;
  text-decoration: none;
  color: #1a1a1a;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-icon {
  font-size: 1.8rem;
  background: none;
  -webkit-text-fill-color: initial;
}

.nav {
  display: flex;
  gap: 24px;
}

.nav-link {
  text-decoration: none;
  color: #666;
  transition: color 0.2s;
  font-weight: 500;
}

.nav-link:hover {
  color: #667eea;
}

/* Hero */
.hero {
  text-align: center;
  padding: 60px 20px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  margin-bottom: 40px;

}

.hero-title {
  font-size: 3rem;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 16px;
}

.hero-text {
  font-size: 1.2rem;
  color: #555;
}

.hero-tag {
  margin-top: 20px;
  display: flex;
  gap: 12px;
  justify-content: center;
}

.tag {
  display: inline-block;
  padding: 6px 16px;
  background: #667eea;
  color: #fff;
  border-radius: 30px;
  font-size: 0.9rem;
}

.tag-count {
  display: inline-block;
  padding: 6px 16px;
  background: #fff;
  border-radius: 30px;
  font-size: 0.9rem;
}

/* Categories */
.categories {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 2px solid #f0f0f0;
}

.categories-label {
  font-weight: bold;
  color: #333;
}

.categories-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cat {
  padding: 6px 16px;
  background: #f5f5f5;
  border-radius: 30px;
  text-decoration: none;
  color: #666;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.cat:hover {
  background: #667eea;
  color: #fff;
  transform: translateY(-2px);
}

.cat.active {
  background: #667eea;
  color: #fff;
}

.cat .count {
  display: inline-block;
  margin-left: 6px;
  background: rgba(0,0,0,0.1);
  padding: 0 6px;
  border-radius: 20px;
  font-size: 0.7rem;
}

/* Posts */
.posts {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.post {
  display: flex;
  gap: 30px;
  background: #fff;
  border-radius: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.post:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.post-image {
  flex-shrink: 0;
  width: 280px;
}

.post-image img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 16px;
}

.post-content {
  flex: 1;
}

.post-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: #888;
}

.post-cat {
  background: #f0f0f0;
  padding: 2px 10px;
  border-radius: 20px;
  color: #667eea;
}

.post-title {
  font-size: 1.6rem;
  margin-bottom: 12px;
}

.post-title a {
  text-decoration: none;
  color: #1a1a1a;
  transition: color 0.2s;
}

.post-title a:hover {
  color: #667eea;
}

.post-excerpt {
  color: #666;
  margin-bottom: 16px;
}

.post-link {
  display: inline-block;
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
}

.post-link:hover {
  transform: translateX(4px);
}

/* Post full */
.post-full {
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
}

.post-full-image img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
}

.post-full-header {
  padding: 30px;
  border-bottom: 1px solid #f0f0f0;
}

.post-full-header h1 {
  font-size: 2.5rem;
  margin-top: 16px;
}

.post-full-content {
  padding: 30px;
  font-size: 1.1rem;
  line-height: 1.8;
}

.post-full-content p {
  margin-bottom: 20px;
}

.post-full-content h2 {
  margin: 30px 0 15px;
  font-size: 1.8rem;
}

.post-full-content h3 {
  margin: 25px 0 12px;
  font-size: 1.4rem;
}

.post-full-content img {
  max-width: 100%;
  border-radius: 12px;
  margin: 20px 0;
}

.post-full-content pre {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 16px;
  border-radius: 12px;
  overflow-x: auto;
}

.post-full-content code {
  font-family: 'Monaco', monospace;
  font-size: 0.9rem;
}

.post-full-content blockquote {
  border-left: 4px solid #667eea;
  padding-left: 20px;
  margin: 20px 0;
  color: #666;
  font-style: italic;
}

.post-footer {
  padding: 20px 30px 30px;
  border-top: 1px solid #f0f0f0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #667eea;
  text-decoration: none;
  transition: gap 0.2s;
}

.back-link:hover {
  gap: 12px;
}

/* Footer */
.footer {
  margin-top: 60px;
  padding: 40px 0;
  background: #1a1a2e;
  color: #888;
  border-radius: 40px 40px 0 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.2rem;
  font-weight: bold;
  color: #fff;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: #aaa;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: #667eea;
}

/* Empty state */
.empty {
  text-align: center;
  padding: 60px;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.error {
  text-align: center;
  padding: 60px;
}

/* Adaptive */
@media (max-width: 700px) {
  .post {
      flex-direction: column;
  }
  .post-image {
      width: 100%;
  }
  .post-image img {
      height: 200px;
  }
  .hero-title {
      font-size: 2rem;
  }
  .post-full-header h1 {
      font-size: 1.8rem;
  }
  .footer-inner {
      flex-direction: column;
      text-align: center;
  }
}
/* Добавить в конец файла */

/* Ограничиваем ширину статьи */
.post-full {
    max-width: 800px;
    margin: 0 auto;
}

.post-full-header {
    text-align: left;
    padding: 30px 0;
}

.post-full-header h1 {
    font-size: 2rem;
}

.post-full-content {
    font-size: 1.05rem;
    line-height: 1.75;
}

/* Картинка внутри статьи тоже не на весь экран */
.post-full-image {
    max-width: 800px;
    margin: 0 auto;
}

.post-full-image img {
    width: 100%;
    border-radius: 16px;
}

/* На главной тоже сужаем */
.container {
    max-width: 1000px;
}

.post {
    max-width: 800px;
    margin: 0 auto 40px;
}

/* Комментарии */
.comments-section {
  max-width: 800px;
  margin: 60px auto 0;
  padding-top: 40px;
  border-top: 2px solid var(--border, #e2e8f0);
}

.comments-title {
  font-size: 1.5rem;
  margin-bottom: 30px;
  color: var(--text, #1e293b);
}

.comments-list {
  margin-bottom: 40px;
}

.comment {
  background: var(--bg-secondary, #f8fafc);
  padding: 20px;
  border-radius: 16px;
  margin-bottom: 16px;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.comment-name {
  color: var(--primary, #3b82f6);
  font-weight: 600;
}

.comment-date {
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
}

.comment-text {
  line-height: 1.5;
  color: var(--text, #1e293b);
}

.comments-empty {
  text-align: center;
  padding: 40px;
  color: var(--text-muted, #64748b);
  background: var(--bg-secondary, #f8fafc);
  border-radius: 16px;
  margin-bottom: 40px;
}

/* Форма комментария */
.comment-form {
  background: var(--bg-secondary, #f8fafc);
  padding: 30px;
  border-radius: 20px;
}

.comment-form h4 {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: var(--text, #1e293b);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--bg, #ffffff);
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary, #3b82f6);
}

.comment-btn {
  background: var(--primary, #3b82f6);
  color: white;
  border: none;
  padding: 12px 28px;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.comment-btn:hover {
  background: var(--primary-dark, #2563eb);
  transform: translateY(-2px);
}

.comment-hint {
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
  margin-top: 12px;
}

.comment-success {
  background: #d1fae5;
  color: #065f46;
  padding: 12px 20px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.comment-error {
  background: #fee2e2;
  color: #991b1b;
  padding: 12px 20px;
  border-radius: 12px;
  margin-bottom: 20px;
}

@media (max-width: 600px) {
  .form-row {
      grid-template-columns: 1fr;
      gap: 12px;
  }
  .comment-form {
      padding: 20px;
  }
}