/* =============================================
   BLOG.CSS — в стиле xselid.ru
   ============================================= */

/* NAV */
.nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav a {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--text);
}

.logo {
  text-decoration: none;
}

/* MAIN overrides for non-center pages */
.main--left {
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  padding: 60px 40px;
}

/* BTN BLOG */
.btn-blog {
  display: inline-block;
  margin-top: 8px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  border: 1px solid var(--border);
  padding: 10px 20px;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.btn-blog:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* =============================================
   BLOG PAGE
   ============================================= */

.blog-header {
  margin-bottom: 56px;
  animation: fade-up 0.6s 0.1s ease both;
}

.blog-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 5vw, 3.5rem);
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 12px;
}

.blog-subtitle {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.posts-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  background: transparent;
  border: none;
  animation: fade-up 0.6s 0.2s ease both;
}

.post-card {
  background: var(--bg);
  text-decoration: none;
  display: block;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
}

.post-card::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.post-card:hover {
  background: #0f0f0f;
  border-color: var(--accent);
  transform: translateY(-3px);
}

.post-card:hover::before {
  width: 100%;
}

.post-card-inner {
  padding: 30px 28px;
}

.post-date {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
  display: block;
  margin-bottom: 14px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.post-card-title {
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.3;
  transition: color 0.2s;
}

.post-card:hover .post-card-title {
  color: var(--accent);
}

.post-card-excerpt {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #b0b0b0;
  line-height: 1.7;
  margin-bottom: 22px;
}

.post-read-more {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.post-card:hover .post-read-more {
  color: var(--accent);
}

.post-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.post-card:active {
  transform: translateY(-1px);
}

.empty-blog {
  text-align: center;
  padding: 80px 0;
  color: #2a2a2a;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  animation: fade-up 0.6s 0.2s ease both;
}

/* =============================================
   POST PAGE
   ============================================= */

.post-container {
  max-width: 680px;
  width: 100%;
  animation: fade-up 0.6s 0.1s ease both;
}

.back-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 48px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--accent);
}

.post-header {
  margin-bottom: 48px;
}

.post-date {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
  display: block;
  margin-bottom: 16px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.post-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.post-excerpt {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 28px;
}

.post-divider {
  height: 1px;
  background: var(--border);
  position: relative;
}

.post-divider::after {
  content: '';
  position: absolute;
  left: 0;
  top: -1px;
  width: 40px;
  height: 2px;
  background: var(--accent);
}

/* =============================================
   POST CONTENT
   ============================================= */

.post-content {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.95;
  color: #aaa;
  margin-top: 40px;
}

.post-content h1,
.post-content h2,
.post-content h3 {
  font-family: var(--font-display);
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 48px 0 16px;
  line-height: 1.3;
}

.post-content h1 { font-size: 1.6rem; }
.post-content h2 { font-size: 1.2rem; }
.post-content h3 {
  font-size: 0.9rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: var(--font-mono);
}

.post-content p {
  margin-bottom: 20px;
}

.post-content a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.post-content a:hover {
  border-color: var(--accent);
}

.post-content strong {
  color: var(--text);
  font-weight: 700;
}

.post-content em {
  color: var(--muted);
}

.post-content code {
  background: #111;
  border: 1px solid var(--border);
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  border-radius: 0;
}

.post-content pre {
  background: #0d0d0d;
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  padding: 24px;
  overflow-x: auto;
  margin: 24px 0;
}

.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: #ccc;
  font-size: 0.78rem;
}

.post-content blockquote {
  border-left: 2px solid var(--accent);
  padding: 12px 20px;
  color: var(--muted);
  margin: 24px 0;
  background: #0d0d0d;
}

.post-content ul,
.post-content ol {
  padding-left: 0;
  margin-bottom: 24px;
  list-style: none;
}

.post-content ul li::before {
  content: '—';
  color: var(--accent);
  margin-right: 10px;
}

.post-content ol {
  counter-reset: list;
}

.post-content ol li {
  counter-increment: list;
}

.post-content ol li::before {
  content: counter(list, decimal-leading-zero) '.';
  color: var(--accent);
  margin-right: 10px;
  font-size: 0.7rem;
}

.post-content li {
  margin-bottom: 10px;
  padding-left: 4px;
}

.post-content img {
  max-width: 100%;
  border: 1px solid var(--border);
  display: block;
  margin: 24px 0;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

/* =============================================
   404
   ============================================= */

.error-page {
  text-align: center;
  padding: 80px 0;
  animation: fade-up 0.6s ease both;
}

.error-code {
  font-family: var(--font-display);
  font-size: clamp(80px, 18vw, 160px);
  font-weight: 700;
  color: #111;
  margin-bottom: 16px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.error-text {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 32px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 768px) {
  .main--left {
    padding: 40px 24px;
  }

  .posts-grid {
    grid-template-columns: 1fr;
  }

  .post-container {
    padding: 0;
  }

  .post-title {
    font-size: 1.6rem;
  }
}

@media (max-width: 480px) {
  .main--left {
    padding: 32px 18px;
  }

  .nav {
    gap: 16px;
  }

  .nav a {
    font-size: 0.62rem;
  }

  .blog-title {
    font-size: 1.6rem;
  }
}