:root {
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --container-max-width: 1440px;
    --container-padding: 16px;
}

/* Общие стили */
.guides-archive-page {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    padding: var(--spacing-xl) 0;
    line-height: 1.6;
}

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.archive-header {
    text-align: center;
}

.archive-title {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    font-weight: 700;
    line-height: 1.2;
}

.archive-description {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto;
}

/* Фильтры в одну строку */
.modern-filters-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    border: 1px solid var(--border-secondary);
}

.filters-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    flex-grow: 1;
}

.sort-options {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    white-space: nowrap;
}

.sort-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.sort-button {
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    border: none;
    cursor: pointer;
}

.sort-button:hover {
    background: var(--border-primary);
}

.sort-button.active {
    background: var(--accent-primary);
    color:  var(--bg-primary);
}

.filter-tabs {
    flex-grow: 1;
    min-width: 0;
}

.tabs-scroll-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tabs-scroll-container::-webkit-scrollbar {
    display: none;
}

.tabs-inner {
    display: flex;
    gap: var(--spacing-sm);
    padding-bottom: 2px;
}

.tab-item {
    padding: var(--spacing-xs) var(--spacing-sm);
    white-space: nowrap;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.tab-item:hover {
    background: var(--border-primary);
}

.tab-item.active {
    background: var(--accent-primary);
    color:  var(--bg-primary);
}

.modern-search {
    position: relative;
    min-width: 250px;
}

.modern-search-input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    padding-right: 40px;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.modern-search-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-tertiary);
    outline: none;
}
   @media screen and (min-width: 769px) {
.modern-search-button {
    position: absolute;
    right: var(--spacing-sm);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 80%;
}
   }

/* Основной контент */
.content-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--spacing-xl);
}

@media (max-width: 992px) {
    .content-with-sidebar {
        grid-template-columns: 1fr;
    }
}

/* Карточки гайдов */
.guides-feed {
        display: grid;
		grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
		grid-auto-flow: row; /* Добавляем эту строку */
    position: relative;
    grid-auto-rows: auto;
    z-index: 1;
    width: 100%;
    float: none;
    gap: var(--spacing-lg);
    justify-items: center;
}

.guide-article {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-secondary);
    transition: all var(--transition-fast);
    position: relative;
	 padding: var(--spacing-sm);
    max-width: 600px;
    width: 100%;
}

.guide-article:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-accent);
}

.clickable-card {
    cursor: pointer;
}

.clickable-card > *:not(.article-actions, .article-actions *) {
    pointer-events: none;
}

.article-content-wrapper {
    display: flex;
    gap: var(--spacing-md);
}

@media (max-width: 768px) {
    .article-content-wrapper {
        flex-direction: column;
    }
	.guides-feed {
        display: flex;
		flex-direction: column;
}
}


.article-image img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    transition: transform var(--transition-normal);
}

.guide-article:hover .article-image img {
    transform: scale(1.03);
}

.article-text-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.article-header {
    margin-bottom: var(--spacing-sm);
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-xs);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.meta-item img {
    border-radius: 50%;
    width: 20px;
    height: 20px;
}

.article-title {
    font-size: 1.2rem;
    margin: 0 0 var(--spacing-sm) 0;
    line-height: 1.4;
    color: var(--text-primary);
}

.article-title a {
    color: inherit;
    text-decoration: none;
}

.article-title a:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

.article-excerpt {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
    font-size: 14px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
	-webkit-line-clamp: 5;
}

.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--border-secondary);
    margin-top: auto;
}

.article-stats {
    display: flex;
    gap: var(--spacing-md);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.article-actions {
    position: relative;
    z-index: 10;
}

.share-dropdown {
    position: relative;
    display: inline-block;
}

.share-btn {
    background: var(--bg-tertiary);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.share-btn:hover {
    background: var(--accent-primary);
    color:  var(--bg-primary);
}

.share-menu {
    position: absolute;
    right: 0;
    bottom: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    display: flex;
    gap: var(--spacing-sm);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-normal);
    pointer-events: auto;
}

.share-dropdown:hover .share-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.share-option {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
    font-size: 0.9rem;
}

.share-option.vk { background: #4a76a8; }
.share-option.tg { background: #2aabee; }
.share-option.tw { background: #1da1f2; }
.share-option.copy { background: var(--text-muted); }

.share-option:hover {
    transform: scale(1.1);
}

/* Пагинация */
.pagination-wrapper {
    margin-top: var(--spacing-xl);
}

.pagination-wrapper .page-numbers {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    flex-wrap: wrap;
}

.pagination-wrapper a,
.pagination-wrapper span {
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.pagination-wrapper a:hover {
    background: var(--bg-tertiary);
}

.pagination-wrapper .current {
    background: var(--accent-primary);
    color:  var(--bg-primary);
    border-color: var(--accent-primary);
}

.pagination-wrapper .dots {
    border: none;
}

/* Сайдбар */
.guides-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.sidebar-block {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    border: 1px solid var(--border-secondary);
}

.sidebar-title {
    font-size: 1.2rem;
    margin: 0 0 var(--spacing-md) 0;
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-secondary);
    color: var(--text-primary);
}

/* Популярные гайды */
.popular-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.popular-item {
    padding: var(--spacing-xs) 0;
    border-bottom: 1px dashed var(--border-secondary);
}

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

.popular-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    text-decoration: none;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

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

.popular-rank {
    font-weight: bold;
    color: var(--accent-primary);
    min-width: 20px;
    text-align: center;
    font-size: 0.9rem;
}

.popular-title {
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden; 
    text-overflow: ellipsis;
    line-height: 1.4;
}

/* Категории */
.categories-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-xs) var(--spacing-sm);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.category-link:hover {
    background: var(--accent-tertiary);
    color: var(--accent-primary);
}

.category-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: var(--spacing-sm);
}

.category-count {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    min-width: 24px;
    text-align: center;
}

/* Пустые состояния */
.no-guides,
.no-popular,
.no-categories {
    padding: var(--spacing-md);
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.guide-article {
    animation: fadeIn 0.3s ease forwards;
}

/* Микро-интеракции */
@media (hover: hover) {
    .category-link:hover .category-count {
        background: var(--bg-secondary);
    }
    
    .sort-button:hover {
        transform: translateY(-1px);
    }
    
    .tab-item:hover {
        transform: translateY(-1px);
    }
}

/* Улучшения для мобильных */
@media (max-width: 768px) {
    .modern-filters-row {
        flex-direction: row;
        align-items: stretch;
    }
    
    .filters-left {
        flex-direction: row;
        align-items: stretch;
        gap: var(--spacing-sm);
    }
    
    .sort-options {
        justify-content: center;
    }
    
    .archive-title {
        font-size: 2rem;
    }
    
    .article-image {
        width: 100%;
    }
    
    .article-image img {
        height: 200px;
    }
    
    .popular-title {
        -webkit-line-clamp: 1;
    }
}

/* Обновленный стиль для карточки гайда */
.guide-article {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.article-content-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.article-header {
    margin-bottom: var(--spacing-md);
}

.article-main-content {
    display: flex;
    gap: var(--spacing-md);
    flex: 1;
}



.article-text-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.article-footer {
    margin-top: auto;
    padding-top: var(--spacing-md);
}

@media (max-width: 768px) {
    .article-content-wrapper {
        flex-direction: column;
    }
	.tab-item{
		font-size: 10px;
		padding: 4px 4px;
	}
    
    .article-image {
        flex: 0 0 auto;
        max-width: 100%;
        width: 100%;
    }
}

.article-content-wrapper.horizontal-layout {
    display: flex;
    flex-direction: column;
    gap:0;
}

@media (max-width: 768px) {
    .article-content-wrapper.horizontal-layout {
        flex-direction: column;
    }
}
.article-content-wrapper.horizontal-layout {
    display: flex;
    gap:0;
	 flex-direction: column;
    align-items: start;
}

.article-image {
    grid-column: 1;
}

.article-text-content {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.title-excerpt-wrapper {
    grid-column: 1 / 3;
    display: flex;
    flex-direction: row;
    gap: var(--spacing-md);
    align-items: flex-start;
}

.title-excerpt-wrapper .article-title {
    flex: 0 0 35%;
    margin: 0;
}

.title-excerpt-wrapper .article-excerpt {
    flex: 1;
}

@media (max-width: 768px) {
    .article-content-wrapper.horizontal-layout {
        display: flex;
        flex-direction: column;
    }

    .title-excerpt-wrapper {
        flex-direction: column;
        grid-column: auto;
    }

    .title-excerpt-wrapper .article-title,
    .title-excerpt-wrapper .article-excerpt {
        flex: unset;
        width: 100%;
		-webkit-line-clamp: 4;
    }
}


/* 🌐 Мобильная адаптация */
@media (max-width: 768px) {
    .modern-filters-row {
        flex-direction: row;
        align-items: stretch;
    }

    .modern-search {
        width: 100%;
		min-width: auto;
    }

    .modern-search form {
        width: 100%;
        display: flex;
        align-items: center;
        flex-basis: fit-content;
        justify-content: space-between;
    }

    .modern-search-input {
        width: 100%;
    }

    .sort-options {
        flex-wrap: wrap;
    }

    .tabs-inner {
        overflow-x: auto;
    }
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.sort-controls label {
    font-weight: 600;
}

.sort-controls select {
    padding: 6px 10px;
    font-size: 0.9rem;
	border-radius: var(--radius-md);
    border: 1px solid var(--border-secondary);
}
.console-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}
.console-filter label {
    font-weight: 600;
}
.console-select {
    padding: 6px 10px;
    font-size: 0.9rem;
	border-radius: var(--radius-md);
    border: 1px solid var(--border-secondary);
}
.article-title a:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

.article-image img {
    transition: transform 0.3s ease;
}

.guide-article:hover .article-image img {
    transform: scale(1.05);
}
/* 📱 Глобальный стиль горизонтального скролла */
.modern-filters-row {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 12px;
  scroll-snap-type: x mandatory;
  padding: 8px 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}

.modern-filters-row::-webkit-scrollbar {
  display: none;
}

/* 📦 Обёртки: не дают переноса */
.filters-left,
.sort-controls,
.filter-tabs,
.modern-search {
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: space-around;
}

/* 📉 Уменьшить размер label и select */
.sort-controls label {
  font-size: 13px;
  margin-right: 4px;
  color: var(--text-secondary, #aaa);
}

.sort-select {
  font-size: 13px;
  padding: 4px 6px;
  border-radius: 6px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--bg-tertiary);
  color: var(--text-primary, #fff);
  min-width: 100px;
}

/* 🎯 Табы в одну строку */
.tabs-inner {
  display: flex;
  gap: 8px;
}

.tab-item {
  white-space: nowrap;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 6px;
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  transition: background 0.2s ease;
}

/* 🔍 Поиск */
.modern-search {
display: flex;
    align-items: center;
    flex-direction: row;
    flex-basis: fit-content;
}



.modern-search-button {
  padding: 4px 8px;
  border-radius: 0 6px 6px 0;
  background-color: var(--accent-primary);
  border: none;
  color: #000;
  display: flex;
  align-items: center;
}

/* Скрыть иконку сортировки на десктопе */
.sort-icon-button {
  display: none;
  background: transparent;
  border: none;
  padding: 6px;
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .sort-select, 
  .sort-controls,
  .sort-controls,
  .sort-controls label {
    display: none;
  }
  .console-select, 
  .console-filter,
  .console-filter label {
    display: none;
  }
  .modern-search-input {
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 6px 0 0 6px;
  border: 1px solid var(--bg-tertiary);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  width: 120px;
}
.article-image img{
    max-height: 140px;
}
  .sort-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .modern-search-button {
	position: relative;
    border: none;
    width: 24px;
    height: 24px;
}
}

/* Модалка */
.sort-modal {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  padding: 16px;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
  z-index: 9999;
}

.sort-modal-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sort-modal button {
  background: var(--accent-primary);
  color: #000;
  border: none;
  padding: 10px;
  border-radius: 8px;
  font-size: 15px;
}

.hidden {
  display: none;
}

/* 1. Стили для изображений гайдов */
.article-image {
    width: 100%;
}

.article-image img {
    width: 100%;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

/* 2. Фиксированная высота для заголовка и описания */
.title-excerpt-wrapper {
    min-height: auto;
    max-height: none;
}

.article-title {
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 1.1rem;
    line-height: 1.4;
    margin: 0 0 8px 0;
}

.article-excerpt {
    height: auto;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* 3. Адаптивность изображений */
@media (max-width: 768px) {
    .article-image img {
        height: 160px;
    }
}

/* 4. Карточки с авто-высотой */
.guide-article {
    height: auto;
    display: flex;
    flex-direction: column;
}

/* Консоли */


.console-tag {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: var(--spacing-xs);
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    white-space: nowrap;
}