/*
Theme Name: GridTilePure
Author: Сергей Ведерников
Description: Тема на всю ширину, главная — плитки, меню — только гамбургер (CSS only), кнопка строго справа
Version: 1.0
License: GNU General Public License v3 or later
*/

:root {
  --footer-bg: #1a1a1a;
  --footer-text: #e0e0e0;
  --footer-link: #8bc34a;          /* яркий цвет ссылок */
  --footer-link-hover: #ffffff;
  --footer-title: #ffffff;
  --tile-bg: #252525;
  --tile-border: #333;
  --font-size-base: 16px;
  --font-size-mobile: 14px;
}

* { box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-body);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  line-height: 1.6;
  font-size: var(--font-size-base);
}

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

.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 20px;
}
body.home .container { padding: 0 32px; }

/*-------------------------------------- Шапка и меню (гамбургер всегда справа) ----------------------------------------------*/
.header {
  background: var(--black);
  height: 70px;
  position: relative;
  z-index: 9999;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1em;
  height: 100%;
}

.logo-link {
  color: var(--white);
  font-weight: 700;
  font-size: 1.8em;
  letter-spacing: -0.5px;
  text-decoration: none;
}

#menu-toggle { display: none; }

.menu-button-container {
  display: flex;
  height: 100%;
  width: 30px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.menu-button,
.menu-button::before,
.menu-button::after {
  display: block;
  background-color: var(--white);
  position: absolute;
  height: 3px;
  width: 30px;
  transition: transform 400ms cubic-bezier(0.23, 1, 0.32, 1), background 400ms;
  border-radius: 2px;
}

.menu-button::before { content: ''; margin-top: -8px; }
.menu-button::after { content: ''; margin-top: 8px; }

#menu-toggle:checked + .menu-button-container .menu-button::before {
  margin-top: 0px; transform: rotate(405deg);
}
#menu-toggle:checked + .menu-button-container .menu-button {
  background: rgba(255, 255, 255, 0);
}
#menu-toggle:checked + .menu-button-container .menu-button::after {
  margin-top: 0px; transform: rotate(-405deg);
}

.menu-modal {
  position: fixed;
  top: 0; right: 0;
  width: 300px;
  height: 100vh;
  background: var(--black);
  transform: translateX(110%);
  transition: transform 0.3s ease-in-out;
  z-index: 10000;
  overflow: hidden;
  box-sizing: border-box;
}

#menu-toggle:checked ~ .menu-modal { transform: translateX(0); }

.menu-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding-top: 70px;
  box-sizing: border-box;
}

.menu-nav {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  max-height: 100%;
}

.menu-list { list-style: none; margin: 0; padding: 0; width: 100%; }
.menu-list li { margin-bottom: 15px; width: 100%; }
.menu-list a {
  color: var(--white);
  text-decoration: none;
  font-size: 16px;
  display: block;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  transition: color 0.3s ease;
  width: 100%;
  box-sizing: border-box;
}
.menu-list a:hover { color: #4f85d4; }

.menu-nav::-webkit-scrollbar { width: 6px; }
.menu-nav::-webkit-scrollbar-track { background: rgba(255,255,255,0.08); }
.menu-nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.25);
  border-radius: 3px;
}
.menu-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.4); }

@media (max-width: 768px) {
  .menu-modal {
    width: 100vw;
    top: 0; left: 0; right: 0;
    transform: translateX(100%);
    padding: 0;
  }
  .logo-link { font-size: 1.5em; }
}

@media (min-width: 769px) {
  .menu-modal {
    width: 300px;
    top: 70px; right: 1em;
    height: calc(100vh - 70px);
    border-radius: 0 0 10px 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.25);
  }
}

.menu-list .sub-menu {
  margin-left: 20px;
  margin-top: 10px;
  border-left: 2px solid rgba(255,255,255,0.2);
  padding-left: 10px;
}
.menu-list .menu-item-has-children > a::after {
  content: '▼';
  margin-left: 8px;
  font-size: 10px;
  opacity: 0.7;
}

/*-------------------------------------- Сетка плиток (главная) ----------------------------------------------*/
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--grid-gap);
}

.tile-card {
  background: #fff;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,.04);
  transition: transform .2s, box-shadow .2s;
}
.tile-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 32px rgba(0,0,0,.08);
}
.tile-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
}
.tile-content { padding: 24px; }
.tile-title {
  margin: 0 0 10px;
  font-size: 1.25rem;
  line-height: 1.3;
  color: var(--secondary);
}
.tile-excerpt {
  color: var(--text-muted);
  font-size: .95rem;
  line-height: 1.4;
}

/*-------------------------------------- Лейаут с сайдбарами (не главная) ----------------------------------------------*/
.layout-2sidebars {
  display: grid;
  grid-template-columns: 240px 1fr 240px;
  gap: var(--grid-gap);
  margin-top: 32px;
}
body.home .layout-2sidebars { grid-template-columns: 1fr; margin-top: 24px; }
aside.sidebar {
  background: #fff;
  padding: 28px;
  border-radius: var(--border-radius);
  min-height: 340px;
  box-shadow: 0 2px 8px rgba(0,0,0,.03);
}
aside.sidebar .widget-title {
  margin: 0 0 18px;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--secondary);
}

/*-------------------------------------- Footer ----------------------------------------------*/
footer {
  background: var(--black);
  color: #cbd5e1;
  padding-top: 48px;
  padding-bottom: 28px;
  margin-top: var(--grid-gap);
}
.footer-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 36px;
  margin-bottom: 36px;
}
.footer-col h4 {
  color: var(--white);
  margin: 0 0 14px;
  font-size: 1rem;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 12px; }
.footer-col a { color: #cbd5e1; }
.footer-col a:hover { color: var(--white); }
.site-info {
  text-align: center;
  font-size: .85rem;
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 18px;
}

@media (max-width: 1100px) { .layout-2sidebars { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  body { font-size: 17px; }
  .footer-columns { grid-template-columns: 1fr; }
  .container { padding: 0 16px; }
}
.site-footer {
  background-color: var(--footer-bg);
  color: var(--footer-text);
  padding-top: 40px;
  padding-bottom: 20px;
}

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

/* Грид-сетка подвала: 4 колонки */
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  margin-bottom: 40px;
}

.footer-col h4.footer-title {
  color: var(--footer-title);
  font-size: 1.2rem;
  margin-bottom: 18px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Списки ссылок */
.footer-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-list li {
  margin-bottom: 8px;
}

.footer-list a {
  color: var(--footer-text);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.footer-list a:hover {
  color: var(--footer-link);
  opacity: 1;
}

/* Плитки-виджеты */
.footer-tiles {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tile-link {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--tile-bg);
  border: 1px solid var(--tile-border);
  padding: 10px 12px;
  color: var(--footer-text);
  text-decoration: none;
  border-radius: 6px;
  font-size: var(--font-size-base);
  transition: all 0.2s ease;
}

.tile-link:hover {
  background: var(--footer-link);
  border-color: var(--footer-link);
  color: #000;
  transform: translateY(-2px);
}

.tile-icon {
  font-size: 1.1rem;
}

/* Соцсети */
.social-links {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.social-link {
  display: inline-block;
  padding: 8px 14px;
  background: rgba(255,255,255,0.08);
  color: var(--footer-text);
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: background 0.2s, color 0.2s;
}

.social-link:hover {
  background: var(--footer-link);
  color: #000;
}

.footer-note {
  font-size: 0.85rem;
  line-height: 1.4;
  color: #aaa;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-bottom p {
  margin: 0;
  font-size: 0.9rem;
}

.small-text {
  color: #888;
}

/* Адаптив: на мобильных — 1 колонка */
@media (max-width: 768px) {
  :root {
    --font-size-base: var(--font-size-mobile);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}