/* Fix for scrollbar jump: always show vertical scrollbar to prevent horizontal layout shift
   when navigating between pages (scrollbar appears on long pages, disappears on short ones) */
html {
  overflow-y: scroll;
}

/* Blog Layout */
.blog-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 12px;
}

.blog-header {
  text-align: center;
  padding: 3rem 0 2rem;
  border-bottom: 1px solid #eee;
}

.blog-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: #333;
  margin-bottom: 0.5rem;
}

.blog-description {
  font-size: 1.1rem;
  color: #666;
  max-width: 600px;
  margin: 0 auto;
}

/* Breadcrumbs */
.blog-container {
  position: relative;
}

/* Content separators (horizontal lines) */
.content-separator,
.article-separator {
  width: 100%;
  height: 2px;
  background: #eee;
}

.content-separator {
  margin-top: 1rem;
  margin-bottom: 0;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem 0 1rem;
  font-size: 0.9rem;
  color: #666;
  flex-wrap: nowrap;
  overflow: hidden;
}

.article-separator {
  margin-top: 4rem;
  margin-bottom: 1rem;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.breadcrumb-item:last-child {
  flex-shrink: 1;
  min-width: 0;
}

.breadcrumb-link {
  color: #666;
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb-link:hover {
  color: #A68BD7;
}

.breadcrumb-separator {
  color: #999;
  user-select: none;
}

.breadcrumb-current {
  color: #A68BD7;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Category Tabs */
.category-tabs {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.category-tab {
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    color: #666;
    background: #f5f5f5;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.category-tab:hover {
    background: #D3C5EB;
    transform: translateY(-2px);
}

/* Per-category hover colors — matching the card colors in each section */
.category-tab[data-category="tips"]:hover {
    background: linear-gradient(135deg, #E1F5FE 0%, #B3E5FC 100%);
    color: #01579B;
}

.category-tab[data-category="health"]:hover {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    color: #2E7D32;
}

.category-tab[data-category="stories"]:hover {
    background: linear-gradient(135deg, #F3E5F5 0%, #E1BEE7 100%);
    color: #6A1B9A;
}

.category-tab[data-category="instructions"]:hover {
    background: linear-gradient(135deg, #FFE0B2 0%, #FFCC80 100%);
    color: #E65100;
}

.category-tab.active {
    background: #A68BD7;
    color: #fff;
    border-color: #A68BD7;
}

/* Per-category active colors — slightly darker than hover, same light palette */
.category-tab[data-category="tips"].active {
    background: #81D4FA;
    border-color: #81D4FA;
    color: #01579B;
}

.category-tab[data-category="health"].active {
    background: #A5D6A7;
    border-color: #A5D6A7;
    color: #2E7D32;
}

.category-tab[data-category="stories"].active {
    background: #CE93D8;
    border-color: #CE93D8;
    color: #6A1B9A;
}

.category-tab[data-category="instructions"].active {
    background: #FFB74D;
    border-color: #FFB74D;
    color: #E65100;
}

/* Blog Grid - список статей */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  padding: 3rem 0;
}

.blog-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.blog-card-image-wrapper {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.blog-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.blog-card:hover .blog-card-overlay {
  background: rgba(0, 0, 0, 0.2);
}

.blog-card-text-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.5rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.blog-card-text-overlay .blog-card-category {
  color: #fff !important;
  text-align: right;
  align-self: flex-end;
  margin-bottom: 0;
}

.blog-card-text-overlay .blog-card-title {
  color: #fff !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  margin: 0;
  align-self: flex-start;
}

.blog-card-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  color: #333;
  flex-direction: column;
}

.blog-card-category {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
  text-align: right;
}

/* Цвета категорий для карточек */
.blog-card.category-sovety {
  background: linear-gradient(135deg, #E1F5FE 0%, #B3E5FC 100%);
}

.blog-card.category-sovety .blog-card-category {
  color: #0288D1;
}

.blog-card.category-sovety .blog-card-title {
  color: #01579B;
}

.blog-card.category-zdorovie {
  background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
}

.blog-card.category-zdorovie .blog-card-category {
  color: #66BB6A;
}

.blog-card.category-zdorovie .blog-card-title {
  color: #2E7D32;
}

.blog-card.category-istorii {
  background: linear-gradient(135deg, #F3E5F5 0%, #E1BEE7 100%);
}

.blog-card.category-istorii .blog-card-category {
  color: #AB47BC;
}

.blog-card.category-istorii .blog-card-title {
  color: #6A1B9A;
}

.blog-card.category-instrukcii {
  background: linear-gradient(135deg, #FFE0B2 0%, #FFCC80 100%);
}

.blog-card.category-instrukcii .blog-card-category {
  color: #FB8C00;
}

.blog-card.category-instrukcii .blog-card-title {
  color: #E65100;
}

/* Большие заголовки для первых двух карточек */
.blog-card.featured .blog-card-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.blog-card-excerpt {
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.blog-card-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.blog-card.featured .blog-card-title,
.blog-card:first-child .blog-card-title,
.blog-card:nth-child(2) .blog-card-title {
  font-size: 2rem;
}

.blog-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  padding-top: 1rem;
  border-top: 1px solid #f0f0f0;
}

.blog-card-date {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.blog-card-read-time {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Single Article Page */
.article-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 12px;
}

.article-header {
  text-align: center;
  margin-bottom: 3rem;
}

.article-category {
  font-size: 0.9rem;
  font-weight: 600;
  color: #A68BD7;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
}

.article-title {
  font-size: 2.8rem;
  font-weight: 800;
  color: #333;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.article-meta {
  display: flex;
  justify-content: center;
  gap: 2rem;
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 2rem;
}

.article-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.article-date,
.article-read-time {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.article-featured-image {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 3rem;
}

/* Article Content */
.article-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #333;
}

.article-content h2 {
  font-size: 2rem;
  font-weight: 700;
  color: #333;
  margin: 2.5rem 0 1rem;
  line-height: 1.3;
}

.article-content h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #444;
  margin: 2rem 0 1rem;
}

.article-content p {
  margin-bottom: 1.5rem;
}

.article-content ul,
.article-content ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
}

.article-content li {
  margin-bottom: 0.5rem;
}

.article-content a {
  color: #A68BD7;
  text-decoration: underline;
  transition: opacity 0.2s;
}

.article-content a:hover {
  opacity: 0.8;
}

.article-content blockquote {
  border-left: 4px solid #A68BD7;
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: #555;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 2rem 0;
}

.article-content .article-image {
  width: 85%;
  height: auto;
  border-radius: 16px;
  margin: 2.5rem auto;
  display: block;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.article-content code {
  background: #f5f5f5;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
}

.article-content pre {
  background: #f5f5f5;
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 2rem 0;
}

.article-content pre code {
  background: none;
  padding: 0;
}

/* Article Footer */
.article-footer {
  margin-top: 4rem;
  padding-top: 2rem;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.article-tag {
  background: #f5f5f5;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  color: #666;
  text-decoration: none;
  transition: background 0.2s;
}

.article-tag:hover {
  background: #A68BD7;
  color: #fff;
}

.article-share {
  text-align: center;
}

.article-share h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: #333;
}

.share-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f5f5f5;
  color: #666;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.share-button:hover {
  background: #A68BD7;
  color: #fff;
}

/* Sidebar (опционально) */
.blog-layout-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  padding: 3rem 0;
}

.blog-sidebar {
  position: sticky;
  top: 2rem;
  height: fit-content;
}

.sidebar-widget {
  background: #fff;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 2rem;
}

.sidebar-widget h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 1rem;
}

.sidebar-widget ul {
  list-style: none;
  padding: 0;
}

.sidebar-widget li {
  margin-bottom: 0.75rem;
}

.sidebar-widget a {
  color: #666;
  text-decoration: none;
  transition: color 0.2s;
}

.sidebar-widget a:hover {
  color: #A68BD7;
}

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

/* Tablet */
@media (min-width: 768px) {
  .blog-container,
  .article-container {
    padding: 0 24px;
  }
}

@media (max-width: 768px) {
  .blog-title {
    font-size: 2rem;
  }

  .blog-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
  }

  .article-title {
    font-size: 2.2rem;
  }

  .article-meta {
    gap: 1rem;
  }

  .blog-layout-with-sidebar {
    grid-template-columns: 1fr;
  }

  .blog-sidebar {
    position: static;
  }
}

/* Mobile */
@media (max-width: 575px) {
  .blog-container,
  .article-container {
    padding: 0 1rem;
  }

  .blog-header {
    padding: 2rem 0 1.5rem;
  }

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

  .blog-description {
    font-size: 1rem;
  }

  .blog-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 2rem 0;
  }

  .blog-card-image-wrapper {
    height: 180px;
  }

  .blog-card-image {
    height: 180px;
  }

  .blog-card-title {
    font-size: 1.2rem;
  }

  .article-title {
    font-size: 1.8rem;
  }

  .article-content {
    font-size: 1rem;
  }

  .article-content h2 {
    font-size: 1.6rem;
  }

  .article-content h3 {
    font-size: 1.3rem;
  }

  .article-meta {
    font-size: 0.85rem;
  }

  .article-content .article-image {
    width: 100%;
    margin: 2rem auto;
  }

  .share-buttons {
    flex-wrap: wrap;
  }

  .category-tabs {
    gap: 0.5rem;
    margin: 1.5rem 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
  }

  .category-tabs::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
  }

  .category-tab {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    white-space: nowrap;
    flex-shrink: 0;
  }
}
