/*
Theme Name: Гранд Кровля
Theme URI: https://grandkrovlya.ru
Author: Гранд Кровля
Author URI: https://grandkrovlya.ru
Description: Профессиональная тема для кровельной компании «Гранд Кровля» в Санкт-Петербурге. Строгий прямоугольный дизайн в строительных тонах.
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: grand-krovlya
Tags: blog, custom-logo, custom-header, featured-images, translation-ready
*/

/* ========== VARIABLES ========== */
:root {
  --color-accent: #D4451A;
  --color-accent-hover: #B83915;
  --color-dark: #0d0d0d;
  --color-gray-900: #1a1a1a;
  --color-gray-800: #2a2a2a;
  --color-gray-700: #3a3a3a;
  --color-gray-600: #555;
  --color-gray-400: #999;
  --color-gray-300: #bbb;
  --color-gray-100: #e8e8e8;
  --color-light: #f2f0ec;
  --color-white: #ffffff;
  --color-steel: #4a6274;
  --color-yellow: #E8A630;
  --font-heading: 'Oswald', sans-serif;
  --font-body: 'Source Sans 3', sans-serif;
}

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

body {
  font-family: var(--font-body);
  background: var(--color-light);
  color: var(--color-gray-900);
  line-height: 1.6;
}

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

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

.container--narrow {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ========== HEADER ========== */
.site-header {
  background: var(--color-dark);
  border-bottom: 4px solid var(--color-accent);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-top {
  background: var(--color-gray-800);
  padding: 6px 0;
  font-size: 13px;
  color: var(--color-gray-400);
}

.header-top .container {
  display: flex;
  justify-content: flex-end;
  gap: 24px;
}

.header-top a {
  color: var(--color-gray-300);
  transition: color 0.2s;
}

.header-top a:hover { color: var(--color-yellow); }

.header-main { padding: 16px 0; }

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

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

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

.logo-icon {
  width: 48px;
  height: 48px;
  background: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-icon svg { width: 32px; height: 32px; fill: white; }

.site-title {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  color: var(--color-white);
  text-transform: uppercase;
  letter-spacing: 2px;
  line-height: 1.1;
}

.site-tagline {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--color-gray-400);
  letter-spacing: 3px;
  text-transform: uppercase;
  font-family: var(--font-heading);
}

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

.header-contact-item {
  text-align: right;
  color: var(--color-gray-300);
  font-size: 13px;
}

.header-contact-item strong {
  display: block;
  color: var(--color-white);
  font-size: 17px;
  font-weight: 600;
}

/* ========== HERO ========== */
.hero {
  background: linear-gradient(135deg, var(--color-gray-900) 0%, var(--color-steel) 100%);
  padding: 64px 0;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 40%;
  height: 100%;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 10px,
    rgba(255,255,255,0.02) 10px,
    rgba(255,255,255,0.02) 20px
  );
}

.hero__title {
  font-family: var(--font-heading);
  font-size: 42px;
  font-weight: 700;
  color: var(--color-white);
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
}

.hero__title::after {
  content: '';
  display: block;
  width: 80px;
  height: 4px;
  background: var(--color-accent);
  margin-top: 16px;
}

.hero__text {
  color: var(--color-gray-300);
  font-size: 18px;
  margin-top: 16px;
  max-width: 600px;
  position: relative;
}

/* ========== SECTION TITLE ========== */
.section-title {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-gray-900);
  padding-bottom: 12px;
  border-bottom: 3px solid var(--color-accent);
  display: inline-block;
  margin-bottom: 32px;
}

.section-title--light { color: var(--color-white); }

/* ========== ARTICLES GRID ========== */
.articles-section { padding: 60px 0 80px; }

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

.article-card {
  background: var(--color-white);
  border: 1px solid var(--color-gray-100);
  transition: box-shadow 0.25s, transform 0.25s;
  overflow: hidden;
  display: block;
}

.article-card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  transform: translateY(-3px);
}

.article-card__image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  position: relative;
}

.article-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

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

.article-card__image .placeholder-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3a5a6e, #2a4050);
}

.article-card__date {
  position: absolute;
  bottom: 0;
  left: 0;
  background: var(--color-accent);
  color: white;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 6px 14px;
  letter-spacing: 1px;
}

.article-card__body { padding: 20px 24px 24px; }

.article-card__title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-gray-900);
  line-height: 1.3;
  margin-bottom: 8px;
  transition: color 0.2s;
}

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

.article-card__excerpt {
  font-size: 14px;
  color: var(--color-gray-600);
  line-height: 1.5;
}

/* ========== SINGLE ARTICLE ========== */
.article-hero {
  position: relative;
  height: 360px;
  overflow: hidden;
}

.article-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-hero .placeholder-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-gray-900), var(--color-steel));
}

.article-hero__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 0 32px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
}

.article-hero__title {
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.article-hero__meta {
  color: var(--color-gray-300);
  font-size: 14px;
  margin-top: 8px;
}

.article-hero__meta span {
  color: var(--color-yellow);
  font-weight: 600;
}

/* Breadcrumbs */
.breadcrumbs {
  padding: 16px 0;
  font-size: 13px;
  color: var(--color-gray-600);
  background: var(--color-white);
  border-bottom: 1px solid var(--color-gray-100);
}

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

.breadcrumbs a:hover { text-decoration: underline; }

/* Article content */
.article-content { padding: 48px 0; }

.article-content h2 {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 600;
  text-transform: uppercase;
  margin: 32px 0 16px;
  color: var(--color-gray-900);
  padding-left: 16px;
  border-left: 4px solid var(--color-accent);
}

.article-content h3 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  margin: 24px 0 12px;
  color: var(--color-gray-900);
}

.article-content p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--color-gray-700);
  margin-bottom: 16px;
}

.article-content ul,
.article-content ol {
  margin: 0 0 16px 24px;
  color: var(--color-gray-700);
  font-size: 16px;
  line-height: 1.8;
}

.article-content blockquote {
  background: var(--color-steel);
  color: white;
  padding: 24px 28px;
  margin: 24px 0;
  border-left: 5px solid var(--color-yellow);
}

.article-content blockquote p {
  color: rgba(255,255,255,0.9);
  margin: 0;
}

.article-content img {
  margin: 24px 0;
}

/* ========== RELATED ARTICLES ========== */
.related-section {
  background: var(--color-gray-900);
  padding: 60px 0 72px;
}

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

.related-card {
  background: var(--color-gray-800);
  border: 1px solid var(--color-gray-700);
  transition: background 0.2s;
  overflow: hidden;
  display: block;
}

.related-card:hover { background: var(--color-gray-700); }

.related-card__image {
  width: 100%;
  height: 160px;
  overflow: hidden;
}

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

.related-card__image .placeholder-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3a5a6e, #2a4050);
}

.related-card__body { padding: 16px 20px 20px; }

.related-card__date {
  font-size: 12px;
  color: var(--color-yellow);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: var(--font-heading);
}

.related-card__title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  color: var(--color-white);
  text-transform: uppercase;
  margin-top: 6px;
  line-height: 1.3;
  transition: color 0.2s;
}

.related-card:hover .related-card__title { color: var(--color-yellow); }

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

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--color-white);
  color: var(--color-gray-900);
  border: 1px solid var(--color-gray-100);
  transition: background 0.2s, color 0.2s;
}

.pagination a:hover {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

.pagination .current {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

/* ========== FOOTER ========== */
.site-footer {
  background: var(--color-dark);
  border-top: 4px solid var(--color-accent);
  padding: 32px 0;
  text-align: center;
}

.site-footer p {
  color: var(--color-gray-600);
  font-size: 13px;
}

.footer-brand {
  font-family: var(--font-heading);
  font-size: 16px;
  color: var(--color-gray-400);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

/* ========== COOKIE POPUP ========== */
.cookie-popup {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-dark);
  border-top: 3px solid var(--color-accent);
  padding: 20px 0;
  z-index: 999;
  transform: translateY(0);
  transition: transform 0.4s;
}

.cookie-popup.hidden { transform: translateY(100%); }

.cookie-popup .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.cookie-popup p {
  color: var(--color-gray-300);
  font-size: 14px;
  flex: 1;
}

.cookie-popup p strong { color: white; }

.cookie-popup .btn-group {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.btn {
  border: none;
  padding: 10px 28px;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

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

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

.btn--ghost {
  background: transparent;
  color: var(--color-gray-400);
  border: 1px solid var(--color-gray-700);
}

.btn--ghost:hover {
  border-color: var(--color-gray-400);
  color: white;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
  .articles-grid,
  .related-grid { grid-template-columns: repeat(2, 1fr); }
  .header-contacts { display: none; }
}

@media (max-width: 600px) {
  .articles-grid,
  .related-grid { grid-template-columns: 1fr; }
  .hero__title { font-size: 28px; }
  .article-hero { height: 240px; }
  .article-hero__title { font-size: 24px; }
  .cookie-popup .container { flex-direction: column; text-align: center; }
}
