/* ============================================================
   Bright — адаптация скачанного шаблона W3Layouts (bright-web)
   под флот. Единственные "ручки" от генератора — --accent /
   --accent-dim (writePalette в src/generator/generateSite.js).
   Остальное (светлая подложка-текстура, типографика, формы
   карточек/пагинации) фиксировано в этом файле — см. 10-пунктовый
   чек-лист в CLAUDE.md "Downloaded ('fullTemplate') layouts".
   ============================================================ */
:root {
  --accent: #C0392B;
  --accent-dim: #8E2A1F;

  --ink: #2c2c2c;        /* заголовки */
  --ink-soft: #6c6f72;   /* второстепенный текст */
  --muted: #999999;      /* мета/даты */
  --line: #e7e7e7;       /* тонкие разделители */
  --line-soft: #ededed;
  --card-bg: transparent;
  --panel-dark: #2c2c2c; /* подвал/мобильное меню */
  --star: #F5A623;
}

*, *::before, *::after { box-sizing: border-box; }
html, body, div, span, h1, h2, h3, h4, h5, h6, p, blockquote, a, img, ul, ol, li,
figure, figcaption, header, footer, nav, section, article, aside, form, input, button, textarea {
  margin: 0; padding: 0; border: 0; font: inherit; vertical-align: baseline;
}
ol, ul { list-style: none; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; background: none; }

body {
  font-family: "Segoe UI", "Open Sans", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: #fdfdfd url('images/body-bg.png') repeat;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 88%;
  max-width: 1180px;
  margin: 0 auto;
}
@media (max-width: 1280px) { .wrap { width: 92%; } }
@media (max-width: 700px)  { .wrap { width: 94%; } }

/* container-алиас — homepage-block.php (общий partial) ждёт .container */
.container { width: 100%; }

/* ---------- header ---------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  position: relative;
  z-index: 20;
}
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0;
}
.site-logo {
  display: inline-block;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  white-space: nowrap;
}
.site-logo b { font-weight: 800; }
.site-logo span { color: var(--ink); }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 28px;
  justify-content: flex-end;
}
.site-nav a {
  position: relative;
  display: inline-block;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: color 0.25s ease;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 2px;
  width: 100%;
  height: 2px;
  background: var(--accent);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.site-nav a:hover,
.site-nav a.is-active { color: var(--ink); }
.site-nav a:hover::after,
.site-nav a.is-active::after { opacity: 1; transform: translateY(0); }

.nav-toggle {
  display: none;
  width: 40px; height: 34px;
  position: relative;
  flex: 0 0 auto;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 6px;
  width: 28px; height: 2px;
  background: var(--accent);
}
.nav-toggle span { top: 16px; }
.nav-toggle span::before { top: -8px; }
.nav-toggle span::after  { top: 8px; }

.nav-mobile { display: none; background: var(--panel-dark); }
.nav-mobile a {
  display: block;
  padding: 13px 0;
  margin: 0 6%;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #cfcfcf;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.nav-mobile a:first-child { border-top: 0; }
.nav-mobile a:hover, .nav-mobile a.is-active { color: #fff; }
.nav-mobile.open { display: block; }

@media (max-width: 760px) {
  .site-nav { display: none; }
  .nav-toggle { display: block; }
  .site-header-inner { padding: 16px 0; }
}

/* ---------- hero (главная) ---------- */
.hero {
  text-align: center;
  padding: 56px 0 46px;
}
.hero-kicker {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: var(--accent);
  margin-bottom: 14px;
}
.hero-title {
  font-size: 2.2em;
  font-weight: 400;
  color: var(--ink-soft);
  line-height: 1.5;
  max-width: 760px;
  margin: 0 auto 18px;
}
.hero-title span { color: var(--accent); font-weight: 700; }
.hero-lead {
  font-size: 15px;
  color: var(--ink-soft);
  max-width: 600px;
  margin: 0 auto 26px;
  line-height: 1.8;
}
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- buttons / pagination (круглые обводные, фирменная деталь) ---------- */
.btn {
  display: inline-block;
  padding: 11px 26px;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  transition: background 0.25s ease;
}
.btn:hover { background: var(--accent-dim); }

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 36px;
}
.pagination a, .pagination span {
  display: block;
  min-width: 36px;
  padding: 7px 12px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 999px;
  transition: all 0.25s ease;
}
.pagination a:hover { color: var(--accent); border-color: var(--accent); }
.pagination .is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- panel / основной контент ---------- */
.site-main { padding: 0 0 50px; }
.page-head {
  padding: 40px 0 26px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
  text-align: center;
}
.page-head .eyebrow {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 2px; color: var(--accent); margin-bottom: 10px;
}
.page-head h1 {
  font-size: 1.9em; font-weight: 400; color: var(--ink); text-transform: uppercase;
  letter-spacing: 0.5px;
}
.page-head p { color: var(--ink-soft); margin-top: 14px; max-width: 62ch; margin-left: auto; margin-right: auto; }
.page-head .meta { color: var(--muted); font-size: 13px; margin-top: 12px; }

.cat-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 28px 0 8px; }
.cat-tabs a {
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: all 0.25s ease;
}
.cat-tabs a:hover,
.cat-tabs a.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

.breadcrumbs { padding: 20px 0 0; font-size: 12.5px; color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { margin: 0 7px; opacity: 0.6; }

/* ---------- layout: контент + сайдбар ---------- */
.home-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 50px;
  padding-top: 36px;
}
@media (max-width: 900px) {
  .home-layout { grid-template-columns: 1fr; gap: 36px; }
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ink);
  padding-bottom: 14px;
  margin-bottom: 26px;
  border-bottom: 2px solid var(--line);
}
.section-title span { color: var(--accent); }

/* ---------- post (вертикальная лента — blog_grid оригинала) ---------- */
.post {
  padding-bottom: 32px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
}
.post:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.post-title {
  font-size: 20px;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.35;
  margin-bottom: 16px;
}
.post-title a { color: var(--accent); }
.post-title a:hover { color: var(--accent-dim); }
.post-cover {
  display: block;
  width: 100%;
  height: 340px;
  object-fit: cover;
  margin-bottom: 18px;
  background: #f1f1f1;
}
.post-excerpt { font-size: 14px; color: var(--muted); line-height: 1.7; margin-bottom: 4px; }
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 10px 0;
  margin-top: 18px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px;
  color: var(--muted);
}
.post-meta .cat { color: var(--accent); font-weight: 700; text-transform: uppercase; }
.post-meta .star { color: var(--star); }
.post .btn { margin-top: 18px; }

/* ---------- card-grid (похожие статьи) ---------- */
/* flex-wrap, не grid: repeat(auto-fit/auto-fill) на неполном последнем ряду
   оставляет пустые ячейки — тот же баг уже ловили на .articles-grid.tiles
   и .card-grid в intelijen (см. CLAUDE.md). flex-grow тянет остаток только
   внутри своего перенесённого ряда. */
.card-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
}
.a-card {
  flex: 1 1 260px;
  min-width: 0;
  background: var(--card-bg);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transition: border-color 0.25s ease;
}
.a-card:hover { border-color: var(--accent); }
.a-card-cover {
  height: 170px;
  background-size: cover;
  background-position: center;
  background-color: #f1f1f1;
}
.a-card-body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; }
.a-card-meta { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.a-card-meta .cat { color: var(--accent); font-weight: 700; }
.a-card h3 { font-size: 14.5px; font-weight: 700; line-height: 1.35; color: var(--ink); text-transform: uppercase; }
.a-card:hover h3 { color: var(--accent); }
.a-card p { font-size: 13px; color: var(--muted); }
.a-card-foot { margin-top: auto; font-size: 12px; color: var(--muted); }
.a-card-foot .star { color: var(--star); }

/* ---------- сайдбар (services_list оригинала) ---------- */
.sidebar-block { margin-bottom: 36px; }
.sidebar-block h3 {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink);
  padding-bottom: 12px;
  border-bottom: 2px solid var(--line);
  margin-bottom: 4px;
}
.sidebar-block h3 span { color: var(--accent); }
.cat-list li a {
  display: block;
  padding: 13px 0 13px 18px;
  font-size: 13.5px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  position: relative;
  transition: color 0.25s ease;
}
.cat-list li:first-child a { border-top: 0; }
.cat-list li a::before {
  content: "";
  position: absolute;
  left: 2px; top: 50%;
  width: 5px; height: 5px;
  margin-top: -2.5px;
  background: var(--accent);
  border-radius: 50%;
}
.cat-list li a:hover, .cat-list li a.is-current { color: var(--accent); }
.cat-list .count { color: var(--muted); font-size: 11.5px; }

.mini-post {
  display: flex;
  gap: 12px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}
.mini-post:first-of-type { border-top: 0; }
.mini-post-thumb {
  flex: 0 0 62px;
  width: 62px; height: 62px;
  object-fit: cover;
  background: #f1f1f1;
}
.mini-post-title { font-size: 13px; line-height: 1.4; color: var(--ink); }
.mini-post:hover .mini-post-title { color: var(--accent); }
.mini-post-date { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ---------- одиночная статья ---------- */
.article-head { padding: 30px 0 24px; text-align: left; }
.article-head .eyebrow {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--accent); margin-bottom: 12px;
}
.article-head h1 {
  font-size: 1.9em; font-weight: 700; line-height: 1.3; color: var(--ink);
  text-transform: uppercase; margin-bottom: 14px;
}
.article-head .lead { font-size: 16px; color: var(--ink-soft); margin-bottom: 14px; line-height: 1.7; }
.article-head .byline { font-size: 13px; color: var(--muted); }
.article-head .byline .star { color: var(--star); }

.article-cover-img {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  margin: 6px 0 30px;
}

.article-body { font-size: 16px; line-height: 1.85; color: #333; }
.article-body > *:first-child { margin-top: 0; }
.article-body p { margin: 0 0 20px; }
.article-body h2 { font-size: 22px; color: var(--ink); margin: 34px 0 14px; font-weight: 700; }
.article-body h3 { font-size: 18px; color: var(--ink); margin: 26px 0 12px; font-weight: 700; }
.article-body ul, .article-body ol { margin: 0 0 20px 22px; }
.article-body li { margin-bottom: 8px; }
.article-body ul li { list-style: disc; }
.article-body ol li { list-style: decimal; }
.article-body a { color: var(--accent); text-decoration: underline; }
.article-body img { margin: 22px 0; }
.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 18px;
  margin: 22px 0;
  color: var(--ink-soft);
  font-style: italic;
}
.article-body table { width: 100%; border-collapse: collapse; margin: 22px 0; font-size: 14px; }
.article-body th, .article-body td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.article-body th { background: #f8f8f8; color: var(--ink); }

.article-foot-author {
  display: flex; align-items: center; gap: 14px;
  margin-top: 34px; padding: 20px;
  background: #f8f8f8;
  border: 1px solid var(--line);
}
.article-foot-author .who { font-size: 14px; color: var(--ink-soft); }
.article-foot-author .who b { color: var(--ink); }
.article-foot-author .role { font-size: 12.5px; color: var(--muted); }

/* rating widget (партиал общий, из core-template) */
.article-rating {
  margin-top: 36px;
  padding: 26px;
  background: #fff;
  border: 1px solid var(--line);
  text-align: center;
}
.article-rating-title { font-size: 14px; font-weight: 700; margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--ink); }
.article-rating-summary { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.article-rating-value { font-size: 24px; font-weight: 800; line-height: 1; color: var(--ink); }
.article-rating-stars-display { position: relative; display: inline-block; font-size: 19px; line-height: 1; letter-spacing: 3px; }
.article-rating-stars-bg { color: #ddd; }
.article-rating-stars-fg { position: absolute; top: 0; left: 0; overflow: hidden; white-space: nowrap; color: var(--star); }
.article-rating-count { font-size: 12.5px; color: var(--muted); }
.article-rating-picker { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.article-rating-picker-label { font-size: 13px; color: var(--muted); }
.article-rating-picker-stars { display: flex; gap: 2px; }
.rating-star-btn {
  background: none; border: none; cursor: pointer;
  font-size: 26px; line-height: 1; color: #ddd;
  padding: 2px 3px; transition: color 0.15s ease, transform 0.15s ease;
}
.rating-star-btn.is-active, .rating-star-btn:hover { color: var(--star); transform: scale(1.12); }
.article-rating-thanks { font-size: 13.5px; color: var(--accent); font-weight: 600; }

.related-wrap { margin-top: 40px; padding-top: 30px; border-top: 1px solid var(--line); }
.related-wrap .eyebrow {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--accent); margin-bottom: 6px;
}
.related-wrap h2 { font-size: 18px; text-transform: uppercase; color: var(--ink); margin-bottom: 22px; }

/* ---------- homepage-block (общий partial) ---------- */
.homepage-about {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
  color: #333;
  font-size: 15px;
  line-height: 1.85;
}
.homepage-about h2 { font-size: 20px; color: var(--ink); text-transform: uppercase; margin-bottom: 14px; }
.homepage-about h3 { font-size: 17px; color: var(--ink); margin: 22px 0 10px; }
.homepage-about p { margin-bottom: 16px; }
.homepage-about a { color: var(--accent); text-decoration: underline; }
.homepage-about ul, .homepage-about ol { margin: 0 0 16px 22px; }
.homepage-about ul li { list-style: disc; margin-bottom: 6px; }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 70px 0; }
.notfound .code { font-size: 96px; font-weight: 800; color: var(--accent); line-height: 1; }
.notfound h1 { font-size: 24px; text-transform: uppercase; color: var(--ink); margin: 14px 0 16px; }
.notfound p { color: var(--ink-soft); margin-bottom: 24px; }

/* ---------- footer ---------- */
.site-footer {
  background: var(--panel-dark);
  color: #cfcfcf;
  padding: 50px 0 0;
  margin-top: 50px;
}
.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
@media (max-width: 760px) {
  .footer-cols { grid-template-columns: 1fr; gap: 30px; }
}
.footer-col h4 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #fff;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.footer-col p { font-size: 13px; line-height: 1.8; color: #a9a9a9; }
.footer-cats { display: flex; flex-direction: column; gap: 10px; }
.footer-cats a, .footer-nav a {
  font-size: 13px;
  color: #a9a9a9;
  transition: color 0.25s ease;
}
.footer-cats a:hover, .footer-nav a:hover { color: var(--accent); }
.footer-nav { display: flex; flex-direction: column; gap: 10px; }
.footer-bottom {
  text-align: center;
  padding: 20px 0;
  font-size: 12.5px;
  color: #888;
}
.footer-bottom a { color: var(--accent); }
.footer-bottom a:hover { text-decoration: underline; }

@media (max-width: 760px) {
  .hero { padding: 40px 0 32px; }
  .hero-title { font-size: 1.5em; }
  .post-cover { height: 220px; }
  .page-head h1 { font-size: 1.4em; }
  .article-head h1 { font-size: 1.4em; }
}
