/* ============================================
   Blog-specific styles for Ananas.Click
   ============================================ */

/* --- Header fix: allow dropdown to show --- */
.landing-header {
  overflow: visible !important;
}

/* --- Article Card --- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  margin-top: 40px;
}

/* Первая статья (featured) — на всю ширину */
.blog-card--featured {
  grid-column: 1 / -1;
}

.blog-card--featured .blog-card__image {
  height: 360px;
}

.blog-card--featured .blog-card__title {
  font-size: clamp(24px, 3vw, 32px);
}

.blog-card {
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--landing-shadow);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 55px rgba(28, 51, 140, 0.18);
}

.blog-card__image {
  width: 100%;
  height: 240px;
  object-fit: cover;
  transition: opacity 0.2s ease;
}

.blog-card:hover .blog-card__image {
  opacity: 0.92;
}

.blog-card__body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.blog-card__title {
  margin: 0 0 12px;
  color: var(--landing-text);
  font-weight: 500;
  font-size: clamp(20px, 2.5vw, 26px);
  line-height: 1.3;
}

.blog-card__title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.blog-card__title a:hover {
  color: var(--landing-blue);
}

.blog-card__excerpt {
  color: var(--landing-muted);
  font-size: 16px;
  line-height: 1.5;
  margin: 0 0 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.blog-card__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 14px;
  color: var(--landing-muted);
  margin-top: auto;
}

.blog-card__date {
  font-size: 13px;
}

/* --- Tags --- */
.blog-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--landing-gray);
  color: var(--landing-blue);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.blog-tag:hover {
  background: var(--landing-blue);
  color: #fff;
}

/* --- Article Page --- */
.article-page {
  max-width: 820px;
  margin: 0 auto;
}

.article-hero-image {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: 20px;
  margin-bottom: 32px;
}

.article-header {
  margin-bottom: 32px;
}

.article-title {
  margin: 0 0 16px;
  color: var(--landing-text);
  font-weight: 500;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.2;
}

.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.article-date {
  color: var(--landing-muted);
  font-size: 15px;
}

.article-keywords {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* --- Article Content --- */
.article-content {
  font-size: 18px;
  line-height: 1.65;
  color: var(--landing-text);
}

.article-content h2 {
  color: var(--landing-blue);
  font-weight: 500;
  font-size: clamp(22px, 3vw, 28px);
  margin: 40px 0 16px;
}

.article-content h3 {
  color: var(--landing-text);
  font-weight: 500;
  font-size: clamp(18px, 2.5vw, 22px);
  margin: 32px 0 12px;
}

.article-content p {
  margin: 0 0 16px;
}

.article-content ul,
.article-content ol {
  margin: 0 0 16px;
  padding-left: 24px;
}

.article-content li {
  margin-bottom: 8px;
}

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

.article-content blockquote {
  border-left: 4px solid var(--landing-blue);
  padding: 16px 20px;
  margin: 24px 0;
  background: var(--landing-gray);
  border-radius: 0 12px 12px 0;
  font-style: italic;
}

.article-content pre {
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 20px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 20px 0;
  font-size: 14px;
  line-height: 1.5;
}

.article-content code {
  background: var(--landing-gray);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 15px;
}

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

.article-content a {
  color: var(--landing-blue);
  text-decoration: underline;
}

.article-content a:hover {
  color: var(--landing-blue-2);
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

.article-content th,
.article-content td {
  padding: 12px 16px;
  border: 1px solid #e0e0e0;
  text-align: left;
}

.article-content th {
  background: var(--landing-gray);
  font-weight: 500;
}

/* --- Related Articles --- */
.related-articles {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid #e8e8e8;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }
  
  .blog-card--featured .blog-card__image {
    height: 280px;
  }
}

@media (max-width: 760px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }

  .blog-card__image {
    height: 200px;
  }
  
  .blog-card--featured .blog-card__image {
    height: 240px;
  }

  .article-hero-image {
    max-height: 300px;
  }

  .article-title {
    font-size: clamp(24px, 5vw, 32px);
  }

  .article-content {
    font-size: 16px;
  }
}

@media (max-width: 520px) {
  .blog-card__body {
    padding: 16px;
  }

  .blog-card__excerpt {
    font-size: 14px;
    -webkit-line-clamp: 2;
  }

  .article-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* --- Search Filter Bar --- */
.search-filter-bar {
  margin: 32px 0;
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-form__input-wrapper {
  display: flex;
  gap: 0;
  flex: 1;
}

.search-form__input {
  flex: 1;
  padding: 14px 20px;
  border: 2px solid var(--landing-gray);
  border-radius: 12px;
  font-size: 16px;
  transition: border-color 0.2s ease;
  outline: none;
}

.search-form__input:focus {
  border-color: var(--landing-blue);
}

.search-form__btn {
  padding: 14px 20px;
  background: var(--landing-blue);
  border: none;
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease;
  margin-left: 12px;
}

.search-form__btn:hover {
  background: var(--landing-blue-2);
}

.search-form__filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.search-form__select {
  padding: 10px 16px;
  border: 2px solid var(--landing-gray);
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
  outline: none;
}

.search-form__select:focus {
  border-color: var(--landing-blue);
}

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 48px;
  padding: 24px 0;
}

.pagination__pages {
  display: flex;
  gap: 8px;
}

.pagination__page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--landing-shadow);
  text-decoration: none;
  color: var(--landing-text);
  font-weight: 500;
  transition: all 0.2s ease;
}

.pagination__page:hover {
  background: var(--landing-blue);
  color: #fff;
  transform: translateY(-2px);
}

.pagination__page--active {
  background: var(--landing-blue);
  color: #fff;
}

.pagination__prev,
.pagination__next {
  padding: 10px 20px;
  background: #fff;
  box-shadow: var(--landing-shadow);
  border-radius: 10px;
  text-decoration: none;
  color: var(--landing-text);
  font-weight: 500;
  transition: all 0.2s ease;
}

.pagination__prev:hover,
.pagination__next:hover {
  background: var(--landing-blue);
  color: #fff;
  transform: translateY(-2px);
}

/* --- Breadcrumbs --- */
.breadcrumbs {
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--landing-muted);
}

.breadcrumbs__separator {
  margin: 0 8px;
}

.breadcrumbs a {
  color: var(--landing-blue);
  text-decoration: none;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

/* --- Article Actions (Share) --- */
.article-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 0;
  padding: 20px;
  background: var(--landing-gray);
  border-radius: 14px;
}

.share-buttons {
  display: flex;
  gap: 12px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--landing-muted);
}

.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.share-btn--telegram:hover {
  color: #0088cc;
  background: #e6f4ff;
}

.share-btn--vk:hover {
  color: #4a76a8;
  background: #e8f0fe;
}

.share-btn--twitter:hover {
  color: #1da1f2;
  background: #e8f5fd;
}

.share-btn--copy:hover {
  color: var(--landing-blue);
  background: #f0f4ff;
}

/* --- Article TOC --- */
.article-toc {
  position: fixed;
  right: 24px;
  top: 200px;
  width: 260px;
  max-height: calc(100vh - 240px);
  overflow-y: auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--landing-shadow);
  padding: 20px;
  z-index: 100;
}

.article-toc__title {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--landing-text);
}

.article-toc__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.article-toc__link {
  display: block;
  padding: 8px 12px;
  color: var(--landing-muted);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.4;
  border-left: 2px solid transparent;
  transition: all 0.2s ease;
}

.article-toc__link:hover,
.article-toc__link--active {
  color: var(--landing-blue);
  border-left-color: var(--landing-blue);
  background: rgba(0, 136, 204, 0.05);
}

.article-toc__link--level-3 {
  padding-left: 24px;
  font-size: 13px;
}

/* --- Reading Progress Bar --- */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 4px;
  background: linear-gradient(90deg, var(--landing-blue), var(--landing-blue-2));
  z-index: 9999;
  transition: width 0.1s ease;
}

/* --- Theme Toggle --- */
.landing-nav__theme {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--landing-text);
  transition: all 0.2s ease;
  padding: 0;
  text-decoration: none;
  pointer-events: auto;
  position: relative;
  z-index: 10;
}

.landing-nav__theme svg {
  pointer-events: none;
  width: 20px;
  height: 20px;
  display: block;
}

.landing-nav__theme:hover {
  background: var(--landing-gray);
  border-radius: 8px;
}

/* --- Back to Top --- */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--landing-blue);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 136, 204, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 1000;
}

.back-to-top--visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0, 136, 204, 0.4);
}
