/* ОБРИС — каталог лабораторій сертифікації ТЗ. Стилі сайту. */
:root {
  --bg: #F6F7F8;
  --surface: #FFFFFF;
  --ink: #202832;
  --ink-2: #4E5866;
  --line: #D8DCE2;
  --line-strong: #B9C0CA;
  --primary: #464E9B;
  --primary-ink: #343B7E;
  --primary-tint: #ECEDF6;
  --accent: #C9D56B;
  --warn-bg: #FBF3E2;
  --warn-ink: #6B4A00;
  --font-main: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-label: "PT Sans", "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1280px;
  --t: 180ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-main);
  font-size: 17px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--primary-ink); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-weight: 650; line-height: 1.15; letter-spacing: -0.015em; margin: 0; }
p { margin: 0 0 1em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 10; background: var(--ink); color: #fff; padding: 10px 14px; text-decoration: none; }
.skip:focus { top: 8px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Логотип ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-height: 44px; }
.brand svg { display: block; height: 30px; width: auto; }
.brand:hover { color: var(--ink); }

/* ---------- Шапка ---------- */
.site-head { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px 32px; min-height: 68px; }
.nav { display: flex; gap: 4px 24px; flex-wrap: wrap; }
.nav a, .lang a, .lang span {
  font-family: var(--font-label); font-size: 16px; color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; position: relative;
}
.nav a::after, .lang [aria-current]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 6px; height: 4px; background: transparent;
  transition: background-color var(--t) ease;
}
.nav a[aria-current="page"]::after, .lang [aria-current]::after { background: var(--accent); }
.nav a:hover::after { background: var(--line-strong); }
.nav a[aria-current="page"]:hover::after { background: var(--accent); }
.lang { display: flex; gap: 2px; align-items: center; }
.lang a, .lang span { min-width: 44px; justify-content: center; }
.lang span { font-weight: 700; }
.lang a:hover { color: var(--primary); }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; font: 600 17px/1.2 var(--font-main);
  border: 2px solid var(--primary); border-radius: 2px; cursor: pointer; text-decoration: none;
  transition: background-color var(--t) ease, border-color var(--t) ease, color var(--t) ease;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-ink); border-color: var(--primary-ink); color: #fff; }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--primary-tint); color: var(--primary-ink); }
.btn-small { min-height: 44px; padding: 0 14px; font-size: 15px; }

/* ---------- Фото й рамка-дужки ---------- */
.photo { margin: 0; position: relative; }
.photo .frame { position: relative; background: #2A313B; overflow: hidden; }
.photo img { width: 100%; height: 100%; object-fit: cover; color: #C9CFD8; font-size: 14px; }
.photo figcaption { font-family: var(--font-label); font-size: 14px; line-height: 1.4; color: var(--ink-2); margin-top: 10px; max-width: 42ch; }
.bracketed { position: relative; }
.bracketed::before, .bracketed::after {
  content: ""; position: absolute; width: 22px; border: 3px solid var(--ink); pointer-events: none;
}
.bracketed::before { left: -12px; top: -12px; bottom: 18%; border-right: 0; }
.bracketed::after { right: -12px; top: 14%; bottom: -12px; border-left: 0; transform: translateX(4px); }

/* ---------- Перший екран ---------- */
.hero { padding: clamp(28px, 5vw, 64px) 0 clamp(40px, 6vw, 88px); }
.hero .wrap { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; align-items: end; }
.hero .photo { grid-column: 1 / span 5; }
.hero .photo .frame { aspect-ratio: 3 / 4; }
.photo .bracketed { margin: 12px; }
.hero .photo img { object-position: 50% 70%; }
.hero-copy { grid-column: 7 / span 6; padding-bottom: 8px; }
.hero-kicker { font-family: var(--font-label); font-size: 16px; color: var(--ink-2); margin: 0 0 18px; }
.hero h1 { font-size: clamp(38px, 6.2vw, 76px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.02; max-width: 12ch; }
.hero-lead { font-size: clamp(18px, 1.6vw, 20px); max-width: 52ch; margin: 24px 0 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 32px; }
.hero-note { font-family: var(--font-label); font-size: 15px; color: var(--ink-2); max-width: 52ch; margin: 0; }
.facts { display: flex; flex-wrap: wrap; gap: 12px 40px; margin: 0 0 18px; padding: 18px 0 0; border-top: 1px solid var(--line); }
.facts div { display: flex; flex-direction: column; }
.facts dt { font-family: var(--font-label); font-size: 15px; color: var(--ink-2); order: 2; }
.facts dd { margin: 0; font-size: 30px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.1; }

/* ---------- Секції: чергування вузької та широкої колонки ---------- */
.section { padding: clamp(48px, 7vw, 96px) 0; border-top: 1px solid var(--line); }
.section .wrap { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; }
.sec-mark { grid-column: 1 / span 3; font-family: var(--font-label); font-size: 15px; color: var(--ink-2); margin: 0; padding-top: 10px; }
.sec-mark span { display: inline-block; border-left: 4px solid var(--accent); padding-left: 10px; }
.sec-body { grid-column: 4 / span 9; min-width: 0; }
.sec-body.narrow { grid-column: 4 / span 6; }
.section h2 { font-size: clamp(28px, 3.4vw, 44px); max-width: 22ch; margin-bottom: 18px; }
.section .intro { font-size: 18px; max-width: 62ch; color: var(--ink); }
.section-white { background: var(--surface); }

/* Напрями: двоколонкове текстове меню */
.directions { display: grid; grid-template-columns: 1fr 1fr; gap: 0 48px; margin: 32px 0 0; padding: 0; list-style: none; border-top: 2px solid var(--ink); }
.directions li { padding: 22px 0 24px; border-bottom: 1px solid var(--line); }
.directions h3 { font-size: 22px; margin-bottom: 8px; }
.directions p { margin: 0 0 12px; max-width: 54ch; }
.directions .count { font-family: var(--font-label); font-size: 15px; color: var(--ink-2); margin: 0 0 8px; }
.directions a { font-weight: 600; display: inline-flex; min-height: 44px; align-items: center; }
.out-of-scope { font-family: var(--font-label); font-size: 15px; color: var(--ink-2); margin-top: 22px; max-width: 70ch; }

/* Що уточнити */
.check-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; align-items: start; }
.checklist { grid-column: 4 / span 5; margin: 0; padding: 0; list-style: none; counter-reset: none; }
.checklist li { padding: 16px 0 18px; border-bottom: 1px solid var(--line); }
.checklist li:first-child { border-top: 2px solid var(--ink); }
.checklist strong { display: block; font-size: 18px; margin-bottom: 4px; }
.checklist p { margin: 0; color: var(--ink); }
.check-photo { grid-column: 10 / span 3; }
.check-photo .frame { aspect-ratio: 3 / 4; }
.check-photo img { object-position: 38% 50%; }

/* Процес: великі номери кроків */
.steps { margin: 36px 0 0; padding: 0; list-style: none; }
.steps li { display: grid; grid-template-columns: 120px 1fr; gap: 24px; padding: 28px 0 30px; border-top: 1px solid var(--line); }
.steps li:last-child { border-bottom: 1px solid var(--line); }
.step-no { font-size: 76px; font-weight: 700; line-height: .9; letter-spacing: -0.04em; color: var(--primary); }
.steps h3 { font-size: 23px; margin-bottom: 8px; }
.steps p { margin: 0 0 8px; max-width: 64ch; }
.process-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 48px; align-items: start; }
.process-photo .frame { aspect-ratio: 4 / 5; }
.process-photo img { object-position: 60% 50%; }

/* Документи */
.docs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 36px; margin-top: 32px; border-top: 2px solid var(--ink); }
.docs section { padding-top: 22px; }
.docs h3 { font-size: 21px; margin-bottom: 12px; }
.docs ul { margin: 0; padding-left: 20px; }
.docs li { margin-bottom: 8px; }
.docs li::marker { color: var(--primary); }
.docs .doc-note { font-family: var(--font-label); font-size: 15px; color: var(--ink-2); margin-top: 14px; }
.law { margin-top: 36px; padding: 20px 22px; background: var(--primary-tint); max-width: 860px; }
.law h3 { font-size: 18px; margin-bottom: 8px; }
.law p { margin: 0 0 8px; font-size: 16px; }
.law p:last-child { margin-bottom: 0; }

/* FAQ */
.faq { margin-top: 28px; border-top: 2px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr 28px; gap: 16px; align-items: center;
  padding: 18px 0; min-height: 56px; font-weight: 600; font-size: 19px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 26px; font-weight: 400; color: var(--primary); text-align: center; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq .answer { padding: 0 0 20px; max-width: 66ch; }
.faq .answer p:last-child { margin-bottom: 0; }

/* ---------- Каталог ---------- */
.page-head { padding: clamp(32px, 5vw, 64px) 0 28px; }
.page-head .wrap { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; }
.page-head .head-text { grid-column: 1 / span 8; }
.page-head h1 { font-size: clamp(32px, 4.6vw, 56px); letter-spacing: -0.025em; max-width: 18ch; }
.page-head .intro { font-size: 18px; max-width: 62ch; margin: 18px 0 0; }
.page-head .summary { grid-column: 9 / span 4; align-self: end; font-family: var(--font-label); font-size: 15px; color: var(--ink-2); border-left: 4px solid var(--accent); padding-left: 14px; margin: 0; }
.crumbs { font-family: var(--font-label); font-size: 15px; color: var(--ink-2); margin-bottom: 14px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line-strong); }
.crumbs a { color: var(--ink-2); }

.filters { background: var(--surface); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 3; }
.filters form { display: grid; grid-template-columns: 1.1fr 1.1fr 1fr 1.3fr auto; gap: 12px 16px; align-items: end; padding-top: 16px; padding-bottom: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-family: var(--font-label); font-size: 15px; color: var(--ink-2); }
.field select, .field input {
  width: 100%; min-height: 48px; border: 1px solid var(--line-strong); border-radius: 2px; background: #fff; color: var(--ink);
  font: 16px/1.2 var(--font-main); padding: 0 12px; transition: border-color var(--t) ease, box-shadow var(--t) ease;
}
.field select { appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px; background-size: 5px 5px; background-repeat: no-repeat; }
.field select:hover, .field input:hover { border-color: var(--ink-2); }
.field select:focus-visible, .field input:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(70, 78, 155, .35); }
.field select:disabled { color: var(--ink-2); background-color: var(--bg); }
.result-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; align-items: center; padding: 18px 0 10px; }
.result-count { font-weight: 600; margin: 0; }
.result-hint { font-family: var(--font-label); font-size: 15px; color: var(--ink-2); margin: 0; }
.empty { display: none; padding: 28px; background: var(--surface); border: 1px solid var(--line); margin: 12px 0 24px; }
.empty.is-visible { display: block; }
.empty p { margin: 0 0 14px; font-size: 18px; }

.region { margin: 28px 0 0; }
.region-title { font-size: 20px; font-weight: 650; padding: 10px 0; display: flex; gap: 10px; align-items: baseline; border-bottom: 2px solid var(--ink); }
.region-title small { font-family: var(--font-label); font-size: 15px; font-weight: 400; color: var(--ink-2); }
.labs { list-style: none; margin: 0; padding: 0; }
.lab { position: relative; background: var(--surface); border: 1px solid transparent; border-bottom-color: var(--line); transition: border-color var(--t) ease; }
.lab::before, .lab::after { content: ""; position: absolute; top: -1px; bottom: -1px; width: 14px; border: 3px solid transparent; pointer-events: none; transition: border-color var(--t) ease; }
.lab::before { left: -1px; border-right: 0; }
.lab::after { right: -1px; border-left: 0; top: 10px; }
.lab.is-open { border-color: var(--line); }
.lab.is-open::before, .lab.is-open::after { border-color: var(--primary); }
.lab:hover { border-left-color: var(--line-strong); border-right-color: var(--line-strong); }
.lab-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, auto) auto; gap: 14px 28px; align-items: start; padding: 20px 22px; }
.lab-place { font-family: var(--font-label); font-size: 15px; color: var(--ink-2); margin: 0 0 4px; }
.lab h3 { font-size: 21px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.lab h3 .lab-word { font-weight: 400; color: var(--ink-2); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.tags li { font-family: var(--font-label); font-size: 14px; line-height: 1; padding: 6px 8px; border: 1px solid var(--line-strong); color: var(--ink); border-radius: 2px; }
.status { display: inline-block; margin-top: 10px; font-family: var(--font-label); font-size: 14px; padding: 6px 8px; background: var(--warn-bg); color: var(--warn-ink); }
.lab-phones { display: flex; flex-direction: column; gap: 4px; }
.lab-phones a, .lab-phones .nophone { font-size: 21px; font-weight: 650; letter-spacing: -0.005em; white-space: nowrap; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.lab-phones a:hover { text-decoration: underline; }
.lab-phones .nophone { font-size: 16px; font-weight: 400; color: var(--ink-2); white-space: normal; }
.phone-kind { font-family: var(--font-label); font-size: 14px; color: var(--ink-2); }
.lab-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.toggle { font: 600 15px/1.2 var(--font-main); color: var(--primary); background: transparent; border: 1px solid var(--line-strong); border-radius: 2px; min-height: 44px; padding: 0 14px; cursor: pointer; display: none; transition: border-color var(--t) ease; }
.js .toggle { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.toggle:hover { border-color: var(--primary); }
.toggle .chev { display: inline-block; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform var(--t) ease; }
.toggle[aria-expanded="true"] .chev { transform: rotate(-135deg) translateY(-2px); }

.lab-more { display: grid; grid-template-rows: 1fr; transition: grid-template-rows var(--t) ease; }
.js .lab-more { grid-template-rows: 0fr; }
.js .lab.is-open .lab-more { grid-template-rows: 1fr; }
.lab-more > .inner { overflow: hidden; min-height: 0; }
.js .lab:not(.is-open) .lab-more > .inner { visibility: hidden; }
.lab-more dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 28px; margin: 0; padding: 18px 22px 22px; border-top: 1px dashed var(--line-strong); background: #FBFBFC; }
.lab-more dt { font-family: var(--font-label); font-size: 14px; color: var(--ink-2); margin-bottom: 4px; }
.lab-more dd { margin: 0; overflow-wrap: anywhere; }
.lab-more dd p { margin: 0 0 4px; }
.lab-more dd a { display: inline-flex; align-items: center; min-height: 44px; }
.lab-more .wide { grid-column: 1 / -1; }
.copy { font: 600 14px/1 var(--font-label); color: var(--primary); background: none; border: 0; padding: 0 2px; min-height: 44px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; display: none; }
.js .copy { display: inline-flex; align-items: center; }
.copy:hover { color: var(--primary-ink); }
.copy-ok { font-family: var(--font-label); font-size: 14px; color: var(--ink-2); margin-left: 8px; }
.lab[hidden], .region[hidden] { display: none; }

.howto { margin-top: 56px; }
.howto-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; margin: 24px 0 0; border-top: 2px solid var(--ink); }
.howto-list div { padding: 16px 0 18px; border-bottom: 1px solid var(--line); }
.howto-list dt { font-weight: 650; font-size: 18px; margin-bottom: 4px; }
.howto-list dd { margin: 0; max-width: 56ch; }
@media (max-width: 680px) { .howto-list { grid-template-columns: 1fr; } }

/* ---------- Футер ---------- */
.site-foot { background: var(--ink); color: #E9ECF0; padding: 48px 0 40px; margin-top: 0; }
.site-foot .wrap { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; }
.foot-brand { grid-column: 1 / span 4; }
.foot-brand .brand { color: #fff; }
.foot-brand p { font-size: 15px; color: #C9CFD8; margin-top: 12px; max-width: 40ch; }
.foot-cta { grid-column: 6 / span 4; }
.foot-cta h2 { font-size: 24px; margin-bottom: 12px; color: #fff; }
.foot-cta p { color: #C9CFD8; font-size: 15px; }
.foot-cta .btn-primary { background: #fff; color: var(--ink); border-color: #fff; }
.foot-cta .btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.foot-meta { grid-column: 10 / span 3; font-family: var(--font-label); font-size: 14px; color: #C9CFD8; }
.foot-meta p { margin: 0 0 10px; }
.site-foot a { color: #fff; }
.site-foot a:hover { color: var(--accent); }
.foot-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 10px; padding: 0; list-style: none; }
.foot-nav a { display: inline-flex; min-height: 44px; align-items: center; }

/* ---------- Адаптивність ---------- */
@media (max-width: 1080px) {
  .filters form { grid-template-columns: 1fr 1fr 1fr; }
  .filters .field-q { grid-column: 1 / span 2; }
  .lab-main { grid-template-columns: minmax(0, 1fr) auto; }
  .lab-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .process-grid { grid-template-columns: 1fr; }
  .process-photo { max-width: 360px; }
}
@media (max-width: 900px) {
  .hero .photo { grid-column: 1 / span 5; }
  .hero-copy { grid-column: 6 / span 7; }
  .sec-mark { grid-column: 1 / -1; padding-top: 0; }
  .sec-body, .sec-body.narrow { grid-column: 1 / -1; }
  .checklist { grid-column: 1 / span 8; }
  .check-photo { grid-column: 9 / span 4; }
  .docs { grid-template-columns: 1fr; }
  .docs section + section { border-top: 1px solid var(--line); margin-top: 18px; }
  .page-head .head-text, .page-head .summary { grid-column: 1 / -1; }
  .lab-more dl { grid-template-columns: 1fr 1fr; }
  .foot-brand, .foot-cta, .foot-meta { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .site-head .wrap { grid-template-columns: 1fr auto; padding-top: 6px; }
  .nav { grid-column: 1 / -1; grid-row: 2; gap: 4px 20px; margin-top: -6px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 28px; }
  .hero .photo, .hero-copy { grid-column: 1 / -1; }
  .hero .photo { order: 2; max-width: 360px; margin-left: 12px; }
  .hero .photo .frame { aspect-ratio: 4 / 5; }
  .hero h1 { max-width: none; }
  .directions { grid-template-columns: 1fr; }
  .checklist, .check-photo { grid-column: 1 / -1; }
  .check-photo { max-width: 300px; margin-left: 12px; }
  .check-photo .frame { aspect-ratio: 16 / 10; }
  .steps li { grid-template-columns: 1fr; gap: 6px; }
  .step-no { font-size: 56px; }
  .filters { position: static; }
  .filters form { grid-template-columns: 1fr; }
  .filters .field-q { grid-column: auto; }
  .lab-main { grid-template-columns: 1fr; padding: 18px 16px; }
  .lab-actions { flex-direction: row; }
  .lab-actions > * { flex: 1 1 0; }
  .lab-more dl { grid-template-columns: 1fr; padding: 16px; }
  .lab h3 { font-size: 19px; }
  .lab-phones a { font-size: 20px; }
  .facts dd { font-size: 26px; }
  .bracketed::before { left: -8px; top: -8px; }
  .bracketed::after { right: -8px; bottom: -8px; }
}

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

@media print {
  .site-head .nav, .lang, .filters, .toggle, .copy, .hero-actions, .site-foot .btn { display: none !important; }
  .js .lab-more { grid-template-rows: 1fr !important; }
  .js .lab-more > .inner { visibility: visible !important; }
  body { background: #fff; }
}

:root { color-scheme: light; }
body { background: var(--bg); }
.photo .frame { position: relative; }
