/* ============================================================
   Ukrconsult · креативний шар новинного контуру (midnight+crimson)
   Підключається ОСТАННІМ (після news-skin.css) і володіє лише
   редакційною подачею: masthead, картки, стаття, люди, теги.
   Палітра — дзеркало palette--midnight з /assets/site.css.
   ============================================================ */

:root {
  --nc-canvas: #10132b;
  --nc-paper: #171b3d;
  --nc-mist: #1d224b;
  --nc-ink: #eef0ff;
  --nc-muted: #a9b0d6;
  --nc-line: #2c3263;
  --nc-line-strong: #3c4380;
  --nc-accent: #f0958e;
  --nc-accent-deep: #b3261e;
  /* колірний код категорій (м'які відтінки для темного ґрунту) */
  --nc-cat-telekom: #8fb4f4;
  --nc-cat-kiberbezpeka: #7fd6a6;
  --nc-cat-iot: #6fd0c5;
  --nc-cat-bpm: #f2ce7f;
  --nc-cat-docs: #b49af0;
  --nc-cat-soft: #f0958e;
  --nc-cat-integration: #7fc6e8;
  --nc-cat-infra: #e8b7d4;
}

/* ------------------------------------------------------------
   1. Masthead архівів (новини, рубрики, теги)
   ------------------------------------------------------------ */
.hero.hero-inner {
  position: relative;
  overflow: hidden;
  padding: 84px 48px 64px !important;
  border: 1px solid var(--nc-line);
  border-radius: 14px;
  text-align: left;
}

.hero.hero-inner .hero-content {
  position: relative;
  z-index: 1;
  max-width: none;
  margin: 0;
  text-align: left;
}

/* Ghost-слово (eyebrow) — величезний контурний напис у правому куті */
/* !important: легасі-тема фіксує .hero-tag 11px !important. */
.hero.hero-inner .hero-tag {
  position: absolute;
  right: 8px;
  top: 2px;
  margin: 0;
  color: transparent !important;
  -webkit-text-stroke: 1px color-mix(in srgb, var(--nc-accent) 34%, transparent);
  font-size: clamp(64px, 12vw, 150px) !important;
  font-weight: 800;
  letter-spacing: .04em !important;
  line-height: 1;
  text-transform: uppercase;
  pointer-events: none;
  user-select: none;
}

.hero.hero-inner h1 {
  position: relative;
  max-width: 720px;
  margin: 0 0 18px;
  padding-top: 22px;
  font-size: clamp(36px, 4.6vw, 58px);
  line-height: 1.06;
  letter-spacing: -.03em;
  text-align: left;
}

/* Акцентна планка над заголовком */
.hero.hero-inner h1::before {
  content: "";
  position: absolute;
  top: 0;
  left: 2px;
  width: 64px;
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--nc-accent-deep), var(--nc-accent));
}

.hero.hero-inner h1 .highlight {
  color: var(--nc-accent);
}

.hero.hero-inner .hero-description {
  max-width: 560px;
  margin: 0;
  text-align: left;
  font-size: 17px;
  line-height: 1.65;
}

/* ------------------------------------------------------------
   2. Таб-бар рубрик
   ------------------------------------------------------------ */
.news-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.news-filter-bar .filter-tab {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 16px;
  border: 1px solid var(--nc-line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--nc-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: border-color .15s ease, color .15s ease;
}

.news-filter-bar .filter-tab:hover {
  border-color: var(--nc-accent);
  color: var(--nc-ink);
}

/* ------------------------------------------------------------
   3. Картки новин + featured-подача на вкладці «Всі»
   ------------------------------------------------------------ */
.news-card {
  border-radius: 12px;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.news-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgb(0 0 0 / 40%);
}

.news-card-title a {
  font-weight: 700;
}

/* Перша картка вкладки «Всі» — редакційний spotlight на всю ширину */
#nt-all:checked ~ .news-layout .news-grid > .news-card:first-child {
  grid-column: 1 / -1;
  gap: 18px;
  padding: 34px 38px 30px;
  border-left-width: 4px;
  background:
    linear-gradient(115deg, var(--nc-mist) 0%, var(--nc-paper) 55%),
    linear-gradient(color-mix(in srgb, var(--nc-accent) 7%, transparent) 1px, transparent 1px);
  background-size: auto, 100% 34px;
}

#nt-all:checked ~ .news-layout .news-grid > .news-card:first-child .news-card-title a {
  font-size: clamp(24px, 2.6vw, 32px);
  line-height: 1.15;
  letter-spacing: -.03em;
}

#nt-all:checked ~ .news-layout .news-grid > .news-card:first-child .news-excerpt {
  max-width: 640px;
  font-size: 15px;
}

/* Бейдж «Свіже» — лише на spotlight-картці */
#nt-all:checked ~ .news-layout .news-grid > .news-card:first-child .news-card-top::after {
  content: "Свіже";
  order: -1;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--nc-accent);
  color: #08110e;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

html[lang="en"] #nt-all:checked ~ .news-layout .news-grid > .news-card:first-child .news-card-top::after {
  content: "Latest";
}

#nt-all:checked ~ .news-layout .news-grid > .news-card:first-child .news-card-top {
  justify-content: flex-start;
}

#nt-all:checked ~ .news-layout .news-grid > .news-card:first-child .news-card-date {
  margin-left: auto;
}

/* ------------------------------------------------------------
   4. Колірний код категорій: pill + ліва рамка картки
   ------------------------------------------------------------ */
.news-card[data-category] { border-left-color: color-mix(in srgb, var(--nc-accent) 45%, transparent); }

.news-card[data-category="telekom"] { border-left-color: var(--nc-cat-telekom); }
.news-card[data-category="telekom"] .news-card-cat { color: var(--nc-cat-telekom) !important; border-color: color-mix(in srgb, var(--nc-cat-telekom) 55%, transparent); }
.news-card[data-category="kiberbezpeka"] { border-left-color: var(--nc-cat-kiberbezpeka); }
.news-card[data-category="kiberbezpeka"] .news-card-cat { color: var(--nc-cat-kiberbezpeka) !important; border-color: color-mix(in srgb, var(--nc-cat-kiberbezpeka) 55%, transparent); }
.news-card[data-category="internet-rechei"] { border-left-color: var(--nc-cat-iot); }
.news-card[data-category="internet-rechei"] .news-card-cat { color: var(--nc-cat-iot) !important; border-color: color-mix(in srgb, var(--nc-cat-iot) 55%, transparent); }
.news-card[data-category="bpm"] { border-left-color: var(--nc-cat-bpm); }
.news-card[data-category="bpm"] .news-card-cat { color: var(--nc-cat-bpm) !important; border-color: color-mix(in srgb, var(--nc-cat-bpm) 55%, transparent); }
.news-card[data-category="elektronnyj-dokumentoobig"] { border-left-color: var(--nc-cat-docs); }
.news-card[data-category="elektronnyj-dokumentoobig"] .news-card-cat { color: var(--nc-cat-docs) !important; border-color: color-mix(in srgb, var(--nc-cat-docs) 55%, transparent); }
.news-card[data-category="rozrobka-softu"] { border-left-color: var(--nc-cat-soft); }
.news-card[data-category="systemna-integratsiia"] { border-left-color: var(--nc-cat-integration); }
.news-card[data-category="systemna-integratsiia"] .news-card-cat { color: var(--nc-cat-integration) !important; border-color: color-mix(in srgb, var(--nc-cat-integration) 55%, transparent); }
.news-card[data-category="infrastruktura"] { border-left-color: var(--nc-cat-infra); }
.news-card[data-category="infrastruktura"] .news-card-cat { color: var(--nc-cat-infra) !important; border-color: color-mix(in srgb, var(--nc-cat-infra) 55%, transparent); }

/* ------------------------------------------------------------
   5. Пагінація і лічильник архіву
   ------------------------------------------------------------ */
.news-pagination a,
.news-pagination span {
  min-width: 42px;
  min-height: 42px;
  border-radius: 50% !important;
  font-weight: 700;
}

.news-pagination .active,
.news-pagination span[aria-current] {
  border-color: var(--nc-accent) !important;
  background: var(--nc-accent) !important;
  color: #08110e !important;
}

.archive-count {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 6px 0 22px;
  color: var(--nc-muted);
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.archive-count strong {
  color: var(--nc-accent);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -.02em;
}

/* ------------------------------------------------------------
   6. Сайдбар: бренд-віджет, «популярні» з ghost-номерами
   ------------------------------------------------------------ */
.sidebar-widget {
  border-radius: 12px;
}

.widget-about {
  background-image:
    linear-gradient(color-mix(in srgb, var(--nc-accent) 7%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--nc-accent) 7%, transparent) 1px, transparent 1px) !important;
  background-size: 26px 26px, 26px 26px !important;
  background-color: var(--nc-paper) !important;
}

.sidebar-widget .widget-title {
  position: relative;
  padding-left: 14px;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-size: 12px;
}

.sidebar-widget .widget-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 18px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--nc-accent-deep), var(--nc-accent));
}

/* Популярні матеріали: великі порядкові номери */
.sidebar-widget .sidebar-recent {
  counter-reset: nc-popular;
}

.sidebar-widget .sidebar-recent-item {
  position: relative;
  counter-increment: nc-popular;
  padding-left: 44px;
}

.sidebar-widget .sidebar-recent-item::before {
  content: "0" counter(nc-popular);
  position: absolute;
  left: 0;
  top: 2px;
  color: transparent;
  -webkit-text-stroke: 1px color-mix(in srgb, var(--nc-accent) 55%, transparent);
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}

/* ------------------------------------------------------------
   7. Стаття: hero, буквиця, цитати, TOC, теги, prev/next
   ------------------------------------------------------------ */
.single-hero {
  border-bottom: 1px solid var(--nc-line);
  background-image:
    radial-gradient(ellipse 620px 220px at 85% 0%, color-mix(in srgb, var(--nc-accent) 9%, transparent), transparent) !important;
}

.single-title {
  font-size: clamp(30px, 3.8vw, 48px);
  line-height: 1.1;
  letter-spacing: -.03em;
}

.single-excerpt {
  border-left: 3px solid color-mix(in srgb, var(--nc-accent) 55%, transparent);
  padding-left: 16px;
  font-size: 17px;
}

/* Буквиця першого абзацу */
.igng-article-body > p:first-of-type::first-letter {
  float: left;
  margin: 4px 12px 0 0;
  color: var(--nc-accent);
  font-size: 58px;
  font-weight: 800;
  line-height: .85;
}

/* Цитати — велика лапка, м'яка поверхня */
main .igng-article-body blockquote,
main .single-body blockquote {
  position: relative;
  margin: 28px 0;
  padding: 24px 28px 24px 64px;
  border-left: none !important;
  border-radius: 12px;
  background: var(--nc-mist) !important;
}

main .igng-article-body blockquote::before,
main .single-body blockquote::before {
  content: "“";
  position: absolute;
  left: 18px;
  top: 6px;
  color: var(--nc-accent);
  font-size: 64px;
  font-weight: 800;
  line-height: 1;
}

/* Заголовки розділів статті з акцентним маркером */
.igng-article-body h2 {
  position: relative;
  padding-left: 18px;
}

.igng-article-body h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: .18em;
  width: 6px;
  height: .9em;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--nc-accent-deep), var(--nc-accent));
}

/* Зміст статті: охайна двоколонкова сітка з номерами-чипами */
nav.article-toc {
  border-radius: 12px;
  border: 1px solid var(--nc-line) !important;
}

.article-toc__list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Номер у зміст кладе main.js (.article-toc__number) — лише стилізуємо. */
.article-toc__list li {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
}

/* Декоративні пігулки/плашки рядків легасі-теми — геть. */
.article-toc__list li::before,
.article-toc__list li::after {
  content: none !important;
}

.article-toc__list li a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 0;
  border: none !important;
  background: transparent !important;
  color: var(--nc-ink) !important;
  font-size: 14px;
  line-height: 1.45;
}

.article-toc__list li a:hover .article-toc__label {
  color: var(--nc-accent);
}

.article-toc__number {
  flex: 0 0 auto;
  position: static !important;
  color: var(--nc-accent) !important;
  font-size: 12px !important;
  font-weight: 800;
  letter-spacing: .06em;
  background: transparent !important;
}

/* Теги наприкінці статті */
.single-tags .tag-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin: 0 6px 6px 0;
  padding: 0 14px;
  border: 1px solid color-mix(in srgb, var(--nc-accent) 45%, transparent);
  border-radius: 999px;
  color: var(--nc-accent) !important;
  font-size: 12px;
  font-weight: 700;
}

.single-tags .tag-pill:hover {
  background: color-mix(in srgb, var(--nc-accent) 14%, transparent);
}

/* Попередня / наступна — дві картки */
.single-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 34px;
}

.single-nav a {
  display: grid;
  gap: 8px;
  padding: 18px 20px;
  border: 1px solid var(--nc-line);
  border-radius: 12px;
  background: var(--nc-paper);
  transition: border-color .16s ease, transform .16s ease;
}

.single-nav a:hover {
  transform: translateY(-2px);
  border-color: var(--nc-accent);
}

.single-nav .nav-dir {
  color: var(--nc-accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.single-nav .single-nav-next {
  text-align: right;
}

/* Автор і коментар експерта: кільце навколо аватара */
.igng-authorbox__avatar img,
.igng-expert-comment__card img {
  border-radius: 50%;
  outline: 2px solid color-mix(in srgb, var(--nc-accent) 55%, transparent);
  outline-offset: 3px;
}

aside.igng-authorbox,
.igng-expert-comment__card {
  border-radius: 12px;
  border-left: 3px solid color-mix(in srgb, var(--nc-accent) 45%, transparent) !important;
}

/* ------------------------------------------------------------
   8. Тег-контекст (визначення з глосарію)
   ------------------------------------------------------------ */
section.tag-context {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  overflow: hidden;
  margin-bottom: 28px;
  padding: 30px 34px 30px 96px;
  border: 1px solid var(--nc-line) !important;
  border-left: 4px solid var(--nc-accent) !important;
  border-radius: 14px;
}

section.tag-context::before {
  content: "«»";
  position: absolute;
  left: 20px;
  top: 16px;
  color: transparent;
  -webkit-text-stroke: 1px color-mix(in srgb, var(--nc-accent) 60%, transparent);
  font-size: 56px;
  font-weight: 800;
  line-height: 1;
}

.tag-context__eyebrow {
  margin-bottom: 8px;
  color: var(--nc-accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.tag-context__copy h2 {
  margin: 0 0 10px;
  font-size: 22px;
  letter-spacing: -.02em;
}

.tag-context__copy p {
  max-width: 640px;
  margin: 0;
  color: var(--nc-muted);
  line-height: 1.65;
}

.tag-context__glossary {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 20px;
  border: 1px solid color-mix(in srgb, var(--nc-accent) 55%, transparent);
  border-radius: 999px;
  color: var(--nc-accent) !important;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.tag-context__glossary:hover {
  background: color-mix(in srgb, var(--nc-accent) 14%, transparent);
}

/* ------------------------------------------------------------
   9. Сторінка людини (автор / експерт)
   ------------------------------------------------------------ */
.hero-author {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--nc-line);
}

.hero-author .ha-tag {
  position: absolute;
  right: 12px;
  top: 6px;
  color: transparent !important;
  -webkit-text-stroke: 1px color-mix(in srgb, var(--nc-accent) 30%, transparent);
  font-size: clamp(56px, 10vw, 120px) !important;
  font-weight: 800;
  letter-spacing: .04em !important;
  line-height: 1;
  text-transform: uppercase;
  pointer-events: none;
}

.ha-head {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

/* wireframe задає .ha-ava width:100% (гріється під grid) — у flex це чавить текст. */
.ha-ava {
  width: auto !important;
  flex: 0 0 auto;
}

.ha-head-text {
  flex: 1 1 auto;
  min-width: 0;
}

.ha-ava img {
  width: 128px !important;
  height: 128px !important;
  border-radius: 50%;
  object-fit: cover;
  outline: 2px solid color-mix(in srgb, var(--nc-accent) 60%, transparent);
  outline-offset: 5px;
}

.ha-head-text h1 {
  margin: 4px 0 6px;
  font-size: clamp(28px, 3.4vw, 44px);
  letter-spacing: -.03em;
}

.ha-pos,
.ha-pos a {
  margin-bottom: 12px;
  color: var(--nc-accent) !important;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
}

.ha-bio {
  max-width: 640px;
  color: var(--nc-muted);
  line-height: 1.65;
}

.ha-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}

.ha-stats > span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: var(--nc-muted);
  font-size: 13px;
}

.ha-stats > span strong {
  color: var(--nc-accent);
  font-size: 26px;
  font-weight: 800;
}

.ha-stats .ha-tag-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 14px;
  border: 1px solid var(--nc-line-strong);
  border-radius: 999px;
  color: var(--nc-ink) !important;
  font-size: 12px;
  font-weight: 700;
}

.ha-stats .ha-tag-chip:hover {
  border-color: var(--nc-accent);
  color: var(--nc-accent) !important;
}

.author-context__eyebrow {
  margin-bottom: 6px;
  color: var(--nc-accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.author-context h2 {
  margin: 0 0 22px;
  font-size: clamp(22px, 2.6vw, 30px);
  letter-spacing: -.02em;
}

/* ------------------------------------------------------------
   10. Індекси експертів та авторів
   ------------------------------------------------------------ */
.experts-index__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 26px;
}

.experts-index__count {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--nc-muted);
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: 13px;
}

.experts-index__count strong {
  color: var(--nc-accent);
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.experts-alpha {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.experts-alpha__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  font-weight: 700;
}

.experts-alpha__btn:hover {
  background: color-mix(in srgb, var(--nc-accent) 16%, transparent);
}

.expert-card__link {
  border-radius: 12px;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.expert-card__link:hover {
  transform: translateY(-3px);
  border-left-color: var(--nc-accent);
  box-shadow: 0 18px 40px rgb(0 0 0 / 40%);
}

.expert-card__ava img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  outline: 2px solid color-mix(in srgb, var(--nc-accent) 45%, transparent);
  outline-offset: 3px;
}

/* ------------------------------------------------------------
   11. Адаптив
   ------------------------------------------------------------ */
@media (max-width: 900px) {
  .article-toc__list {
    grid-template-columns: 1fr;
  }

  section.tag-context {
    grid-template-columns: 1fr;
    padding-left: 34px;
  }

  section.tag-context::before {
    display: none;
  }
}

@media (max-width: 640px) {
  .hero.hero-inner {
    padding: 64px 22px 44px !important;
  }

  .hero.hero-inner .hero-tag {
    right: 4px;
    top: 4px;
    font-size: 52px;
  }

  .ha-head {
    flex-direction: column;
    gap: 18px;
  }

  .single-nav {
    grid-template-columns: 1fr;
  }

  .single-nav .single-nav-next {
    text-align: left;
  }

  #nt-all:checked ~ .news-layout .news-grid > .news-card:first-child {
    padding: 24px 22px;
  }
}
