/* e-Ukraine — державна українська гарнітура, безкоштовна.
   Потрібні три накреслення в assets/fonts/:
     e-Ukraine-Regular  (400)
     e-Ukraine-Medium   (500)
     e-Ukraine-Bold     (700)
   Спершу підключається .woff2, якщо його немає — .otf.
   Конвертувати otf → woff2 варто: різниця у вазі приблизно втричі. */
@font-face {
  font-family: "e-Ukraine";
  src: url("../fonts/e-Ukraine-Regular.woff2") format("woff2"),
       url("../fonts/e-Ukraine-Regular.otf") format("opentype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "e-Ukraine";
  src: url("../fonts/e-Ukraine-Medium.woff2") format("woff2"),
       url("../fonts/e-Ukraine-Medium.otf") format("opentype");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "e-Ukraine";
  src: url("../fonts/e-Ukraine-Bold.woff2") format("woff2"),
       url("../fonts/e-Ukraine-Bold.otf") format("opentype");
  font-weight: 700; font-style: normal; font-display: swap;
}

/* ==========================================================================
   KirKat — базові стилі
   Порядок: токени → скид → типографіка → сітка → шапка → підвал → утиліти
   ========================================================================== */

/* --------------------------------------------------------------- Токени */
:root {

  /* Кольори — гама старого сайту */
  /* Значення зі старого styles.css, без градієнтів */
  --hdr-bg:     #1E87DA;   /* .header */
  --nav-bg:     #5C5C5C;   /* #header3 */
  --nav-text:   #E0E0E0;
  --nav-link:   #B5B5B5;
  --footer-bg:  #373737;   /* footer */
  --search-bg:  #A0C0E6;   /* поле пошуку */

  --blue-600: #2E80C8;   /* кнопки, активний стан */
  --blue-500: #1E6FB5;   /* посилання */
  --blue-050: #EAF3FB;   /* підкладка блоків */

  --ink:      #222222;   /* основний текст */
  --ink-mid:  #5C5C5C;   /* другорядний текст */
  --ink-soft: #8A8A8A;   /* підписи, метадані */

  --paper:    #FFFFFF;
  --surface:  #FFFFFF;   /* фон сторінок білий, як було */
  --line:     #DDDDDD;
  --line-soft:#EEEEEE;

  --gold:     #E8A317;   /* лише позначка VIP */
  --red:      #C0392B;   /* лише «закрито» */

  /* Типографіка */
  --font: "e-Ukraine", -apple-system, BlinkMacSystemFont,
          "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --fs-xs:   0.8125rem;  /* 13 — метадані */
  --fs-sm:   0.875rem;   /* 14 — підписи, теги */
  --fs-base: 1rem;       /* 16 — основний текст */
  --fs-md:   1.125rem;   /* 18 — назва картки */
  --fs-lg:   1.375rem;   /* 22 — заголовок блоку */
  --fs-xl:   1.75rem;    /* 28 — H2 */
  --fs-2xl:  2.25rem;    /* 36 — H1 */

  --lh-tight: 1.25;
  --lh-base:  1.6;

  /* Сітка */
  --container: 1140px;   /* Bootstrap 5, брейкпойнт xl */
  --sidebar:   300px;    /* під стандартні блоки AdSense 300×250 і 300×600 */
  --gap:       32px;
  --pad:       16px;

  /* Інше */
  --radius:  6px;
  --radius-lg: 12px;
  --shadow: 0 1px 2px rgba(22, 32, 43, .06);
}

/* ----------------------------------------------------------------- Скид */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--blue-500); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--blue-600);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------------------------------------------------- Типографіка */
h1, h2, h3, h4 {
  margin: 0 0 .5em;
  line-height: var(--lh-tight);
  font-weight: 500;
  letter-spacing: -0.01em;
}
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

/* Довжина рядка. Основний текст не має тягнутись на всю колонку. */
.prose { max-width: 68ch; }

/* ---------------------------------------------------------------- Сітка */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sidebar);
  gap: var(--gap);
  align-items: start;
  padding-block: 28px 48px;
}

/* minmax(0, 1fr) обовʼязково: без нього довга назва без пробілів
   розпирає колонку і ламає сітку */

@media (max-width: 1023px) {
  .layout { grid-template-columns: 1fr; }
}

.site-main { min-width: 0; }

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 16px;
}
@media (max-width: 1023px) {
  .sidebar { position: static; }
}

/* ---------------------------------------------------------- Пропуск меню */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--paper);
  color: var(--ink);
  padding: 10px 16px;
  z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------------------------------------------------------------- Шапка */
.site-header {
  background: var(--hdr-bg);
  color: #fff;
}

.header-top {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 72px;   /* висота як на старому сайті */
  padding-block: 10px;
}

.site-brand {
  display: block;
  flex: none;
  line-height: 0;
}
.site-brand:hover { text-decoration: none; }
.site-brand img {
  height: 46px;          /* пропорція логотипа зі старого сайту */
  width: auto;
}
/* Запасний варіант, поки файл логотипа не завантажено */
.site-brand .brand-text {
  font-size: 1.5rem;
  font-weight: 700;
  font-style: italic;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
}

/* Пошук — головний елемент шапки, бо це головна дія на сайті */
.header-search {
  flex: 1;
  min-width: 0;
  display: flex;
}
.header-search input[type="search"] {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  font: inherit;
  font-size: var(--fs-base);
  color: var(--ink);
  background: var(--search-bg);
  border: 0;
  border-radius: var(--radius) 0 0 var(--radius);
}
.header-search input[type="search"]:focus {
  background: #fff;
  outline-offset: -2px;
}
.header-search input::placeholder { color: #4A6B8C; }
.header-search button {
  height: 38px;
  padding: 0 20px;
  font: inherit;
  font-weight: 500;
  color: #fff;
  background: var(--blue-600);
  border: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer;
}
.header-search button:hover { background: var(--blue-500); }

.header-city {
  font-size: var(--fs-sm);
  color: #9FC3E5;
  white-space: nowrap;
}
@media (max-width: 767px) {
  .header-city { display: none; }
  .header-top { flex-wrap: wrap; gap: 12px; }
  .header-search { order: 3; flex-basis: 100%; }
}

/* Кнопка мобільного меню */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 11px 0;
  font: inherit;
  font-size: var(--fs-base);
  font-weight: 500;
  color: #fff;
  background: none;
  border: 0;
  cursor: pointer;
}
.nav-toggle__bars {
  position: relative;
  display: block;
  width: 20px; height: 2px;
  background: #fff;
}
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px; height: 2px;
  background: #fff;
}
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after  { top:  6px; }

/* Навігація */
.site-nav {
  background: var(--nav-bg);
}
.site-nav .container {
  display: flex;
  align-items: center;
}
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav ul { gap: 0; }
.site-nav a {
  display: block;
  padding: 10px 16px;
  font-size: var(--fs-base);
  font-weight: 700;
  font-style: italic;      /* як на старому сайті */
  color: var(--nav-text);
  min-height: 40px;
}
.site-nav a:hover {
  color: #fff;
  background: rgba(255,255,255,.12);
  text-decoration: none;
}
.site-nav .current-menu-item > a,
.site-nav .current_page_item > a {
  color: #fff;
  background: rgba(0,0,0,.15);
}

@media (max-width: 767px) {
  .nav-toggle { display: flex; }
  .site-nav .container { display: block; }
  .site-nav ul {
    display: none;
    flex-direction: column;
    padding-bottom: 6px;
  }
  .site-nav.is-open ul { display: flex; }
  .site-nav a { padding: 11px 0; }
}

/* ------------------------------------------------------- Хлібні крихти */
.breadcrumbs {
  padding-block: 10px;
  font-size: var(--fs-sm);
  color: var(--ink-mid);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.breadcrumbs a { color: var(--ink-mid); }
.breadcrumbs a:hover { color: var(--blue-500); }

/* --------------------------------------------------------------- Підвал */
.site-footer {
  background: var(--footer-bg);
  color: #D6D6D6;
  font-size: var(--fs-sm);
  padding-block: 40px 0;
  margin-top: auto;
}

.footer-cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--gap);
  padding-bottom: 32px;
}
@media (max-width: 767px) {
  .footer-cols { grid-template-columns: 1fr; gap: 28px; }
}

.footer-col h3 {
  margin: 0 0 12px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: #fff;
}
.footer-col ul {
  margin: 0; padding: 0; list-style: none;
  display: grid; gap: 7px;
}
.footer-col a { color: #D6D6D6; }
.footer-col a:hover { color: #fff; }

.footer-about p { max-width: 46ch; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12);
  padding-block: 16px 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  font-size: var(--fs-xs);
  color: #9A9A9A;
}

/* Сторінка притискає підвал донизу навіть на короткому контенті */
body { min-height: 100vh; display: flex; flex-direction: column; }
.site-content { flex: 1; }

/* -------------------------------------------------------------- Утиліти */
.block {
  background: var(--paper);
  padding: 0 0 26px;
}
.sidebar .block { padding-bottom: 18px; }

/* Заголовки блоків у бічній колонці — як на старому сайті:
   #sidebar .moduletitle { background:#dbd9da; color:#7b7b7b; }
   Якщо схочеш білий текст — поміняй --side-title-text */
:root {
  --side-title-bg:   #DBD9DA;
  --side-title-text: #7B7B7B;
}
.sidebar .block > h2,
.sidebar .block > h3,
.sidebar .widget-title,
.sidebar .wp-block-heading,
.sidebar .widget > h2,
.sidebar .widget > h3 {
  margin: 0 0 12px;
  padding: 0 14px;
  height: 36px;
  line-height: 36px;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--side-title-text);
  background: var(--side-title-bg);
  border-radius: 4px;
}

/* Заголовок блоку в основній колонці: #eee / #7b7b7b, курсив */
.site-main .block > h2.block-title {
  padding: 5px 10px;
  font-size: 1.3125rem;
  font-style: italic;
  font-weight: 700;
  color: #7B7B7B;
  background: #EEEEEE;
}
.block > h2, .block > h3 {
  margin: 0 0 14px;
  font-size: var(--fs-md);
  font-weight: 500;
}

.ad-slot { text-align: center; }
.ad-slot::before {
  content: "Реклама";
  display: block;
  margin-bottom: 6px;
  font-size: var(--fs-xs);
  color: var(--ink-soft);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: var(--fs-xs);
  font-weight: 500;
  border-radius: 3px;
}
.badge-vip    { background: var(--gold); color: #3A2600; }
.badge-closed { background: var(--line); color: var(--ink-mid); }


/* ------------------------------------------ Доступність: приховані підписи */
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.screen-reader-text:focus {
  position: static !important;
  width: auto; height: auto;
  clip: auto; clip-path: none;
}

/* ------------------------------------------------- Сторінка «Усі рубрики» */
.catalog-root__group {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.catalog-root__group:last-child { border-bottom: 0; }

.catalog-root__title {
  margin: 0 0 10px;
  font-size: var(--fs-lg);
}
.catalog-root__children {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 4px 20px;
  margin: 0; padding: 0;
  list-style: none;
}
.catalog-root__children a { color: var(--blue-500); }
.catalog-root__count { color: var(--ink-soft); font-size: var(--fs-sm); }


/* ------------------------------------------------------- Логотип у підвалі */
.footer-logo { display: inline-block; margin-bottom: 14px; line-height: 0; }
.footer-logo img { height: 40px; width: auto; }

/* ------------------------------------------------------------ Архів рубрики */
.term-intro { margin-bottom: 22px; }
.term-intro h1 { margin-bottom: .35em; }

.subcats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 6px 20px;
  margin: 0 0 26px;
  padding: 0;
  list-style: none;
}
.subcats a { color: var(--blue-500); }
.subcats .count { color: var(--ink-soft); font-size: var(--fs-sm); }

.company-list { margin: 0; padding: 0; list-style: none; }
.company-list > li {
  padding: 16px 0;
  border-bottom: 1px solid var(--line-soft);
}
.company-list > li:first-child { padding-top: 0; }

.empty-note { color: var(--ink-mid); }


/* ================================================================ Блог і новини
   Картки за зразком теми Gorilla: 4:3, радіус 12, назва 18/500,
   опис обрізаний двома рядками
   ============================================================================ */
.post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 34px 24px;
  margin: 0 0 30px;
  padding: 0;
  list-style: none;
}
.post-grid > li {
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
}
@media (max-width: 560px) {
  .post-grid { grid-template-columns: 1fr; gap: 28px; }
}

.post-card__img {
  display: block;
  line-height: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #EFEFEF;
}
.post-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4/3;
}
.post-card__img--empty { aspect-ratio: 4/3; }

.post-card__title {
  display: block;
  margin: 10px 0;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.3;
  color: #333;
}
.post-card__title:hover { color: var(--blue-500); text-decoration: none; }

.post-card__desc {
  line-height: 1.4;
  color: var(--ink-mid);
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.post-card__desc p { margin: 0; }

/* ------------------------------------------------- Рядок автора (бульбашка) */
/* Висота зарезервована, щоб картки не стрибали, поки вантажиться аватар */
.byline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  min-height: 34px;
  padding: 0 12px 0 4px;
  margin-bottom: 10px;
  background: #F1F1F1;
  border-radius: 999px;
  font-size: var(--fs-sm);
  color: var(--ink-mid);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
}
.byline__avatar {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  background: #DDD;
}
.byline__name {
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
}
.byline__sep { color: var(--ink-soft); }
.byline__date { color: var(--ink-mid); }

/* Місце під бульбашку резервується навіть коли автора немає */
.post-card .byline { margin-bottom: 10px; }

/* ------------------------------------------------------- Одиночний матеріал */
.entry { max-width: 760px; }
.entry__title { font-size: var(--fs-2xl); margin-bottom: .4em; }
.entry__thumb {
  margin: 0 0 24px;
  border-radius: 12px;
  overflow: hidden;
}
.entry__thumb img { width: 100%; height: auto; }
.entry__content { font-size: 1.0625rem; line-height: 1.7; }
.entry__content h2 { margin-top: 1.4em; }
.entry__content img { border-radius: 8px; }
.entry__meta {
  margin-bottom: 18px;
  color: var(--ink-mid);
  font-size: var(--fs-sm);
}
.entry__company {
  margin: 26px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
}

/* ----------------------------------------------------------- Пагінація */
.pagination { margin-top: 10px; }
.pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pagination .page-numbers {
  display: inline-block;
  min-width: 36px;
  padding: 7px 10px;
  text-align: center;
  color: var(--ink);
  background: #F1F1F1;
  border-radius: 4px;
}
.pagination .page-numbers:hover { background: #E4E4E4; text-decoration: none; }
.pagination .page-numbers.current {
  color: #fff;
  background: var(--hdr-bg);
}
