/* ============================================================
   style.css — сайт-візитка хірурга-онколога, тема «Преміум»
   Токени → базові стилі → компоненти. Mobile-first.
   ============================================================ */

:root {
  /* Palette */
  --c-ink: #16171b;            /* хедер, хіро, футер */
  --c-ink-soft: #1f2127;
  --c-accent: #8e2038;         /* CTAs ONLY; білий на ньому 8.2:1 */
  --c-accent-hover: #6f1729;
  --c-accent-soft: #f6e9ec;
  --c-gold: #c2a15c;           /* тонкі лінії-деталі, не текст */
  --c-bg: #ffffff;
  --c-bg-alt: #f7f4f0;
  --c-text: #1d1e22;
  --c-text-muted: #5d5f66;
  --c-text-on-dark: #d9d6cf;
  --c-muted-on-dark: #9a978f;
  --c-on-accent: #ffffff;
  --c-border: #e6e1d9;

  /* Typography */
  --font-heading: "Playfair Display", Georgia, serif;
  --font-body: "Inter", system-ui, sans-serif;
  --fs-h1: clamp(2.1rem, 5vw + 1rem, 3.75rem);
  --fs-h2: clamp(1.6rem, 3vw + 0.75rem, 2.5rem);
  --fs-h3: 1.25rem;
  --fs-body: clamp(1rem, 0.5vw + 0.9rem, 1.125rem);
  --fs-small: 0.875rem;

  /* Spacing (8px scale) */
  --sp-1: 0.5rem; --sp-2: 1rem; --sp-3: 1.5rem; --sp-4: 2rem;
  --sp-6: 3rem; --sp-8: 4rem; --sp-12: 6rem;
  --section-pad: clamp(4rem, 10vw, 7rem);

  /* Shape */
  --radius: 4px;
  --shadow: 0 8px 32px rgb(22 23 27 / 0.10);

  --container: 1180px;
  --header-h: 4.5rem;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3 { font-family: var(--font-heading); line-height: 1.15; text-wrap: balance; font-weight: 600; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p { max-width: 65ch; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; }

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

/* ---- Layout utilities ---- */
.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--sp-3); }
.section { padding-block: var(--section-pad); }
.section--alt { background: var(--c-bg-alt); }
.section--dark { background: var(--c-ink); color: var(--c-text-on-dark); }
.section--dark h2 { color: #fff; }

.sec-head { margin-bottom: var(--sp-6); }
.eyebrow {
  display: block;
  font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: var(--sp-2);
}
.section--dark .eyebrow { color: var(--c-gold); }
.sec-head .sub { color: var(--c-text-muted); margin-top: var(--sp-2); }
.section--dark .sub { color: var(--c-muted-on-dark); }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: 1em 2.1em;
  border: 1px solid var(--c-accent);
  border-radius: var(--radius);
  background: var(--c-accent);
  color: var(--c-on-accent);
  font-weight: 600; font-size: 0.95rem;
  letter-spacing: 0.04em; text-transform: uppercase;
  text-decoration: none; text-align: center;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.btn:hover {
  background: var(--c-accent-hover); border-color: var(--c-accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgb(142 32 56 / 0.28);
}
.btn--ghost { background: transparent; color: var(--c-accent); }
.btn--ghost:hover { background: var(--c-accent-soft); color: var(--c-accent); box-shadow: none; }
.btn--ghost-dark { background: transparent; color: #fff; border-color: rgb(255 255 255 / 0.35); }
.btn--ghost-dark:hover { background: transparent; border-color: #fff; box-shadow: none; }

/* ---- Scroll reveal ---- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ---- Honeypot / a11y ---- */
.hp-field { position: absolute; left: -9999px; opacity: 0; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ============================================================
   Header
   ============================================================ */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-h);
  background: rgb(22 23 27 / 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgb(255 255 255 / 0.08);
  color: #fff;
}
.header__inner {
  height: 100%;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3);
}
.logo { text-decoration: none; line-height: 1.15; }
.logo b { font-family: var(--font-heading); font-weight: 600; font-size: 1.15rem; white-space: nowrap; }
.logo span {
  display: block;
  font-size: 0.66rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--c-muted-on-dark);
}
.nav__list { display: flex; gap: 1.25rem; list-style: none; }
.nav__list a { color: var(--c-text-on-dark); text-decoration: none; font-size: 0.9rem; white-space: nowrap; transition: color 0.2s; }
.nav__list a:hover { color: #fff; }
.header__actions { display: flex; align-items: center; gap: var(--sp-3); }
.header__phone {
  color: #fff; text-decoration: none; font-weight: 600; font-size: 0.9rem;
  white-space: nowrap;
  border-bottom: 2px solid var(--c-gold); padding-bottom: 2px;
}
.header .btn { padding: 0.65em 1.2em; font-size: 0.8rem; white-space: nowrap; }
@media (max-width: 1279px) { .header__phone { display: none; } }
@media (min-width: 1280px) { .header .container { max-width: 1280px; } }

/* Burger — прихований на десктопі */
.burger {
  display: none;
  width: 44px; height: 44px;
  background: none; border: 0;
  position: relative; z-index: 110;
}
.burger span, .burger span::before, .burger span::after {
  content: ""; display: block; position: absolute; left: 10px;
  width: 24px; height: 2px; background: #fff;
  transition: transform 0.25s, opacity 0.25s;
}
.burger span { top: 21px; }
.burger span::before { left: 0; top: -7px; }
.burger span::after { left: 0; top: 7px; }
.burger[aria-expanded="true"] span { background: transparent; }
.burger[aria-expanded="true"] span::before { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span::after { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  background: radial-gradient(1200px 600px at 80% 20%, #23252c, var(--c-ink));
  color: #fff;
  padding-top: calc(var(--header-h) + var(--sp-4));
  padding-bottom: 0;
}
.hero__inner {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-6);
  align-items: center;
  padding-block: var(--sp-4) var(--sp-8);
}
.hero__inner > * { min-width: 0; }
.hero h1 { color: #fff; margin-block: var(--sp-2) var(--sp-3); }
.hero h1 em { font-style: italic; font-weight: 500; color: var(--c-gold); }
.hero__sub { color: var(--c-muted-on-dark); margin-bottom: var(--sp-4); max-width: 50ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.hero__cta .btn { flex: 1 1 auto; }

.hero__photo { position: relative; max-width: 420px; justify-self: center; width: 100%; }
.hero__photo::before {
  content: ""; position: absolute; inset: -12px 12px 12px -12px;
  border: 1px solid var(--c-gold);
}
.hero__photo img {
  position: relative; z-index: 1;
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
  filter: saturate(0.85) contrast(1.05);
}
.hero__caption {
  position: absolute; z-index: 2; left: 12px; bottom: 12px;
  background: rgb(22 23 27 / 0.85);
  padding: 0.6rem 1rem;
  font-size: var(--fs-small); color: var(--c-text-on-dark);
}
.hero__caption b { display: block; font-family: var(--font-heading); font-size: 1.05rem; color: #fff; }

/* Смуга цифр */
.stats {
  border-top: 1px solid rgb(255 255 255 / 0.08);
  padding-block: var(--sp-6);
}
.stats__grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4) var(--sp-2);
  text-align: center;
}
.stat b {
  display: block;
  font-family: var(--font-heading); font-weight: 600;
  font-size: clamp(1.25rem, 2.6vw, 1.9rem); line-height: 1.15;
  color: #fff;
}
.stat b i { font-style: italic; color: var(--c-gold); }
.stat span { font-size: var(--fs-small); color: var(--c-muted-on-dark); }

/* ============================================================
   Напрями допомоги
   ============================================================ */
.services__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); }
.card {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--sp-4);
  display: flex; flex-direction: column; gap: var(--sp-2);
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 40px rgb(22 23 27 / 0.14); }
.card__icon {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  background: var(--c-accent-soft); color: var(--c-accent);
  border-radius: var(--radius);
}
.card__idx { font-family: var(--font-heading); font-style: italic; font-size: 1.1rem; color: var(--c-gold); }
.card p { font-size: var(--fs-small); color: var(--c-text-muted); }
.card a { margin-top: auto; font-size: var(--fs-small); font-weight: 600; color: var(--c-accent); text-decoration: none; }
.card a:hover { text-decoration: underline; }

/* ============================================================
   Про лікаря
   ============================================================ */
.about__inner { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-6); align-items: start; }
.about__inner > * { min-width: 0; }
.about__photo { position: relative; max-width: 380px; }
.about__photo::before { content: ""; position: absolute; inset: 12px -12px -12px 12px; background: var(--c-accent-soft); }
.about__photo img { position: relative; z-index: 1; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.about__creds { list-style: none; display: grid; gap: var(--sp-2); margin-top: var(--sp-3); }
.about__creds li { display: flex; gap: var(--sp-2); align-items: flex-start; }
.about__creds svg { flex: 0 0 auto; margin-top: 4px; color: var(--c-accent); }
.about__quote {
  margin-top: var(--sp-4);
  padding-left: var(--sp-3);
  border-left: 2px solid var(--c-gold);
  font-family: var(--font-heading); font-style: italic; font-size: 1.15rem;
}

/* ============================================================
   Шлях лікування
   ============================================================ */
.steps__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); counter-reset: step; }
.step { padding: var(--sp-3); border-left: 2px solid var(--c-gold); background: rgb(255 255 255 / 0.03); }
.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  display: block;
  font-family: var(--font-heading); font-style: italic; font-weight: 600;
  font-size: 1.5rem; color: var(--c-gold);
  margin-bottom: var(--sp-1);
}
.step h3 { color: #fff; margin-bottom: var(--sp-1); font-size: 1.1rem; }
.step p { font-size: var(--fs-small); color: var(--c-muted-on-dark); }

/* Маршрут пацієнта — фото з операційної під темним оверлеєм */
.section--route {
  background:
    linear-gradient(rgb(22 23 27 / 0.88), rgb(22 23 27 / 0.94)),
    url("../img/surgery.webp") center 30% / cover no-repeat;
}

/* ============================================================
   Наукові публікації
   ============================================================ */
.pubs { border-top: 1px solid var(--c-border); }
.pub {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-1);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--c-border);
}
.pub__journal {
  font-size: var(--fs-small); font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--c-accent);
}
.pub h3 { font-size: 1.15rem; max-width: 60ch; }
.pub__link {
  font-size: var(--fs-small); font-weight: 600;
  color: var(--c-accent); text-decoration: none;
  justify-self: start;
}
.pub__link:hover { text-decoration: underline; }

/* Кол-центр — головний канал запису, тому найпомітніший */
.callcenter {
  margin-block: var(--sp-3) var(--sp-4);
  padding: var(--sp-3);
  background: rgb(255 255 255 / 0.05);
  border-left: 3px solid var(--c-gold);
  display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); align-items: baseline;
}
.callcenter__title {
  color: var(--c-gold); flex-basis: 100%;
  font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
}
.callcenter a {
  color: #fff; text-decoration: none;
  font-size: clamp(1.15rem, 2.5vw, 1.4rem); font-weight: 600;
  white-space: nowrap;
}
.callcenter a:hover { color: var(--c-gold); }

/* Кваліфікація */
.quals { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); }
.quals .card h3 { margin-bottom: var(--sp-1); }
.quals .about__creds { margin-top: var(--sp-2); }

/* Хронологія освіти */
.edu { list-style: none; margin-top: var(--sp-2); display: grid; gap: var(--sp-2); }
.edu li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: var(--sp-2); align-items: baseline; }
.edu b {
  font-family: var(--font-heading); font-style: italic; font-weight: 600;
  color: var(--c-accent); white-space: nowrap;
}
.edu span { font-size: var(--fs-small); color: var(--c-text-muted); }

/* Доповіді та конференції */
.talks { margin-top: var(--sp-6); }
.talks h3 { font-size: 1.25rem; margin-bottom: var(--sp-2); }
.talks ul { list-style: none; display: grid; gap: var(--sp-1); }
.talks li { font-size: var(--fs-small); color: var(--c-text-muted); max-width: 75ch; }
.talks b { color: var(--c-accent); font-weight: 600; }
.subhead {
  font-size: 1.5rem;
  margin: var(--sp-8) 0 var(--sp-3);
}
.subhead span {
  font-family: var(--font-body); font-weight: 400;
  font-size: var(--fs-small); color: var(--c-text-muted);
  margin-left: var(--sp-2);
}

/* ============================================================
   Відгуки
   ============================================================ */
.reviews__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); }
.review {
  background: var(--c-bg);
  border: 1px solid var(--c-border); border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--sp-4);
}
.review blockquote { font-style: italic; }
.review blockquote::before { content: "« "; color: var(--c-gold); font-family: var(--font-heading); }
.review cite {
  display: block; margin-top: var(--sp-2);
  font-style: normal; font-size: var(--fs-small); font-weight: 600;
}
.review cite span { display: block; font-weight: 400; color: var(--c-text-muted); }

/* ============================================================
   Сертифікати
   ============================================================ */
.certs__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
.cert {
  border: 1px solid var(--c-border); border-radius: var(--radius);
  background: var(--c-bg);
  aspect-ratio: 3 / 4;
  display: grid; place-items: center;
  padding: var(--sp-2);
  text-align: center; font-size: var(--fs-small); color: var(--c-text-muted);
}
.cert img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   FAQ
   ============================================================ */
.faq { max-width: 820px; }
.faq details {
  border-bottom: 1px solid var(--c-border);
  padding: var(--sp-2) 0;
}
.faq details:first-child { border-top: 1px solid var(--c-border); }
.faq summary {
  cursor: pointer; list-style: none;
  font-family: var(--font-heading); font-weight: 600; font-size: 1.15rem;
  padding: var(--sp-1) var(--sp-4) var(--sp-1) 0;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 4px; top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-heading); font-style: italic;
  font-size: 1.5rem; color: var(--c-gold);
  transition: transform 0.2s;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq summary:hover { color: var(--c-accent); }
.faq details p {
  padding: var(--sp-1) 0 var(--sp-2);
  color: var(--c-text-muted); font-size: var(--fs-small);
  max-width: 70ch;
}

/* ============================================================
   Контакти
   ============================================================ */
.contact__inner { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-6); align-items: start; }
.contact__inner > * { min-width: 0; }
.contact__channels { list-style: none; display: grid; gap: var(--sp-2); margin-block: var(--sp-3); }
.contact__channels a { color: #fff; text-decoration: none; font-weight: 500; }
.contact__channels a:hover { text-decoration: underline; }
.contact__channels li { display: flex; align-items: center; gap: var(--sp-2); }
.contact__channels svg { flex: 0 0 auto; color: var(--c-gold); }

.form {
  background: var(--c-bg); color: var(--c-text);
  border-radius: var(--radius);
  padding: var(--sp-4);
}
.form label { display: block; font-size: var(--fs-small); font-weight: 500; margin-bottom: 4px; }
.form input, .form textarea {
  width: 100%;
  padding: 0.8rem 0.95rem; margin-bottom: var(--sp-2);
  font: inherit;
  border: 1px solid var(--c-border); border-radius: var(--radius);
  background: var(--c-bg-alt);
}
.form input:focus, .form textarea:focus { outline: 2px solid var(--c-accent); outline-offset: 1px; }
.form .btn { width: 100%; }
.form__note { font-size: 0.8rem; color: var(--c-text-muted); margin-top: var(--sp-2); }
.form__msg { margin-top: var(--sp-2); font-weight: 600; }
.form__msg--ok { color: #15803d; }
.form__msg--err { color: var(--c-accent); }

/* Тимчасова картка запису замість форми */
.form--alt { display: grid; gap: var(--sp-2); align-content: start; }
.form--alt h3 { font-size: 1.4rem; }
.form--alt p { color: var(--c-text-muted); font-size: var(--fs-small); }
.form--alt .btn { width: 100%; }

.map { margin-top: var(--sp-8); }
.map iframe { width: 100%; height: 320px; border: 0; filter: grayscale(0.4); }

/* ============================================================
   Footer
   ============================================================ */
.footer {
  background: var(--c-ink); color: var(--c-muted-on-dark);
  border-top: 1px solid rgb(255 255 255 / 0.08);
  padding-block: var(--sp-4);
  font-size: var(--fs-small);
}
.footer__inner { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); justify-content: space-between; align-items: center; }
.footer__social { display: flex; gap: var(--sp-2); list-style: none; }
.footer__social a { color: var(--c-muted-on-dark); transition: color 0.2s; }
.footer__social a:hover { color: #fff; }
.footer__disclaimer { flex-basis: 100%; font-size: 0.78rem; }

/* ============================================================
   Мобільна навігація (< 900px) і адаптація
   ============================================================ */
@media (max-width: 1119px) {
  .burger { display: block; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0; z-index: 105;
    background: var(--c-ink);
    border-bottom: 1px solid rgb(255 255 255 / 0.1);
    transform: translateY(-120%);
    transition: transform 0.3s ease;
    visibility: hidden;
  }
  .nav.is-open { transform: translateY(0); visibility: visible; }
  .nav__list { flex-direction: column; gap: 0; padding: var(--sp-2) var(--sp-3) var(--sp-3); }
  .nav__list a {
    display: block; padding: 0.9rem 0; font-size: 1.05rem;
    border-bottom: 1px solid rgb(255 255 255 / 0.08);
  }
  body.menu-open { overflow: hidden; }
}

@media (max-width: 599px) {
  .header__inner { gap: var(--sp-1); }
  .header__actions { gap: var(--sp-1); }
  .header .btn {
    padding: 0.65em 0.8em; font-size: 0.7rem; letter-spacing: 0.02em;
    white-space: nowrap;
  }
  .logo b { font-size: 0.95rem; white-space: nowrap; }
  .logo span { display: none; }   /* спеціальність видно в хіро — в хедері на 360px їй тісно */
}

@media (min-width: 600px) {
  .services__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reviews__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .certs__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .steps__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero__cta .btn { flex: 0 0 auto; }
}

@media (min-width: 900px) {
  .hero__inner { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); padding-block: var(--sp-8) var(--sp-12); }
  .hero__photo { justify-self: end; }
  .stats__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stats__grid .stat { border-right: 1px solid rgb(255 255 255 / 0.1); }
  .stats__grid .stat:last-child { border-right: 0; }
  .services__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .about__inner { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); }
  .steps__grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  .reviews__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .certs__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .contact__inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pub { grid-template-columns: 280px minmax(0, 1fr) auto; gap: var(--sp-3); align-items: center; }
  .quals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
