/* ploie — сайт студии: основа конструктора.

   ПЕРЕМЕННЫЕ
   --c-*  тема сайта (apps/websites/themes.py → <style> в base_site.html):
          bg surface text muted line accent on-accent contrast-bg contrast-text
          header-bg header-text footer-bg footer-text; --font-head --font-body
          --radius (карточки, фото) --radius-btn (кнопки).
   --s-*  схема подложки секции (.sch-base | .sch-alt | .sch-contrast | .sch-accent,
          свои цвета блока — инлайн поверх): bg surface text muted line
          accent btn-bg btn-text. БЛОКИ КРАСЯТСЯ ТОЛЬКО ЧЕРЕЗ --s-*.

   РАЗМЕТКА БЛОКА (templates/sites/blocks/_section.html):
     <section id class="blk blk-<группа> v-<вариант> sch-<схема>">
       <div class="wrap">…</div>        — контейнер 1200px; без него — на всю ширину
     Общие элементы: .tag .h2 .sub .btn .btn.ghost .card .grid.g2/.g3/.g4
     .ph (заглушка картинки), .cta-row (ряд кнопок).
   Стили вариантов — static/site/blocks/<группа>.css, классы с префиксом
   группы: .hero-…, .dir-…, .price-… */

:root {
  /* «Монохром» — на случай страницы без темы; тема перекрывает. */
  --c-bg: #ffffff; --c-surface: #f4f4f4; --c-text: #111111; --c-muted: #5f5f5f;
  --c-line: #e3e3e3; --c-accent: #111111; --c-on-accent: #ffffff;
  --c-contrast-bg: #111111; --c-contrast-text: #ffffff;
  --c-header-bg: #ffffff; --c-header-text: #111111; --c-header-bg-glass: rgba(255, 255, 255, .92);
  --c-footer-bg: #ffffff; --c-footer-text: #5f5f5f;
  --font-head: "Segoe UI", -apple-system, Roboto, Arial, sans-serif;
  --font-body: "Segoe UI", -apple-system, Roboto, Arial, sans-serif;
  --radius: 18px; --radius-btn: 40px;
}

/* Схемы подложки. :root — чтобы страницы без секций (кабинет, документы)
   тоже имели --s-*. */
:root, .sch-base {
  --s-bg: var(--c-bg); --s-surface: var(--c-surface); --s-text: var(--c-text);
  --s-muted: var(--c-muted); --s-line: var(--c-line); --s-accent: var(--c-accent);
  --s-btn-bg: var(--c-accent); --s-btn-text: var(--c-on-accent);
}
.sch-alt {
  --s-bg: var(--c-surface); --s-surface: var(--c-bg); --s-text: var(--c-text);
  --s-muted: var(--c-muted); --s-line: var(--c-line); --s-accent: var(--c-accent);
  --s-btn-bg: var(--c-accent); --s-btn-text: var(--c-on-accent);
}
.sch-contrast {
  --s-bg: var(--c-contrast-bg); --s-text: var(--c-contrast-text);
  --s-surface: color-mix(in srgb, var(--c-contrast-text) 7%, var(--c-contrast-bg));
  --s-muted: color-mix(in srgb, var(--c-contrast-text) 70%, var(--c-contrast-bg));
  --s-line: color-mix(in srgb, var(--c-contrast-text) 18%, var(--c-contrast-bg));
  --s-accent: var(--c-contrast-text);
  --s-btn-bg: var(--c-contrast-text); --s-btn-text: var(--c-contrast-bg);
}
.sch-accent {
  --s-bg: var(--c-accent); --s-text: var(--c-on-accent);
  --s-surface: color-mix(in srgb, var(--c-on-accent) 10%, var(--c-accent));
  --s-muted: color-mix(in srgb, var(--c-on-accent) 78%, var(--c-accent));
  --s-line: color-mix(in srgb, var(--c-on-accent) 25%, var(--c-accent));
  --s-accent: var(--c-on-accent);
  --s-btn-bg: var(--c-on-accent); --s-btn-text: var(--c-accent);
}

/* Старые имена переменных — ими пользуется cabinet.css. */
:root {
  --bg: var(--c-bg); --bg2: var(--c-surface); --card: var(--c-surface); --line: var(--c-line);
  --ink: var(--c-accent); --gold: var(--c-muted); --txt: var(--c-text); --mut: var(--c-muted);
  --accent: var(--c-accent);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body); background: var(--c-bg); color: var(--c-text); line-height: 1.6;
}
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; line-height: 1.25; }
h2, .h2 { font-size: clamp(24px, 3.4vw, 36px); margin-bottom: 12px; }
.sub { color: var(--s-muted); max-width: 640px; margin-bottom: 36px; }
.sub:empty { display: none; }

/* секции конструктора */
.blk { background: var(--s-bg); color: var(--s-text); padding: 72px 0; position: relative; }
/* блок, которому нечего показать (нет отзывов, преподавателей), шаблон оставляет пустым */
.blk:not(:has(> *)) { display: none; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 5%; }
.wrap.narrow { max-width: 820px; }
.center { text-align: center; }
.center .sub { margin-left: auto; margin-right: auto; }
/* секция старого вида (кабинет, документы) */
section:not(.blk) { padding: 72px 5%; max-width: 1200px; margin: 0 auto; }

.btn {
  display: inline-block; background: var(--s-btn-bg); color: var(--s-btn-text); padding: 15px 34px;
  border-radius: var(--radius-btn); font-weight: 600; text-decoration: none;
  border: 1px solid var(--s-btn-bg); font-size: 16px; cursor: pointer; transition: .2s;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .18); font-family: inherit; text-align: center;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn.ghost { background: none; border: 1px solid var(--s-text); box-shadow: none; color: var(--s-text); }
.btn.ghost:hover { background: var(--s-text); color: var(--s-bg); filter: none; }
.btn.wa, .btn.tg { background: var(--s-bg); border: 1px solid var(--s-text); box-shadow: none; color: var(--s-text); }
.btn.wa:hover, .btn.tg:hover { background: var(--s-text); color: var(--s-bg); }
.btn[disabled] { opacity: .5; cursor: default; transform: none; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.tag {
  display: inline-block; font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--s-muted); margin-bottom: 14px;
}
.link { color: var(--s-accent); text-decoration: none; font-weight: 600; }

/* заглушка картинки: пока фото не загружено — мягкий градиент темы */
.ph {
  background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--s-accent) 16%, transparent), transparent 55%),
              radial-gradient(circle at 75% 80%, color-mix(in srgb, var(--s-accent) 9%, transparent), transparent 50%),
              var(--s-surface);
  border: 1px solid var(--s-line); color: var(--s-muted);
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: 13px; padding: 20px;
}

/* блоки/строки формы, видимые только когда филиалов больше одного */
body:not(.multi) .multi-only { display: none !important; }
body.multi .single-only { display: none !important; }

/* превью-плашка (черновик или предпросмотр по служебному адресу) */
.preview-bar {
  background: #111; color: #fff; text-align: center; font-size: 13px;
  padding: 8px 12px;
}

/* ---- шапка: общее для всех вариантов (static/site/blocks/header.css — различия) */
header.site-header {
  position: sticky; top: 0; z-index: 50; background: var(--c-header-bg-glass);
  backdrop-filter: blur(10px); border-bottom: 1px solid color-mix(in srgb, var(--c-header-text) 12%, transparent);
  color: var(--c-header-text);
  --s-bg: var(--c-header-bg); --s-text: var(--c-header-text);
  --s-muted: color-mix(in srgb, var(--c-header-text) 65%, var(--c-header-bg));
  --s-line: color-mix(in srgb, var(--c-header-text) 14%, var(--c-header-bg));
  --s-surface: color-mix(in srgb, var(--c-header-text) 6%, var(--c-header-bg));
}
.nav { max-width: 1200px; margin: 0 auto; padding: 12px 5%; display: flex; align-items: center; gap: 20px; }
.logo { font-family: var(--font-head); font-size: 24px; letter-spacing: .28em; color: var(--c-header-text); text-decoration: none; }
.logo.studio-logo, .nav a.logo { font-weight: 600; color: var(--c-header-text); }
.logo.studio-logo { white-space: nowrap; }
/* последняя буква: без хвостового интервала, чтобы черта была ровно под ней */
.logo .accent { font-weight: 900; border-bottom: 3px solid currentColor; letter-spacing: 0; }
.nav ul { display: flex; gap: 22px; list-style: none; margin-left: auto; }
.nav a { color: var(--s-muted); text-decoration: none; font-size: 14px; }
.nav a:hover { color: var(--s-text); }
.nav .btn { padding: 10px 22px; font-size: 14px; color: var(--s-btn-text); white-space: nowrap; }
.nav .btn:hover { color: var(--s-btn-text); }

/* локация / переключатель филиала */
.city-label {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600;
  color: var(--s-muted); white-space: nowrap;
}
.city-label svg { width: 14px; height: 14px; flex: none; }
.city-switch {
  display: flex; background: var(--s-surface); border: 1px solid var(--s-line); border-radius: 30px;
  padding: 4px; gap: 2px; width: max-content;
}
.city-switch button {
  background: none; border: none; color: var(--s-muted); font-size: 13px; font-weight: 600;
  padding: 7px 16px; border-radius: 24px; cursor: pointer; transition: .2s; font-family: inherit;
  white-space: nowrap;
}
.city-switch button.active { background: var(--s-btn-bg); color: var(--s-btn-text); }

/* карточки и сетки */
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--s-surface); border: 1px solid var(--s-line); border-radius: var(--radius); padding: 26px; }
.card h3 { font-size: 19px; margin-bottom: 10px; }
.card p { font-size: 14.5px; color: var(--s-muted); }

/* таблицы (расписание, кабинет) */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 480px; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--s-line); }
th { color: var(--s-muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; }

/* формы */
input, select, textarea {
  width: 100%; padding: 14px 18px; margin-bottom: 14px; background: var(--c-bg);
  border: 1px solid color-mix(in srgb, var(--c-text) 22%, var(--c-bg));
  border-radius: 12px; color: var(--c-text); font-size: 15px; font-family: inherit;
}
input::placeholder { color: color-mix(in srgb, var(--c-text) 45%, var(--c-bg)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--c-accent); }
label.check { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--s-muted); margin-bottom: 14px; }
label.check input { width: auto; margin: 3px 0 0; }
.note { font-size: 12px; color: var(--s-muted); }
.field-error { color: #d92d20; font-size: 12.5px; margin: -10px 0 12px; }
.hp-field { position: absolute; left: -9999px; top: -9999px; }
.msgr-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.msgr-row .btn { padding: 11px 22px; font-size: 14px; }
.thanks h3 { margin-bottom: 8px; }

/* липкая панель CTA на мобильных */
.sticky-cta {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  background: var(--c-header-bg-glass); backdrop-filter: blur(10px);
  border-top: 1px solid color-mix(in srgb, var(--c-header-text) 12%, transparent);
  padding: 10px 12px; gap: 8px;
  --s-bg: var(--c-header-bg); --s-text: var(--c-header-text);
}
.sticky-cta a { flex: 1; text-align: center; padding: 12px 6px; font-size: 13.5px; border-radius: 12px; }

/* ---- подвал: общее (static/site/blocks/footer.css — различия) */
footer.site-footer {
  background: var(--c-footer-bg); color: var(--c-footer-text); font-size: 13px;
  border-top: 1px solid color-mix(in srgb, var(--c-footer-text) 18%, var(--c-footer-bg));
  --s-bg: var(--c-footer-bg); --s-text: var(--c-footer-text);
  --s-muted: color-mix(in srgb, var(--c-footer-text) 80%, var(--c-footer-bg));
  --s-line: color-mix(in srgb, var(--c-footer-text) 18%, var(--c-footer-bg));
}
footer.site-footer .wrap { padding-top: 40px; padding-bottom: 60px; }
footer.site-footer a { color: inherit; }

.legal { max-width: 760px; margin: 40px auto; padding: 0 5% 80px; }
.legal h2 { margin-top: 28px; }
.legal h3 { margin-top: 22px; margin-bottom: 8px; }
.legal p { color: var(--s-muted); margin-bottom: 12px; }

.not-published { min-height: 70vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 20px; }
.not-published h1 { font-size: 24px; margin-bottom: 10px; }

@media (max-width: 900px) {
  .blk { padding: 56px 0; }
  .g3, .g4 { grid-template-columns: 1fr 1fr; }
  .g2 { grid-template-columns: 1fr; }
  .nav ul { display: none; }
  .nav .city-slot { margin-left: auto; }
}
@media (max-width: 700px) {
  .sticky-cta { display: flex; }
  footer.site-footer .wrap { padding-bottom: 100px; }
  .nav > .btn { display: none; }
}
@media (max-width: 560px) {
  .g3, .g4 { grid-template-columns: 1fr; }
  .cta-row .btn { flex: 1 1 100%; }
}
