/*
Theme Name: Narco Clinic
Theme URI: https://example.com/
Author: Custom
Description: Кастомная тема для сайта частной наркологической клиники: лидогенерация, каталог услуг, врачи, отзывы, FAQ.
Version: 1.0.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: narco-clinic
*/

/* ============ База ============ */
:root {
  --c-primary: #0d6e5f;
  --c-primary-dark: #0a564a;
  --c-primary-light: #e3f1ee;
  --c-accent: #ff7a3d;
  --c-accent-dark: #e8662b;
  --c-text: #1d2b29;
  --c-muted: #5c6f6b;
  --c-bg: #ffffff;
  --c-bg-soft: #f3f8f6;
  --c-border: #dde8e5;
  --c-danger: #c4452f;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(13, 60, 53, .10);
  --container: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--c-text);
  background: var(--c-bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-dark); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .6em; font-weight: 700; }
h1 { font-size: clamp(28px, 4vw, 44px); }
h2 { font-size: clamp(24px, 3vw, 34px); }
h3 { font-size: 20px; }
p { margin: 0 0 1em; }
ul { padding-left: 1.2em; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.section { padding: 64px 0; }
.section--soft { background: var(--c-bg-soft); }
.section--dark { background: linear-gradient(135deg, var(--c-primary-dark), var(--c-primary)); color: #fff; }
.section--dark h2 { color: #fff; }
.section__lead { max-width: 760px; color: var(--c-muted); margin-bottom: 36px; }
.section--dark .section__lead { color: rgba(255,255,255,.85); }
.text-center { text-align: center; }
.text-center .section__lead { margin-left: auto; margin-right: auto; }

/* ============ Кнопки ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px; border-radius: 999px;
  font-size: 16px; font-weight: 600; line-height: 1.2;
  border: 2px solid transparent; cursor: pointer; transition: .2s;
  text-align: center;
}
.btn--accent { background: var(--c-accent); color: #fff; }
.btn--accent:hover { background: var(--c-accent-dark); color: #fff; }
.btn--primary { background: var(--c-primary); color: #fff; }
.btn--primary:hover { background: var(--c-primary-dark); color: #fff; }
.btn--outline { border-color: var(--c-primary); color: var(--c-primary); background: transparent; }
.btn--outline:hover { background: var(--c-primary); color: #fff; }
.btn--ghost-light { border-color: rgba(255,255,255,.6); color: #fff; background: transparent; }
.btn--ghost-light:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn--lg { padding: 18px 36px; font-size: 18px; }
.btn--block { width: 100%; }

/* ============ Шапка ============ */
.topbar { background: var(--c-primary-dark); color: #fff; font-size: 14px; }
.topbar__inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 6px 0; flex-wrap: wrap; }
.topbar a { color: #fff; }
.topbar__note { opacity: .85; }

.site-header { background: #fff; border-bottom: 1px solid var(--c-border); position: sticky; top: 0; z-index: 100; }
.site-header__inner { display: flex; align-items: center; gap: 24px; padding: 12px 0; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--c-text); }
.brand__logo {
  width: 48px; height: 48px; flex: none; display: block;
}
.brand__logo svg { width: 48px; height: 48px; display: block; }
.brand__name { font-weight: 800; font-size: 19px; line-height: 1.15; letter-spacing: .5px; text-transform: uppercase; display: block; }
.brand__tagline { font-size: 12.5px; color: var(--c-muted); }

.header-phone { margin-left: auto; text-align: right; }
.header-phone__number { font-size: 20px; font-weight: 800; color: var(--c-text); display: block; }
.header-phone__note { font-size: 12.5px; color: var(--c-primary); font-weight: 600; }
.header-cta { white-space: nowrap; }

/* ============ Навигация ============ */
.main-nav { background: var(--c-primary); }
.main-nav ul { list-style: none; margin: 0; padding: 0; }
.main-nav > .container > ul { display: flex; flex-wrap: wrap; }
.main-nav li { position: relative; }
.main-nav a { display: block; padding: 13px 18px; color: #fff; font-weight: 600; font-size: 15.5px; }
.main-nav > .container > ul > li:hover > a,
.main-nav > .container > ul > li.current-menu-ancestor > a,
.main-nav > .container > ul > li.current-menu-item > a { background: var(--c-primary-dark); }
.main-nav .sub-menu {
  display: none; position: absolute; left: 0; top: 100%; min-width: 280px;
  background: #fff; box-shadow: var(--shadow); border-radius: 0 0 12px 12px;
  padding: 8px 0; z-index: 50;
}
.main-nav li:hover > .sub-menu { display: block; }
.main-nav .sub-menu a { color: var(--c-text); padding: 9px 20px; font-weight: 500; font-size: 15px; }
.main-nav .sub-menu a:hover { background: var(--c-primary-light); color: var(--c-primary-dark); }

.nav-toggle { display: none; margin-left: auto; background: none; border: 2px solid var(--c-primary); color: var(--c-primary); border-radius: 10px; padding: 8px 12px; font-size: 15px; font-weight: 700; cursor: pointer; }

/* ============ Хиро ============ */
.hero { background: linear-gradient(120deg, #07332d 0%, var(--c-primary-dark) 55%, #11806e 100%); color: #fff; padding: 52px 0 0; overflow: hidden; }
.hero__inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: 32px; align-items: end; }
.hero__content { padding-bottom: 52px; }
.hero h1 { color: #fff; max-width: 720px; }
.hero__sub { font-size: 19px; max-width: 640px; color: rgba(255,255,255,.88); margin-bottom: 28px; }

/* Фигура врача в хиро — стоит на нижней кромке экрана */
.hero__figure { position: relative; align-self: end; justify-self: center; display: flex; align-items: flex-end; }
.hero__figure img { max-height: 540px; width: auto; display: block; filter: drop-shadow(0 18px 36px rgba(0,0,0,.35)); }
.hero__badge {
  position: absolute; left: 0; bottom: 64px;
  background: #fff; color: var(--c-text); border-radius: 14px;
  padding: 10px 16px; box-shadow: var(--shadow); text-align: left;
}
.hero__badge-value { display: block; font-weight: 800; font-size: 20px; color: var(--c-primary-dark); }
.hero__badge-label { font-size: 12.5px; color: var(--c-muted); }
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 40px; }
.hero__features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 36px; }
.hero-feature { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); border-radius: var(--radius); padding: 16px 18px; }
.hero-feature__title { font-weight: 700; margin-bottom: 4px; }
.hero-feature__text { font-size: 14px; color: rgba(255,255,255,.8); }
.hero__stats { display: flex; gap: 40px; flex-wrap: wrap; border-top: 1px solid rgba(255,255,255,.18); padding-top: 24px; margin-top: 28px; }
.hero-stat__value { font-size: 30px; font-weight: 800; }
.hero-stat__label { font-size: 14px; color: rgba(255,255,255,.78); }

/* ============ Карточки и сетки ============ */
.grid { display: grid; gap: 22px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius);
  padding: 26px; box-shadow: 0 2px 10px rgba(13,60,53,.05);
  display: flex; flex-direction: column;
}
.card--soft { background: var(--c-bg-soft); }
.card__icon { font-size: 34px; margin-bottom: 12px; line-height: 1; }
.card__title { font-size: 19px; margin-bottom: 8px; }
.card__text { color: var(--c-muted); font-size: 15.5px; flex: 1; }
.card__footer { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card .price { font-weight: 800; color: var(--c-primary-dark); font-size: 18px; white-space: nowrap; }
.card .price small { font-weight: 500; color: var(--c-muted); }

/* Срочные сценарии */
.urgent-card { border-left: 5px solid var(--c-danger); }
.urgent-card .card__title { color: var(--c-danger); }

/* Категории услуг */
.service-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 28px; }
.service-tab {
  padding: 10px 20px; border-radius: 999px; border: 2px solid var(--c-border);
  background: #fff; font-weight: 600; font-size: 15px; cursor: pointer; transition: .2s;
}
.service-tab.is-active, .service-tab:hover { border-color: var(--c-primary); background: var(--c-primary); color: #fff; }
.service-panel { display: none; }
.service-panel.is-active { display: grid; }

/* ============ Этапы ============ */
.steps { counter-reset: step; }
.step { position: relative; padding: 24px 24px 24px 84px; background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 22px; top: 22px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--c-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800;
}
.step__title { font-size: 18px; margin-bottom: 6px; }
.step__text { color: var(--c-muted); font-size: 15px; margin: 0; }

/* ============ Врачи ============ */
.doctor-card { text-align: center; }
.doctor-card__photo {
  width: 140px; height: 140px; border-radius: 50%; margin: 0 auto 16px;
  overflow: hidden; border: 4px solid var(--c-primary-light);
  background: linear-gradient(135deg, var(--c-primary-light), #cfe6e0);
  display: flex; align-items: center; justify-content: center;
  font-size: 42px; color: var(--c-primary); font-weight: 800;
}
.doctor-card__photo img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.doctor-card__role { color: var(--c-primary); font-weight: 600; font-size: 14.5px; margin-bottom: 6px; }
.doctor-card__meta { color: var(--c-muted); font-size: 14.5px; }

/* ============ Отзывы ============ */
.review-card { background: var(--c-bg-soft); border: none; }
.review-card__head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.review-card__name { font-weight: 700; }
.review-card__date { color: var(--c-muted); font-size: 14px; }
.review-card__stars { color: #f5a623; letter-spacing: 2px; margin-bottom: 8px; }
.rating-summary { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; flex-wrap: wrap; }
.rating-summary__value { font-size: 44px; font-weight: 800; color: var(--c-primary-dark); }

/* ============ FAQ ============ */
.faq-item { border: 1px solid var(--c-border); border-radius: var(--radius); background: #fff; margin-bottom: 12px; overflow: hidden; }
.faq-item__q {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  padding: 18px 52px 18px 22px; font-size: 17px; font-weight: 700; color: var(--c-text);
  position: relative; font-family: inherit;
}
.faq-item__q::after { content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 26px; color: var(--c-primary); transition: .2s; }
.faq-item.is-open .faq-item__q::after { content: "–"; }
.faq-item__a { display: none; padding: 0 22px 18px; color: var(--c-muted); }
.faq-item.is-open .faq-item__a { display: block; }

/* ============ Формы ============ */
.lead-form { background: #fff; border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); color: var(--c-text); }
.lead-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.lead-form input[type=text], .lead-form input[type=tel], .lead-form textarea {
  width: 100%; padding: 14px 16px; border: 2px solid var(--c-border); border-radius: 10px;
  font-size: 16px; font-family: inherit;
}
.lead-form input:focus, .lead-form textarea:focus { outline: none; border-color: var(--c-primary); }
.lead-form__agree { font-size: 13px; color: var(--c-muted); margin-top: 12px; }
.form-message { padding: 14px 18px; border-radius: 10px; margin-bottom: 16px; font-weight: 600; }
.form-message--ok { background: #e4f5e9; color: #1d7a3a; }
.form-message--err { background: #fdeae6; color: var(--c-danger); }

/* ============ Галерея ============ */
.gallery-item { border-radius: var(--radius); overflow: hidden; background: #fff; border: 1px solid var(--c-border); }
.gallery-item__img {
  aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--c-primary-light), #d8ebe6);
  color: var(--c-primary); font-size: 40px; overflow: hidden;
}
.gallery-item__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gallery-item:hover .gallery-item__img img { transform: scale(1.04); }

/* Фото в текстовых блоках */
.section-figure { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.section-figure img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Текст + фото в ряд */
.media-row { display: grid; grid-template-columns: 1.1fr .9fr; gap: 36px; align-items: center; }
.media-row__figure { align-self: stretch; }
.media-row__figure img { width: 100%; height: 100%; min-height: 280px; object-fit: cover; }
.gallery-item__caption { padding: 12px 16px; font-size: 14.5px; color: var(--c-muted); }

/* ============ Лицензии ============ */
.license-card { text-align: center; }
.license-card__img {
  aspect-ratio: 3/4; border-radius: 10px; border: 1px dashed var(--c-border);
  background: var(--c-bg-soft); display: flex; align-items: center; justify-content: center;
  color: var(--c-muted); font-size: 13px; padding: 12px; margin-bottom: 10px;
}

/* ============ Контент страниц ============ */
.page-hero { background: linear-gradient(120deg, var(--c-primary-dark), var(--c-primary)); color: #fff; padding: 44px 0; }
.page-hero h1 { color: #fff; margin: 0; }
.breadcrumbs { font-size: 14px; color: rgba(255,255,255,.75); margin-bottom: 10px; }
.breadcrumbs a { color: rgba(255,255,255,.9); }

.layout-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; }
.entry-content h2 { margin-top: 1.4em; }
.entry-content ul li { margin-bottom: .4em; }

.sidebar-cta { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 18px; }
.cta-box { background: linear-gradient(135deg, var(--c-primary-dark), var(--c-primary)); color: #fff; border-radius: var(--radius); padding: 26px; }
.cta-box h3 { color: #fff; }
.cta-box p { color: rgba(255,255,255,.85); font-size: 15px; }
.cta-box .btn { width: 100%; margin-top: 8px; }
.cta-box__phone { font-size: 22px; font-weight: 800; color: #fff; display: block; margin: 10px 0 2px; }
.price-badge { background: var(--c-primary-light); color: var(--c-primary-dark); border-radius: var(--radius); padding: 18px 22px; font-size: 15px; }
.price-badge strong { font-size: 24px; display: block; }

/* Списки услуг на странице раздела */
.service-list { display: grid; gap: 16px; }
.service-list__item {
  display: flex; justify-content: space-between; gap: 16px; align-items: center;
  background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); padding: 18px 22px;
}
.service-list__title { font-weight: 700; font-size: 17px; }
.service-list__price { font-weight: 800; color: var(--c-primary-dark); white-space: nowrap; }

/* Таблица цен */
.price-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: 0 2px 10px rgba(13,60,53,.05); }
.price-table th, .price-table td { padding: 14px 18px; border-bottom: 1px solid var(--c-border); text-align: left; }
.price-table th { background: var(--c-primary); color: #fff; font-size: 15px; }
.price-table tr:last-child td { border-bottom: none; }
.price-table td:last-child { font-weight: 700; color: var(--c-primary-dark); white-space: nowrap; }
.price-table__cat td { background: var(--c-bg-soft); font-weight: 800; }

/* ============ Подвал ============ */
.site-footer { background: #0a2723; color: rgba(255,255,255,.82); font-size: 15px; }
.site-footer__main { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 32px; padding: 48px 0 32px; }
.site-footer h4 { color: #fff; font-size: 16px; }
.site-footer a { color: rgba(255,255,255,.82); }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer__disclaimer { border-top: 1px solid rgba(255,255,255,.12); padding: 20px 0; font-size: 13px; color: rgba(255,255,255,.55); }
.site-footer__warning { background: #081f1c; padding: 14px 0; font-size: 13.5px; text-align: center; color: #ffce8a; }

/* Плавающая кнопка звонка (мобайл) */
.float-call { display: none; position: fixed; right: 16px; bottom: 16px; z-index: 200; }

/* ============ Адаптив ============ */
@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .hero__features { grid-template-columns: repeat(2, 1fr); }
  .layout-sidebar { grid-template-columns: 1fr; }
  .sidebar-cta { position: static; }
  .site-footer__main { grid-template-columns: 1fr 1fr; }
  .hero__figure img { max-height: 380px; }
}
@media (max-width: 768px) {
  body { font-size: 16px; }
  .section { padding: 44px 0; }
  .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .header-cta { display: none; }
  .header-phone__number { font-size: 17px; }
  .nav-toggle { display: block; }
  .main-nav { display: none; }
  .main-nav.is-open { display: block; }
  .main-nav > .container > ul { flex-direction: column; }
  .main-nav .sub-menu { position: static; display: block; box-shadow: none; border-radius: 0; background: var(--c-primary-dark); padding: 0; }
  .main-nav .sub-menu a { color: rgba(255,255,255,.85); padding-left: 34px; }
  .lead-form .form-row { grid-template-columns: 1fr; }
  .float-call { display: block; }
  .service-list__item { flex-direction: column; align-items: flex-start; }
  .hero__inner { grid-template-columns: 1fr; }
  .hero__figure { display: none; }
  .media-row { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .grid--4, .hero__features { grid-template-columns: 1fr; }
  .site-footer__main { grid-template-columns: 1fr; }
  .hero { padding: 48px 0 40px; }
}
