/*
Theme Name: Всё о кровле
Theme URI: https://example.com/vse-o-krovle
Author: ROOF Team
Author URI: https://example.com
Description: Кровельный блог — минималистичная тёмная тема для WordPress с акцентным красным цветом, адаптивной сеткой статей и стильной типографикой.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: vse-o-krovle
Tags: blog, custom-logo, custom-menu, featured-images, translation-ready, one-column, three-columns
*/

/* ===== VARIABLES ===== */
:root {
  --color-bg: #f5f2ed;
  --color-surface: #ffffff;
  --color-dark: #1a1a1a;
  --color-accent: #c0392b;
  --color-accent-hover: #a93226;
  --color-text: #2c2c2c;
  --color-text-muted: #6b6b6b;
  --color-border: #e0dbd4;
  --color-tag-bg: #fdf0ee;
  --color-tag-text: #c0392b;
  --font-heading: 'Oswald', sans-serif;
  --font-body: 'Source Sans 3', sans-serif;
  --shadow-card: 0 2px 20px rgba(0,0,0,0.06);
  --shadow-card-hover: 0 8px 40px rgba(0,0,0,0.12);
  --radius: 6px;
  --max-width: 1280px;
}

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

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }

/* ===== HEADER ===== */
.header {
  background: var(--color-dark);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-top {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  width: 44px;
  height: 44px;
}

.logo-icon svg {
  width: 100%;
  height: 100%;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 2px;
  text-transform: uppercase;
  line-height: 1;
}

.logo-text span {
  color: var(--color-accent);
}

.logo-sub {
  font-family: var(--font-body);
  font-size: 11px;
  color: #999;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 400;
  margin-top: 2px;
}

.header-contacts {
  display: flex;
  align-items: center;
  gap: 32px;
}

.header-address {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #aaa;
  font-size: 14px;
}

.header-address svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--color-accent);
}

.header-phone {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.header-phone svg {
  width: 18px;
  height: 18px;
  color: var(--color-accent);
}

.header-nav {
  background: rgba(255,255,255,0.05);
  border-top: 1px solid rgba(255,255,255,0.08);
}

.header-nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
}

/* WP Menu styling */
.header-nav-inner .menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.header-nav-inner .menu li a {
  display: block;
  padding: 14px 24px;
  color: #ccc;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: color 0.2s, background 0.2s;
  position: relative;
}

.header-nav-inner .menu li a:hover,
.header-nav-inner .menu li.current-menu-item a,
.header-nav-inner .menu li.current_page_item a {
  color: #fff;
  background: rgba(255,255,255,0.06);
}

.header-nav-inner .menu li.current-menu-item a::after,
.header-nav-inner .menu li.current_page_item a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 24px;
  right: 24px;
  height: 3px;
  background: var(--color-accent);
}

/* ===== HERO (Blog index) ===== */
.hero {
  background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(192,57,43,0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 64px 32px 56px;
  position: relative;
}

.breadcrumbs {
  font-size: 13px;
  color: #888;
  margin-bottom: 24px;
}

.breadcrumbs a {
  color: #aaa;
  transition: color 0.2s;
}

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

.breadcrumbs span {
  margin: 0 8px;
  color: #555;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: 52px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 2px;
  text-transform: uppercase;
  line-height: 1.1;
}

.hero h1 span {
  color: var(--color-accent);
}

.hero-desc {
  color: #999;
  font-size: 17px;
  margin-top: 16px;
  max-width: 560px;
  line-height: 1.7;
}

/* ===== ARTICLES GRID ===== */
.articles-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 56px 32px 80px;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.article-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-hover);
}

.article-card-img {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/10;
}

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

.article-card:hover .article-card-img img {
  transform: scale(1.06);
}

.article-card-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--color-accent);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 3px;
}

.article-card-body {
  padding: 24px 24px 28px;
  flex: 1;
}

.article-card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.article-card-meta svg {
  width: 14px;
  height: 14px;
  margin-right: 4px;
  vertical-align: -2px;
}

.article-card h2 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.3px;
  color: var(--color-dark);
  margin-bottom: 12px;
  transition: color 0.2s;
}

.article-card:hover h2 {
  color: var(--color-accent);
}

.article-card-excerpt {
  font-size: 15px;
  color: var(--color-text-muted);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  margin-top: auto;
}

.article-card-views {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.article-card-views svg {
  width: 16px;
  height: 16px;
}

.article-card-link {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-accent);
  letter-spacing: 1px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.2s;
}

.article-card:hover .article-card-link {
  gap: 10px;
}

.article-card-link svg {
  width: 16px;
  height: 16px;
}

/* ===== ARTICLE HERO (single) ===== */
.article-hero {
  background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
  position: relative;
  overflow: hidden;
}

.article-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(192,57,43,0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.article-hero-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 48px 32px 52px;
  position: relative;
}

.article-hero-tag {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 3px;
  margin-bottom: 20px;
}

.article-hero h1 {
  font-family: var(--font-heading);
  font-size: 42px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
  line-height: 1.15;
  margin-bottom: 20px;
}

.article-hero-meta {
  display: flex;
  align-items: center;
  gap: 24px;
  color: #999;
  font-size: 14px;
}

.article-hero-meta svg {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  vertical-align: -3px;
}

/* ===== ARTICLE CONTENT ===== */
.article-content-wrapper {
  max-width: 860px;
  margin: 0 auto;
  padding: 48px 32px 64px;
}

.article-featured-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  margin-bottom: 40px;
}

.article-content {
  font-size: 17px;
  line-height: 1.8;
  color: var(--color-text);
}

.article-content h2 {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 600;
  color: var(--color-dark);
  margin: 40px 0 16px;
  letter-spacing: 0.5px;
  line-height: 1.3;
}

.article-content h3 {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 600;
  color: var(--color-dark);
  margin: 32px 0 12px;
  letter-spacing: 0.3px;
}

.article-content p {
  margin-bottom: 18px;
}

.article-content ul,
.article-content ol {
  margin: 16px 0 24px 24px;
}

.article-content li {
  margin-bottom: 8px;
}

.article-content blockquote {
  border-left: 4px solid var(--color-accent);
  background: rgba(192,57,43,0.04);
  padding: 20px 24px;
  margin: 28px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--color-text-muted);
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  font-size: 15px;
}

.article-content th {
  background: var(--color-dark);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 14px 18px;
  text-align: left;
}

.article-content td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--color-border);
}

.article-content tr:nth-child(even) td {
  background: rgba(0,0,0,0.02);
}

.article-content img {
  width: 100%;
  border-radius: var(--radius);
  margin: 24px 0;
}

/* ===== RELATED ARTICLES ===== */
.related-section {
  background: var(--color-dark);
  padding: 64px 32px 80px;
  position: relative;
  overflow: hidden;
}

.related-section::before {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -5%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(192,57,43,0.1) 0%, transparent 70%);
  border-radius: 50%;
}

.related-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
}

.related-title {
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

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

.related-subtitle {
  color: #777;
  font-size: 16px;
  margin-bottom: 36px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.related-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s, background 0.3s, border-color 0.3s;
  display: flex;
  flex-direction: column;
}

.related-card:hover {
  transform: translateY(-4px);
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
}

.related-card-img {
  aspect-ratio: 16/10;
  overflow: hidden;
}

.related-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
  opacity: 0.85;
}

.related-card:hover .related-card-img img {
  transform: scale(1.06);
  opacity: 1;
}

.related-card-body {
  padding: 18px 20px 22px;
}

.related-card-tag {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 8px;
}

.related-card h3 {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 600;
  color: #ddd;
  line-height: 1.35;
  letter-spacing: 0.3px;
  transition: color 0.2s;
}

.related-card:hover h3 {
  color: #fff;
}

.related-card-meta {
  margin-top: 10px;
  font-size: 12px;
  color: #666;
  display: flex;
  gap: 14px;
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 40px 0 0;
}

.pagination .page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  transition: all 0.2s;
}

.pagination .page-numbers:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.pagination .page-numbers.current {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

.pagination .page-numbers.prev,
.pagination .page-numbers.next {
  width: auto;
  padding: 0 18px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 13px;
}

/* ===== FOOTER ===== */
.footer {
  background: var(--color-dark);
  border-top: 3px solid var(--color-accent);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-copy {
  color: #666;
  font-size: 14px;
}

.footer-copy span {
  color: #888;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: #666;
  font-size: 13px;
  transition: color 0.2s;
  font-weight: 600;
  letter-spacing: 0.5px;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .articles-grid,
  .related-grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 40px; }
}

@media (max-width: 768px) {
  .header-top { padding: 0 20px; height: 64px; }
  .header-contacts { gap: 16px; }
  .header-address { display: none; }
  .header-nav-inner { padding: 0 20px; overflow-x: auto; }
  .header-nav-inner .menu li a { padding: 12px 16px; font-size: 13px; white-space: nowrap; }
  .hero-inner { padding: 40px 20px 36px; }
  .hero h1 { font-size: 32px; }
  .articles-section { padding: 32px 20px 60px; }
  .articles-grid,
  .related-grid { grid-template-columns: 1fr; gap: 20px; }
  .article-hero-inner { padding: 32px 20px 36px; }
  .article-hero h1 { font-size: 28px; }
  .article-content-wrapper { padding: 32px 20px 48px; }
  .related-section { padding: 48px 20px 60px; }
  .footer-inner { padding: 24px 20px; flex-direction: column; gap: 16px; text-align: center; }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.article-card {
  animation: fadeUp 0.5s ease both;
}

.article-card:nth-child(1) { animation-delay: 0.05s; }
.article-card:nth-child(2) { animation-delay: 0.15s; }
.article-card:nth-child(3) { animation-delay: 0.25s; }
.article-card:nth-child(4) { animation-delay: 0.1s; }
.article-card:nth-child(5) { animation-delay: 0.2s; }
.article-card:nth-child(6) { animation-delay: 0.3s; }
.article-card:nth-child(7) { animation-delay: 0.15s; }
.article-card:nth-child(8) { animation-delay: 0.25s; }
.article-card:nth-child(9) { animation-delay: 0.35s; }

.related-card {
  animation: fadeUp 0.4s ease both;
}

.related-card:nth-child(1) { animation-delay: 0.05s; }
.related-card:nth-child(2) { animation-delay: 0.11s; }
.related-card:nth-child(3) { animation-delay: 0.17s; }
.related-card:nth-child(4) { animation-delay: 0.08s; }
.related-card:nth-child(5) { animation-delay: 0.14s; }
.related-card:nth-child(6) { animation-delay: 0.2s; }
.related-card:nth-child(7) { animation-delay: 0.11s; }
.related-card:nth-child(8) { animation-delay: 0.17s; }
.related-card:nth-child(9) { animation-delay: 0.23s; }
.related-card:nth-child(10) { animation-delay: 0.14s; }
.related-card:nth-child(11) { animation-delay: 0.2s; }
.related-card:nth-child(12) { animation-delay: 0.26s; }
