/* ============================================
   BLOG LIST PAGE - Список постов блога
   ============================================ */

/* --- Карточка поста --- */
.blog.style-1 .inner-box {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-secondary, rgba(255,255,255,0.05));
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.2s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  height: 100%;
}

.blog.style-1 .inner-box:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.3);
}

.blog.style-1 .inner-box:focus-visible {
  box-shadow:
    0 12px 30px rgba(0,0,0,0.25),
    0 0 0 3px color-mix(in srgb, var(--accent-secondary, var(--color-primary, #32b8c6)) 65%, transparent);
  border-color: color-mix(in srgb, var(--accent-secondary, var(--color-primary, #32b8c6)) 55%, rgba(255,255,255,0.18));
  transform: translateY(-2px);
}

html[data-theme="light"] .blog.style-1 .inner-box,
html[data-theme="light_japan"] .blog.style-1 .inner-box {
  background: #fff;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

html[data-theme="light"] .blog.style-1 .inner-box:hover,
html[data-theme="light_japan"] .blog.style-1 .inner-box:hover {
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

/* --- Контейнер картинки --- */
.blog.style-1 .image-box {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 aspect ratio */
  overflow: hidden;
  background: rgba(0,0,0,0.2);
}

.blog.style-1 .image-box img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.blog.style-1 .inner-box:hover .image-box img {
  transform: scale(1.08);
}

.category-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(var(--accent-primary-rgb, 201, 24, 43), 0.9);
    color: #fff;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 2;
}

/* --- Информация о посте --- */
.blog.style-1 .author-box {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.blog.style-1 .author-box .detail {
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--text-muted, rgba(255,255,255,0.6));
  font-weight: 500;
}

.blog.style-1 .author-box .detail p {
  margin: 0;
}

.blog.style-1 .author-box .detail i {
    margin-right: 4px;
}

.blog.style-1 .author-box h4 {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 12px 0;
  color: var(--text-primary, #fff);
  /* Ограничение строк */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

html[data-theme="light"] .blog.style-1 .author-box h4,
html[data-theme="light_japan"] .blog.style-1 .author-box h4 {
  color: var(--text-primary, #1a1a1a);
}

.blog.style-1 .author-box h5 {
  font-size: 13px;
  font-weight: 500;
  margin: 0;
  color: var(--text-muted, rgba(255,255,255,0.6));
}

.blog.style-1 .author-box h5 i {
    margin-right: 4px;
}

/* --- Сайдбар: Популярное --- */
.blog-search,
.blog-sidebar .card-body {
  padding: 20px;
  border-radius: 16px;
  background: var(--bg-secondary, rgba(255,255,255,0.05));
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  border: 1px solid rgba(255,255,255,0.05);
}

.blog-search h5 {
    font-weight: 700;
    color: var(--text-primary, #fff);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

html[data-theme="light"] .blog-search h5,
html[data-theme="light_japan"] .blog-search h5 {
    color: var(--text-primary, #1a1a1a);
    border-bottom-color: rgba(0,0,0,0.1);
}

.popular-blogs {
  list-style: none;
  padding: 0;
  margin: 0;
}

.popular-blogs li {
  margin-bottom: 16px;
}

.popular-blogs li:last-child {
  margin-bottom: 0;
}

.popular-blogs a {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.2s ease;
  padding: 8px;
  border-radius: 12px;
}

.popular-blogs a:hover {
    background: rgba(255,255,255,0.03);
    transform: translateX(4px);
}

html[data-theme="light"] .popular-blogs a:hover,
html[data-theme="light_japan"] .popular-blogs a:hover {
    background: rgba(0,0,0,0.03);
}

.popular-blogs a:hover h6 {
  color: var(--accent-primary, #c9182b);
}

.popular-blogs img {
  width: 100px;
  height: 75px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.popular-blogs .content-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.popular-blogs .date {
  font-size: 11px;
  color: var(--text-muted, rgba(255,255,255,0.5));
  margin-bottom: 4px;
  font-weight: 500;
}

.popular-blogs h6 {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
  transition: color 0.2s ease;
  /* Ограничение строк */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text-primary, #fff);
}

html[data-theme="light"] .popular-blogs h6,
html[data-theme="light_japan"] .popular-blogs h6 {
    color: var(--text-primary, #1a1a1a);
}

/* ============================================
   Адаптив блога
   ============================================ */
@media (max-width: 991px) {
    .blog.style-1 .col-lg-6 {
        margin-bottom: 24px;
    }
    
    .blog-search, .blog-sidebar .card-body {
        margin-top: 24px;
    }
}

@media (max-width: 576px) {
    .blog.style-1 .author-box {
        padding: 14px 16px;
    }
    
    .blog.style-1 .author-box h4 {
        font-size: 1.05rem;
    }
    
    .custom-pills .nav-link {
        padding: 6px 16px;
        font-size: 13px;
    }
    
    .popular-blogs img {
        width: 80px;
        height: 60px;
    }
}

/* ============================================
   Блог - Категории (Табы)
   ============================================ */
.blog-categories {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

.blog-categories::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.custom-pills {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    padding-bottom: 4px;
}

.custom-pills .nav-link {
    background: var(--bg-secondary, rgba(255, 255, 255, 0.05));
    border-radius: 20px;
    padding: 8px 20px;
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.custom-pills .nav-link:hover {
    color: var(--text-primary, #fff);
    background: var(--bg-tertiary, rgba(255, 255, 255, 0.1));
}

.custom-pills .nav-link.active {
    background: var(--accent-primary, #c9182b);
    color: #fff;
    box-shadow: 0 4px 12px rgba(var(--accent-primary-rgb, 201, 24, 43), 0.3);
}

html[data-theme="light"] .custom-pills .nav-link,
html[data-theme="light_japan"] .custom-pills .nav-link {
    background: #f1f5f9;
    color: #475569;
}

html[data-theme="light"] .custom-pills .nav-link:hover,
html[data-theme="light_japan"] .custom-pills .nav-link:hover {
    background: #e2e8f0;
    color: #0f172a;
}

html[data-theme="light"] .custom-pills .nav-link.active,
html[data-theme="light_japan"] .custom-pills .nav-link.active {
    background: var(--accent-secondary, #7a1c1c);
    color: #fff;
}

/* ============================================
   NEON THEME - Blog List
   ============================================ */
html[data-theme="neon"] .blog.style-1 .inner-box {
  background: rgba(16, 19, 31, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.15);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

html[data-theme="neon"] .blog.style-1 .inner-box:hover {
  border-color: rgba(0, 240, 255, 0.35);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5), 0 0 25px rgba(0, 212, 255, 0.15);
}

html[data-theme="neon"] .blog.style-1 .author-box h4 {
  color: rgba(255, 255, 255, 0.95);
}

html[data-theme="neon"] .blog.style-1 .inner-box:hover .author-box h4 {
  color: var(--color-primary, #00f3ff);
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

html[data-theme="neon"] .blog-sidebar .card-body {
  background: rgba(16, 19, 31, 0.9);
  border: 1px solid rgba(0, 240, 255, 0.15);
}

html[data-theme="neon"] .popular-blogs h6 {
  color: rgba(255, 255, 255, 0.9);
  transition: color 0.2s ease;
}

html[data-theme="neon"] .popular-blogs a:hover h6 {
  color: var(--color-primary, #00f3ff);
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.25);
}

html[data-theme="neon"] .blog-search input {
  background: rgba(0, 240, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.25);
  color: #fff;
}

html[data-theme="neon"] .blog-search input:focus {
  border-color: rgba(0, 240, 255, 0.5);
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
}

/* ============================================
   HARD JAPAN THEME - Blog List
   ============================================ */
html[data-theme="hard_japan"] .blog.style-1 .inner-box {
  background: rgba(18, 18, 18, 0.9);
  border: 1px solid rgba(212, 175, 55, 0.12);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

html[data-theme="hard_japan"] .blog.style-1 .inner-box:hover {
  border-color: rgba(212, 175, 55, 0.35);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5), 0 0 20px rgba(196, 30, 58, 0.1);
}

html[data-theme="hard_japan"] .blog.style-1 .author-box h4 {
  color: rgba(255, 255, 255, 0.95);
}

html[data-theme="hard_japan"] .blog.style-1 .inner-box:hover .author-box h4 {
  color: var(--accent-secondary, #d4af37);
}

html[data-theme="hard_japan"] .blog-sidebar .card-body {
  background: rgba(18, 18, 18, 0.92);
  border: 1px solid rgba(212, 175, 55, 0.15);
}

html[data-theme="hard_japan"] .popular-blogs h6 {
  color: rgba(255, 255, 255, 0.9);
}

html[data-theme="hard_japan"] .popular-blogs a:hover h6 {
  color: var(--accent-secondary, #d4af37);
}

html[data-theme="hard_japan"] .blog-search input {
  background: rgba(212, 175, 55, 0.06);
  border-color: rgba(212, 175, 55, 0.2);
  color: #fff;
}

html[data-theme="hard_japan"] .blog-search input:focus {
  border-color: rgba(212, 175, 55, 0.4);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.15);
}

/* ============================================
   LIGHT JAPAN THEME - Blog List
   ============================================ */
html[data-theme="light_japan"] .blog.style-1 .inner-box {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}

html[data-theme="light_japan"] .blog.style-1 .inner-box:hover {
  border-color: rgba(31, 107, 78, 0.25);
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.12);
}

html[data-theme="light_japan"] .blog.style-1 .author-box h4 {
  color: var(--text-primary, #0f172a);
}

html[data-theme="light_japan"] .blog.style-1 .inner-box:hover .author-box h4 {
  color: var(--accent-secondary, #7a1c1c);
}

html[data-theme="light_japan"] .blog.style-1 .author-box h5,
html[data-theme="light_japan"] .blog.style-1 .author-box .detail {
  color: var(--text-secondary, #334155);
}

html[data-theme="light_japan"] .blog-sidebar .card-body {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

html[data-theme="light_japan"] .blog-sidebar h5 {
  color: var(--text-primary, #0f172a);
}

html[data-theme="light_japan"] .popular-blogs h6 {
  color: var(--text-primary, #0f172a);
}

html[data-theme="light_japan"] .popular-blogs a:hover h6 {
  color: var(--accent-secondary, #7a1c1c);
}

html[data-theme="light_japan"] .popular-blogs .date {
  color: var(--text-muted, #64748b);
}

html[data-theme="light_japan"] .blog-search input {
  background: rgba(15, 23, 42, 0.03);
  border-color: rgba(15, 23, 42, 0.12);
  color: var(--text-primary, #0f172a);
}

html[data-theme="light_japan"] .blog-search input:focus {
  border-color: rgba(31, 107, 78, 0.4);
  box-shadow: 0 0 10px rgba(31, 107, 78, 0.1);
}

html[data-theme="light_japan"] .blog-search input::placeholder {
  color: var(--text-muted, #64748b);
}

/* Final blog page polish: consistent with the rebuilt home surface. */
.blog-list-page {
  --blog-accent: #e31b4d;
  --blog-accent-2: #d6b25e;
  --blog-panel: rgba(13, 17, 29, .70);
  --blog-panel-strong: rgba(13, 17, 29, .88);
  --blog-line: rgba(255,255,255,.11);
  --blog-text: rgba(255,255,255,.94);
  --blog-muted: rgba(255,255,255,.62);
  padding-top: 34px;
}

html[data-theme="neon"] .blog-list-page {
  --blog-accent: #24b9d6;
  --blog-accent-2: #8f7cff;
  --blog-panel: rgba(9, 15, 30, .74);
  --blog-panel-strong: rgba(9, 15, 30, .90);
  --blog-line: rgba(36,185,214,.18);
}

html[data-theme="light_japan"] .blog-list-page,
html[data-theme="light"] .blog-list-page {
  --blog-accent: #59633f;
  --blog-accent-2: #b58f45;
  --blog-panel: rgba(255,255,255,.74);
  --blog-panel-strong: rgba(255,255,255,.92);
  --blog-line: rgba(26,34,48,.12);
  --blog-text: #161b26;
  --blog-muted: rgba(39,50,68,.66);
}

.blog-list-hero {
  margin: 0 0 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--blog-line);
}

.blog-list-hero__title {
  margin: 0;
  color: var(--blog-text);
  font-size: 38px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.blog-list-hero__text {
  max-width: 680px;
  margin: 10px 0 0;
  color: var(--blog-muted);
  font-size: 15px;
  line-height: 1.55;
}

.blog-list-page .blog-categories {
  margin-bottom: 22px !important;
}

.blog-list-page .custom-pills {
  gap: 8px;
}

.blog-list-page .custom-pills .nav-link {
  border-radius: 9px;
  min-height: 38px;
  padding: 9px 15px;
  background: transparent !important;
  border: 1px solid var(--blog-line);
  color: var(--blog-muted);
  box-shadow: none !important;
}

.blog-list-page .custom-pills .nav-link:hover,
.blog-list-page .custom-pills .nav-link.active {
  background: color-mix(in srgb, var(--blog-accent) 16%, transparent) !important;
  border-color: color-mix(in srgb, var(--blog-accent) 45%, var(--blog-line));
  color: var(--blog-text);
}

.blog-list-page .custom-pills .nav-link.active {
  color: #fff;
}

html[data-theme="light_japan"] .blog-list-page .custom-pills .nav-link.active,
html[data-theme="light"] .blog-list-page .custom-pills .nav-link.active {
  color: #172036;
}

.blog-list-grid {
  row-gap: 20px;
}

.blog-list-grid__col {
  margin-bottom: 0 !important;
}

.blog-list-page .blog-list-card,
.blog-list-page.blog.style-1 .inner-box.blog-list-card {
  border-radius: 18px;
  background: var(--blog-panel) !important;
  border: 1px solid var(--blog-line);
  box-shadow: 0 18px 38px rgba(0,0,0,.22);
  overflow: hidden;
}

.blog-list-page .blog-list-card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--blog-accent) 44%, var(--blog-line));
  box-shadow: 0 24px 54px rgba(0,0,0,.30), 0 0 24px color-mix(in srgb, var(--blog-accent) 14%, transparent);
}

.blog-list-page .image-box {
  background: rgba(255,255,255,.04);
}

.blog-list-page .category-badge {
  top: 12px;
  left: 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--blog-accent) 82%, rgba(0,0,0,.18));
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 8px 18px rgba(0,0,0,.22);
}

.blog-list-page .author-box {
  min-height: 152px;
  padding: 16px 17px 18px;
}

.blog-list-page .author-box .detail,
.blog-list-page .author-box h5,
.blog-list-page .popular-blogs .date {
  color: var(--blog-muted) !important;
}

.blog-list-page .author-box h4,
.blog-list-page .popular-blogs h6,
.blog-list-page .blog-search h5 {
  color: var(--blog-text) !important;
}

.blog-list-page .blog-list-card:hover h4,
.blog-list-page .popular-blogs a:hover h6 {
  color: color-mix(in srgb, var(--blog-accent-2) 70%, #fff) !important;
}

html[data-theme="neon"] .blog-list-page .blog-list-card:hover h4,
html[data-theme="neon"] .blog-list-page .popular-blogs a:hover h6 {
  color: color-mix(in srgb, var(--blog-accent) 70%, #fff) !important;
  text-shadow: none;
}

.blog-list-page .blog-search,
.blog-list-page .blog-ad-sidebar,
.blog-list-page .blog-ad-banner {
  background: var(--blog-panel-strong) !important;
  border: 1px solid var(--blog-line);
  border-radius: 18px;
  box-shadow: 0 18px 38px rgba(0,0,0,.20);
}

.blog-list-page .blog-search {
  padding: 18px;
}

.blog-list-page .blog-search h5 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px !important;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--blog-line);
}

.blog-list-page .blog-search h5 i {
  color: var(--blog-accent) !important;
}

.blog-list-page .popular-blogs a {
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
}

.blog-list-page .popular-blogs a:hover {
  background: color-mix(in srgb, var(--blog-accent) 9%, transparent);
  border-color: color-mix(in srgb, var(--blog-accent) 24%, transparent);
  transform: translateX(3px);
}

.blog-list-page .popular-blogs img {
  width: 92px;
  height: 64px;
  border-radius: 10px;
}

html[data-theme="light_japan"] .blog-list-page .blog-list-card,
html[data-theme="light_japan"] .blog-list-page .blog-search,
html[data-theme="light_japan"] .blog-list-page .blog-ad-sidebar,
html[data-theme="light_japan"] .blog-list-page .blog-ad-banner,
html[data-theme="light"] .blog-list-page .blog-list-card,
html[data-theme="light"] .blog-list-page .blog-search,
html[data-theme="light"] .blog-list-page .blog-ad-sidebar,
html[data-theme="light"] .blog-list-page .blog-ad-banner {
  box-shadow: 0 14px 34px rgba(28,34,48,.10);
}

@media (max-width: 767px) {
  .blog-list-hero__title {
    font-size: 30px;
  }

  .blog-list-hero__text {
    font-size: 14px;
  }

  .blog-list-page .author-box {
    min-height: auto;
  }
}
