/*
Theme Name: ІГТМ — Вібраційні технології
Theme URI: http://igtmdep8/
Description: Дочірня тема Astra для сайту відділу вібраційних технологій ІГТМ НАН України. Містить дизайн-систему, картки каталогу та стилі технічних таблиць.
Author: ІГТМ
Template: astra
Version: 1.0.0
Text Domain: igtm
*/

/* ============================================================
   1. ДИЗАЙН-СИСТЕМА — токени
   ============================================================ */
:root {
  --igtm-ink:        #0C1E2E;
  --igtm-navy:       #12395A;
  --igtm-navy-700:   #0E2C46;
  --igtm-steel:      #4A7C9B;
  --igtm-accent:     #D98324;
  --igtm-accent-700: #B26A16;
  --igtm-accent-soft:#FDF3E5;
  --igtm-surface:    #F4F7F9;
  --igtm-surface-2:  #E9EFF4;
  --igtm-line:       #DBE3EA;
  --igtm-text:       #24333F;
  --igtm-muted:      #5E7183;
  --igtm-white:      #FFFFFF;

  --igtm-font-head: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --igtm-font-body: "Inter", "Segoe UI", system-ui, sans-serif;

  --igtm-r-sm: 4px;
  --igtm-r:    8px;
  --igtm-r-lg: 14px;

  --igtm-sp-1: 4px;  --igtm-sp-2: 8px;   --igtm-sp-3: 12px;
  --igtm-sp-4: 16px; --igtm-sp-5: 24px;  --igtm-sp-6: 32px;
  --igtm-sp-7: 48px; --igtm-sp-8: 64px;  --igtm-sp-9: 96px;

  --igtm-shadow-sm: 0 1px 2px rgba(12,30,46,.06), 0 1px 3px rgba(12,30,46,.08);
  --igtm-shadow:    0 4px 12px rgba(12,30,46,.08), 0 2px 4px rgba(12,30,46,.06);
  --igtm-shadow-lg: 0 12px 32px rgba(12,30,46,.12), 0 4px 8px rgba(12,30,46,.06);
}

/* ============================================================
   2. ТИПОГРАФІКА
   ============================================================ */
body,
.ast-container,
button, input, select, textarea {
  font-family: var(--igtm-font-body);
  color: var(--igtm-text);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.entry-title, .site-title {
  font-family: var(--igtm-font-head);
  color: var(--igtm-ink);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

h1, .entry-title { font-size: clamp(1.9rem, 1.35rem + 2.1vw, 2.9rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.3vw, 2.1rem); margin-top: var(--igtm-sp-7); }
h3 { font-size: clamp(1.2rem, 1.08rem + 0.6vw, 1.45rem); margin-top: var(--igtm-sp-6); }
h4 { font-size: 1.1rem; }

.entry-content p { margin-bottom: var(--igtm-sp-4); }
.entry-content a  { color: var(--igtm-navy); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.entry-content a:hover { color: var(--igtm-accent-700); }

/* Провідний абзац */
.igtm-lead {
  font-size: 1.16rem;
  line-height: 1.65;
  color: var(--igtm-muted);
  max-width: 62ch;
}

/* Заголовок секції з акцентною рискою */
.igtm-h-rule { position: relative; padding-top: var(--igtm-sp-4); }
.igtm-h-rule::before {
  content: "";
  position: absolute; top: 0; left: 0;
  width: 56px; height: 3px;
  background: var(--igtm-accent); border-radius: 2px;
}

/* ============================================================
   3. ШАПКА / ПІДВАЛ
   ============================================================ */
.site-header, .ast-primary-header-bar { border-bottom: 1px solid var(--igtm-line); }
.site-title a { font-weight: 700; letter-spacing: -0.02em; }
.main-header-menu a { font-family: var(--igtm-font-head); font-weight: 500; }

.site-footer, .ast-small-footer {
  background: var(--igtm-ink);
  color: #B9C7D3;
}
.site-footer a, .ast-small-footer a { color: #DCE6EE; }
.site-footer a:hover { color: var(--igtm-accent); }
.site-footer h2, .site-footer h3, .site-footer h4 { color: var(--igtm-white); }

/* ============================================================
   4. ГЕРОЙ-БЛОК
   ============================================================ */
.igtm-hero {
  background:
    linear-gradient(115deg, rgba(12,30,46,.94) 0%, rgba(18,57,90,.88) 55%, rgba(74,124,155,.80) 100%),
    var(--igtm-navy);
  color: var(--igtm-white);
  padding: clamp(48px, 4vw + 32px, 104px) 0;
  position: relative;
  overflow: hidden;
}

/* Тонкі «хвилі» — натяк на вібраційний спектр */
.igtm-hero::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none; opacity: .16;
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.55) 0 1px, transparent 1px 14px);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 45%, transparent 100%);
          mask-image: linear-gradient(180deg, transparent 0%, #000 45%, transparent 100%);
}
.igtm-hero > * { position: relative; z-index: 1; }
/* Макет «constrained» центрує дочірні блоки — вирівнюємо їх по лівому краю. */
.wp-block-group.igtm-hero > * { margin-left: 0; margin-right: auto; }
.igtm-hero h1, .igtm-hero h2 { color: var(--igtm-white); margin-top: 0; }
.igtm-hero p { color: #D6E2EC; font-size: 1.12rem; max-width: 66ch; }
.igtm-hero .igtm-kicker { color: var(--igtm-accent); max-width: none; }

/* Герой розтягнутий на всю ширину — повертаємо внутрішні поля. */
.igtm-hero.alignfull {
  padding-left: max(24px, calc((100vw - var(--igtm-content-w, 1240px)) / 2));
  padding-right: max(24px, calc((100vw - var(--igtm-content-w, 1240px)) / 2));
}

.igtm-kicker {
  font-family: var(--igtm-font-head);
  font-size: .82rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--igtm-accent-700);
  margin-bottom: var(--igtm-sp-3);
  display: block;
}

/* ============================================================
   5. КНОПКИ
   ============================================================ */
.igtm-btn,
.wp-block-button__link {
  font-family: var(--igtm-font-head);
  font-weight: 600;
  border-radius: var(--igtm-r);
  padding: 12px 26px;
  display: inline-block;
  text-decoration: none !important;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.igtm-btn--primary,
.wp-block-button:not(.is-style-outline) .wp-block-button__link {
  background: var(--igtm-accent); color: #fff; border: 1px solid var(--igtm-accent);
}
.igtm-btn--primary:hover,
.wp-block-button:not(.is-style-outline) .wp-block-button__link:hover {
  background: var(--igtm-accent-700); border-color: var(--igtm-accent-700);
  color: #fff; transform: translateY(-1px); box-shadow: var(--igtm-shadow);
}
.igtm-btn--ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.55); }
.igtm-btn--ghost:hover { background: rgba(255,255,255,.12); color: #fff; }

/* ============================================================
   6. КАРТКИ КАТАЛОГУ  [igtm_children]
   ============================================================ */
.igtm-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--igtm-sp-5);
  margin: var(--igtm-sp-6) 0;
  padding: 0; list-style: none;
}
.igtm-cards.is-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.igtm-cards.is-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.igtm-cards.is-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1024px) {
  .igtm-cards.is-cols-3,
  .igtm-cards.is-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.igtm-card {
  display: flex; flex-direction: column;
  background: var(--igtm-white);
  border: 1px solid var(--igtm-line);
  border-radius: var(--igtm-r-lg);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.igtm-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--igtm-shadow-lg);
  border-color: var(--igtm-steel);
}
.igtm-card__media {
  display: block; aspect-ratio: 16 / 10; overflow: hidden;
  background: var(--igtm-surface-2);
}
.igtm-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.igtm-card__media--empty {
  display: flex; align-items: center; justify-content: center;
  color: var(--igtm-steel);
  font-family: var(--igtm-font-head); font-weight: 600;
  font-size: 2rem; letter-spacing: .06em;
  background: linear-gradient(135deg, var(--igtm-surface-2), #DAE4EC);
}
.igtm-card__body { padding: var(--igtm-sp-5); display: flex; flex-direction: column; flex: 1; }
.igtm-card__index {
  font-family: var(--igtm-font-head); font-size: .78rem; font-weight: 600;
  letter-spacing: .08em; color: var(--igtm-accent-700); margin-bottom: var(--igtm-sp-2);
}
.igtm-card__title {
  font-family: var(--igtm-font-head); font-size: 1.08rem; font-weight: 600;
  margin: 0 0 var(--igtm-sp-2); line-height: 1.35;
}
.entry-content .igtm-card__title a,
.igtm-card__title a { color: var(--igtm-ink); text-decoration: none; }
.igtm-card:hover .igtm-card__title a { color: var(--igtm-navy); }
/* Мініатюра-заглушка теж є посиланням — прибираємо підкреслення */
.entry-content .igtm-card__media,
.igtm-card__media { text-decoration: none; }
.igtm-card__text { font-size: .94rem; color: var(--igtm-muted); margin: 0 0 var(--igtm-sp-4); flex: 1; }
.igtm-card__more {
  font-family: var(--igtm-font-head); font-weight: 600; font-size: .92rem;
  color: var(--igtm-navy); text-decoration: none !important; margin-top: auto;
}
.igtm-card__more::after { content: " →"; transition: margin-left .15s ease; }
.igtm-card:hover .igtm-card__more::after { margin-left: 4px; }

/* ============================================================
   7. ТЕХНІЧНІ ТАБЛИЦІ
   ============================================================ */
.entry-content .wp-block-table { margin: var(--igtm-sp-6) 0; overflow-x: auto; }
.entry-content .wp-block-table table {
  width: 100%; border-collapse: collapse;
  font-size: .95rem; background: var(--igtm-white);
  border: 1px solid var(--igtm-line);
}
.entry-content .wp-block-table th {
  background: var(--igtm-navy); color: #fff;
  font-family: var(--igtm-font-head); font-weight: 600;
  text-align: left; padding: 12px 14px;
  border: 1px solid var(--igtm-navy-700);
  vertical-align: middle;
}
.entry-content .wp-block-table td {
  padding: 10px 14px; border: 1px solid var(--igtm-line); vertical-align: top;
}
.entry-content .wp-block-table tbody tr:nth-child(even) { background: var(--igtm-surface); }
.entry-content .wp-block-table tbody tr:hover { background: var(--igtm-accent-soft); }
.entry-content .wp-block-table figcaption {
  font-size: .88rem; color: var(--igtm-muted); margin-top: var(--igtm-sp-2);
}

/* ============================================================
   8. ЗОБРАЖЕННЯ ТА ПІДПИСИ
   ============================================================ */
.entry-content figure { margin: var(--igtm-sp-6) 0; }
.entry-content .wp-block-image img {
  border-radius: var(--igtm-r);
  border: 1px solid var(--igtm-line);
  max-width: 100%; height: auto;
}
.entry-content figcaption,
.wp-element-caption {
  font-size: .9rem; color: var(--igtm-muted); text-align: center;
  margin-top: var(--igtm-sp-3); line-height: 1.5; font-style: normal;
}

/* Схеми та креслення — на світлому тлі, без обрізання */
.igtm-scheme img {
  background: var(--igtm-white);
  object-fit: contain;
  padding: var(--igtm-sp-4);
}

/* ============================================================
   9. ІНФО-БЛОКИ
   ============================================================ */
.igtm-callout {
  background: var(--igtm-surface);
  border-left: 3px solid var(--igtm-accent);
  border-radius: 0 var(--igtm-r) var(--igtm-r) 0;
  padding: var(--igtm-sp-5);
  margin: var(--igtm-sp-6) 0;
}
.igtm-callout p:last-child { margin-bottom: 0; }

/* Перелік переваг */
.igtm-benefits { list-style: none; padding: 0; margin: var(--igtm-sp-5) 0; display: grid; gap: var(--igtm-sp-3); }
.igtm-benefits li { position: relative; padding-left: 30px; line-height: 1.6; }
.igtm-benefits li::before {
  content: ""; position: absolute; left: 0; top: .55em;
  width: 9px; height: 9px; border-radius: 2px;
  background: var(--igtm-accent); transform: rotate(45deg);
}

/* Плитки з показниками */
.igtm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--igtm-sp-4); margin: var(--igtm-sp-6) 0; }
.igtm-stat {
  background: var(--igtm-white); border: 1px solid var(--igtm-line);
  border-radius: var(--igtm-r-lg); padding: var(--igtm-sp-5);
}
.igtm-stat__value {
  font-family: var(--igtm-font-head); font-size: 1.9rem; font-weight: 700;
  color: var(--igtm-navy); line-height: 1.1; letter-spacing: -0.02em;
}
.igtm-stat__label { font-size: .9rem; color: var(--igtm-muted); margin-top: var(--igtm-sp-2); }

/* ============================================================
   10. КОНТАКТИ
   ============================================================ */
.igtm-contacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--igtm-sp-5); margin: var(--igtm-sp-6) 0; }
.igtm-person {
  background: var(--igtm-white); border: 1px solid var(--igtm-line);
  border-radius: var(--igtm-r-lg); padding: var(--igtm-sp-5);
}
.igtm-person__name { font-family: var(--igtm-font-head); font-weight: 600; font-size: 1.06rem; color: var(--igtm-ink); margin-bottom: var(--igtm-sp-1); }
.igtm-person__degree { font-size: .88rem; color: var(--igtm-accent-700); margin-bottom: var(--igtm-sp-3); }
.igtm-person__row { font-size: .96rem; margin-bottom: var(--igtm-sp-2); }
.igtm-person__row a { text-decoration: none; color: var(--igtm-navy); }
.igtm-person__row a:hover { color: var(--igtm-accent-700); }

/* ============================================================
   10а. ПІДВАЛ САЙТУ
   ============================================================ */
.igtm-footer {
  background: var(--igtm-ink);
  color: #B9C7D3;
  padding: var(--igtm-sp-8) 0 var(--igtm-sp-7);
  font-size: .95rem;
}
.igtm-footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: var(--igtm-sp-7);
}
.igtm-footer__title {
  font-family: var(--igtm-font-head);
  font-weight: 600; font-size: 1rem;
  color: var(--igtm-white);
  margin-bottom: var(--igtm-sp-4);
  padding-bottom: var(--igtm-sp-3);
  border-bottom: 1px solid rgba(255,255,255,.14);
}
.igtm-footer__text { color: #93A6B6; line-height: 1.65; margin: 0; }
.igtm-footer__list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--igtm-sp-3); color: #C6D3DD; }
.igtm-footer__list a { color: #DCE6EE; text-decoration: none; }
.igtm-footer__list a:hover { color: var(--igtm-accent); text-decoration: underline; }
.igtm-footer__muted { color: #7C8FA0; font-size: .86rem; }

@media (max-width: 900px) {
  .igtm-footer__grid { grid-template-columns: 1fr 1fr; gap: var(--igtm-sp-6); }
  .igtm-footer__col--about { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .igtm-footer__grid { grid-template-columns: 1fr; }
}

/* ============================================================
   10б. ТЕХНОЛОГІЧНИЙ ЛАНЦЮЖОК  b_flow()
   ============================================================ */
.igtm-flow {
  display: grid;
  gap: var(--igtm-sp-3);
  margin: var(--igtm-sp-6) 0;
  counter-reset: igtm-flow;
}
.igtm-flow__step {
  display: flex;
  align-items: flex-start;
  gap: var(--igtm-sp-4);
  background: var(--igtm-surface);
  border: 1px solid var(--igtm-line);
  border-radius: var(--igtm-r);
  padding: var(--igtm-sp-4) var(--igtm-sp-5);
  position: relative;
}
/* Сполучна лінія між кроками */
.igtm-flow__step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(var(--igtm-sp-5) + 15px);
  bottom: calc(-1 * var(--igtm-sp-3) - 1px);
  width: 2px; height: var(--igtm-sp-3);
  background: var(--igtm-steel);
}
.igtm-flow__num {
  flex: 0 0 32px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--igtm-navy); color: #fff;
  font-family: var(--igtm-font-head); font-weight: 600; font-size: .95rem;
  border-radius: 50%;
}
.igtm-flow__text { line-height: 1.55; padding-top: 3px; }

/* ============================================================
   11. ХЛІБНІ КРИХТИ
   ============================================================ */
.igtm-crumbs { font-size: .88rem; color: var(--igtm-muted); margin-bottom: var(--igtm-sp-4); }
.igtm-crumbs a { color: var(--igtm-muted); text-decoration: none; }
.igtm-crumbs a:hover { color: var(--igtm-navy); text-decoration: underline; }
.igtm-crumbs span[aria-current] { color: var(--igtm-text); }

/* ============================================================
   12. АДАПТИВНІСТЬ І ДРУК
   ============================================================ */
@media (max-width: 768px) {
  body { font-size: 16px; }
  .igtm-cards,
  .igtm-cards.is-cols-2,
  .igtm-cards.is-cols-3,
  .igtm-cards.is-cols-4 { grid-template-columns: 1fr; gap: var(--igtm-sp-4); }
  .entry-content .wp-block-table table { font-size: .88rem; }
  .entry-content .wp-block-table th,
  .entry-content .wp-block-table td { padding: 8px 10px; }
}

@media print {
  .site-header, .site-footer, .igtm-card__more { display: none; }
  .entry-content .wp-block-table th { background: #ddd !important; color: #000 !important; }
}
