/*
Theme Name: TMNTTheme
Theme URI: https://github.com/S0ftware-Developer
Author: Orlov Andrei
Author URI: https://orlovandrei.space
Description: Фан-тема в стиле Teenage Mutant Ninja Turtles (1989) для игрового блога, фан-сайта и портфолио. Пиксельный шрифт, канализационные трубы, черепашки-карточки и пицца.
Version: 1.0.0
Requires at least: 5.3
Tested up to: 6.6
Requires PHP: 7.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tmnttheme
Tags: blog, portfolio, custom-menu, featured-images, dark, retro
*/

/* =========================================================
   1. ПЕРЕМЕННЫЕ: палитра и шрифт
   ========================================================= */
:root {
  --green-light: #8fd14f;
  --green:       #4c9a1f;
  --green-dark:  #1f4d12;
  --sewer:       #0d1a10;   /* фон канализации */
  --ink:         #0a0a0a;   /* «чернила» для обводок */
  --paper:       #eaffd0;   /* светлый фон карточек */
  --cheese:      #f4c542;   /* сыр / жёлтый логотип */
  --sauce:       #d62828;   /* томатный соус / красный */

  /* Банданы: Леонардо, Рафаэль, Донателло, Микеланджело */
  --leo:   #1e5bd6;
  --raph:  #e0202a;
  --donnie:#7b3fb8;
  --mike:  #ff8a00;

  --bandana: var(--leo);    /* текущая бандана карточки */
  --font-pixel: 'Press Start 2P', 'Courier New', monospace;
}

/* =========================================================
   2. БАЗА
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  overflow-x: hidden;
  font-family: var(--font-pixel);
  font-size: 12px;
  line-height: 1.9;
  color: var(--paper);
  /* Пиксельная 8-бит сцена: ночной Нью-Йорк и черепашки на крыше */
  background: #0a0a26 url('assets/img/bg-tmnt.png') center bottom / cover no-repeat fixed;
  image-rendering: pixelated;        /* пиксели остаются чёткими */
}

a { color: var(--cheese); }
img { max-width: 100%; height: auto; }

/* Доступность: текст только для скринридеров и «пропустить меню» */
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link:focus {
  position: fixed; top: 8px; left: 8px; width: auto; height: auto;
  clip: auto; z-index: 100; padding: 10px; background: var(--cheese); color: var(--ink);
}

/* =========================================================
   3. ШАПКА: ночной Нью-Йорк и логотип
   ========================================================= */
.site-header { border-bottom: 6px solid var(--ink); }

.header-top {
  position: relative;
  overflow: hidden;                 /* чтобы звезда не создавала прокрутку */
  padding: 40px 16px 56px;
  text-align: center;
}

.header-inner { position: relative; z-index: 1; }

/* Логотип TMNT */
.tmnt-logo {
  display: inline-block;
  text-decoration: none;
  text-transform: uppercase;
}
.logo-line {
  display: block;
  font-size: clamp(10px, 2vw, 16px);
  color: #fff;
  letter-spacing: 3px;
  text-shadow: 3px 3px 0 var(--ink);
}
.logo-main {
  display: block;
  margin-top: 8px;
  font-size: clamp(20px, 5vw, 44px);
  letter-spacing: 2px;
  color: var(--cheese);
  text-shadow: 4px 4px 0 var(--sauce), 8px 8px 0 var(--ink);
}
.logo-sub {
  display: inline-block;
  margin-top: 22px;
  padding: 6px 10px;
  font-size: 10px;
  color: var(--ink);
  background: var(--green-light);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

/* =========================================================
   4. МЕНЮ В ВИДЕ КАНАЛИЗАЦИОННЫХ ТРУБ
   ========================================================= */
.sewer-nav {
  padding: 24px 12px 10px;
  background: rgba(5,5,32,.72);
}
.sewer-menu {
  display: flex; flex-wrap: wrap; justify-content: center;
  margin: 0; padding: 0; list-style: none;
}
.sewer-menu li {
  position: relative;
  margin: 0 18px 16px;
}

/* Сама труба: вертикальный градиент даёт «объём» */
.sewer-menu a {
  position: relative;
  display: block;
  padding: 14px 30px;
  font-size: 11px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper);
  text-shadow: 2px 2px 0 var(--ink);
  background: linear-gradient(#a6e864 0%, #4c9a1f 28%, #2d6a12 62%, #1a4409 100%);
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
}

/* Фланцы (кольца) на концах трубы */
.sewer-menu a::before,
.sewer-menu a::after {
  content: '';
  position: absolute; top: -7px; bottom: -7px; width: 14px;
  background: linear-gradient(#7fc23d, #2d6a12 60%, #163a08);
  border: 3px solid var(--ink);
}
.sewer-menu a::before { left: -10px; }
.sewer-menu a::after  { right: -10px; }

.sewer-menu a:hover,
.sewer-menu a:focus-visible {
  color: var(--cheese);
  filter: brightness(1.15);
  outline: none;
}

/* Текущий пункт: труба «светится» */
.sewer-menu .current-menu-item > a,
.sewer-menu .current_page_item > a {
  color: var(--cheese);
  box-shadow: 0 0 0 3px var(--cheese);
}

/* Капля слизи под трубой при наведении (анимация в animations.css) */
.sewer-menu li::after {
  content: '';
  position: absolute; left: 50%; top: 100%;
  width: 6px; height: 0; margin-left: -3px;
  background: #9be34a;
  border: 2px solid var(--ink);
  pointer-events: none;
}

/* =========================================================
   5. ОСНОВНОЙ КОНТЕНТ
   ========================================================= */
.site-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 16px 48px;
}

/* Приветственный блок на главной */
.hero {
  margin-bottom: 44px;
  padding: 24px 16px;
  text-align: center;
  background: rgba(5,5,32,.78);
  border: 4px dashed var(--green);
}
.hero-title {
  margin: 0 0 12px;
  font-size: clamp(14px, 3vw, 22px);
  color: var(--cheese);
  text-shadow: 3px 3px 0 var(--sauce);
}
.hero p { margin: 0; }

/* Универсальная «пиксельная» рамка для страниц */
.pixel-box {
  margin-bottom: 32px;
  padding: 24px;
  color: var(--ink);
  background: var(--paper);
  border: 4px solid var(--ink);
  box-shadow: 8px 8px 0 var(--green-dark);
}
.page-title {
  margin: 0 0 16px;
  font-size: clamp(14px, 3vw, 20px);
  line-height: 1.5;
  color: var(--green-dark);
}

/* Текст записей: чуть мельче и просторнее, чтобы читалось */
.entry-content { font-size: 11px; line-height: 2.2; }
.entry-content a { color: var(--leo); }
.entry-content h2, .entry-content h3 { color: var(--green-dark); line-height: 1.6; }
.entry-content blockquote {
  margin: 20px 0; padding: 12px 16px;
  background: #d5f2b0; border-left: 8px solid var(--green);
}

/* =========================================================
   6. КАРТОЧКИ-ЧЕРЕПАШКИ
   ========================================================= */
.turtle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 40px 34px;
}

/* Цвет банданы задаётся переменной для каждой черепашки */
.turtle-leo    { --bandana: var(--leo); }
.turtle-raph   { --bandana: var(--raph); }
.turtle-donnie { --bandana: var(--donnie); }
.turtle-mike   { --bandana: var(--mike); }

.turtle-card {
  position: relative;
  display: flex; flex-direction: column;
  color: var(--ink);
  background: var(--paper);
  border: 4px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  transition: transform .15s steps(3), box-shadow .15s steps(3);
}
.turtle-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 9px 9px 0 var(--bandana);
}

/* «Голова» черепашки: зелёная кожа с точечной текстурой */
.turtle-head {
  position: relative;
  height: 90px;
  background: var(--green) radial-gradient(rgba(0,0,0,.18) 2px, transparent 2px) 0 0 / 12px 12px;
  border-bottom: 4px solid var(--ink);
}
.turtle-name {
  position: absolute; top: 8px; left: 12px;
  font-size: 10px;
  color: var(--cheese);
  text-shadow: 2px 2px 0 var(--ink);
}

/* Бандана с прорезями для глаз */
.bandana {
  position: absolute; left: -4px; right: -4px; top: 36px; height: 40px;
  display: flex; align-items: center; justify-content: center; gap: 22px;
  background: var(--bandana);
  border: 4px solid var(--ink);
}
.eye {
  position: relative;
  width: 38px; height: 20px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 50%;
}
.eye::after {                       /* зрачок */
  content: '';
  position: absolute; top: 3px; right: 6px;
  width: 6px; height: 8px;
  background: var(--ink);
}
/* Хвосты банданы, развевающиеся справа */
.bandana-tail {
  position: absolute; right: -20px;
  width: 24px; height: 10px;
  background: var(--bandana);
  border: 3px solid var(--ink);
}
.tail-a { top: 4px;  transform: rotate(14deg); }
.tail-b { top: 20px; transform: rotate(-8deg); }

.turtle-body {
  display: flex; flex-direction: column; gap: 12px;
  flex: 1; padding: 16px;
}
.turtle-thumb img {
  display: block; width: 100%;
  border: 3px solid var(--ink);
}
.turtle-title { margin: 0; font-size: 12px; line-height: 1.7; }
.turtle-title a { color: var(--ink); text-decoration: none; }
.turtle-title a:hover { color: var(--bandana); }
.turtle-meta { margin: 0; font-size: 8px; line-height: 1.8; color: #3d5a2b; }
.turtle-meta a { color: #3d5a2b; }
.turtle-excerpt { font-size: 10px; line-height: 2; }
.turtle-excerpt p { margin: 0; }

/* Нижняя полоска: оружие черепашки */
.turtle-weapon {
  padding: 8px 12px;
  font-size: 8px;
  color: #fff;
  text-shadow: 2px 2px 0 var(--ink);
  background: var(--bandana);
  border-top: 4px solid var(--ink);
}

/* =========================================================
   7. КНОПКА-ПИЦЦА И ПАГИНАЦИЯ
   ========================================================= */
.btn-pizza,
.page-numbers {
  display: inline-block;
  padding: 10px 14px;
  font-family: var(--font-pixel);
  font-size: 10px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  background: var(--cheese);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--sauce);
  cursor: pointer;
}
.btn-pizza:hover, .page-numbers:hover { background: #ffe27a; }
.btn-pizza:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--sauce);
}
.btn-pizza { align-self: flex-start; }

/* Маленькая ниндзя-звезда внутри кнопки */
.btn-star {
  display: inline-block; width: 14px; height: 14px; margin-left: 8px;
  vertical-align: -2px;
  background: url('assets/img/shuriken.svg') center / contain no-repeat;
}

.pagination { margin-top: 48px; }
.pagination .nav-links {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px;
}
.page-numbers.current { background: var(--green-light); }

/* =========================================================
   8. ФУТЕР: ПАТТЕРН ИЗ ПИЦЦЫ
   ========================================================= */
.site-footer {
  position: relative;
  overflow: hidden;
  margin-top: 40px;
  padding: 44px 16px 28px;
  text-align: center;
  background: #0a140c;
  border-top: 6px solid var(--ink);
}
/* Шахматный паттерн: два слоя, второй сдвинут на полклетки */
.site-footer::before {
  content: '';
  position: absolute; inset: 0;
  background-image: url('assets/img/pizza.svg'), url('assets/img/pizza.svg');
  background-size: 80px 80px;
  background-position: 0 0, 40px 40px;
  opacity: .22;
  pointer-events: none;
}
.footer-inner { position: relative; z-index: 1; }
.footer-slogan {
  margin: 0 0 12px;
  font-size: clamp(12px, 2.5vw, 18px);
  color: var(--cheese);
  text-shadow: 3px 3px 0 var(--sauce);
}
.pizza-row { margin: 12px 0; font-size: 24px; letter-spacing: 8px; }
.footer-menu {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 16px;
  margin: 16px 0; padding: 0; list-style: none;
}
.footer-copy { margin: 16px 0 0; font-size: 9px; color: var(--green-light); }

/* Строка с указанием автора сайта */
.footer-credit {
  margin: 16px 0 0;
  font-size: 9px;
  line-height: 1.9;
  color: var(--paper);
}
.footer-credit a {
  color: var(--cheese);
  text-decoration: underline;
}
.footer-credit a:hover { color: var(--green-light); }

/* =========================================================
   9. ПРОЧЕЕ: 404, комментарии, формы
   ========================================================= */
.error-404 { text-align: center; }
.error-404 .manhole { margin-bottom: 16px; }

input[type="text"], input[type="search"], input[type="email"], textarea {
  width: 100%; padding: 10px;
  font-family: var(--font-pixel); font-size: 10px;
  background: #fff; border: 3px solid var(--ink);
}

/* =========================================================
   10. АДАПТИВ
   ========================================================= */
@media (max-width: 640px) {
  body { background-attachment: scroll; }
  .sewer-menu { flex-direction: column; }
  .sewer-menu li { margin: 0 24px 16px; }
  .sewer-menu a { text-align: center; }
}
