/*
Theme Name: Author Dark Theme
Theme URI: https://example.com
Author: Your Name
Author URI: https://example.com
Description: Темная тема для сайта автора с блогом и каталогом книг
Version: 1.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: author-dark
*/

/* Fonts */
@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter-VariableFont_opsz,wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter-Italic-VariableFont_opsz,wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg-primary: #000000;
  --bg-secondary: #1a1a1a;
  --text-primary: #ffffff;
  --text-secondary: #b0b0b0;
  --accent: #006494;
  --accent-hover: #0177a9;
  --border: #333333;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  font-weight: 400;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  background: var(--bg-primary);
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.main-nav a:hover,
.main-nav a.current-menu-item,
.main-nav .current-menu-item > a,
.main-nav .current_page_item > a,
.main-nav .current-cat > a {
  color: var(--text-primary);
}


.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-logo {
  font-size: 38px;
  font-weight: 300;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -2px;
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 30px;
}

.main-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: color 0.3s;
}

.main-nav a:hover {
  color: var(--text-primary);
}


/* Mobile Menu */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
  padding: 5px;
}

.menu-close {
  display: none;
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 32px;
  cursor: pointer;
  z-index: 1000;
  padding: 5px;
  line-height: 1;
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }
  
  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    height: 100vh;
    background: var(--bg-secondary);
    transition: right 0.3s ease;
    z-index: 999;
  }
  
  .main-nav.active {
    right: 0;
  }
  
  .main-nav.active .menu-close {
    display: block;
  }
  
  .main-nav ul {
    flex-direction: column;
    padding: 80px 30px 30px;
    gap: 20px;
  }
  
  .main-nav a {
    font-size: 18px;
  }
}

/* Hero Section */
.hero-section {
  padding: 0px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: 500px;
}

#particles-js {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-section .container {
  position: relative;
  z-index: 10;
}

.author-image {
  max-width: 1000px;
  width: 100%;
  height: auto;
  margin: 0 auto 40px;
  border-radius: 10px;
  filter: grayscale(100%);
  position: relative;
  z-index: 10;
}

.hero-quote {
  max-width: 700px;
  margin: 0 auto;
  font-size: 18px;
  line-height: 1.8;
  color: var(--text-secondary);
  font-style: italic;
  font-weight: 400;
  position: relative;
  z-index: 10;
}

/* Cards Grid (General) */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
  margin-bottom: 60px;
}

/* Books Grid - специфичная сетка для обложек */
.books-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.card {
  background: var(--bg-secondary);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.3s;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-5px);
}

/* Blog Cards (Standard) */
/*.blog-card {
/*  background: var(--bg-secondary);
/*}

/*.blog-card .card-content {
/*  padding: 25px;
/*}

/* --- ИСПРАВЛЕННЫЕ СТИЛИ (для объектов на белом фоне) --- */

.card.blog-card {
  border-radius: 0;
  background-color: #1a1a1a;
}

.blog-card {
    position: relative;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    /* background-blend-mode: multiply; */
    background-color: #333333;
/*    height: 320px; */
    aspect-ratio: 4 / 5;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    border: 1px solid #333;
    transition: all 0.3s ease;
    filter: grayscale(0);
}



/* Затемнение снизу для текста */
.blog-card::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 70%; /* Поднял градиент повыше */
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%);
  z-index: 1;
}

.blog-card:hover {
  border-color: var(--text-primary);
  transform: translateY(-5px);
  /* При наведении можно чуть высветлить фон, чтобы объект "засветился" */
  background-color: #555; 
  filter: grayscale(1);
}

/* Контент */
.blog-card .card-content {
  position: relative;
  z-index: 3;
  padding: 20px;
}

.blog-card .card-title {
  margin: 0;
  line-height: 1.3;
}

.blog-card .card-title a {
  color: #fff;
  background: #000;
  padding: 4px 6px; /* Чуть больше воздуха вокруг текста */
  text-decoration: none;
  font-weight: 700;
  text-transform: uppercase;
  box-shadow: 6px 0 0 #000, -6px 0 0 #000;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.blog-card .card-excerpt {
  display: none; 
}

/* Book Cards - только обложки */
.book-card {
  background: transparent;
  cursor: pointer;
}

.book-card a {
  display: block;
}

.book-card:hover {
  transform: scale(1.05);
}

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

/* Book Cover - для обложек книг */
.book-cover {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: 10px;
}

.book-cover.no-image {
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 14px;
}

.card-content {
  padding: 25px;
}

.card-title {
  font-size: 20px;
  margin-bottom: 15px;
  color: var(--text-primary);
}

.card-title a {
  color: var(--text-primary);
  text-decoration: none;
}

.card-title a:hover {
  color: var(--accent);
}

.card-excerpt {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --- Archive Pages Styles (BLOG SNIPPETS) --- */

/* Сетка: 3 колонки на десктопе */
.archive-blog .blog-snippets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-bottom: 60px;
}

/* Карточка сниппета */
.blog-snippet {
  display: block;
  position: relative;
  background: var(--bg-secondary);
  border-radius: 0px;
  overflow: hidden;
  transition: transform 0.3s;
  text-decoration: none;
  aspect-ratio: 4/5; /* Соотношение сторон 4:5 */
  height: auto;
}

.blog-snippet:hover {
  transform: translateY(-5px);
}

.blog-snippet-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

/* Градиент поверх изображения */
.blog-snippet::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70%;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%);
  z-index: 2;
}

/* Контейнер контента внутри сниппета */
.blog-snippet-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  z-index: 3;
  
  /* ВАЖНО: Используем block, а не flex, чтобы inline-фоны работали корректно */
  display: block; 
  text-align: right; 
}

/* Блок заголовка */
.blog-snippet-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 12px 0; /* Отступ снизу вместо gap */
    text-align: right;
    text-transform: uppercase;
}

/* Первая часть заголовка (первые 2 слова) */
.blog-snippet-title-first {
  color: var(--text-primary);
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  font-size: 18px;
  
  /* ВАЖНО: Делаем блочным, чтобы перенести остальное на новую строку */
  display: block; 
  width: 100%;
  margin-bottom: 8px; /* Отступ до красной плашки */
}

/* Вторая часть заголовка (красный фон) */
.blog-snippet-title-rest {
    display: inline;
    background: #000000;
    color: var(--text-primary);
    padding: 3px 8px;
    text-transform: uppercase;
    font-size: 18px;
    line-height: 1.6;
    
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    
    margin-left: 0; /* Уже на новой строке, отступ не нужен */
    box-shadow: 5px 0 0 #000000, -5px 0 0 #000000;
}

/* Описание (белый фон) */
.blog-snippet-excerpt {
    font-size: 12px;
    line-height: 1.9; /* Увеличенный интерлиньяж для читаемости фона */
    
    background: rgba(255, 255, 255, 0.85);
    color: #000000;
    
    padding: 3px 8px;
    margin: 0;
    text-transform: uppercase;
    font-weight: 600;
    text-align: right;
    
    /* ВАЖНО: display: inline для обтекания текста фоном */
    display: inline;
    
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    
    /* "Ушки" для фона */
    box-shadow: 5px 0 0 rgba(255, 255, 255, 0.85), -5px 0 0 rgba(255, 255, 255, 0.85);
}

/* Books Archive */
.archive-books .books-snippets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 30px;
  margin-bottom: 60px;
}

.book-snippet {
  position: relative;
  text-decoration: none;
  display: block;
}

.book-snippet-cover {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  filter: grayscale(0%);
  transition: filter 0.3s, transform 0.3s;
}

.book-snippet:hover .book-snippet-cover {
  filter: grayscale(100%);
  transform: scale(1.05);
}

.book-snippet-buttons {
  margin-top: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.book-button {
  display: inline-block;
  padding: 12px 20px;
  background: #292c32;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.3s;
}

.book-button:hover {
  background: white;
  color: black;
  opacity: 70%;
}

/* Section Headers */
.section-header {
    /* background: var(--text-primary); */
    color: #dbe0e5;
    padding: 15px 30px;
    margin: 60px 0 40px;
    font-size: 24px;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Single Post/Book Page */
.single-header {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  margin-bottom: 40px;
  align-items: start;
}

.single-title-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.single-title {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 20px;
    margin-top: 15px;
    color: #292c32;
    text-align: right;
    line-height: 1;
    text-transform: uppercase;
    background: white;
    padding: 5px 10px;
}

.single-buttons {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.single-featured-image {
  width: 100%;
  padding-top: 15px;
  height: auto;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: 10px;
}

.share-buttons {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.share-buttons-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.share-buttons-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* style.css */

.share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  /* border-radius: 50%; <--- УБИРАЕМ скругление */
  border-radius: 0;     /* <--- Делаем квадратными */
  
  /* background: var(--bg-secondary); <--- УБИРАЕМ фон */
  background: none;     /* <--- Делаем прозрачным как в футере */
  border: 1px solid var(--border); /* <--- Добавляем рамку как в футере */
  
  color: var(--text-primary);
  text-decoration: none;
  transition: background 0.3s, transform 0.3s, border-color 0.3s;
  font-size: 18px;
}

.share-button:hover {
  background: var(--bg-secondary); /* При наведении легкий фон */
  border-color: var(--text-primary);
  transform: translateY(-2px); /* Чуть всплывает */
}

.share-button svg {
  width: 22px; /* Чуть увеличил размер иконки внутри кнопки */
  height: 22px;
  fill: currentColor;
}

.single-content {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 40px;
  font-weight: 400;
}

.single-content p {
  margin-bottom: 20px;
}

.single-content h2,
.single-content h3 {
  color: var(--text-primary);
  margin: 30px 0 15px;
  font-weight: 700;
}

.back-button {
  display: inline-block;
  padding: 12px 30px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 5px;
  font-weight: 500;
  transition: background 0.3s;
}

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

/* Contact Page Styles */
.contact-page .section-header {
  margin-top: 40px;
}

.social-icons-large {
  display: flex;
  gap: 30px;
  justify-content: center;
  margin: 40px 0;
  flex-wrap: wrap;
}

.social-icon-large {
  width: 60px;
  height: 60px;
  background: none;
  border-radius: 5%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  filter: grayscale(100%);
  transition: filter 0.3s, transform 0.3s;
  overflow: hidden;
  border: 1px solid var(--border);
}

/* Иконки на странице контактов */
.social-icon-large img {
  width: 60%;
  height: 60%;
  object-fit: cover;
  
  /* Добавляем фильтр: обесцветить -> сделать черным -> инвертировать в белый */
  filter: grayscale(100%) brightness(0) invert(1);
}

/* При наведении возвращаем оригинальный цвет */
.social-icon-large:hover img {
  filter: grayscale(0%) brightness(1) invert(50%);
}

.social-icon-large:hover {
  filter: grayscale(0%);
  transform: scale(1.1);
}

.contact-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin: 40px 0;
  flex-wrap: wrap;
}

.contact-button {
  padding: 15px 40px;
  background: #292c32;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  font-size: 16px;
  font-weight: 500;
  transition: background 0.3s;
}

.contact-button:hover {
  background: white;
  color: black;
  opacity: 70%;
}

/* Footer */
footer {
  background: var(--bg-secondary);
  padding: 40px 0;
  margin-top: 80px;
  text-align: center;
  border-top: 1px solid var(--border);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.copyright {
  color: var(--text-secondary);
  font-size: 14px;
}

.social-links {
  display: flex;
  gap: 15px;
}

.social-links a {
  width: 40px;
  height: 40px;
  background: none;
  border-radius: none;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background 0.3s, transform 0.3s;
  border: 1px solid var(--border);
  overflow: hidden;
  filter: grayscale(100%);
}

.social-links a:hover {
  filter: grayscale(0%);
  transform: scale(1.1);
}

.social-links a img {
  width: 60%;
  height: 60%;
  object-fit: cover;
}

.social-links a img {
  filter: grayscale(100%) brightness(0) invert(1);
}

.social-links a:hover img {
  filter: grayscale(0%) brightness(1) invert(0.7);
}

/* Pagination */
.pagination {
  margin: 40px 0;
  text-align: center;
}

.pagination .nav-links {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pagination a,
.pagination .current {
  padding: 10px 15px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 5px;
  transition: background 0.3s;
}

.pagination a:hover,
.pagination .current {
  background: var(--accent);
  color: white;
}

/* Responsive */
@media (max-width: 768px) {
  .main-nav ul {
    gap: 15px;
  }
  
  .cards-grid {
    grid-template-columns: 1fr;
  }
  
  .books-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .books-grid .book-card .book-cover {
    aspect-ratio: 2/3;
    height: auto;
  }
  
  .footer-content {
    flex-direction: column;
  }
  
  /* --- Мобильная сетка: 2 колонки для блога --- */
  .archive-blog .blog-snippets-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  .blog-snippet-image {
    height: 100% !important;
    position: absolute;
    width: 100%;
  }
  
  .single-header {
    grid-template-columns: 1fr !important;
  }
  
  .single-featured-image {
    aspect-ratio: 2/3 !important;
    height: auto !important;
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  /* Форсируем 2 колонки даже на узких экранах */
  .archive-blog .blog-snippets-grid {
    grid-template-columns: repeat(1, 1fr) !important;
    gap: 15px; /* Чуть меньше отступов, чтобы поместилось */
  }
  
  .blog-snippet-title {
    font-size: 13px; /* Чуть уменьшаем шрифт заголовка */
  }
  
  .blog-snippet-excerpt {
    font-size: 10px; /* И описания */
  }
}

/* --- Стили для навигации внутри поста --- */
.navigation-buttons {
  display: flex;
  gap: 15px;
  margin-top: 40px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

/* Вторая кнопка (например, "Все книги") может быть чуть прозрачнее или другого оттенка */
.secondary-button {
  background: transparent;
  border: 1px solid var(--border);
}

.secondary-button:hover {
  background: var(--bg-secondary);
  border-color: var(--text-primary);
}

/* Отступ для секции "Смотрите также" */
.related-section {
  margin-top: 80px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

/* --- Сетка похожих книг (внизу страницы) --- */
.related-books-grid {
  display: grid;
  /* Ровно 3 колонки */
  grid-template-columns: repeat(3, 1fr); 
  gap: 30px;
  margin-bottom: 60px;
}

/* Адаптивность для похожих книг */
@media (max-width: 768px) {
  .related-books-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 колонки на планшете */
  }
}

@media (max-width: 480px) {
  .related-books-grid {
    grid-template-columns: repeat(1, 1fr); /* 1 колонка на телефоне */
  }
  
  /* Уменьшим обложки на телефоне, чтобы не были гигантскими */
  .related-books-grid .book-snippet-cover {
    max-width: 200px; 
    margin: 0 auto;
    display: block;
  }
  
  .related-books-grid .book-snippet {
    text-align: center;
  }
}

/* --- Сайдбар под изображением (Meta Info) --- */
.sidebar-info-block {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 14px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05); /* Очень тонкая линия */
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 1px;
}

.info-value {
  color: var(--text-primary);
  font-weight: 600;
  text-align: right;
}

.info-value a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.3s;
}

.info-value a:hover {
  color: var(--accent);
}

/* Стили для тегов */
.info-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.tag-chip {
  display: inline-block;
  font-size: 11px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 15px; /* Овальные чипсы */
  text-decoration: none;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  text-transform: uppercase;
}

.tag-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* Выделение возрастного рейтинга */
.age-rating {
  display: inline-block;
  color: #dc2626; /* Красный цвет */
  border: 1px solid #dc2626;
  padding: 0px 6px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.5;
}

/* --- Стили для страницы Тегов (tag.php) --- */

.tag-archive-container {
    margin-bottom: 80px;
}

/* Список материалов */
.tag-results-list {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0; /* Или 10px, если хотите скругления */
    padding: 10px 0;
}

.tag-list-item {
    display: flex;
    align-items: baseline;
    padding: 15px 25px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.3s;
}

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

.tag-list-item:hover {
    background: rgba(255,255,255,0.02);
}

.tag-item-cat {
    color: var(--accent); /* Цвет категории */
    font-size: 13px;
    text-transform: uppercase;
    font-weight: 700;
    min-width: 80px; /* Фиксированная ширина для выравнивания разделителя */
    text-align: right;
}

.tag-item-sep {
    color: var(--text-secondary);
    margin: 0 15px;
    opacity: 0.5;
}

.tag-item-title {
    flex-grow: 1;
}

.tag-item-title a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.3s;
}

.tag-item-title a:hover {
    color: var(--accent);
}

/* Облако тегов (Все теги) */
.all-tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 60px;
}

/* Переопределяем или дополняем стиль tag-chip из style.css если нужно */
.tag-chip {
    /* Если в style.css его еще нет или он только для single.php */
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.tag-chip:hover, .tag-chip.active-tag {
    border-color: var(--accent);
    color: #fff;
    background: var(--accent);
    transform: translateY(-2px);
}

.tag-count {
    background: rgba(0,0,0,0.2);
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 11px;
}

/* Адаптивность для списка */
@media (max-width: 600px) {
    .tag-list-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px 20px;
    }
    
    .tag-item-sep {
        display: none; /* Скрываем палку на мобилках */
    }
    
    .tag-item-cat {
        text-align: left;
        font-size: 11px;
        margin-bottom: 5px;
        color: var(--text-secondary);
    }
}

/* =========================
   HOME PAGE BODY STYLES
   ========================= */

.home-body {
    padding-top: 80px;
    padding-bottom: 120px;
}

/* Desktop: две колонки для Latest Thoughts и Selected Works */
@media (min-width: 769px) {
    .home-body {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 60px;
    }
}

/* Section Headers */
.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 48px;
}

.view-all-link {
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s;
}

.view-all-link:hover {
    color: var(--accent);
}

/* =========================
   LATEST THOUGHTS (BLOG LIST)
   ========================= */

.latest-thoughts-section {
    margin-bottom: 0; /* Убираем отступ, т.к. теперь в grid */
}

.blog-list {
    display: grid;
    gap: 24px;
}

.blog-item {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 24px;
    padding: 24px;
    border-left: 2px solid transparent;
    background: transparent;
    transition: all 0.3s ease;
    text-decoration: none;
}

.blog-item:hover {
    border-left-color: var(--accent);
    background: var(--bg-card);
}

.blog-index {
    font-size: 24px;
    color: var(--accent);
    font-weight: 600;
    line-height: 1;
}

.blog-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.blog-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}

.blog-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.blog-separator {
    opacity: 0.5;
}

.blog-category {
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* =========================
   HOME PAGE BODY STYLES
   ========================= */

.home-body {
    padding-top: 80px;
    padding-bottom: 120px;
}

/* Desktop: две колонки для Latest Thoughts и Selected Works */
@media (min-width: 769px) {
    .home-body {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 60px;
    }
}

/* Section Headers */
.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 48px;
}

.view-all-link {
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s;
}

.view-all-link:hover {
    color: var(--accent);
}

/* =========================
   LATEST THOUGHTS (BLOG LIST)
   ========================= */

.latest-thoughts-section {
    margin-bottom: 0;
}

.blog-list {
    display: grid;
    gap: 24px;
}

.blog-item {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 24px;
    padding: 24px;
    border-left: 2px solid transparent;
    background: transparent;
    transition: all 0.3s ease;
    text-decoration: none;
}

.blog-item:hover {
    border-left-color: var(--accent);
    background: var(--bg-card);
}

.blog-index {
    font-size: 24px;
    color: var(--accent);
    font-weight: 600;
    line-height: 1;
}

.blog-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.blog-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}

.blog-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.blog-separator {
    opacity: 0.5;
}

.blog-category {
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* =========================
   SELECTED WORKS (BOOKS)
   ========================= */

.selected-works-section {
    margin-bottom: 0;
}

/* Desktop: книги в 2 колонки */
.books-grid-home {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.book-card-home {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.book-cover-link {
    display: block;
    transition: transform 0.35s ease;
}

.book-cover-link:hover {
    transform: translateY(-8px);
}

.book-cover-home {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.7);
}

.book-info-home {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.book-title-home {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.book-title-home a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s;
}

.book-title-home a:hover {
    color: var(--accent);
}

.book-genre-home {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0;
}

.book-actions-home {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.book-link-home {
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.book-link-home:hover {
    color: var(--accent);
}

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

@media (max-width: 768px) {
    .home-body {
        padding-top: 60px;
        padding-bottom: 80px;
        display: block;
    }
    
    .section-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        margin-bottom: 32px;
    }
    
    .latest-thoughts-section {
        margin-bottom: 80px;
    }
    
    .blog-item {
        grid-template-columns: 36px 1fr;
        gap: 16px;
        padding: 16px;
    }
    
    .blog-index {
        font-size: 18px;
    }
    
    .blog-title {
        font-size: 16px;
    }
    
    /* Мобилка: книги в 1 колонку */
    .books-grid-home {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

/* =========================
   BLOG ARCHIVE PAGE
   ========================= */

.blog-archive-container {
    padding-top: 40px;
    padding-bottom: 120px;
}

/* Breadcrumbs */
.breadcrumbs {
    padding-bottom: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

.breadcrumbs a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumbs a:hover {
    color: var(--accent);
}

.breadcrumb-sep {
    margin: 0 8px;
    opacity: 0.5;
}

/* Main Container */
.blog-archive-page {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 80px;
    grid-template-areas:
        "title sidebar"
        "label sidebar"
        "list sidebar"
        "pagination sidebar";
}

/* Page Title */
.page-title-large {
    grid-area: title;
    font-size: 56px;
    font-weight: 300;
    margin: 0 0 40px 0;
    line-height: 1.1;
}

/* Section Label */
.section-label-blog {
    grid-area: label;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

/* Blog Archive List */
.blog-archive-list {
    grid-area: list;
    display: grid;
    gap: 40px;
}

.blog-archive-item {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 32px;
    padding: 32px 0;
    border-bottom: 1px solid var(--border-soft);
    border-left: 2px solid transparent; /* ДОБАВЛЕНО: как на главной */
    padding-left: 24px; /* ДОБАВЛЕНО: базовый отступ */
    text-decoration: none;
    transition: all 0.3s ease;
}

.blog-archive-item:hover {
    border-left-color: var(--accent); /* ИЗМЕНЕНО: вместо padding-left */
    background: rgba(255, 255, 255, 0.02); /* ДОБАВЛЕНО: легкий фон */
}

.blog-archive-item:hover .blog-archive-number {
    color: var(--accent-hover);
}

.blog-archive-number {
    font-size: 28px;
    font-weight: 600;
    color: var(--accent);
    line-height: 1;
    transition: color 0.3s;
}

.blog-archive-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.blog-archive-title {
    font-size: 24px;
    font-weight: 400;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}

.blog-archive-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.archive-separator {
    opacity: 0.5;
}

.archive-category {
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.blog-archive-excerpt {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
}

/* Pagination */
.blog-pagination {
    grid-area: pagination;
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 60px;
}

.blog-pagination a,
.blog-pagination .current {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.blog-pagination a:hover,
.blog-pagination .current {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

/* Author Bio Sidebar */
.author-bio-sidebar {
    grid-area: sidebar;
    position: sticky;
    top: 100px;
    height: fit-content;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
}

.author-bio-image {
    width: 100%;
    max-width: 280px;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: 12px;
    filter: grayscale(100%);
    transition: filter 0.3s;
}

.author-bio-image:hover {
    filter: grayscale(0%);
}

.author-bio-name {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin: 20px 0 0 0;
}

.author-bio-role {
    font-size: 16px;
    color: var(--text-primary);
    margin: 0;
}

.author-bio-subtitle {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
    margin: 0;
}

.author-bio-description {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 16px 0;
}

.author-bio-link {
    font-size: 14px;
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s;
    margin-bottom: 40px;
}

.author-bio-link:hover {
    color: #7df3ff;
}

/* Sidebar Controls (Search + Filters) */
.sidebar-controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding-top: 0;
    border-top: 1px solid var(--border-soft);
}

/* Search Input */
.blog-search-wrapper {
    width: 100%;
}

.blog-search-input {
    width: 100%;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-main);
    transition: all 0.3s ease;
}

.blog-search-input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.05);
}

.blog-search-input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

/* Для темной темы добавим небольшую тень */
.blog-search-input:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

/* Filter Tags in Sidebar */
.blog-filter-tags {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
}

.filter-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
}

.filter-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-tag {
    padding: 6px 16px;
    background: transparent;
    border: 1px solid var(--border-soft);
    border-radius: 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 12px;
    transition: all 0.3s ease;
}

.filter-tag:hover,
.filter-tag.active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

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

@media (max-width: 1024px) {
    .blog-archive-page {
        grid-template-columns: 1fr;
        gap: 60px;
        grid-template-areas:
            "title"
            "label"
            "sidebar"
            "list"
            "pagination";
    }
    
    .author-bio-sidebar {
        position: relative;
        top: 0;
        max-width: 400px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .page-title-large {
        font-size: 36px;
        margin-bottom: 40px;
    }
    
    .blog-archive-item {
        grid-template-columns: 42px 1fr;
        gap: 20px;
        padding: 24px 0;
    }
    
    .blog-archive-number {
        font-size: 20px;
    }
    
    .blog-archive-title {
        font-size: 18px;
    }
    
    .blog-archive-excerpt {
        font-size: 14px;
    }
}

/* --- NEW BOOKS PAGE DESIGN (4 COLUMNS VERSION) --- */

.books-archive-container {
    padding-top: 40px;
    padding-bottom: 120px;
}

/* Сетка книг - 4 колонки */
.books-design-grid {
    display: grid;
    /* ИЗМЕНЕНО: repeat(4, 1fr) делает 4 колонки */
    grid-template-columns: repeat(4, 1fr); 
    gap: 50px 30px; /* Отступы: 50px между рядами, 30px между книгами */
    margin-top: 40px;
}

/* Карточка */
.book-design-card {
    display: flex;
    flex-direction: column;
}

/* Обложка */
.book-design-cover-wrap {
    margin-bottom: 20px;
    overflow: hidden;
    border-radius: 4px;
    background: #000;
}

.book-design-image {
    width: 100%;
    height: auto;
    aspect-ratio: 3/4;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease, opacity 0.3s;
    opacity: 0.9;
}

.book-design-card:hover .book-design-image {
    transform: scale(1.03);
    opacity: 1;
}

/* Типографика */
.book-design-title {
    font-family: 'Inter', sans-serif;
    /* ИЗМЕНЕНО: Уменьшили шрифт с 28px до 18px, так как карточки стали уже */
    font-size: 18px; 
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1.3;
    margin: 0 0 6px 0;
    letter-spacing: 0.5px;
}

.book-design-title a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s;
}

.book-design-title a:hover {
    color: var(--accent);
}

.book-design-genre {
    color: #888888;
    font-size: 13px; /* Тоже чуть уменьшили */
    margin: 0 0 15px 0;
    font-weight: 400;
}

/* Ссылки (Actions) */
.book-design-actions {
    display: flex;
    flex-wrap: wrap; /* Позволяет ссылкам переноситься, если не влезут */
    gap: 15px; /* Уменьшили отступ между ссылками */
    font-size: 13px;
    font-weight: 500;
}

.bd-action-link {
    text-decoration: none;
    color: #b0b0b0;
    transition: all 0.3s;
    white-space: nowrap; /* Запрещаем разрыв текста ссылки */
}

.bd-action-link:hover {
    color: #ffffff;
}

.bd-action-link.accent-link {
    color: var(--accent);
}

.bd-action-link.accent-link:hover {
    color: #4da3ff;
}

/* Адаптивность */

/* Планшеты (меньше 1024px) - делаем 3 колонки */
@media (max-width: 1024px) {
    .books-design-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }
}

/* Мобильные (меньше 768px) - делаем 2 колонки (или 1, как захочешь) */
@media (max-width: 768px) {
    .books-design-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 колонки на телефоне */
        gap: 20px;
    }

    .page-title-large {
        font-size: 32px;
    }
}

@media (max-width: 480px) {
    .books-design-grid {
        grid-template-columns: repeat(1, 1fr); /* 1 колонка на совсем узких экранах */
    }
}

/* --- SINGLE BOOK PAGE STYLES --- */

.single-book-container {
    padding-top: 40px;
    padding-bottom: 80px;
}

/* Breadcrumbs */
.book-breadcrumbs {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 60px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.back-arrow {
    text-decoration: none;
    color: var(--text-primary);
    font-size: 18px;
    transition: transform 0.3s;
}

.back-arrow:hover {
    transform: translateX(-5px);
    color: var(--accent);
}

.crumb-link {
    text-decoration: none;
    color: var(--text-secondary);
    transition: color 0.3s;
}

.crumb-link:hover {
    color: var(--text-primary);
}

.crumb-current {
    color: var(--text-primary);
}

/* Hero Section (Grid) */
.single-book-hero {
    display: grid;
    grid-template-columns: 400px 1fr; /* Фиксированная ширина для обложки, остальное текст */
    gap: 80px;
    margin-bottom: 100px;
    align-items: center; /* Центрируем по вертикали, как на макете */
}

/* Cover */
.sb-cover-wrapper {
    width: 100%;
    position: relative;
}

.sb-main-cover {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8); /* Глубокая тень как на макете */
    display: block;
}

/* Info Side */
.sb-title {
    font-size: 56px; /* Крупный заголовок */
    font-weight: 300;
    line-height: 1.1;
    margin: 0 0 30px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Tags */
.sb-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.sb-tag {
    padding: 6px 14px;
    border: 1px solid #333;
    border-radius: 4px;
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255,255,255,0.02);
}

.sb-tag.accent-tag {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(0, 100, 148, 0.1); /* Легкий фон акцентного цвета */
}

/* Intro Text */
.sb-intro-text {
    font-size: 16px;
    line-height: 1.8;
    color: #b0b0b0;
    margin-bottom: 50px;
    max-width: 600px;
}

/* Actions Buttons */
.sb-actions {
    display: flex;
    gap: 20px;
}

.sb-btn {
    padding: 18px 40px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}

/* Primary Button (Читать отрывок) - Стиль "Призрак" с цветной рамкой */
.btn-primary {
    border: 1px solid var(--accent);
    color: var(--accent);
    background: transparent;
    box-shadow: 0 0 15px rgba(0, 100, 148, 0.2);
}

.btn-primary:hover {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 25px rgba(0, 100, 148, 0.5);
}

/* Secondary Button (Где купить) - Серый стиль */
.btn-secondary {
    border: 1px solid #444;
    color: #bbb;
    background: transparent;
}

.btn-secondary:hover {
    border-color: #fff;
    color: #fff;
}

/* Content Section (О книге) */
.sb-content-section {
    border-top: 1px solid #222;
    padding-top: 60px;
    margin-bottom: 80px;
}

.sb-section-title {
    font-size: 24px;
    font-weight: 300;
    color: #fff;
    margin-bottom: 40px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sb-full-text {
    font-size: 18px;
    line-height: 1.8;
    color: #ccc;
    max-width: 800px;
}

.sb-full-text p {
    margin-bottom: 25px;
}

/* Related Section Modifications */
.sb-related-section {
    border-top: 1px solid #222;
    padding-top: 60px;
}

/* Специальный модификатор для сетки в 3 колонки (вместо 4) */
.books-design-grid.related-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* Responsive */
@media (max-width: 1024px) {
    .single-book-hero {
        grid-template-columns: 1fr; /* Одна колонка */
        gap: 40px;
        text-align: center;
    }

    .sb-cover-wrapper {
        max-width: 400px; /* Ограничиваем ширину картинки на планшете */
        margin: 0 auto;
    }
    
    .sb-info-wrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .sb-intro-text {
        text-align: center;
    }
}

@media (max-width: 768px) {
    .sb-title {
        font-size: 36px;
    }
    
    .sb-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .sb-btn {
        width: 100%;
        justify-content: center;
    }

    /* На мобильном related перестраиваем в 1 колонку */
    .books-design-grid.related-grid-3 {
        grid-template-columns: repeat(1, 1fr);
    }
}

/* --- SINGLE POST (BLOG) REDESIGN --- */

.single-post-container {
    padding-top: 40px;
    padding-bottom: 100px;
}

/* --- HERO LAYOUT (NEW) --- */
.post-hero-layout {
    position: relative;
    display: flex;
    min-height: 400px;
    margin-bottom: 80px;
    align-items: flex-start;
}

/* Header: Слева, перекрывает картинку */
.post-header {
    width: 65%;
    position: relative;
    z-index: 10;
    padding-top: 40px;
    padding-bottom: 20px;
    margin-bottom: 0;
    background: transparent;
    border: none !important;
}

/* Градиентная линия снизу */
.post-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 70%);
    z-index: 11;
}

.post-title-large {
    font-size: 56px;
    font-weight: 300;
    line-height: 1.1;
    margin-bottom: 30px;
    color: #ffffff;
    text-shadow: 0 2px 20px rgba(0,0,0,0.8);
}

.post-meta-row {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
    color: #6d7075;
    font-family: 'Inter', sans-serif;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.meta-cat-link {
    color: var(--accent);
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.meta-sep {
    opacity: 0.3;
}

/* --- HERO IMAGE & OVERLAY --- */
.post-hero-image-wrapper {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.post-hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: brightness(0.85);
}

/* Улучшенный градиент для виньетки */
.radial-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    
    background: 
        linear-gradient(to right, #000 0%, transparent 25%),
        linear-gradient(to left, #000 0%, transparent 25%),
        linear-gradient(to bottom, #000 0%, transparent 25%),
        linear-gradient(to top, #000 0%, transparent 25%),
        radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.6) 70%, #000 100%);
}

/* --- CONTENT GRID --- */
.post-body-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 60px;
    max-width: 100%; /* ВАЖНО: предотвращаем переполнение */
}

.post-content-area {
    min-width: 0; /* ВАЖНО: позволяет flex/grid детям уменьшаться */
}

.single-content {
    font-size: 18px;
    line-height: 1.8;
    color: #d0d0d0;
    max-width: 100%; /* ВАЖНО */
    overflow-wrap: break-word; /* Разбиваем длинные слова */
}

.single-content p {
    margin-bottom: 24px;
}

.single-content img {
    max-width: 100%; /* ВАЖНО: изображения в контенте */
    height: auto;
}

.single-content blockquote {
    border-left: 2px solid var(--accent);
    padding-left: 25px;
    margin: 40px 0;
    font-style: italic;
    font-size: 20px;
    color: #fff;
}

/* Tags Footer */
.post-tags-footer {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #222;
    display: flex;
    gap: 10px;
    flex-wrap: wrap; /* ВАЖНО: теги могут переноситься */
}

/* Author Sidebar (Small) */
.post-sidebar {
    padding-top: 20px;
    min-width: 0;
}

.author-card-small {
    border: 1px solid #222;
    padding: 30px;
    text-align: center;
    background: rgba(255,255,255,0.02);
    display: flex;
    flex-direction: column; /* ВАЖНО: всегда вертикальная ориентация */
    align-items: center;
}

.author-small-img {
    width: 100px;
    height: 150px;
    object-fit: cover;
    margin-bottom: 20px;
    filter: grayscale(100%);
}

.author-small-name {
    font-size: 16px;
    text-transform: uppercase;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.author-small-role {
    font-size: 13px;
    color: var(--accent);
    margin-bottom: 5px;
}

.author-small-desc {
    font-size: 12px;
    color: #777;
    margin-bottom: 20px;
}

.author-small-link {
    font-size: 12px;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid var(--accent);
}

/* Navigation Links */
.post-navigation-row {
    display: flex;
    justify-content: space-between;
    margin: 80px 0;
    padding: 30px 0;
    border-top: 1px solid #222;
    border-bottom: 1px solid #222;
    flex-wrap: wrap; /* ВАЖНО: на маленьких экранах */
    gap: 20px;
}

.nav-prev a, .nav-next a {
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    font-weight: 300;
    text-transform: uppercase;
    transition: color 0.3s;
}

.nav-prev a:hover, .nav-next a:hover {
    color: var(--accent);
}

/* Read Also Grid */
.read-also-section {
    margin-top: 60px;
}

.read-also-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.read-also-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #111;
    border: 1px solid #222;
    text-decoration: none;
    transition: transform 0.3s, border-color 0.3s;
}

.read-also-item:hover {
    transform: translateY(-5px);
    border-color: #444;
}

.ra-number {
    font-size: 24px;
    color: var(--accent);
    font-weight: 600;
    line-height: 1;
    flex-shrink: 0; /* Не сжимается */
}

.ra-content {
    min-width: 0; /* Позволяет сжиматься */
}

.ra-title {
    font-size: 15px;
    color: #fff;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.ra-meta {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
}

/* Responsive */
@media (max-width: 1024px) {
    .post-body-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .post-sidebar {
        max-width: 500px;
        margin: 0 auto;
    }
}

@media (max-width: 900px) {
    /* Hero на мобильном схлопывается в столбик */
    .post-hero-layout {
        display: block;
        min-height: auto;
    }

    .post-header {
        width: 100%;
        margin-bottom: 30px;
        padding-top: 0;
    }
    
    .post-header::after {
        background: linear-gradient(to right, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 100%);
    }

    .post-hero-image-wrapper {
        position: relative;
        width: 100%;
        height: 400px; /* УВЕЛИЧЕНО с 300px */
        margin-bottom: 40px;
    }
    
    /* Усиленный градиент для мобильной версии */
    .radial-overlay {
        background: 
            linear-gradient(to right, #000 0%, transparent 20%),
            linear-gradient(to left, #000 0%, transparent 20%),
            linear-gradient(to bottom, #000 0%, transparent 20%),
            linear-gradient(to top, #000 0%, transparent 20%),
            radial-gradient(ellipse at center, transparent 20%, rgba(0,0,0,0.7) 60%, #000 95%);
    }
    

    
    .read-also-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .post-title-large {
        font-size: 32px;
        margin-bottom: 20px;
    }
    
    .post-meta-row {
        font-size: 12px;
        flex-wrap: wrap;
    }

    .single-content {
        font-size: 16px;
    }
    
    .single-content blockquote {
        font-size: 18px;
        padding-left: 15px;
    }
}

@media (max-width: 480px) {
    .post-hero-image-wrapper {
        height: 300px; /* На очень маленьких экранах чуть меньше */
    }
    
    .read-also-grid {
        grid-template-columns: 1fr;
    }
    
    .post-navigation-row {
        flex-direction: column;
        text-align: center;
    }
}

/* =========================
   CONTACT PAGE REDESIGN
   ========================= */

.contact-page-wrapper {
    position: relative;
    min-height: 100vh;
    padding-top: 100px; /* Отступ от хедера */
    padding-bottom: 80px;
    background: #000; /* Фон страницы */
}

.contact-content-container {
    max-width: 600px !important; /* Узкая колонка по центру */
    margin: 0 auto;
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Breadcrumbs */
.contact-breadcrumbs {
    font-size: 13px;
    color: #4B5563;
    margin-bottom: 20px;
    width: 100%;
    text-align: left; /* Хлебные крошки слева, как на макете */
}

.contact-breadcrumbs a {
    color: #4B5563;
    text-decoration: none;
    transition: color 0.3s;
}

.contact-breadcrumbs a:hover {
    color: var(--accent);
}

.contact-breadcrumbs .sep {
    margin: 0 8px;
    opacity: 0.5;
}

.contact-breadcrumbs .current {
    color: var(--accent);
}

/* Main Title */
.contact-main-title {
    font-size: 32px;
    font-weight: 300;
    color: #fff;
    margin-bottom: 60px;
    width: 100%;
    text-align: left; /* Заголовок слева */
}

/* Profile Section */
.contact-profile-section {
    margin-bottom: 60px;
    width: 100%;
}

.cp-image-wrap {
    width: 200px; /* Размер фото */
    height: 250px;
    margin: 0 auto 30px;
    position: relative;
}

.cp-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px; /* Легкое скругление */
    filter: grayscale(100%); /* ЧБ фото */
    box-shadow: 0 20px 40px rgba(0,0,0,0.8);
}

.cp-text-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.cp-subtitle {
    color: var(--accent);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.cp-name {
    font-size: 42px;
    font-weight: 400;
    color: #fff;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    line-height: 1.1;
}

.cp-role {
    font-size: 20px;
    color: var(--accent);
    font-weight: 300;
}

.cp-genre {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

/* Links List */
.contact-links-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cl-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    
    background: rgba(255, 255, 255, 0.02); /* Почти прозрачный фон */
    border: 1px solid rgba(255, 255, 255, 0.05); /* Тонкая рамка */
    border-radius: 4px;
    
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cl-item:hover {
    background: linear-gradient(90deg, rgba(0, 100, 148, 0.1) 0%, transparent 100%);
    border-color: rgba(0, 100, 148, 0.3);
    transform: translateY(-2px);
}

/* Эффект свечения снизу */
.cl-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 100, 148, 0.5), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.cl-item:hover::after {
    opacity: 1;
}

.cl-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.cl-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    /* Было: filter: grayscale(100%) brightness(2); */
    
    /* Стало: Сначала делаем черным (brightness 0), потом инвертируем в белый */
    filter: brightness(0) invert(1); 
}

.cl-icon-placeholder {
    width: 24px;
    height: 24px;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cl-label {
    font-size: 16px;
    color: #ccc;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 400;
}

.cl-item:hover .cl-label {
    color: #fff;
}

.cl-right {
    display: flex;
    align-items: center;
}

.cl-arrow {
    width: 20px;
    height: 20px;
    color: var(--accent); /* Синяя стрелка */
    transition: transform 0.3s;
}

.cl-item:hover .cl-arrow {
    transform: translateX(5px);
    color: #fff;
}

/* Footer Info */
.cp-footer-info {
    margin-top: 60px;
    color: #444;
    font-size: 12px;
}

/* Адаптив */
@media (max-width: 600px) {
    .contact-page-wrapper {
        padding-top: 60px;
    }
    
    .contact-main-title {
        text-align: center;
        margin-bottom: 40px;
        font-size: 28px;
    }
    
    .contact-breadcrumbs {
        text-align: center;
        justify-content: center;
        display: flex;
    }
    
    .cp-name {
        font-size: 32px;
    }
    
    .cl-item {
        padding: 15px 20px;
    }
}

/* --- Fix: Breadcrumbs Positioning on Contacts --- */

/* Убираем верхний отступ у обертки, так как теперь отступ задает контейнер крошек */
.contact-page-wrapper {
    padding-top: 40px; /* Было 100px */
}

/* Настраиваем контейнер контента, чтобы он был по центру, но уже ПОД крошками */
.contact-content-container {
    max-width: 600px;
    margin: 40px auto 0; /* Отступ сверху от крошек */
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Стили для хлебных крошек на странице контактов (чтобы были как везде) */
.contact-breadcrumbs {
    font-size: 14px; /* Размер как везде */
    color: var(--text-secondary);
    text-align: left; /* ВАЖНО: выравнивание по левому краю */
    text-transform: uppercase; /* Если везде капсом */
    letter-spacing: 1px;
}

.contact-breadcrumbs .sep {
    margin: 0 10px;
    opacity: 0.5;
}

/* --- GLOBAL: Active Breadcrumb Highlight (Как вы просили) --- */

/* 1. Для страницы Контактов */
.contact-breadcrumbs .current {
    color: var(--accent);
    font-weight: 500;
}

/* 2. Для страницы одной Книги и Поста (single.php) */
.book-breadcrumbs .crumb-current, 
.breadcrumbs .crumb-current {
    color: var(--accent);
    font-weight: 500;
}

/* 3. Для страниц категорий (Блог, Книги - category.php) */
/* Там текущая страница просто в span без класса, берем последний span */
.breadcrumbs span:last-child {
    color: var(--accent);
    font-weight: 500;
}

/* Исключаем разделитель, если он случайно попадет под селектор */
.breadcrumbs .breadcrumb-sep {
    color: var(--text-secondary) !important;
    font-weight: normal !important;
}

/* --- ASTERISK ICON (Instagram Replacement) --- */

.asterisk-icon {
    color: var(--text-secondary);
    font-family: monospace; /* Моноширинный шрифт делает звездочку крупнее и ровнее */
    display: inline-block;
    transition: color 0.3s;
}

/* При наведении на саму кнопку, звездочка становится белой */
.text-icon:hover .asterisk-icon {
    color: var(--text-primary);
}

/* Размеры для страницы контактов (крупная кнопка 60x60) */
.social-icon-large .asterisk-icon {
    font-size: 54px;
    line-height: 1;
    transform: translateY(8px); /* Опускаем визуально в центр */
}

/* Размеры для футера (маленькая кнопка 40x40) */
.social-links a.text-icon .asterisk-icon {
    font-size: 40px;
    line-height: 1;
    transform: translateY(7px); /* Опускаем визуально в центр */
}

/* --- ASTERISK ICON FOR CONTACTS PAGE --- */
.asterisk-contact {
    font-family: monospace;
    font-size: 45px;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin-right: 5px;
    transition: color 0.3s ease;
    transform: translateY(6px);
}

/* При наведении на строчку списка подсвечиваем звездочку */
.cl-item:hover .asterisk-contact {
    color: var(--text-primary);
}

/* --- COOKIE NOTICE --- */
.cookie-notice {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    /* Полупрозрачный темный фон с размытием */
    background: rgba(15, 15, 15, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 9999;
    transform: translateY(0);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s;
}

.cookie-notice.hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

.cookie-notice-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.cookie-notice-content p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.cookie-btn {
    padding: 10px 30px;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap; /* Чтобы кнопка не переносилась на 2 строки */
}

.cookie-btn:hover {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 15px rgba(0, 100, 148, 0.4);
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .cookie-notice-content {
        flex-direction: column;
        text-align: left; /* Текст слева, чтобы легче читалось */
        gap: 15px;
        padding: 20px 15px;
    }
    
    .cookie-btn {
        width: 100%;
        text-align: center;
    }
}