/* /blog/assets/blog.css */
:root{
  --blog-bg: var(--bg, #f4f1ea);
  --blog-surface: var(--surface, #fff);
  --blog-text: var(--text, #1f1b16);
  --blog-muted: var(--muted, #5f5a52);
  --blog-green: var(--green-700, #1f5a3a);
  --blog-border: var(--border, rgba(47,31,20,.14));
  --blog-shadow: var(--shadow, 0 10px 28px rgba(26,18,13,.10));
  --r-lg: 18px;
}

#blogIndex .wrapMax,
#blogPost  .wrapMax{ max-width: 1100px; margin: 0 auto; }

#blogIndex .blogTop{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
  margin-bottom: 14px;
}

#blogIndex .blogSearch{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
#blogIndex .blogSearch .input{
  min-width: 260px;
}
@media (max-width: 560px){
  #blogIndex .blogSearch{ width:100%; }
  #blogIndex .blogSearch .input{ width:100%; min-width:0; }
}

#blogIndex .blogCats{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:center;
  margin: 0 0 14px;
}
#blogIndex .blogCat{
  padding:8px 12px;
  border-radius: 999px;
  border: 1px solid var(--blog-border);
  background: var(--blog-surface);
  color: var(--blog-text);
  cursor:pointer;
  font-weight: 900;
  text-decoration:none;
}
#blogIndex .blogCat.is-active{
  background: var(--blog-green);
  border-color: transparent;
  color:#fff;
}

#blogIndex .blogGrid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap:16px;
}
@media (max-width: 980px){
  #blogIndex .blogGrid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 560px){
  #blogIndex .blogGrid{ grid-template-columns: 1fr; }
}

.blogCard{
  padding:0;
  overflow:hidden;
  border-radius: 22px;
  background: var(--blog-surface);
  border: 1px solid var(--blog-border);
  box-shadow: var(--blog-shadow);
  display:flex;
  flex-direction:column;
  min-height: 100%;
}
.blogCard__media{
  height: 200px;
  background:#111;
}
.blogCard__media img{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
}
.blogCard__body{
  padding: 16px;
  display:flex;
  flex-direction:column;
  gap:10px;
  height:100%;
}
.blogMeta{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  color: var(--blog-muted);
  font-size: 13px;
}
.blogBadge{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius: 999px;
  background: rgba(31,90,58,.10);
  border: 1px solid rgba(31,90,58,.16);
  color: var(--blog-green);
  font-weight: 900;
  font-size: 12px;
}
.blogTitle{
  margin:0;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 900;
  color: var(--blog-text);
}
.blogExcerpt{
  margin:0;
  color: var(--blog-muted);
  line-height: 1.6;
}
.blogCard__bottom{
  margin-top:auto;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}
.blogLink{
  font-weight: 900;
  color: var(--blog-green);
  text-decoration:none;
}
.blogLink:hover{ text-decoration: underline; }

/* pagination */
.blogPager{
  display:flex;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
  margin-top: 18px;
}
.blogPager a{
  padding:10px 14px;
  border-radius: 14px;
  border: 1px solid var(--blog-border);
  background: var(--blog-surface);
  color: var(--blog-text);
  font-weight: 900;
  text-decoration:none;
}
.blogPager a.is-active{
  background: var(--blog-green);
  border-color: transparent;
  color:#fff;
}

/* post */
#blogPost .postHead{
  text-align:center;
  margin-bottom: 14px;
}
#blogPost .postCover{
  border-radius: 22px;
  overflow:hidden;
  border: 1px solid var(--blog-border);
  box-shadow: var(--blog-shadow);
  background:#111;
  margin: 0 0 16px;
}
#blogPost .postCover img{
  width:100%;
  height: 360px;
  object-fit: cover;
  display:block;
}
@media (max-width: 820px){
  #blogPost .postCover img{ height: 260px; }
}

#blogPost .postWrap{
  max-width: 900px;
  margin: 0 auto;
}

#blogPost .postContent{
  line-height: 1.75;
}
#blogPost .postContent h2{
  margin: 20px 0 10px;
}
#blogPost .postContent ul{
  margin: 10px 0 14px 18px;
}

#blogPost .backRow{
  display:flex;
  justify-content:center;
  margin-top: 16px;
}

/* Whole card clickable (no layout changes) */
.blogCard{ position: relative; }

.blogCard__hit{
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

/* Поднимаем реальную кнопку "Читать" и другие интерактивы выше */
.blogCard__bottom,
.blogCard__bottom a,
.blogCard .blogLink{
  position: relative;
  z-index: 2;
}
/* Search: input + button in one row */
#blogIndex .blogSearchForm{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:nowrap;
}

#blogIndex .blogSearchForm .input{
  flex: 1 1 auto;
  min-width: 260px;
}

#blogIndex .blogSearchForm .btn{
  flex: 0 0 auto;
  white-space: nowrap;
}

/* На мобиле можно снова в столбик (если надо) */
@media (max-width: 560px){
  #blogIndex .blogSearchForm{
    flex-wrap:wrap; /* чтобы не ломало экран */
  }
  #blogIndex .blogSearchForm .input{
    flex: 1 1 100%;
    min-width: 0;
  }
}
/* Низ карточки: кнопка сверху, теги снизу */
.blogCard__bottom{
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.blogCard__bottom .mini{
  white-space: normal;      /* чтобы переносились */
  line-height: 1.35;
  opacity: .9;
}