/*
  article_category.css
  Страница категории / списка статей клиники
  v2 — крупные шрифты, отступы, компактный поиск
*/

/* ── ОБЁРТКА ── */
.pg {
  padding: 24px 32px 56px;
}

@media (max-width: 768px) {
  .pg { padding: 16px 20px 40px; }
}

@media (max-width: 480px) {
  .pg { padding: 12px 16px 32px; }
}

/* ═══════════════════════════════════════
   ХЛЕБНЫЕ КРОШКИ
═══════════════════════════════════════ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  padding-top: 1rem;
}

.breadcrumb-link {
  font-size: var(--text-sm);
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
}

.breadcrumb-link:hover { color: var(--sage-dk); }

.breadcrumb-sep {
  font-size: var(--text-sm);
  color: var(--muted);
  opacity: .4;
}

.breadcrumb-current {
  font-size: var(--text-sm);
  color: var(--text);
}

/* ═══════════════════════════════════════
   ПОИСК — компактный
═══════════════════════════════════════ */
.search-bar {
  margin-bottom: 24px;
}

.search-form {
  display: flex;
  align-items: center;
  max-width: 500px;
  border: 0.5px solid rgba(107, 143, 113, .35);
  border-radius: var(--radius-md);
  background: var(--white);
  overflow: hidden;
}

.search-icon {
  flex-shrink: 0;
  color: var(--muted);
  margin: 0 10px 0 14px;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--sys);
  font-size: var(--text-base);
  color: var(--text);
  padding: 12px 0;
}

.search-input::placeholder {
  color: var(--muted);
  opacity: .6;
}

.search-btn {
  flex-shrink: 0;
  padding: 12px 18px;
  border: none;
  border-left: 0.5px solid rgba(107, 143, 113, .2);
  background: transparent;
  font-family: var(--sys);
  font-size: var(--text-xs);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--sage-dk);
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}

.search-btn:hover {
  background: var(--sage-dk);
  color: var(--white);
}

/* ═══════════════════════════════════════
   ДВУХКОЛОННЫЙ LAYOUT
═══════════════════════════════════════ */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 24px;
  align-items: start;
}

/* ═══════════════════════════════════════
   ОПИСАНИЕ КАТЕГОРИИ
═══════════════════════════════════════ */
.cat-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 24px;
  background: var(--white);
  border: 0.5px solid rgba(107, 143, 113, .2);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.cat-icon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 10px;
  border: 0.5px solid rgba(107, 143, 113, .25);
  background: var(--ivory);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sage-dk);
}

.cat-title {
  font-family: var(--serif);
  font-size: var(--text-4xl);
  font-weight: 400;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 6px;
}

.cat-desc {
  font-size: var(--text-md);
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}

/* ═══════════════════════════════════════
   ПОПУЛЯРНАЯ СТАТЬЯ
═══════════════════════════════════════ */
.featured {
  margin-bottom: 24px;
  border: 0.5px solid rgba(107, 143, 113, .22);
  border-radius: var(--radius-md);
  background: var(--white);
  overflow: hidden;
}

.featured-label {
  font-size: var(--text-xs);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 18px 9px;
  border-bottom: 0.5px solid rgba(107, 143, 113, .12);
}

.featured-inner {
  display: flex;
  min-height: 220px;
}

.featured-img {
  width: 260px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  border-right: 0.5px solid rgba(107, 143, 113, .15);
}

.featured-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}

.featured:hover .featured-img img { transform: scale(1.03); }

.featured-img-ph {
  width: 100%;
  height: 100%;
  min-height: 220px;
  background: var(--ivory);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.featured-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: var(--text-xs);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--sage-dk);
  background: rgba(245, 242, 235, .94);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}

.featured-body {
  flex: 1;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.featured-title {
  font-family: var(--serif);
  font-size: var(--text-4xl);
  font-weight: 400;
  font-style: italic;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 12px;
}

.featured-excerpt {
  font-size: var(--text-lg);
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 auto;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.featured-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 0.5px solid rgba(107, 143, 113, .15);
  gap: 12px;
  flex-wrap: wrap;
}

.featured-author {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.featured-ava {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(107, 143, 113, .2);
}

.featured-ava--init {
  background: var(--sage);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--white);
}

.featured-aname {
  font-size: var(--text-base);
  color: var(--text);
  font-weight: 500;
}

.featured-apos {
  font-size: var(--text-sm);
  color: var(--muted);
  margin-top: 2px;
}

.featured-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.featured-read {
  font-size: var(--text-xs);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--sage-dk);
  text-decoration: none;
  border-bottom: 0.5px solid rgba(62, 94, 68, .4);
  padding-bottom: 1px;
  white-space: nowrap;
  transition: color .15s;
}

.featured-read:hover { color: var(--sage); }

/* ═══════════════════════════════════════
   МЕТА (просмотры, время)
═══════════════════════════════════════ */
.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-sm);
  color: var(--muted);
  opacity: .75;
}

/* ═══════════════════════════════════════
   ТУЛБАР
═══════════════════════════════════════ */
.toolbar {
  margin-bottom: 14px;
}

.toolbar-label {
  font-size: var(--text-xs);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ═══════════════════════════════════════
   СЕТКА КАРТОЧЕК
═══════════════════════════════════════ */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 0.5px solid rgba(107, 143, 113, .2);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .2s, transform .2s;
}

.card:hover {
  box-shadow: 0 4px 20px rgba(42, 36, 32, .07);
  transform: translateY(-2px);
}

.card-img {
  height: 160px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}

.card:hover .card-img img { transform: scale(1.04); }

.card-img-ph {
  width: 100%;
  height: 100%;
  background: var(--ivory);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: var(--text-xs);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--sage-dk);
  background: rgba(245, 242, 235, .94);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

.card-body {
  padding: 16px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-family: var(--serif);
  font-size: var(--text-xl);
  font-weight: 400;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-excerpt {
  font-size: var(--text-lg);
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 auto;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-line {
  height: 0.5px;
  background: rgba(107, 143, 113, .15);
  margin: 12px 0;
  flex-shrink: 0;
}

.card-author {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.card-ava {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--ivory);
  border: 0.5px solid rgba(107, 143, 113, .2);
}

.card-ava--init {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--white);
  background: var(--sage);
}

.card-aname {
  font-size: var(--text-sm);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ═══════════════════════════════════════
   САЙДБАР
═══════════════════════════════════════ */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sb-block {
  background: var(--white);
  border: 0.5px solid rgba(107, 143, 113, .2);
  border-radius: var(--radius-md);
  padding: 18px;
}

.sb-title {
  font-size: var(--text-xs);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 0.5px solid rgba(107, 143, 113, .15);
}

.sb-cats {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sb-cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  transition: background .15s;
}

.sb-cat:hover { background: var(--ivory); }
.sb-cat--active { background: rgba(62, 94, 68, .08); }

.sb-cat-name { font-size: var(--text-base); }

.sb-cat--active .sb-cat-name {
  color: var(--sage-dk);
  font-weight: 500;
}

.sb-cat-count {
  font-size: var(--text-xs);
  color: var(--muted);
  background: var(--ivory);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}

.sb-cat--active .sb-cat-count {
  background: rgba(62, 94, 68, .1);
  color: var(--sage-dk);
}

.sb-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.sb-item {
  border-bottom: 0.5px solid rgba(107, 143, 113, .12);
}

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

.sb-item-link {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  text-decoration: none;
  color: inherit;
  transition: opacity .15s;
}

.sb-item-link:hover { opacity: .72; }

.sb-item-img {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--ivory);
}

.sb-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sb-item-ph {
  width: 100%;
  height: 100%;
  background: var(--ivory);
}

.sb-item-title {
  font-size: var(--text-sm);
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sb-item-author {
  font-size: var(--text-xs);
  color: var(--muted);
}

.sb-popular {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.sb-pop-item {
  border-bottom: 0.5px solid rgba(107, 143, 113, .12);
}

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

.sb-pop-link {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  text-decoration: none;
  color: inherit;
  transition: opacity .15s;
}

.sb-pop-link:hover { opacity: .72; }

.sb-pop-num {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 5px;
  background: var(--ivory);
  border: 0.5px solid rgba(107, 143, 113, .2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--muted);
  margin-top: 1px;
}

.sb-pop-title {
  font-size: var(--text-sm);
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sb-pop-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ═══════════════════════════════════════
   ПУСТОЕ СОСТОЯНИЕ
═══════════════════════════════════════ */
.empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--muted);
  font-size: var(--text-md);
  border: 0.5px dashed rgba(107, 143, 113, .3);
  border-radius: var(--radius-lg);
}

/* ═══════════════════════════════════════
   ПАГИНАЦИЯ
═══════════════════════════════════════ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 24px;
}

.pag-item {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 0.5px solid rgba(107, 143, 113, .25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  color: var(--muted);
  text-decoration: none;
  background: var(--white);
  transition: background .15s, color .15s;
}

.pag-item:hover {
  background: var(--ivory);
  color: var(--sage-dk);
}

.pag-item--active {
  background: var(--sage-dk);
  color: var(--white);
  border-color: var(--sage-dk);
}

.pag-item--disabled {
  opacity: .35;
  cursor: default;
  pointer-events: none;
}

.pag-item--dots {
  border: none;
  background: transparent;
  cursor: default;
}

/* ═══════════════════════════════════════
   АДАПТИВ
═══════════════════════════════════════ */
@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr) 230px; }
  .featured-img { width: 220px; }
}

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .featured-img { width: 180px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .sidebar { grid-template-columns: 1fr; }
  .search-form { max-width: 100%; }
  .featured-inner { flex-direction: column; }
  .featured-img { width: 100%; height: 200px; border-right: none; border-bottom: 0.5px solid rgba(107, 143, 113, .15); }
  .grid { grid-template-columns: 1fr; gap: 12px; }
  .cat-title { font-size: var(--text-xl); }
  .featured-title { font-size: var(--text-xl); }
}