/*
Theme Name: СтройИнфо
Theme URI: https://stroyinfo.local
Author: Grok Construction
Author URI: https://x.ai
Description: Светлая информационная новостная тема строительной тематики. Magazine-style layout для порталов о строительстве, технологиях и материалах.
Version: 1.4.8
Requires at least: 7.0
Tested up to: 7.0.4
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: stroyinfo
Tags: news, blog, construction, magazine, two-columns, custom-menu, featured-images, translation-ready, light
*/

/* ============================================
   СтройИнфо — WordPress Theme
   Светлая новостная тема строительной тематики
   ============================================ */

:root {
  /* Пастельная строительная палитра */
  --primary: #5a6a75;
  --primary-dark: #4a5963;
  --accent: #c9926a;
  --accent-hover: #b57d56;
  --accent-light: #dfb089;
  --concrete: #8a969e;
  --concrete-light: #c5ced4;
  --bg: #f7f5f2;
  --bg-white: #fcfbfa;
  --bg-card: #ffffff;
  --text: #4a5560;
  --text-muted: #7a8690;
  --border: #e6e1db;
  --success: #7aad8c;
  --icon-color: #c9926a;

  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Montserrat', 'Inter', sans-serif;

  --shadow-sm: 0 1px 3px rgba(90, 106, 117, 0.06);
  --shadow-md: 0 4px 14px rgba(90, 106, 117, 0.08);
  --shadow-lg: 0 12px 32px rgba(90, 106, 117, 0.1);
  --radius: 0;
  --transition: all 0.25s ease;
}

/* ========== BASE ========== */
/* Единый цвет иконок Font Awesome */
.fa, .fas, .far, .fab, .fal, .fad,
i[class^="fa-"], i[class*=" fa-"] {
  color: var(--icon-color);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  /* Строительный фон — лёгкая сетка чертежа + мягкий градиент */
  background-image:
    linear-gradient(rgba(247, 245, 242, 0.94), rgba(247, 245, 242, 0.96)),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c5cdd3' fill-opacity='0.35'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

ul, ol {
  list-style: none;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--primary);
}

/* ========== TOP BAR ========== */
.top-bar {
  background: #ebe6e0;
  color: var(--text);
  font-size: 13px;
  padding: 8px 0;
}

.top-bar .container {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.top-bar-date,
.top-bar-weather {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.top-bar-social a {
  color: var(--concrete);
  font-size: 15px;
}

.top-bar-social a:hover {
  color: var(--accent);
}

/* ========== HEADER ========== */
.site-header {
  background: var(--bg-white);
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.site-header .container {
  position: relative;
}

.header-main {
  display: grid;
  grid-template-columns: minmax(150px, 210px) minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 20px;
  min-height: 88px;
  padding: 18px 0;
  position: relative;
}

/* Branding: logo image + caption */
.site-branding {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  max-width: 210px;
  z-index: 2;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

.logo img,
.logo .custom-logo {
  display: block;
  max-height: 56px;
  width: auto;
  height: auto;
  max-width: 170px;
  object-fit: contain;
}

.logo-icon {
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  font-family: var(--font-heading);
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.15;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logo-text .logo-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-description {
  margin: 0;
  padding: 0;
  font-size: 11px;
  font-weight: 500;
  color: var(--concrete);
  letter-spacing: 0.2px;
  line-height: 1.3;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Navigation — лаконичное, все пункты в зоне меню */
.main-nav {
  min-width: 0;
  width: 100%;
  overflow: hidden;
  z-index: 1;
}

.main-nav ul,
.main-nav .nav-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  row-gap: 4px;
}

.main-nav li {
  flex-shrink: 0;
}

.main-nav a {
  display: block;
  padding: 6px 9px;
  font-weight: 500;
  font-size: 13px;
  color: var(--text);
  border-radius: 0;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.main-nav a:hover {
  color: var(--accent-hover);
  background: transparent;
  border-bottom-color: var(--accent-light);
}

.main-nav .current-menu-item > a,
.main-nav .current_page_item > a {
  color: var(--accent-hover);
  background: transparent;
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* Search */
.header-search {
  position: relative;
  flex-shrink: 0;
  width: 170px;
  z-index: 2;
}

.header-search form {
  display: block;
  width: 100%;
}

.header-search input[type="search"] {
  width: 100%;
  max-width: 170px;
  padding: 10px 40px 10px 12px;
  border: 1px solid var(--border);
  border-radius: 0;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
  background: var(--bg);
  color: var(--text);
  box-sizing: border-box;
}

.header-search input:focus {
  border-color: var(--accent);
  background: #fff;
  width: 100%;
  max-width: 170px;
}

.header-search button {
  position: absolute;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--accent);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 0;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.header-search button:hover {
  background: var(--accent-hover);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--primary);
  padding: 6px;
}

/* ========== BREAKING NEWS ========== */
.breaking-news {
  background: #ece8e3;
  color: var(--text);
  padding: 9px 0;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.breaking-news .container {
  display: flex;
  align-items: center;
  gap: 14px;
}

.breaking-label {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 4px 11px;
  border-radius: 0;
  white-space: nowrap;
  flex-shrink: 0;
}

.breaking-ticker {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
}

.breaking-ticker a {
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

.breaking-ticker a:hover {
  color: var(--accent-hover);
}

/* ========== HERO ========== */
.hero {
  padding: 28px 0 18px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 18px;
  align-items: stretch;
}

.featured-post {
  position: relative;
  border-radius: 0;
  overflow: hidden;
  min-height: 480px;
  height: 100%;
  background: var(--primary);
  box-shadow: var(--shadow-md);
}

.featured-post .post-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.78;
  transition: transform 0.5s ease;
  min-height: 480px;
  position: absolute;
  inset: 0;
}

.featured-post:hover .post-thumbnail {
  transform: scale(1.04);
}

.featured-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px;
  background: linear-gradient(transparent, rgba(15, 23, 30, 0.9));
  color: #fff;
}

.featured-content .category,
.category-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 3px 9px;
  border-radius: 0;
  margin-bottom: 10px;
}

.featured-content h2 {
  font-size: 26px;
  color: #fff;
  margin-bottom: 10px;
  line-height: 1.3;
}

.featured-content h2 a {
  color: #fff;
}

.featured-content h2 a:hover {
  color: var(--accent-light);
}

.featured-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
}

.side-featured {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  min-height: 480px;
}

.side-post {
  display: flex;
  gap: 12px;
  background: var(--bg-card);
  border-radius: 0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border: 1px solid var(--border);
  flex: 1 1 0;
  min-height: 0;
  align-items: stretch;
}

.side-post:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.side-post-img {
  width: 110px;
  flex-shrink: 0;
  align-self: stretch;
  background: var(--bg);
  overflow: hidden;
}

.side-post-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 100px;
}

.side-post-content {
  padding: 12px 14px 12px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.side-post-content .category {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 5px;
}

.side-post-content h3 {
  font-size: 14px;
  margin-bottom: 5px;
  line-height: 1.35;
}

.side-post-content h3 a:hover {
  color: var(--accent);
}

.side-post-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* ========== SECTIONS ========== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 11px;
}

.section-title {
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  position: relative;
  padding-left: 13px;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 2px;
  width: 4px;
  background: var(--accent);
  border-radius: 0;
}

.section-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
}

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

/* ========== MAIN LAYOUT ========== */
.main-content {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  padding: 10px 0 40px;
}

/* News Grid */
.news-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.news-card {
  background: var(--bg-card);
  border-radius: 0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
}

.news-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.news-card-img {
  position: relative;
  height: 170px;
  overflow: hidden;
  background: #e8ecef;
}

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

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

.news-card-badge {
  position: absolute;
  top: 11px;
  left: 11px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 0;
  letter-spacing: 0.4px;
}

.news-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.news-card-body h3 {
  font-size: 16px;
  margin-bottom: 8px;
  line-height: 1.35;
}

.news-card-body h3 a:hover {
  color: var(--accent);
}

.news-card-excerpt {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 11px;
  flex-wrap: wrap;
}

.news-card-meta .author {
  font-weight: 600;
  color: var(--primary);
}

/* ========== SIDEBAR ========== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.widget {
  background: var(--bg-card);
  border-radius: 0;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.widget-header,
.widget .widget-title {
  background: #d9e0e4;
  color: var(--primary-dark);
  padding: 12px 16px;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.widget-body,
.widget > ul,
.widget > div:not(.widget-header):not(.widget-title) {
  padding: 16px;
}

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

/* Popular */
.popular-item {
  display: flex;
  gap: 11px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

.popular-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.popular-item:first-child {
  padding-top: 0;
}

.popular-num {
  width: 26px;
  height: 26px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.popular-content h4 {
  font-size: 13px;
  line-height: 1.35;
  margin-bottom: 3px;
}

.popular-content h4 a:hover {
  color: var(--accent);
}

.popular-content .meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* Categories */
.cat-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cat-list a,
.widget_categories a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.cat-list a:last-child,
.widget_categories li:last-child a {
  border-bottom: none;
}

.cat-list a:hover,
.widget_categories a:hover {
  color: var(--accent-hover);
}

.cat-list .cat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  background: #f0ebe6;
  font-size: 13px;
}

.cat-list .cat-icon i {
  color: var(--icon-color);
}

.cat-list a:hover .cat-icon {
  background: #e8dfd6;
}

.cat-list a:hover .cat-icon i {
  color: var(--icon-color);
}

.cat-list .cat-name {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}

.cat-list .count,
.widget_categories .count {
  background: var(--bg);
  color: var(--text-muted);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 0;
  font-weight: 600;
  margin-left: auto;
  flex-shrink: 0;
}

.cat-list-empty {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* Tags */
.tag-cloud,
.widget_tag_cloud .tagcloud {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag-cloud a,
.widget_tag_cloud a {
  display: inline-block;
  padding: 5px 11px;
  background: var(--bg);
  border-radius: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  border: 1px solid var(--border);
}

.tag-cloud a:hover,
.widget_tag_cloud a:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Newsletter */
.newsletter-widget {
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
}

.newsletter-widget .widget-header {
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.newsletter-widget p {
  font-size: 13px;
  margin-bottom: 14px;
  opacity: 0.9;
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.newsletter-form input {
  padding: 11px 13px;
  border: none;
  border-radius: 0;
  font-size: 13px;
  outline: none;
}

.newsletter-form button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 11px;
  border-radius: 0;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  transition: var(--transition);
}

.newsletter-form button:hover {
  background: var(--accent-hover);
}

/* ========== CATEGORY SECTION ========== */
.category-section {
  background: var(--bg-white);
  padding: 36px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* Секция рубрики: 1 крупный + 6 в 2 колонки */
.category-grid {
  display: grid;
  grid-template-columns: 1.35fr 1.65fr;
  gap: 18px;
  align-items: stretch;
}

.cat-featured {
  position: relative;
  border-radius: 0;
  overflow: hidden;
  min-height: 320px;
  height: 100%;
  background: var(--primary);
  box-shadow: var(--shadow-sm);
}

.cat-featured-link {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 320px;
  color: #fff;
}

.cat-featured img,
.cat-featured-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.75;
  display: block;
  min-height: 320px;
  position: absolute;
  inset: 0;
}

.cat-featured-no-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  height: 100%;
  background: linear-gradient(135deg, #5a6a75, #4a5963);
  color: rgba(255,255,255,0.8);
  font-size: 13px;
}

.cat-featured-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 20px;
  background: linear-gradient(transparent, rgba(15, 23, 30, 0.9));
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 1;
}

.cat-featured-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
}

.cat-featured-meta {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
}

.cat-list-posts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 0;
  padding: 0;
  height: 100%;
  align-items: stretch;
}

.cat-list-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  min-width: 0;
}

.cat-list-item {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
  flex: 1 1 0;
  min-height: 0;
  margin: 0;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
  box-sizing: border-box;
}

.cat-list-item:last-child {
  margin-bottom: 0;
}

.cat-list-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.cat-list-thumb {
  display: block;
  width: 100px;
  flex: 0 0 100px;
  align-self: stretch;
  overflow: hidden;
  background: var(--bg);
}

.cat-list-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  min-height: 90px;
}

.cat-list-no-thumb {
  width: 100%;
  height: 100%;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-muted);
  background: linear-gradient(135deg, #f3f0ec, #e8e4de);
  text-align: center;
  padding: 6px;
  box-sizing: border-box;
}

.cat-list-item-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 10px 12px;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.cat-list-item-content h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cat-list-item-content .meta {
  font-size: 12px;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .category-grid {
    grid-template-columns: 1fr;
  }
  .cat-featured,
  .cat-featured-link,
  .cat-featured img,
  .cat-featured-link img,
  .cat-featured-no-thumb {
    min-height: 240px;
  }
}

@media (max-width: 600px) {
  .cat-list-posts {
    grid-template-columns: 1fr;
  }
}

.cat-list-item-content h4 {
  font-size: 13px;
  line-height: 1.3;
  margin-bottom: 3px;
}

.cat-list-item-content h4 a:hover {
  color: var(--accent);
}

.cat-list-item-content .meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* ========== FOOTER ========== */
.site-footer {
  background: #e8e4de;
  color: var(--text-muted);
  padding-top: 48px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 36px;
  padding-bottom: 36px;
  align-items: start;
}

.footer-brand {
  min-width: 0;
}

.footer-brand p {
  max-width: 100%;
  word-wrap: break-word;
}

.footer-col {
  min-width: 0;
}

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

.footer-brand .logo-text {
  color: var(--primary-dark);
  margin-bottom: 14px;
  font-size: 20px;
}

.footer-brand .logo-text span {
  color: var(--concrete);
}

.footer-brand p {
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 18px;
}

.footer-social {
  display: flex;
  gap: 10px;
}

.footer-social a {
  width: 34px;
  height: 34px;
  background: rgba(90, 106, 117, 0.08);
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 14px;
}

.footer-social a:hover {
  background: var(--accent);
}

.footer-col h4 {
  color: var(--primary-dark);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 16px;
  padding-bottom: 9px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.footer-col ul li {
  margin-bottom: 9px;
}

.footer-col ul a {
  font-size: 13px;
  color: var(--text-muted);
}

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

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 18px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

/* ========== SINGLE POST ========== */
.single-layout {
  padding: 30px 0 50px;
}

.single-main {
  min-width: 0;
  width: 100%;
}

.single-post {
  background: var(--bg-card);
  border-radius: 0;
  padding: 32px 36px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  max-width: none;
  width: 100%;
  margin: 0;
}

.single-post .entry-header {
  margin-bottom: 24px;
}

.single-post .entry-title {
  font-size: 28px;
  margin: 12px 0 16px;
  line-height: 1.3;
}

.single-post .entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.single-post .post-thumbnail {
  margin: 24px 0;
  border-radius: 0;
  overflow: hidden;
}

.single-post .post-thumbnail img {
  width: 100%;
  height: auto;
}

.single-post .entry-content {
  font-size: 16px;
  line-height: 1.75;
  max-width: none;
}

.single-post .entry-content p {
  margin-bottom: 1.2em;
}

.single-post .entry-content img {
  max-width: 100%;
  height: auto;
}

.single-post .entry-content h2,
.single-post .entry-content h3 {
  margin: 1.6em 0 0.7em;
}

.single-post .entry-footer {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* Другие интересные статьи */
.related-posts {
  margin: 32px 0 10px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.related-posts-title {
  font-size: 18px;
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent);
  color: var(--primary);
}

.related-posts-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.related-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
  align-items: start;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.related-item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.related-thumb {
  display: block;
  width: 120px;
  height: 90px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.related-thumb img,
.related-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.related-no-thumb {
  width: 100%;
  height: 100%;
  min-height: 90px;
  font-size: 11px;
}

.related-body {
  min-width: 0;
}

.related-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 6px;
}

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

.related-excerpt {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-meta {
  font-size: 12px;
  color: var(--concrete);
}

@media (max-width: 600px) {
  .related-item {
    grid-template-columns: 90px 1fr;
    gap: 10px;
  }
  .related-thumb {
    width: 90px;
    height: 70px;
  }
  .related-posts {
    padding: 16px;
  }
}

/* Пагинация на главной скрыта */
body.home .pagination,
body.front-page .pagination {
  display: none !important;
}

/* ========== ARCHIVE / SEARCH ========== */
.page-header {
  padding: 28px 0 10px;
}

.page-header h1 {
  font-size: 26px;
}

/* ========== PAGINATION ========== */
.pagination,
.nav-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 28px 0;
  flex-wrap: wrap;
}

.pagination a,
.pagination span,
.nav-links a,
.nav-links span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

.pagination a:hover,
.nav-links a:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.pagination .current,
.nav-links .current {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .main-content {
    grid-template-columns: 1fr;
  }
  .category-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1100px) {
  .header-main {
    grid-template-columns: minmax(120px, 170px) minmax(0, 1fr) auto;
    column-gap: 12px;
  }
  .header-search {
    width: 150px;
  }
  .header-search input[type="search"],
  .header-search input:focus {
    max-width: 150px;
  }
  .main-nav a {
    padding: 5px 7px;
    font-size: 12px;
  }
  .header-main {
    min-height: 80px;
    padding: 14px 0;
  }
}

@media (max-width: 900px) {
  .header-search {
    display: none;
  }
  .header-main {
    grid-template-columns: minmax(120px, 1fr) auto;
  }
  .main-nav {
    display: none;
  }
  .menu-toggle {
    display: block;
    justify-self: end;
  }
  .main-nav.active {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    background: #fff;
    border-bottom: 3px solid var(--accent);
    box-shadow: var(--shadow-md);
    padding: 14px;
    z-index: 20;
    overflow: visible;
  }
  .main-nav.active ul,
  .main-nav.active .nav-menu {
    flex-direction: column;
    align-items: stretch;
    overflow: visible;
    white-space: normal;
  }
  .main-nav.active a {
    padding: 12px 10px;
    font-size: 13px;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 3px solid var(--accent);
    box-shadow: var(--shadow-md);
    padding: 14px;
  }
  .main-nav.active {
    display: block;
  }
  .main-nav ul,
  .main-nav .nav-menu {
    flex-direction: column;
    flex-wrap: wrap;
    white-space: normal;
    overflow-x: visible;
  }
  .site-branding {
    max-width: 70%;
  }
  .header-search {
    display: none;
  }
  .news-grid {
    grid-template-columns: 1fr;
  }
  .category-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .featured-content h2 {
    font-size: 20px;
  }
  .side-post {
    flex-direction: column;
  }
  .side-post-img {
    width: 100%;
    height: 130px;
  }
  .single-post {
    padding: 22px 18px;
  }
}

/* Placeholder when no image — светлый фон */
.no-thumb {
  background: linear-gradient(135deg, #eef1f4, #e4e9ee);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8a97a3;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  width: 100%;
  height: 100%;
  min-height: inherit;
  border: 1px solid var(--border);
}

/* Современные архивы в сайдбаре */
.archives-modern {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.archive-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.archive-item:hover {
  border-color: var(--accent);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.archive-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.archive-month {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-transform: capitalize;
}

.archive-count {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  padding: 2px 8px;
  min-width: 28px;
  text-align: center;
}

.archive-bar {
  display: block;
  height: 4px;
  background: #e0e5ea;
  overflow: hidden;
}

.archive-bar-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  transition: width 0.3s ease;
}

.archives-empty {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* Рубрики в том же стиле, что архивы */
.categories-modern .category-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  text-transform: none;
}

.categories-modern .cat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  background: #f0ebe6;
  font-size: 12px;
}

.categories-modern .cat-icon i {
  color: var(--icon-color);
}

.categories-modern .cat-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.categories-modern .category-item:hover .cat-icon {
  background: #e8dfd6;
}

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

.widget_archive li {
  margin-bottom: 8px;
}

.widget_archive a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
}

.widget_archive a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* WordPress specific */
.wp-block-image {
  margin: 1.5em 0;
}

.alignwide,
.alignfull {
  max-width: 100%;
}

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}
/* ========== PIPE CALCULATOR ========== */
.calc-page {
  padding: 28px 0 50px;
}

.calc-page-header {
  margin-bottom: 24px;
}

.calc-page-title {
  font-size: 28px;
  margin-bottom: 10px;
}

.calc-page-intro {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 800px;
}

.pipe-calc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 32px;
}

.pipe-calc-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0;
}

.pipe-calc-form {
  padding: 28px;
  border-right: 1px solid var(--border);
}

.pipe-calc-results {
  padding: 28px;
  background: linear-gradient(160deg, #f8fafb 0%, #eef2f5 100%);
}

.pipe-calc-results h3 {
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 18px;
  color: var(--primary);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.pc-row {
  margin-bottom: 16px;
}

.pc-row label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.pc-row input,
.pc-row select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: var(--transition);
  border-radius: 0;
  font-family: inherit;
}

.pc-row input:focus,
.pc-row select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(230, 126, 34, 0.15);
}

.pc-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.pc-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.pc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border: none;
  cursor: pointer;
  border-radius: 0;
  transition: var(--transition);
  font-family: inherit;
}

.pc-btn-primary {
  background: var(--accent);
  color: #fff;
}

.pc-btn-primary:hover {
  background: var(--accent-hover);
}

.pc-btn-secondary {
  background: var(--bg);
  color: var(--primary);
  border: 1px solid var(--border);
}

.pc-btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pc-error {
  margin-top: 14px;
  padding: 10px 12px;
  background: #fdecea;
  color: #c0392b;
  font-size: 13px;
  border-left: 3px solid #c0392b;
}

.pc-result-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pc-result-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border);
}

.pc-result-item.pc-result-main {
  border-color: var(--accent);
  background: #fff8f2;
}

.pc-result-label {
  font-size: 13px;
  color: var(--text-muted);
}

.pc-result-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  font-family: var(--font-heading);
  white-space: nowrap;
}

.pc-result-main .pc-result-value {
  color: var(--accent);
  font-size: 18px;
}

.calc-formula-block {
  margin-top: 10px;
}

.calc-formula-block h2 {
  font-size: 20px;
  margin-bottom: 18px;
}

.calc-formula-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.calc-formula-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 22px;
}

.calc-formula-card h3 {
  font-size: 15px;
  margin-bottom: 12px;
  color: var(--primary);
}

.calc-formula {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  background: var(--bg);
  padding: 12px 14px;
  margin-bottom: 14px;
  color: var(--primary);
  border-left: 3px solid var(--accent);
}

.calc-formula-card ul {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
}

.calc-formula-card li {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.calc-note {
  font-size: 12px;
  color: var(--concrete);
  margin: 0;
  font-style: italic;
}

@media (max-width: 900px) {
  .pipe-calc-grid {
    grid-template-columns: 1fr;
  }
  .pipe-calc-form {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .calc-formula-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .pc-row-2 {
    grid-template-columns: 1fr;
  }
  .pipe-calc-form,
  .pipe-calc-results {
    padding: 18px;
  }
}

/* Иконки на акцентных кнопках — белые */
.header-search button i,
.pc-btn-primary i,
.logo-icon,
.breaking-label {
  color: #fff;
}
.header-search button .fa,
.header-search button .fas,
.pc-btn-primary .fa,
.pc-btn-primary .fas {
  color: #fff;
}


/* Маркер рубрики: FA или своё изображение */
.categories-modern .cat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  background: #f0ebe6;
  overflow: hidden;
}

.categories-modern .cat-icon-fa i {
  font-size: 13px;
  line-height: 1;
  color: var(--icon-color) !important;
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
  font-style: normal;
  display: inline-block;
}

.categories-modern .cat-icon-image {
  background: transparent;
  border: 1px solid var(--border);
}

.categories-modern .cat-icon-image img,
.categories-modern .cat-marker-img {
  width: 28px;
  height: 28px;
  object-fit: cover;
  display: block;
}

/* Footer mobile responsive */
@media (max-width: 768px) {
  .site-footer {
    padding-top: 32px;
  }
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  .footer-brand,
  .footer-col {
    width: 100%;
    text-align: left;
  }
  .footer-social {
    flex-wrap: wrap;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    text-align: left;
  }
  .footer-bottom span {
    display: block;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .site-footer {
    padding-top: 24px;
  }
  .footer-grid {
    gap: 20px !important;
    padding-bottom: 24px;
  }
  .footer-brand .logo-text {
    font-size: 18px;
  }
  .footer-brand p {
    font-size: 13px;
  }
  .footer-col h4 {
    font-size: 12px;
  }
}

/* Home categories grid */
.home-categories {
  padding: 10px 0 28px;
}

.home-cat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(0, auto);
  gap: 16px;
  align-items: stretch;
}

/* Крупная карточка = 2 колонки × 2 ряда (как 4 обычных блока) */
.home-cat-card--large {
  grid-column: span 2;
  grid-row: span 2;
}

.home-cat-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  min-width: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--transition);
  color: inherit;
  box-sizing: border-box;
}

.home-cat-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.home-cat-media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  flex: 0 0 auto;
  background: #f0ebe6;
  overflow: hidden;
}

.home-cat-card--large {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.home-cat-card--large .home-cat-media {
  flex: 1 1 auto;
  aspect-ratio: auto;
  min-height: 220px;
}

.home-cat-card--large .home-cat-name {
  font-size: 20px;
  min-height: auto;
  -webkit-line-clamp: 3;
}

.home-cat-card--large .home-cat-body {
  min-height: 88px;
  padding: 16px 18px;
}

.home-cat-media img,
.home-cat-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.home-cat-placeholder {
  width: 100%;
  height: 100%;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f3f0ec, #e8e4de);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  padding: 12px;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
  box-sizing: border-box;
}

.home-cat-icon-wrap {
  font-size: 28px;
}

.home-cat-icon-wrap i {
  color: var(--icon-color) !important;
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
}

.home-cat-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  flex: 1 1 auto;
  min-height: 72px;
}

.home-cat-name {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

.home-cat-card:hover .home-cat-name {
  color: var(--accent-hover);
}

.home-cat-count {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: auto;
}

@media (max-width: 1024px) {
  .home-cat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .home-cat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .home-cat-card--large {
    grid-column: span 2;
    grid-row: span 1;
  }
  .home-cat-card--large .home-cat-media {
    min-height: 160px;
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 480px) {
  .home-cat-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .home-cat-card--large {
    grid-column: span 1;
    grid-row: span 1;
  }
  .home-cat-card--large .home-cat-name {
    font-size: 16px;
  }
}


/* Главная: только основная область без сайдбара */
body.home .main-content,
body.front-page .main-content {
  grid-template-columns: 1fr;
}

body.home .main-content > main,
body.front-page .main-content > main {
  width: 100%;
  max-width: 100%;
}

body.home .news-grid,
body.front-page .news-grid {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1024px) {
  body.home .news-grid,
  body.front-page .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  body.home .news-grid,
  body.front-page .news-grid {
    grid-template-columns: 1fr;
  }
}
