/* ═══════════════════════════════════════════════════════
   WP-THEME.CSS — стили специфичные для WordPress-темы
   (карточки блога, архив, сайдбар, пагинация, страницы)
   Подключается через functions.php вместе с blog.css
═══════════════════════════════════════════════════════ */

/* ─── Blog Hero ─── */
.blog-hero { padding: 80px 0 40px; background: var(--bg); }
.blog-hero-title {
  font-family: 'Geologica', sans-serif;
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 700;
  color: var(--text);
  margin: 0 0 12px;
}
.blog-hero-sub { color: var(--text-2); font-size: 17px; margin: 0; }

/* ─── Filter Tabs ─── */
.blog-filter {
  background: var(--white);
  border-bottom: 1px solid rgba(0,0,0,.07);
  position: sticky;
  top: 64px;
  z-index: 10;
}
.filter-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  white-space: nowrap;
  transition: background .18s, color .18s;
}
.filter-tab:hover { background: var(--bg-section); color: var(--text); }
.filter-tab.active { background: var(--accent-light); color: var(--accent); }
.filter-count {
  background: rgba(0,0,0,.07);
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 600;
}

/* ─── Blog Main ─── */
.blog-main { padding: 48px 0 80px; background: var(--bg); }

/* ─── Article Grid ─── */
.art-grid { display: grid; gap: 24px; }
.art-grid-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 1024px) { .art-grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .art-grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 768px)  {
  .art-card-featured { flex-direction: column; }
  .art-card-featured .art-cover { width: 100%; }
}

/* ─── Article Card ─── */
.art-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  transition: transform .22s, box-shadow .22s;
}
.art-card:hover { transform: translateY(-4px); box-shadow: var(--lg-shadow); }
.art-card-featured { grid-column: 1 / -1; flex-direction: row; }

.art-cover {
  display: block;
  aspect-ratio: 1/1;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}
.art-card-featured .art-cover { width: 46%; aspect-ratio: 1/1; min-height: auto; }
.art-cover-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.art-cover-deco { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }

.art-cover-red    { background: linear-gradient(135deg, #D93030 0%, #ff6b6b 100%); }
.art-cover-orange { background: linear-gradient(135deg, #e67e22 0%, #f39c12 100%); }
.art-cover-blue   { background: linear-gradient(135deg, #2c3e8c 0%, #4e6ef7 100%); }
.art-cover-teal   { background: linear-gradient(135deg, #0e7a72 0%, #20c997 100%); }
.art-cover-violet { background: linear-gradient(135deg, #6E4FF7 0%, #9c7fff 100%); }
.art-cover-green  { background: linear-gradient(135deg, #15803D 0%, #22c55e 100%); }

.art-body { padding: 22px 24px 24px; flex: 1; display: flex; flex-direction: column; }
.art-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.art-title {
  font-family: 'Geologica', sans-serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.art-title a { color: inherit; text-decoration: none; }
.art-title a:hover { color: var(--accent); }
.art-title-lg { font-size: 22px; -webkit-line-clamp: 4; }
.art-excerpt { color: var(--text-2); font-size: 14px; line-height: 1.6; margin: 0 0 14px; flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.art-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); margin-top: auto; }
.art-sep { color: var(--text-3); }

/* ─── Post Layout ─── */
.post-body {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 40px 80px;
  background: var(--bg);
}
.post-body > .container { max-width: none; padding: 0; margin: 0; }
.post-layout {
  max-width: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  align-items: start;
}
@media (max-width: 1024px) { .post-layout { grid-template-columns: 1fr; } .post-sidebar { display: none; } }

.post-featured-img {
  float: left;
  width: 300px;
  height: 300px;
  margin: 4px 28px 12px 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  shape-outside: inset(0 round var(--radius-lg));
}
.post-cover-img { width: 100%; height: 100%; display: block; object-fit: cover; }
.post-entry::after { content: ''; display: block; clear: both; }
@media (max-width: 640px) {
  .post-featured-img {
    float: none;
    width: 100%;
    max-width: 300px;
    height: auto;
    aspect-ratio: 1/1;
    margin: 0 auto 24px;
  }
}
.post-entry {
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
}
.post-entry h2 { font-family: 'Geologica', sans-serif; font-size: clamp(22px,2.5vw,28px); font-weight: 700; margin: 40px 0 16px; color: var(--text); }
.post-entry h3 { font-family: 'Geologica', sans-serif; font-size: 20px; font-weight: 600; margin: 32px 0 12px; }
/* h3 как первый дочерний элемент li — убираем верхний отступ, чтобы цифра и заголовок стояли рядом */
.post-entry li > h3:first-child { margin-top: 4px; }
.post-entry p  { margin: 0 0 20px; }
.post-entry ul, .post-entry ol { padding-left: 24px; margin: 0 0 20px; }
.post-entry li { margin-bottom: 8px; }
.post-entry a  { color: var(--accent); text-decoration: underline; }
.post-entry strong { font-weight: 600; }
.post-entry table { width: 100%; border-collapse: collapse; margin: 24px 0; }
.post-entry th, .post-entry td { padding: 12px 16px; border: 1px solid rgba(0,0,0,.1); text-align: left; }
.post-entry th { background: var(--bg-section); font-weight: 600; }
.post-entry blockquote { border-left: 3px solid var(--accent); margin: 28px 0; padding: 16px 24px; background: var(--accent-light); border-radius: 0 8px 8px 0; font-style: italic; }

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid rgba(0,0,0,.08);
}
.post-nav-link {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  background: var(--white);
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.post-nav-link:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(110,79,247,.08);
}
.post-nav-next { text-align: right; }
.post-nav-dir  { font-size: 13px; color: var(--text-3); }
.post-nav-title{
  font-size: 15px; font-weight: 500; color: var(--text); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-nav-link:hover .post-nav-title { color: var(--accent); }
.post-nav-spacer { display: block; }
@media (max-width: 640px) {
  .post-nav { grid-template-columns: 1fr; }
  .post-nav-next { text-align: left; }
}

/* ─── Sidebar ─── */
/* Структура сайдбара: sidebar-card + sidebar-cta-card используют стили из blog.css */
.post-sidebar {
  position: sticky; top: 80px;
  display: flex; flex-direction: column; gap: 20px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,.18) transparent;
}
.post-sidebar::-webkit-scrollbar { width: 6px; }
.post-sidebar::-webkit-scrollbar-track { background: transparent; }
.post-sidebar::-webkit-scrollbar-thumb { background: rgba(0,0,0,.18); border-radius: 3px; }

/* ─── Related Posts ─── */
.related-posts { padding: 60px 0; background: var(--bg-section); }
.related-title { font-family: 'Geologica', sans-serif; font-size: 28px; font-weight: 700; margin: 0 0 32px; color: var(--text); }

/* ─── Pagination ─── */
.blog-pagination { margin-top: 48px; display: flex; justify-content: center; }
.blog-pagination .page-numbers {
  display: flex;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.blog-pagination .page-numbers li a,
.blog-pagination .page-numbers li span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  background: var(--white);
  border: 1px solid rgba(0,0,0,.1);
  transition: background .18s, color .18s, border-color .18s;
}
.blog-pagination .page-numbers li a:hover { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }
.blog-pagination .page-numbers li .current { background: var(--accent); color: white; border-color: var(--accent); }
.blog-pagination .page-numbers li .prev,
.blog-pagination .page-numbers li .next { width: auto; padding: 0 16px; }

/* ─── Blog Empty ─── */
.blog-empty { text-align: center; padding: 80px 0; }
.blog-empty p { font-size: 18px; color: var(--text-2); margin-bottom: 24px; }

/* ─── Page Template ─── */
.page-wrap { padding: 60px 0 100px; }
.page-title { font-family: 'Geologica', sans-serif; font-size: clamp(28px,3.5vw,44px); font-weight: 700; margin: 0 0 40px; color: var(--text); }
.page-content { max-width: 760px; }
