/*
Theme Name: Godfather RU
Theme URI: https://the-godfather.ru
Author: the-godfather.ru
Description: Тёмная тема для фан-сайта The Godfather 2
Version: 1.0
Text Domain: godfather
*/

:root {
  --bg: #0e0f12;
  --surface: #17191d;
  --surface-2: #1e2126;
  --border: #2a2d33;
  --text: #e8e6e2;
  --text-muted: #9a9a95;
  --gold: #c9a227;
  --gold-light: #e0bf4a;
  --crimson: #8b1e3f;
  --font-heading: Georgia, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
}

a {
  color: var(--gold-light);
  text-decoration: none;
}

a:hover {
  color: var(--gold);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--text);
  line-height: 1.25;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Шапка сайта */
.site-header {
  background: linear-gradient(180deg, #15161a 0%, var(--bg) 100%);
  border-bottom: 2px solid var(--gold);
  padding: 18px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: padding 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.site-header.is-scrolled {
  padding: 10px 0;
  background: rgba(14, 15, 18, 0.92);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.site-header .wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.site-title {
  margin: 0;
  font-size: 26px;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: font-size 0.25s ease;
}

.site-header.is-scrolled .site-title {
  font-size: 21px;
}

.site-title a {
  color: var(--gold);
}

.site-title a:hover {
  text-decoration: none;
  color: var(--gold-light);
}

.site-description {
  color: var(--text-muted);
  font-size: 13px;
  margin: 2px 0 0;
  max-height: 20px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease, margin 0.25s ease;
}

.site-header.is-scrolled .site-description {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
}

.main-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.main-nav a {
  display: block;
  padding: 8px 14px;
  color: var(--text);
  border-radius: 3px;
}

.main-nav a:hover {
  background: var(--surface-2);
  color: var(--gold-light);
  text-decoration: none;
}

/* Контент */
.site-content {
  padding: 36px 0 60px;
  min-height: 60vh;
}

.entry-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 20px;
}

.entry-card h2 {
  font-size: 20px;
  margin-top: 0;
}

.entry-meta {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.entry-meta a {
  color: var(--text-muted);
}

.entry-excerpt {
  color: var(--text);
}

.read-more {
  display: inline-block;
  margin-top: 10px;
  color: var(--gold);
  border: 1px solid var(--gold);
  padding: 6px 14px;
  border-radius: 3px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.read-more:hover {
  background: var(--gold);
  color: var(--bg);
  text-decoration: none;
}

.single-entry {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 30px;
}

.single-entry h1 {
  font-size: 30px;
  margin-top: 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}

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

.entry-content img {
  border-radius: 4px;
  margin: 12px 0;
}

/* Карточки персонажей */
.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.character-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.character-card:hover {
  border-color: var(--gold);
}

.character-card img {
  aspect-ratio: 4/3;
  object-fit: cover;
  width: 100%;
}

.character-card .character-card-body {
  padding: 14px;
}

.character-card h3 {
  font-size: 16px;
  margin: 0 0 4px;
}

.character-card .family-tag {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 3px;
  padding: 2px 8px;
  margin-bottom: 8px;
}

.family-group-title {
  font-size: 20px;
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.family-group-title:first-of-type {
  margin-top: 0;
}

.family-group-title a {
  color: var(--gold-light);
}

/* Хлебные крошки и заголовок архива */
.archive-title {
  font-size: 26px;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 12px;
  margin-bottom: 24px;
}

.breadcrumbs {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 18px;
}

.breadcrumbs a {
  color: var(--text-muted);
}

/* Пагинация */
.pagination {
  display: flex;
  gap: 6px;
  margin-top: 24px;
}

.pagination a, .pagination span {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
}

.pagination .current {
  background: var(--gold);
  color: var(--bg);
  border-color: var(--gold);
}

/* Комментарии */
.comment-list {
  list-style: none;
  padding: 0;
  margin-top: 30px;
}

.comment-list li {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 18px;
  margin-bottom: 12px;
}

.comment-author {
  color: var(--gold-light);
  font-weight: bold;
}

.comment-date {
  color: var(--text-muted);
  font-size: 12px;
}

/* Подвал */
.site-footer {
  background: var(--surface);
  border-top: 2px solid var(--gold);
  padding: 24px 0;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

/* Поиск */
.search-form {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.search-form input[type="search"] {
  flex: 1;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 3px;
}

.search-form button {
  padding: 10px 18px;
  background: var(--gold);
  color: var(--bg);
  border: none;
  border-radius: 3px;
  cursor: pointer;
  text-transform: uppercase;
  font-size: 13px;
}

.search-form button:hover {
  background: var(--gold-light);
}

/* Лайтбокс-галерея */
body.lightbox-open {
  overflow: hidden;
}

.godfather-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(6, 6, 8, 0.94);
  align-items: center;
  justify-content: center;
}

.godfather-lightbox.is-open {
  display: flex;
}

.godfather-lightbox .lightbox-image {
  max-width: 90vw;
  max-height: 85vh;
  width: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.godfather-lightbox button {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  border-radius: 4px;
}

.godfather-lightbox button:hover {
  border-color: var(--gold);
  color: var(--gold-light);
}

.godfather-lightbox .lightbox-close {
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  font-size: 22px;
  line-height: 1;
}

.godfather-lightbox .lightbox-prev,
.godfather-lightbox .lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  font-size: 18px;
}

.godfather-lightbox .lightbox-prev {
  left: 20px;
}

.godfather-lightbox .lightbox-next {
  right: 20px;
}

.godfather-lightbox .lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 4px 12px;
}

@media (max-width: 600px) {
  .site-header .wrap {
    flex-direction: column;
    align-items: flex-start;
  }
  .single-entry {
    padding: 18px;
  }
  .single-entry h1 {
    font-size: 22px;
  }
  .godfather-lightbox .lightbox-prev,
  .godfather-lightbox .lightbox-next {
    width: 38px;
    height: 38px;
    font-size: 14px;
  }
}

/* Плиточная фотогалерея */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.photo-grid a {
  display: block;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.photo-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0;
  border-radius: 0;
  transition: transform 0.15s ease;
}

.photo-grid a:hover img {
  transform: scale(1.05);
}

@media (max-width: 600px) {
  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 6px;
  }
}

/* Двухколоночный layout */
.content-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 28px;
  align-items: start;
}

.content-area {
  min-width: 0;
}

.sidebar {
  min-width: 0;
}

.sidebar-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 20px;
}

.sidebar-block-title {
  margin: 0;
  padding: 14px 16px;
  background: linear-gradient(180deg, var(--crimson) 0%, #5c1329 100%);
  color: #f2e6ea;
  font-size: 15px;
  border-bottom: 2px solid var(--gold);
}

.sidebar-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
}

.sidebar-list li {
  border-bottom: 1px dashed var(--border);
}

.sidebar-list li:last-child {
  border-bottom: none;
}

.sidebar-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--text);
}

.sidebar-list a::before {
  content: "\25B8";
  color: var(--gold);
  font-size: 12px;
}

.sidebar-list a:hover {
  background: var(--surface-2);
  color: var(--gold-light);
  text-decoration: none;
}

.content-layout.no-sidebar {
  grid-template-columns: 1fr;
}

@media (max-width: 800px) {
  .content-layout {
    grid-template-columns: 1fr;
  }
}

/* Превью в карточках листинга */
.entry-card {
  display: flex;
  gap: 16px;
}

.entry-card-thumb {
  flex: 0 0 160px;
  display: block;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.entry-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0;
  border-radius: 0;
}

.entry-card-body {
  flex: 1;
  min-width: 0;
}

.entry-card-body h2 {
  margin-top: 0;
}

@media (max-width: 500px) {
  .entry-card {
    flex-direction: column;
  }
  .entry-card-thumb {
    flex-basis: auto;
    aspect-ratio: 16/9;
  }
}

/* Выпадающее подменю в топ-меню */
.main-nav ul li {
  position: relative;
}

.main-nav .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 0;
  margin: 0;
  list-style: none;
  z-index: 100;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.main-nav li.menu-item-has-children:hover .sub-menu,
.main-nav li.menu-item-has-children:focus-within .sub-menu {
  display: block;
}

.main-nav .sub-menu li {
  width: 100%;
}

.main-nav .sub-menu a {
  padding: 8px 14px;
  white-space: nowrap;
}

.main-nav li.menu-item-has-children > a::after {
  content: "\25BE";
  margin-left: 4px;
  font-size: 10px;
  color: var(--gold);
}

@media (max-width: 700px) {
  .main-nav .sub-menu {
    position: static;
    border: none;
    box-shadow: none;
    padding-left: 14px;
    display: block;
  }
}

.vk-comments {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* Кнопка "наверх" */
.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: var(--surface);
  color: var(--gold);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease, background-color 0.15s ease;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

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

.back-to-top:hover {
  background: var(--gold);
  color: #15161a;
}

/* Гамбургер-меню */
.nav-toggle {
  display: none;
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  z-index: 1001;
}

.nav-toggle-box {
  position: relative;
  display: block;
  width: 20px;
  height: 14px;
}

.nav-toggle-inner,
.nav-toggle-inner::before,
.nav-toggle-inner::after {
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--gold);
  transition: transform 0.2s ease, opacity 0.2s ease, top 0.2s ease;
}

.nav-toggle-inner {
  top: 6px;
}

.nav-toggle-inner::before {
  content: "";
  top: -6px;
}

.nav-toggle-inner::after {
  content: "";
  top: 6px;
}

.nav-toggle.is-open .nav-toggle-inner {
  background: transparent;
}

.nav-toggle.is-open .nav-toggle-inner::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle.is-open .nav-toggle-inner::after {
  top: 0;
  transform: rotate(-45deg);
}

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.nav-overlay.is-visible {
  display: block;
  opacity: 1;
}

@media (max-width: 700px) {
  .nav-toggle {
    display: flex;
  }

  .site-branding {
    max-width: calc(100% - 56px);
  }

  .main-nav {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(300px, 82vw);
    background: var(--surface);
    border-left: 1px solid var(--border);
    padding: 70px 18px 24px;
    overflow-y: auto;
    z-index: 999;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }

  .main-nav.is-open {
    transform: translateX(0);
  }

  .main-nav ul {
    flex-direction: column;
    gap: 0;
  }

  .main-nav > ul > li {
    border-bottom: 1px dashed var(--border);
  }

  .main-nav a {
    padding: 12px 8px;
  }

  body.nav-open {
    overflow: hidden;
  }
}

/* Перенесённые инлайн-стили из контента старого сайта */
.content-highlight {
  color: var(--gold-light);
  font-weight: 600;
}

.video-embed {
  text-align: center;
}
