/*
Theme Name: Хоздела
Theme URI: https://hozdela.ru/
Description: Дочерняя тема GeneratePress для hozdela.ru. Тёплый холст, крупные белые карточки с большим радиусом, чипы-пилюли, геометрический гротеск Manrope. Опорный образец - knopka.com/blog. Рубрики цветокодированы по слагу.
Author: Редакция «Хоздела»
Template: generatepress
Version: 1.0.7
Text Domain: hozdela
*/

/* ==========================================================================
   1. Шрифт
   Manrope переменный: один файл на кириллицу закрывает веса 200-800.
   Внешних запросов нет.
   ========================================================================== */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('assets/fonts/manrope-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('assets/fonts/manrope-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================================
   2. Токены
   ========================================================================== */
:root {
  --canvas: #F4F2EE;
  --surface: #FFFFFF;
  --surface-2: #FBFAF8;
  --dark: #201E1B;
  --dark-2: #2C2926;

  --ink: #1E1C1A;
  --ink-2: #56514B;
  --ink-3: #8C867E;
  --on-dark: #F4F2EE;
  --on-dark-2: #A8A199;

  --line: #E6E1D8;
  --line-2: #D6CFC2;
  --line-dark: #3A3733;

  --brand: #1C7A5E;
  --brand-600: #16624C;
  --brand-100: #DDEFE8;
  --amber: #E8952A;
  --amber-100: #FBEBD4;

  /* Рубрики: цвет назначается по слагу через body-класс, см. раздел 9 */
  --rubric: var(--brand);

  --wrap: 1200px;
  --wrap-narrow: 740px;
  --r-card: 24px;
  --r-media: 18px;
  --r-note: 18px;
  --r-pill: 999px;

  --sh-1: 0 1px 2px rgba(32, 30, 27, .04);
  --sh-2: 0 14px 30px rgba(32, 30, 27, .09);

  --t: .18s cubic-bezier(.4, 0, .2, 1);
}

/* ==========================================================================
   3. База
   ========================================================================== */
body {
  background: var(--canvas);
  color: var(--ink);
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  font-size: 18px;
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, .entry-title, .page-title, .widget-title {
  font-family: inherit;
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -.025em;
  color: var(--ink);
  text-wrap: balance;
}

a { color: var(--brand); text-decoration: none; }
a:hover, a:focus { color: var(--brand-600); }

img { border-radius: 0; }

:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* Ширина контейнера GeneratePress */
.grid-container { max-width: var(--wrap); }

.hz-vh {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ==========================================================================
   4. Шапка
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(244, 242, 238, .88);
  -webkit-backdrop-filter: saturate(1.5) blur(10px);
  backdrop-filter: saturate(1.5) blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 0;
}
.site-header .inside-header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 20px;
  min-height: 72px;
}
.site-branding { display: flex; align-items: center; }

/* Логотип: знак - фоновая картинка, галочка внутри знака прозрачная,
   сквозь неё виден холст. Отдельного файла на тёмный фон не нужно. */
.site-branding .main-title {
  margin: 0;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1;
}
.site-branding .main-title a {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
}
.site-branding .main-title a::before {
  content: '';
  width: 38px; height: 38px;
  flex: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cmask id='m'%3E%3Cpath d='M20 7 L34 18 V32.5 H6 V18 Z' fill='%23fff' stroke='%23fff' stroke-width='4' stroke-linejoin='round'/%3E%3Cpath d='M13.6 25 L18 29.2 L26.4 20.8' fill='none' stroke='%23000' stroke-width='4.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/mask%3E%3Crect width='40' height='40' fill='%231C7A5E' mask='url(%23m)'/%3E%3C/svg%3E") center / contain no-repeat;
}
.site-description { display: none; }

/* Меню */
.main-navigation { background: transparent; margin-left: auto; }
.main-navigation .inside-navigation { padding: 0; }
/* display:flex только с планшета. На мобильном GP прячет ul и показывает
   бургер правилом `.main-navigation ul{display:none}` - оно слабее нашего,
   и без этой медиазапроса меню осталось бы всегда развёрнутым. */
@media (min-width: 769px) {
  .main-navigation .main-nav > ul { display: flex; align-items: center; gap: 4px; }
}
.main-navigation .main-nav ul li a {
  padding: 8px 13px;
  border-radius: var(--r-pill);
  color: var(--ink-2);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.4;
  transition: background var(--t), color var(--t);
}
.main-navigation .main-nav ul li:hover > a,
.main-navigation .main-nav ul li:focus > a,
.main-navigation .main-nav ul li.sfHover > a {
  background: rgba(32, 30, 27, .05);
  color: var(--ink);
}
.main-navigation .main-nav ul li.current-menu-item > a,
.main-navigation .main-nav ul li.current-menu-parent > a,
.main-navigation .main-nav ul li.current-menu-ancestor > a {
  background: var(--ink);
  color: #fff;
}
/* Выпадающее подменю */
.main-navigation ul ul {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--sh-2);
  padding: 6px;
  min-width: 230px;
}
.main-navigation ul ul li a { border-radius: 11px; font-size: 15.5px; }

/* Мобильное меню GP */
.main-navigation .menu-toggle {
  padding: 10px 14px;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  background: transparent;
}
.main-navigation.toggled .main-nav > ul {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 8px;
  margin-top: 8px;
  box-shadow: var(--sh-2);
}
.main-navigation.toggled .main-nav ul li a { padding: 11px 14px; }

/* ==========================================================================
   5. Каркас контента
   ========================================================================== */
.site-content { padding-top: 8px; }
.separate-containers .site-main { margin: 0; }
.separate-containers .inside-article,
.separate-containers .paging-navigation,
.one-container .site-content { padding: 0; }

/* Заголовок архива/рубрики.
   GeneratePress красит его белым правилом
   `.separate-containers .page-header{background-color:#fff}` - это две
   специфичности, поэтому голый `.page-header` проигрывает. Повторяем
   селектор GP, а не давим !important. */
.separate-containers .page-header,
.separate-containers .paging-navigation,
.separate-containers .inside-page-header {
  background: transparent;
  border: 0;
  padding: 44px 0 6px;
  margin: 0;
}
.separate-containers .paging-navigation { padding: 0; }
.page-header .page-title {
  font-size: clamp(34px, 5vw, 52px);
  letter-spacing: -.035em;
  margin: 0;
}
.page-header .taxonomy-description,
.page-header .author-info {
  margin: 14px 0 0;
  max-width: 62ch;
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink-2);
}
.page-header .taxonomy-description p { margin: 0; }

/* Чипы рубрик (выводит functions.php) */
.hz-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}
.hz-chips li { margin: 0; }
.hz-chips a {
  display: block;
  padding: 8px 17px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  color: var(--ink-2);
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -.01em;
  white-space: nowrap;
  transition: background var(--t), color var(--t), border-color var(--t);
}
.hz-chips a:hover { border-color: var(--ink); color: var(--ink); background: var(--surface); }
.hz-chips .is-active a { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ==========================================================================
   6. Лента карточек
   Сетку включаем только на архивах и главной. На 404, поиске без
   результатов и одиночной записи .site-main остаётся блочным (Г-10).
   ========================================================================== */
body.blog .site-main,
body.archive .site-main,
body.search-results .site-main {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
  align-items: start;
}
/* Служебные блоки тянутся на всю ширину сетки */
body.blog .site-main > .page-header,
body.archive .site-main > .page-header,
body.search-results .site-main > .page-header,
body.blog .site-main > .paging-navigation,
body.archive .site-main > .paging-navigation,
body.search-results .site-main > .paging-navigation,
body.blog .site-main > .hz-chips,
body.archive .site-main > .hz-chips,
body.search-results .site-main > .hz-chips,
.site-main > .no-results { grid-column: 1 / -1; }

/* Карточка */
.site-main > article {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--sh-1);
  overflow: hidden;
  margin: 0;
  border: 0;
  transition: transform var(--t), box-shadow var(--t);
}
body.blog .site-main > article:hover,
body.archive .site-main > article:hover,
body.search-results .site-main > article:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-2);
}
.site-main > article > .inside-article {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0;
}

/* Миниатюра */
.post-image, .post-image a { display: block; margin: 0; }
.site-main > article .post-image {
  order: -1;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--brand-100);
}
.site-main > article .post-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 0;
  transition: transform .5s cubic-bezier(.4, 0, .2, 1);
}
.site-main > article:hover .post-image img { transform: scale(1.04); }

/* Текстовая часть карточки */
body.blog .site-main > article .entry-header,
body.archive .site-main > article .entry-header,
body.search-results .site-main > article .entry-header { padding: 20px 24px 0; }
body.blog .site-main > article .entry-summary,
body.archive .site-main > article .entry-summary,
body.search-results .site-main > article .entry-summary { padding: 0 24px; }
body.blog .site-main > article .entry-summary p,
body.archive .site-main > article .entry-summary p,
body.search-results .site-main > article .entry-summary p {
  margin: 10px 0 0;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink-2);
}

/* Чип рубрики над заголовком карточки */
.hz-rubric {
  display: inline-block;
  margin-bottom: 9px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--rubric);
}
.hz-rubric a { color: inherit; }

body.blog .site-main > article .entry-title,
body.archive .site-main > article .entry-title,
body.search-results .site-main > article .entry-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.02em;
  margin: 0;
}
.site-main > article .entry-title a { color: var(--ink); }
.site-main > article .entry-title a::after { content: ''; position: absolute; inset: 0; }
.site-main > article:hover .entry-title a { color: var(--brand-600); }

/* Мета карточки */
.site-main > article .entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 16px 24px 22px;
  margin-top: auto;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.site-main > article .entry-meta a { color: var(--ink-3); }
.site-main > article .entry-meta a:hover { color: var(--ink); }
.entry-meta .comments-link, .entry-meta .byline { display: none; }

/* Обложка для записи без миниатюры: мягкая заливка цветом рубрики
   и знак-дом поверх. Без неё карточка в сетке выглядит обрубком. */
.site-main > article.hz-no-media > .inside-article::before {
  content: '';
  order: -1;
  display: block;
  aspect-ratio: 16 / 10;
  background-color: color-mix(in srgb, var(--rubric) 22%, #fff);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cmask id='m'%3E%3Cpath d='M20 7 L34 18 V32.5 H6 V18 Z' fill='%23fff' stroke='%23fff' stroke-width='4' stroke-linejoin='round'/%3E%3Cpath d='M13.6 25 L18 29.2 L26.4 20.8' fill='none' stroke='%23000' stroke-width='4.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/mask%3E%3Crect width='40' height='40' fill='%23ffffff' mask='url(%23m)'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 74px 74px;
}
body.single .site-main > article.hz-no-media > .inside-article::before,
body.page .site-main > article.hz-no-media > .inside-article::before { display: none; }

/* Первая карточка блога - горизонтальный герой на всю ширину.
   Только при наличии миниатюры: без картинки двухколоночная раскладка
   разваливается на пустой левый столбец. */
@media (min-width: 1025px) {
  body.blog .site-main > article:nth-of-type(1) { grid-column: 1 / -1; }

  body.blog .site-main > article.hz-has-media:nth-of-type(1) {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
  }
  body.blog .site-main > article.hz-has-media:nth-of-type(1) > .inside-article { display: contents; }
  body.blog .site-main > article.hz-has-media:nth-of-type(1) .post-image {
    grid-row: 1 / span 3;
    aspect-ratio: auto;
    height: 100%;
    min-height: 340px;
  }
  body.blog .site-main > article.hz-has-media:nth-of-type(1) .entry-header {
    align-self: end;
    padding: 42px 46px 0;
  }
  body.blog .site-main > article.hz-has-media:nth-of-type(1) .entry-summary { padding: 0 46px; }
  body.blog .site-main > article.hz-has-media:nth-of-type(1) .entry-meta {
    align-self: start;
    padding: 18px 46px 42px;
    margin-top: 0;
  }

  /* Без миниатюры: обложка узкой полосой слева, текст справа */
  body.blog .site-main > article.hz-no-media:nth-of-type(1) > .inside-article {
    display: grid;
    grid-template-columns: 300px 1fr;
    align-items: center;
  }
  body.blog .site-main > article.hz-no-media:nth-of-type(1) > .inside-article::before {
    grid-row: 1 / span 3;
    aspect-ratio: auto;
    height: 100%;
    min-height: 260px;
  }
  body.blog .site-main > article.hz-no-media:nth-of-type(1) .entry-header {
    align-self: end;
    padding: 38px 46px 0;
  }
  body.blog .site-main > article.hz-no-media:nth-of-type(1) .entry-summary { padding: 0 46px; }
  body.blog .site-main > article.hz-no-media:nth-of-type(1) .entry-meta {
    align-self: start;
    padding: 16px 46px 38px;
    margin-top: 0;
  }

  body.blog .site-main > article:nth-of-type(1) .entry-title { font-size: 33px; line-height: 1.2; }
  body.blog .site-main > article:nth-of-type(1) .entry-summary p { font-size: 17.5px; }
}

/* Пагинация */
.paging-navigation {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 38px;
  padding: 0;
}
.paging-navigation .nav-links { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.paging-navigation .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  color: var(--ink-2);
  font-size: 16px;
  font-weight: 700;
  transition: background var(--t), color var(--t), border-color var(--t);
}
.paging-navigation .page-numbers:hover { border-color: var(--ink); color: var(--ink); background: var(--surface); }
.paging-navigation .page-numbers.current { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ==========================================================================
   7. Одиночная запись
   ========================================================================== */
body.single .content-area,
body.page .content-area { width: 100%; }

body.single .site-main > article,
body.page .site-main > article {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
}
/* GeneratePress красит .inside-article белым. На статье и странице фон
   должен быть холстом - белые здесь только карточки и врезки.
   .page-header при этом не трогаем: на поиске он станет белым по светлому. */
body.single .site-main > article > .inside-article,
body.page .site-main > article > .inside-article {
  max-width: var(--wrap-narrow);
  margin-inline: auto;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border: 0;
}

body.single .entry-header, body.page .entry-header { padding: 30px 0 0; }
body.single .entry-title, body.page .entry-title {
  font-size: clamp(30px, 4.2vw, 46px);
  line-height: 1.13;
  letter-spacing: -.032em;
  margin: 0;
}
body.single .hz-rubric, body.page .hz-rubric { font-size: 13px; margin-bottom: 12px; }

/* Подводка (анонс) под заголовком */
.hz-lead {
  margin: 20px 0 0;
  font-size: 21px;
  line-height: 1.55;
  font-weight: 500;
  color: var(--ink-2);
}

body.single .entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 26px 0 0;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-3);
}
body.single .entry-meta .byline { display: inline; }
body.single .entry-meta .author a { color: var(--ink); font-weight: 700; }

/* Обложка одиночной записи */
body.single .post-image {
  margin: 32px 0 0;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-media);
  overflow: hidden;
  background: var(--brand-100);
}
body.single .post-image img { width: 100%; height: 100%; object-fit: cover; }

/* Тело статьи */
.entry-content { font-size: 18.5px; line-height: 1.75; color: var(--ink); }
body.single .entry-content, body.page .entry-content { margin-top: 34px; }
.entry-content > * + * { margin-top: 1.15em; }
.entry-content h2 { margin-top: 1.9em; font-size: 29px; letter-spacing: -.028em; }
.entry-content h3 { margin-top: 1.6em; font-size: 21.5px; font-weight: 700; letter-spacing: -.02em; }
.entry-content p { margin-bottom: 0; }
.entry-content a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  text-decoration-color: rgba(28, 122, 94, .4);
}
.entry-content a:hover { text-decoration-color: var(--brand); }
.entry-content ul, .entry-content ol { margin-bottom: 0; padding-left: 1.35em; }
.entry-content li + li { margin-top: .5em; }
.entry-content ul { list-style: none; padding-left: 0; }
.entry-content ul > li { position: relative; padding-left: 28px; }
.entry-content ul > li::before {
  content: '';
  position: absolute;
  left: 6px; top: .66em;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--brand);
}
.entry-content figure { margin: 2em 0; }
.entry-content img { border-radius: var(--r-media); }
.entry-content figcaption, .wp-caption-text {
  padding-top: 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-3);
  text-align: left;
}
.entry-content blockquote {
  margin: 2em 0;
  padding: 4px 0 4px 26px;
  border-left: 4px solid var(--brand);
  font-size: 21px;
  line-height: 1.5;
  font-weight: 500;
  color: var(--ink);
  font-style: normal;
}
.entry-content blockquote p { margin: 0; }

/* Таблицы */
.entry-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  background: var(--surface);
  border-radius: var(--r-media);
  overflow: hidden;
  margin: 2em 0;
}
.entry-content th, .entry-content td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.entry-content th {
  background: var(--surface-2);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
}
.entry-content tr:last-child td { border-bottom: 0; }
.wp-block-table { overflow-x: auto; }

/* Врезки: класс ставится на блок «Группа» или абзац в редакторе */
.hz-note {
  margin: 2em 0;
  padding: 24px 28px;
  border-radius: var(--r-note);
  background: var(--surface);
  border-left: 4px solid var(--brand);
  font-size: 17px;
  line-height: 1.62;
}
.hz-note > *:first-child { margin-top: 0; }
.hz-note > *:last-child { margin-bottom: 0; }
.hz-note--warn { border-left-color: #CE4438; background: #FDF3F2; }
.hz-note--tip { border-left-color: var(--amber); background: var(--amber-100); }
.hz-note--short { border-left-color: var(--brand); background: var(--brand-100); }

/* Оглавление */
.hz-toc {
  margin: 32px 0;
  padding: 22px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-note);
}
.hz-toc__title {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.hz-toc ol { margin: 0; padding-left: 20px; font-size: 16.5px; }
.hz-toc li + li { margin-top: 7px; }
.hz-toc a { color: var(--ink-2); text-decoration: none; }
.hz-toc a:hover { color: var(--brand); }

/* Блок автора */
.hz-author {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin: 52px 0 0;
  padding: 28px 30px;
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--sh-1);
}
.hz-author__ava {
  width: 60px; height: 60px;
  flex: none;
  border-radius: 50%;
  background: var(--brand-100);
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  color: var(--brand);
}
.hz-author__name { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.hz-author__role {
  margin: 2px 0 8px;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 700;
}
.hz-author p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--ink-2); }

/* Читайте дальше */
.hz-related { margin: 68px 0 0; }
.hz-related__title { font-size: 28px; margin: 0 0 22px; }
.hz-related__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.hz-related__grid li { margin: 0; }
.hz-related__card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--sh-1);
  overflow: hidden;
  transition: transform var(--t), box-shadow var(--t);
}
.hz-related__card:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
.hz-related__media { aspect-ratio: 16 / 10; background: var(--brand-100); overflow: hidden; }
.hz-related__media img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.hz-related__body { padding: 18px 20px 20px; }
.hz-related__name {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: -.02em;
  color: var(--ink);
}
.hz-related__card:hover .hz-related__name { color: var(--brand-600); }

/* Страница целиком без сайдбара */
.entry-content > .alignwide { max-width: none; }

/* Витрина рубрик, шорткод [hozdela_rubriki] */
.hz-rubriki {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}
.hz-rubriki li { margin: 0; padding: 0; }
.hz-rubriki li::before { display: none; }
.hz-rubriki__item a {
  display: block;
  height: 100%;
  padding: 24px 26px 22px;
  background: var(--surface);
  border-radius: var(--r-card);
  /* Цветной корешок именно тенью: border-left загибается по радиусу. */
  box-shadow: inset 4px 0 0 var(--rubric), var(--sh-1);
  color: var(--ink);
  text-decoration: none;
  transition: transform var(--t), box-shadow var(--t);
}
.hz-rubriki__item a:hover {
  transform: translateY(-3px);
  box-shadow: inset 4px 0 0 var(--rubric), var(--sh-2);
  color: var(--ink);
}
.hz-rubriki__name {
  display: block;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.025em;
  color: var(--rubric);
}
.hz-rubriki__desc {
  display: block;
  margin-top: 8px;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink-2);
}
.hz-rubriki__count {
  display: block;
  margin-top: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
@media (max-width: 768px) { .hz-rubriki { grid-template-columns: 1fr; } }

/* ==========================================================================
   8. Пустые состояния и 404
   ========================================================================== */
.hz-empty {
  margin: 40px 0;
  padding: 62px 48px;
  background: var(--dark);
  color: var(--on-dark);
  border-radius: var(--r-card);
  text-align: center;
}
.hz-empty__title { color: var(--on-dark); font-size: clamp(28px, 4vw, 42px); margin: 0; }
.hz-empty p { margin: 14px auto 0; max-width: 52ch; color: var(--on-dark-2); font-size: 17.5px; }
.hz-empty .hz-chips { justify-content: center; }
.hz-empty .hz-chips a { border-color: var(--line-dark); color: var(--on-dark-2); }
.hz-empty .hz-chips a:hover { background: var(--on-dark); border-color: var(--on-dark); color: var(--dark); }
.hz-empty .search-form { max-width: 460px; margin: 26px auto 0; }

/* Форма поиска */
.search-form, .hz-search {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 480px;
  padding: 6px 6px 6px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  transition: border-color var(--t), box-shadow var(--t);
}
.search-form:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-100); }
.search-form input[type="search"], .search-form .search-field {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  padding: 8px 0;
  box-shadow: none;
}
.search-form input[type="search"]:focus { outline: none; box-shadow: none; }
.search-form input[type="search"]::placeholder { color: var(--ink-3); }
.search-form button, .search-form input[type="submit"] {
  flex: none;
  padding: 11px 22px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--t);
}
.search-form button:hover, .search-form input[type="submit"]:hover { background: var(--brand-600); }

/* ==========================================================================
   9. Цвета рубрик
   Класс на <body> ставит functions.php: hz-cat-<слаг>.
   На карточке в ленте цвет ставится на самой карточке.
   ========================================================================== */
.hz-c-tehnika { --rubric: #2F6BD4; }
.hz-c-polomki { --rubric: #CE4438; }
.hz-c-uborka { --rubric: #12908F; }
.hz-c-stirka { --rubric: #6C5CD1; }
.hz-c-kuhnya { --rubric: #D9752E; }
.hz-c-hranenie { --rubric: #578F31; }
.hz-c-kommunalka { --rubric: #9E7420; }
.hz-c-remont { --rubric: #B8467B; }

/* ==========================================================================
   10. Подвал
   ========================================================================== */
.site-footer { margin-top: 80px; }
.site-footer .footer-widgets,
.site-footer .footer-widgets-container { background: var(--dark); }

.site-info, .site-footer .inside-site-info {
  background: var(--dark);
  color: var(--on-dark-2);
  font-size: 15px;
  padding: 30px 20px;
}
.site-info a { color: var(--on-dark-2); }
.site-info a:hover { color: var(--on-dark); }

.hz-footer {
  background: var(--dark);
  color: var(--on-dark-2);
  font-size: 15.5px;
  padding: 54px 0 0;
}
.hz-footer__in {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 0 20px;
}
.hz-footer__top {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 38px;
  border-bottom: 1px solid var(--line-dark);
}
.hz-footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--on-dark);
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -.03em;
}
.hz-footer__brand::before {
  content: '';
  width: 36px; height: 36px;
  flex: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cmask id='m'%3E%3Cpath d='M20 7 L34 18 V32.5 H6 V18 Z' fill='%23fff' stroke='%23fff' stroke-width='4' stroke-linejoin='round'/%3E%3Cpath d='M13.6 25 L18 29.2 L26.4 20.8' fill='none' stroke='%23000' stroke-width='4.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/mask%3E%3Crect width='40' height='40' fill='%237BC4A4' mask='url(%23m)'/%3E%3C/svg%3E") center / contain no-repeat;
}
.hz-footer__about { margin: 16px 0 0; max-width: 42ch; line-height: 1.6; }
.hz-footer h3 {
  margin: 0 0 15px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--on-dark);
}
.hz-footer ul { margin: 0; padding: 0; list-style: none; }
.hz-footer li + li { margin-top: 9px; }
.hz-footer a { color: var(--on-dark-2); }
.hz-footer a:hover { color: var(--on-dark); }
.hz-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 26px;
  padding: 22px 0 30px;
  font-size: 14px;
  color: #7E7871;
}
.hz-footer__bottom p { margin: 0; }

/* ==========================================================================
   11. Адаптив
   ========================================================================== */
@media (max-width: 1024px) {
  body.blog .site-main,
  body.archive .site-main,
  body.search-results .site-main { grid-template-columns: repeat(2, 1fr); }
  .hz-related__grid { grid-template-columns: repeat(2, 1fr); }
  .hz-footer__top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  body { font-size: 17px; }
  .site-header .inside-header { min-height: 64px; padding: 10px 20px; gap: 12px; }
  .site-branding .main-title { font-size: 21px; }
  .site-branding .main-title a::before { width: 33px; height: 33px; }
  .page-header { padding: 30px 0 4px; }
  body.blog .site-main,
  body.archive .site-main,
  body.search-results .site-main { grid-template-columns: 1fr; gap: 20px; }
  .hz-related__grid { grid-template-columns: 1fr; }
  .entry-content { font-size: 17.5px; }
  .entry-content h2 { font-size: 25px; }
  .entry-content h3 { font-size: 20px; }
  .hz-lead { font-size: 19px; }
  .hz-footer__top { grid-template-columns: 1fr; gap: 28px; }
  .hz-author { flex-direction: column; gap: 14px; padding: 24px; }
  .hz-empty { padding: 42px 22px; }
  .hz-note { padding: 20px 22px; }
  .hz-toc { padding: 20px 22px; }
  body.single .site-main > article > .inside-article,
  body.page .site-main > article > .inside-article { padding: 0 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .site-main > article:hover, .hz-related__card:hover { transform: none; }
}
