/*
Theme Name: BUILDPOST
Theme URI: https://buildpost.ru
Description: Независимая тема для новостного портала BUILDPOST.RU. Современный дизайн вдохновлённый Igromania.ru
Author: BUILDPOST Team
Author URI: https://buildpost.ru
Version: 1.3.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: news, real-estate, custom-colors, responsive
Text Domain: buildpost
*/

/* =================================
   ЦВЕТОВАЯ СХЕМА
   ================================= */
:root {
  --accent: #E7A748;
  --dark-primary: #222546;
  --dark-secondary: #212445;
  --black: #000000;
  --white: #FFFFFF;
  --gray-light: #F5F5F5;
  --gray-bg: #ECECEC;
  --gray-border: #E0E0E0;
  --gray-text: #666666;
}

/* =================================
   RESET & BASE
   ================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  color: var(--black);
  background-color: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.3s ease;
}

ul, ol {
  list-style-position: inside;
}

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

/* =================================
   HEADER
   ================================= */
.site-header {
  background-color: var(--dark-primary);
  color: var(--white);
  border-bottom: 3px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-top {
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 15px;
}

.site-title {
  font-size: 36px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -1px;
}

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

.site-description {
  font-size: 14px;
  color: var(--gray-light);
  margin: 5px 0 0;
}

/* Navigation */
.main-navigation {
  background-color: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.nav-menu {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 0;
  padding: 0;
  gap: 5px;
}

.nav-menu > li {
  margin: 0;
  position: relative;
}

.nav-menu > li > a {
  display: block;
  padding: 15px 20px;
  color: var(--white);
  font-weight: 500;
  font-size: 15px;
  position: relative;
  transition: all 0.3s ease;
}

.nav-menu > li > a:hover,
.nav-menu > li.current-menu-item > a,
.nav-menu > li.current-menu-ancestor > a {
  background-color: var(--accent);
}

/* Dropdown меню */
.nav-menu .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--white);
  min-width: 250px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border-radius: 0 0 8px 8px;
  padding: 10px 0;
  list-style: none;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
}

.nav-menu li:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-menu .sub-menu li {
  margin: 0;
  border-bottom: 1px solid var(--gray-border);
}

.nav-menu .sub-menu li:last-child {
  border-bottom: none;
}

.nav-menu .sub-menu a {
  display: block;
  padding: 12px 20px;
  color: var(--dark-primary);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.nav-menu .sub-menu a:hover {
  background-color: var(--gray-light);
  color: var(--accent);
  padding-left: 25px;
}

/* Вложенные подменю (третий уровень) */
.nav-menu .sub-menu .sub-menu {
  left: 100%;
  top: 0;
  border-radius: 8px;
}

/* Стрелки для подменю */
.nav-menu li.menu-item-has-children > a::after {
  content: '▾';
  margin-left: 5px;
  font-size: 12px;
  transition: transform 0.3s ease;
}

.nav-menu .sub-menu li.menu-item-has-children > a::after {
  content: '▸';
  float: right;
}

.nav-menu li.menu-item-has-children:hover > a::after {
  transform: rotate(180deg);
}

/* Мобильное меню - кнопка бургер */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 24px;
  cursor: pointer;
  padding: 10px;
}

.mobile-menu-toggle:hover {
  color: var(--accent);
}

/* =================================
   FEATURED POST
   ================================= */
.featured-section {
  margin: 40px 0;
}

.featured-post {
  position: relative;
  height: 500px;
  border-radius: 8px;
  overflow: hidden;
}

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

.featured-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 60px 40px 40px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, transparent 100%);
  color: var(--white);
}

.post-category {
  display: inline-block;
  background-color: var(--accent);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 12px;
  border-radius: 3px;
  margin-bottom: 15px;
}

.featured-title {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
}

.featured-title a {
  color: var(--white);
}

.featured-excerpt {
  font-size: 18px;
  line-height: 1.5;
  opacity: 0.95;
}

.featured-meta {
  font-size: 14px;
  margin-top: 15px;
  opacity: 0.8;
}

/* =================================
   CATEGORY SECTIONS
   ================================= */
.category-section {
  margin: 60px 0;
}

.section-header {
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 3px solid var(--accent);
}

.section-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--dark-primary);
  display: inline-block;
  margin: 0;
}

.section-title a {
  color: var(--dark-primary);
}

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

/* =================================
   NEWS GRID
   ================================= */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.news-card {
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
}

.news-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-4px);
}

.news-card-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.news-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.news-card:hover .news-card-image img {
  transform: scale(1.05);
}

.news-card-content {
  padding: 20px;
}

.news-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 10px;
}

.news-title a {
  color: var(--dark-primary);
}

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

.news-excerpt {
  font-size: 14px;
  line-height: 1.5;
  color: var(--gray-text);
  margin-bottom: 12px;
}

.news-meta {
  font-size: 12px;
  color: var(--gray-text);
  display: flex;
  gap: 10px;
}

/* =================================
   SINGLE POST
   ================================= */
.single-post-container {
  max-width: 800px;
  margin: 40px auto;
  padding: 0 20px;
}

.entry-header {
  text-align: center;
  margin-bottom: 40px;
}

.entry-title {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--dark-primary);
  margin: 20px 0;
}

.entry-meta {
  font-size: 14px;
  color: var(--gray-text);
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 15px;
}

.featured-image {
  margin-bottom: 40px;
  border-radius: 8px;
  overflow: hidden;
}

.entry-content {
  font-size: 18px;
  line-height: 1.8;
  color: var(--black);
}

.entry-content p {
  margin-bottom: 1.5em;
}

.entry-content h2 {
  font-size: 32px;
  font-weight: 700;
  margin: 40px 0 20px;
  color: var(--dark-primary);
}

.entry-content h3 {
  font-size: 24px;
  font-weight: 700;
  margin: 30px 0 15px;
  color: var(--dark-primary);
}

.entry-content img {
  border-radius: 8px;
  margin: 30px 0;
}

.entry-content a {
  color: var(--accent);
  text-decoration: underline;
}

.entry-content a:hover {
  color: var(--dark-primary);
}

.entry-footer {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 2px solid var(--gray-border);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  background-color: var(--gray-light);
  padding: 5px 12px;
  border-radius: 3px;
  font-size: 13px;
  color: var(--dark-primary);
}

.tag:hover {
  background-color: var(--accent);
  color: var(--white);
}

/* =================================
   FOOTER
   ================================= */
.site-footer {
  background: linear-gradient(180deg, var(--dark-primary) 0%, var(--dark-secondary) 100%);
  color: var(--white);
  padding: 60px 0 0;
  margin-top: 80px;
  border-top: 3px solid var(--accent);
}

.footer-widgets {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 50px;
}

.footer-widget h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--white);
  position: relative;
  padding-bottom: 10px;
}

.footer-widget h3::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 3px;
  background-color: var(--accent);
}

.footer-widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-widget li {
  margin-bottom: 12px;
}

.footer-widget a {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  transition: all 0.3s ease;
  display: inline-block;
}

.footer-widget a:hover {
  color: var(--accent);
  padding-left: 5px;
}

.footer-widget p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  line-height: 1.6;
}

/* Social Links */
.footer-social {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: var(--white);
  font-size: 18px;
  transition: all 0.3s ease;
}

.social-link:hover {
  background-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(231, 167, 72, 0.3);
}

/* Footer Bottom */
.footer-bottom {
  background-color: rgba(0, 0, 0, 0.2);
  padding: 25px 0;
  margin-top: 50px;
}

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

.site-info {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.site-info a {
  color: var(--accent);
  font-weight: 600;
}

/* Footer Legal Links */
.footer-legal {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-legal a {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.3s ease;
}

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

/* =================================
   PAGINATION
   ================================= */
.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 60px 0;
}

.page-numbers {
  padding: 10px 15px;
  background-color: var(--gray-light);
  border-radius: 5px;
  font-weight: 500;
}

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

/* =================================
   SIDEBAR
   ================================= */
.sidebar {
  padding: 20px;
  background-color: var(--gray-light);
  border-radius: 8px;
}

.widget {
  margin-bottom: 30px;
  padding: 20px;
  background: var(--white);
  border-radius: 8px;
}

.widget-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark-primary);
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
}

/* =================================
   RESPONSIVE
   ================================= */
@media (max-width: 1024px) {
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .footer-widgets {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .site-title {
    font-size: 28px;
  }
  
  /* Мобильное меню */
  .mobile-menu-toggle {
    display: block;
  }
  
  .main-navigation {
    position: relative;
  }
  
  .nav-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--dark-primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 999;
  }
  
  .nav-menu.active {
    display: flex;
  }
  
  .nav-menu > li {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .nav-menu > li > a {
    padding: 15px 20px;
  }
  
  .nav-menu .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background-color: rgba(0, 0, 0, 0.3);
    display: none;
  }
  
  .nav-menu li.menu-open > .sub-menu {
    display: block;
  }
  
  .nav-menu .sub-menu a {
    color: var(--white);
    padding-left: 40px;
  }
  
  .nav-menu .sub-menu a:hover {
    background-color: rgba(255, 255, 255, 0.1);
  }
  
  .featured-post {
    height: 400px;
  }
  
  .featured-title {
    font-size: 28px;
  }
  
  .news-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-widgets {
    grid-template-columns: 1fr;
  }
  
  .footer-bottom-content {
    flex-direction: column;
    text-align: center;
  }
  
  .footer-legal {
    justify-content: center;
  }
  
  .entry-title {
    font-size: 32px;
  }
  
  .entry-content {
    font-size: 16px;
  }
}

/* =================================
   UTILITIES
   ================================= */
.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  position: absolute;
  height: 1px;
  width: 1px;
  overflow: hidden;
}

.alignleft {
  float: left;
  margin: 0 20px 20px 0;
}

.alignright {
  float: right;
  margin: 0 0 20px 20px;
}

.aligncenter {
  display: block;
  margin: 20px auto;
}
