/*
Theme Name: GridMaster
Description: Современная тема на CSS Grid с поддержкой двух сайдбаров
Version: 1.0
Author: Your Name
Tags: grid, two-sidebars, responsive, modern
*/

:root {
  --primary-blue: #1a73e8;
  --dark-blue: #0d47a1;
  --white: #ffffff;
  --light-gray: #f5f5f5;
  --black: #212121;
  --text-color: #333333;
  --border-color: #e0e0e0;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-color);
  background-color: var(--white);
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: var(--primary-blue);
  transition: color 0.3s ease;
}

a:hover {
  color: var(--dark-blue);
}

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

/* Контейнер */
.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Шапка */
.header {
  background-color: var(--primary-blue);
  color: var(--white);
  padding: 1rem 0;
  position: relative;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.site-title a {
  color: var(--white);
  font-size: 1.8rem;
  font-weight: bold;
}

/* Гамбургер меню */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 25px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.menu-toggle span {
  width: 100%;
  height: 3px;
  background-color: var(--white);
  border-radius: 5px;
  transition: all 0.3s ease;
}

/* Основное меню */
.main-navigation {
  display: flex;
}

.main-menu {
  display: flex;
  list-style: none;
}

.main-menu li {
  margin-left: 1.5rem;
}

.main-menu a {
  color: var(--white);
  font-weight: 500;
}

.main-menu a:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* Основная сетка */
.grid-container {
  display: grid;
  grid-template-columns: 1fr 3fr 1fr;
  grid-template-areas: 
    "sidebar-left main-content sidebar-right";
  gap: 2rem;
  padding: 2rem 0;
}

.main-content {
  grid-area: main-content;
}

.sidebar-left {
  grid-area: sidebar-left;
}

.sidebar-right {
  grid-area: sidebar-right;
}

/* Сетка записей */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.post-card {
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.post-thumbnail {
  position: relative;
  overflow: hidden;
}

.post-thumbnail img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 50%;
  padding: 10px;
}

.post-content {
  padding: 1.5rem;
}

.post-title {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.post-title a {
  color: var(--black);
}

.post-title a:hover {
  color: var(--primary-blue);
}

.post-excerpt {
  color: #666;
  margin-bottom: 1rem;
}

.post-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center; /* центрируем содержимое */
}

.post-thumbnail {
    width: 200px;
    height: 200px;
    margin: 20px auto 15px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.post-content {
    padding: 0 1.5rem 1.5rem;
}

.read-more {
  display: inline-block;
  background: var(--primary-blue);
  color: var(--white);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-weight: 500;
}

.read-more:hover {
  background: var(--dark-blue);
  color: var(--white);
}

/* Сайдбары */
.sidebar {
  background: var(--light-gray);
  padding: 1.5rem;
  border-radius: 8px;
}

.widget {
  margin-bottom: 2rem;
}

.widget-title {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-blue);
  color: var(--black);
}

/* Пагинация */
.pagination {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
}

.pagination .page-numbers {
  display: inline-block;
  padding: 0.5rem 1rem;
  margin: 0 0.25rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-color);
}

.pagination .page-numbers.current {
  background: var(--primary-blue);
  color: var(--white);
  border-color: var(--primary-blue);
}

.pagination .page-numbers:hover:not(.current) {
  background: var(--light-gray);
}

/* Подвал */
.footer {
  background: var(--black);
  color: var(--white);
  padding: 2rem 0;
  margin-top: 2rem;
}

.footer-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.footer-widget {
  margin-bottom: 1.5rem;
}

.footer-widget-title {
  color: var(--white);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-menu {
  list-style: none;
}

.footer-menu li {
  margin-bottom: 0.5rem;
}

.footer-menu a {
  color: #ccc;
}

.footer-menu a:hover {
  color: var(--white);
}

.copyright {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  color: #ccc;
}

/* Адаптивность */
@media (max-width: 1024px) {
  .grid-container {
    grid-template-columns: 1fr;
    grid-template-areas:
	  "main-content"
      "sidebar-left"
      "sidebar-right";
  }
  
  .sidebar-left, .sidebar-right {
    order: 3;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }
  
  .main-navigation {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    height: 100vh;
    background: var(--primary-blue);
    flex-direction: column;
    padding: 2rem;
    transition: right 0.3s ease;
    z-index: 1000;
  }
  
  .main-navigation.active {
    right: 0;
  }
  
  .main-menu {
    flex-direction: column;
  }
  
  .main-menu li {
    margin: 1rem 0;
  }
  
  .posts-grid {
    grid-template-columns: 1fr;
  }
}

/* Навигация между записями */
.post-navigation {
    display: flex;
    justify-content: space-between;
    margin: 3rem 0;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.nav-previous,
.nav-next {
    flex: 1;
}

.nav-previous {
    text-align: left;
}

.nav-next {
    text-align: right;
}

.post-navigation a {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background: var(--primary-blue);
    color: var(--white);
    border-radius: 5px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.post-navigation a:hover {
    background: var(--dark-blue);
    color: var(--white);
}

/* Похожие записи */
.related-posts {
    margin: 3rem 0;
}

.related-posts h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--black);
    border-bottom: 2px solid var(--primary-blue);
    padding-bottom: 0.5rem;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.related-post {
    background: var(--light-gray);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.related-post:hover {
    transform: translateY(-3px);
}

.related-post-thumbnail {
    height: 150px;
    overflow: hidden;
}

.related-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-post h4 {
    padding: 1rem;
    margin: 0;
    font-size: 1rem;
}

.related-post a {
    color: var(--black);
    text-decoration: none;
}

.related-post a:hover {
    color: var(--primary-blue);
}

/* Адаптивность навигации */
@media (max-width: 768px) {
    .post-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-previous,
    .nav-next {
        text-align: center;
    }
    
    .related-posts-grid {
        grid-template-columns: 1fr;
    }
}
/* Кнопки плавной прокрутки */
.scroll-btn {
    position: fixed;
    right: 30px;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: var(--primary-blue);
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 4px 15px rgba(26, 115, 232, 0.3);
}

.scroll-btn:hover {
    background: var(--dark-blue);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 115, 232, 0.4);
}

.scroll-btn.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-up {
    bottom: 100px;
}

.scroll-down {
    bottom: 30px;
}

.scroll-btn svg {
    width: 20px;
    height: 20px;
}

/* Адаптивность кнопок */
@media (max-width: 768px) {
    .scroll-btn {
        right: 20px;
        width: 45px;
        height: 45px;
        bottom: 20px;
    }
    
    .scroll-up {
        bottom: 80px;
    }
    
    .scroll-down {
        bottom: 20px;
    }
}

@media (max-width: 480px) {
    .scroll-btn {
        right: 15px;
        width: 40px;
        height: 40px;
    }
    
    .scroll-up {
        bottom: 70px;
    }
    
    .scroll-btn svg {
        width: 18px;
        height: 18px;
    }
}
/*******************************************************************************************/

/* Сайдбары - общие стили */
.sidebar {
    background: var(--light-gray);
    padding: 1.5rem;
    border-radius: 8px;
}

.widget {
    margin-bottom: 2rem;
}

.widget-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-blue);
    color: var(--black);
    position: relative;
}

/* Убираем маркеры у всех списков в сайдбарах */
.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar ul li {
    margin-bottom: 0.5rem;
    position: relative;
}

.sidebar ul ul {
    padding-left: 1rem;
    margin-top: 0.5rem;
}

/* Аккордеон меню */
.widget-accordion .menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget-accordion .menu-item {
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.widget-accordion .menu-item:last-child {
    border-bottom: none;
}

.widget-accordion .menu-item-has-children > a {
    position: relative;
    padding-right: 2rem;
}

.widget-accordion .menu-item-has-children > a::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.widget-accordion .menu-item-has-children.active > a::after {
    content: '-';
    transform: translateY(-50%) rotate(0deg);
}

.widget-accordion .sub-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    padding-left: 1rem;
}

.widget-accordion .menu-item-has-children.active .sub-menu {
    max-height: 1000px;
}

.widget-accordion a {
    display: block;
    padding: 0.8rem 0;
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease, padding-left 0.3s ease;
}

.widget-accordion a:hover {
    color: var(--primary-blue);
    padding-left: 0.5rem;
}

/* Анимация для нижнего сайдбара (подвала) */
.footer-widget {
    position: relative;
    overflow: hidden;
}

.footer-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.7s ease;
}

.footer-widget:hover::before {
    left: 100%;
}

.footer-widget-title {
    color: var(--white);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.footer-widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-blue);
    transition: width 0.3s ease;
}

.footer-widget:hover .footer-widget-title::after {
    width: 100%;
}

.footer-menu li {
    margin-bottom: 0.8rem;
    transform: translateX(-10px);
    opacity: 0;
    animation: slideIn 0.5s ease forwards;
}

.footer-menu li:nth-child(1) { animation-delay: 0.1s; }
.footer-menu li:nth-child(2) { animation-delay: 0.2s; }
.footer-menu li:nth-child(3) { animation-delay: 0.3s; }
.footer-menu li:nth-child(4) { animation-delay: 0.4s; }
.footer-menu li:nth-child(5) { animation-delay: 0.5s; }

@keyframes slideIn {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.footer-menu a {
    color: #ccc;
    text-decoration: none;
    transition: all 0.3s ease;
    display: block;
    padding: 0.3rem 0;
    position: relative;
}

.footer-menu a::before {
    content: '→';
    position: absolute;
    left: -1.2rem;
    opacity: 0;
    transition: all 0.3s ease;
}

.footer-menu a:hover {
    color: var(--white);
    padding-left: 1.2rem;
}

.footer-menu a:hover::before {
    opacity: 1;
    left: 0;
}

/* Анимация иконок в подвале */
.footer-widget .textwidget {
    position: relative;
}

.footer-widget .textwidget p {
    margin-bottom: 1rem;
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Социальные иконки в подвале */
.social-icons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-icons a {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    animation: bounceIn 0.6s ease forwards;
}

.social-icons a:hover {
    background: var(--primary-blue);
    transform: translateY(-3px);
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Адаптивность аккордеона */
@media (max-width: 1024px) {
    .widget-accordion a {
        padding: 0.6rem 0;
    }
    
    .sidebar {
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    .widget-accordion .menu-item-has-children > a::after {
        right: 0.5rem;
    }
    
    .footer-menu li {
        animation: none;
        transform: none;
        opacity: 1;
    }
}

/* Стили для комментариев */
.comments-area {
    margin: 4rem 0;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
}

.comments-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--black);
    position: relative;
    padding-bottom: 1rem;
}

.comments-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--primary-blue);
}

/* Список комментариев */
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 3rem 0;
}

.comment {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border-left: 4px solid var(--primary-blue);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.comment:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.comment-body {
    position: relative;
}

.comment-meta {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-blue);
    box-shadow: 0 3px 10px rgba(26, 115, 232, 0.2);
}

.fn {
    font-weight: 600;
    color: var(--black);
    font-style: normal;
}

.comment-metadata {
    margin-left: auto;
    color: #666;
    font-size: 0.9rem;
}

.comment-metadata a {
    color: #666;
    text-decoration: none;
}

.comment-metadata a:hover {
    color: var(--primary-blue);
}

.comment-content {
    line-height: 1.7;
    color: #333;
    margin-bottom: 1.5rem;
}

.comment-content p {
    margin-bottom: 1rem;
}

.comment-content p:last-child {
    margin-bottom: 0;
}

.reply {
    text-align: right;
}

.comment-reply-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: var(--primary-blue);
    color: var(--white);
    text-decoration: none;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.comment-reply-link:hover {
    background: var(--dark-blue);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}

/* Дочерние комментарии */
.children {
    list-style: none;
    padding: 0;
    margin: 2rem 0 0 3rem;
    border-left: 2px solid var(--border-color);
    padding-left: 2rem;
}

.children .comment {
    background: rgba(245, 245, 245, 0.5);
    border-left-color: #ccc;
}

/* Форма комментариев */
.comment-respond {
    background: linear-gradient(135deg, var(--white) 0%, #f8f9fa 100%);
    border-radius: 16px;
    padding: 3rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

.comment-reply-title {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--black);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.comment-reply-title::before {
    content: '💬';
    font-size: 1.8rem;
}

.comment-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.comment-form-comment {
    grid-column: 1 / -1;
}

.comment-notes {
    grid-column: 1 / -1;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.form-submit {
    grid-column: 1 / -1;
    text-align: right;
    margin-top: 1rem;
}

.comment-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--black);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--white);
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
    transform: translateY(-1px);
}

.comment-form textarea {
    min-height: 150px;
    resize: vertical;
}

.submit {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--dark-blue) 100%);
    color: var(--white);
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(26, 115, 232, 0.3);
    position: relative;
    overflow: hidden;
}

.submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 115, 232, 0.4);
}

.submit:hover::before {
    left: 100%;
}

/* Аватарка в форме */
.logged-in-as {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.logged-in-as .avatar {
    width: 40px;
    height: 40px;
}

/* Анимации */
.comment {
    animation: slideInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(30px);
}

@keyframes slideInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.comment-form {
    animation: fadeIn 0.8s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .comment-form {
        grid-template-columns: 1fr;
    }
    
    .children {
        margin-left: 1rem;
        padding-left: 1rem;
    }
    
    .comment-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .comment-metadata {
        margin-left: 0;
    }
    
    .comment-respond {
        padding: 2rem;
    }
    
    .comment {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .comment-author {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .comment-reply-title {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .comments-title {
        font-size: 1.5rem;
    }
}

/* Состояние загрузки */
.comment-form .loading {
    position: relative;
}

.comment-form .loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* Уведомления */
.comment-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    background: var(--primary-blue);
    color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 10000;
}

.comment-notification.success {
    background: #4CAF50;
}

.comment-notification.error {
    background: #f44336;
}

.comment-notification.show {
    transform: translateX(0);
}