/* ── Цвета и размеры ───────────────────────────────── */
:root {
  --bg: #f7f4ef;
  --bg-alt: #efeae1;
  --card: #fffdf9;
  --blue: #1d5fae;
  --blue-dark: #154a8a;
  --blue-soft: #e6eefa;
  --gold: #c9973a;
  --ink: #1a1a2e;
  --ink-mid: #3a3a52;
  --ink-soft: #6b6b80;
  --border: #dcd6ca;
  --open: #2f8a5b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(26,26,46,.05), 0 8px 24px rgba(26,26,46,.06);
  --max: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12141c;
    --bg-alt: #181b25;
    --card: #1e2230;
    --blue: #6aa3ea;
    --blue-dark: #8fbaf0;
    --blue-soft: #1f2d45;
    --gold: #e0b45c;
    --ink: #eceaf2;
    --ink-mid: #c6c4d2;
    --ink-soft: #9593a6;
    --border: #2e3344;
    --open: #5cc08b;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  }
}

/* ── База ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Golos Text', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); }
img, svg { display: block; }
[hidden] { display: none !important; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--ink-soft); }
.small { font-size: .88rem; }

h2 {
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
}
h2::after {
  content: '';
  display: block;
  width: 48px; height: 3px;
  margin-top: 10px;
  background: var(--gold);
  border-radius: 2px;
}
h3 { font-family: 'Lora', Georgia, serif; font-size: 1.2rem; margin-bottom: 8px; }

.section { padding: 64px 0; }
.section-alt { background: var(--bg-alt); }
.lead { color: var(--ink-mid); margin: 14px 0 28px; max-width: 640px; }

/* ── Верхняя панель ────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Lora', serif; font-weight: 700; font-size: 1.1rem;
  color: var(--ink); text-decoration: none;
}
.menu { display: flex; gap: 4px; list-style: none; }
.menu a {
  display: block; padding: 8px 12px; border-radius: 8px;
  color: var(--ink-mid); text-decoration: none; font-size: .95rem; font-weight: 500;
}
.menu a:hover { background: var(--blue-soft); color: var(--blue); }
.menu-btn { display: none; }

@media (max-width: 820px) {
  .menu-btn {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; background: none; border: 0; cursor: pointer;
  }
  .menu-btn span { display: block; height: 2px; width: 24px; margin: 0 auto; background: var(--ink); border-radius: 2px; transition: .2s; }
  .menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .menu {
    position: absolute; top: 60px; left: 0; right: 0;
    flex-direction: column; padding: 8px 20px 16px;
    background: var(--bg); border-bottom: 1px solid var(--border);
    display: none;
  }
  .menu.open { display: flex; }
  .menu a { padding: 12px; font-size: 1.05rem; }
}

/* ── Шапка ─────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, #1d5fae 0%, #154a8a 60%, #10396b 100%);
  color: #fff; text-align: center;
  padding: 56px 0 64px;
}
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cpolygon points='40,8 72,68 8,68' fill='none' stroke='%23ffffff' stroke-width='1' opacity='0.07'/%3E%3C/svg%3E");
  background-size: 80px 80px;
}
.hero-inner { position: relative; display: flex; flex-direction: column; align-items: center; }
.emblem { width: 120px; height: 120px; margin-bottom: 20px; filter: drop-shadow(0 4px 12px rgba(0,0,0,.25)); }
.hero h1 { font-family: 'Lora', serif; font-size: clamp(1.7rem, 5vw, 2.6rem); line-height: 1.2; max-width: 720px; }
.tagline { margin-top: 12px; font-style: italic; opacity: .85; font-size: 1.05rem; }

.next-card {
  margin-top: 32px; width: 100%; max-width: 520px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: var(--radius);
  padding: 18px 22px;
  display: flex; align-items: center; gap: 18px; text-align: left;
  backdrop-filter: blur(4px);
}
.next-card:empty { display: none; }
.next-time {
  font-family: 'Lora', serif; font-size: 2rem; font-weight: 700; line-height: 1;
  padding-right: 18px; border-right: 1px solid rgba(255,255,255,.25);
}
.next-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; opacity: .75; }
.next-day { font-weight: 600; font-size: 1.05rem; }
.next-topic { opacity: .9; font-size: .95rem; }
.live {
  display: inline-block; padding: 2px 8px; margin-left: 6px; border-radius: 20px;
  background: #e8b04a; color: #1a1a2e; font-size: .72rem; font-weight: 600; vertical-align: middle;
}

/* ── Неделя (бар расписания) ───────────────────────── */
.week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}
.day {
  position: relative;
  display: flex; flex-direction: column;
  min-height: 210px;
  padding: 16px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.day:not(.off):hover { transform: translateY(-3px); }
.day-name { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }
.day-full { font-family: 'Lora', serif; font-weight: 600; font-size: 1.05rem; color: var(--ink); }
.day-time {
  margin: 14px 0 8px;
  font-family: 'Lora', serif; font-size: 1.9rem; font-weight: 700; color: var(--blue); line-height: 1;
}
.day-topic { font-weight: 600; font-size: .95rem; line-height: 1.35; color: var(--ink); }
.day-note { margin-top: 6px; font-size: .84rem; color: var(--ink-soft); line-height: 1.4; }
.day-tags { margin-top: auto; padding-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  padding: 3px 8px; border-radius: 20px;
}
.tag-today { background: var(--blue); color: #fff; }
.tag-open { background: color-mix(in srgb, var(--open) 15%, transparent); color: var(--open); }
.tag-live { background: #e8b04a; color: #1a1a2e; }

.day.today { border: 2px solid var(--blue); background: var(--blue-soft); }
.day.off { background: transparent; box-shadow: none; border-style: dashed; justify-content: center; align-items: center; text-align: center; min-height: 0; }
.day.off .day-off-text { margin-top: 8px; font-size: .85rem; color: var(--ink-soft); }
.day.off.today { border-color: var(--blue); }

.legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 18px; font-size: .88rem; color: var(--ink-soft); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-today { background: var(--blue); }
.dot-open { background: var(--open); }

@media (max-width: 900px) {
  .week { grid-template-columns: 1fr; gap: 8px; }
  .day {
    min-height: 0; display: grid; grid-template-columns: 1fr auto;
    align-items: center; gap: 8px 14px; padding: 14px 16px;
  }
  .day-head { display: flex; align-items: baseline; gap: 10px; }
  .day-time { margin: 0; font-size: 1.6rem; text-align: right; }
  .day-body, .day-tags { grid-column: 1 / -1; }
  .day-tags { margin: 0; padding: 0; }
  .day-tags:empty { display: none; }
  .day.off { padding: 10px 16px; }
  .day.off .day-off-text { margin: 0; text-align: right; }
}
@media (min-width: 901px) { .day-head, .day-body { display: contents; } }

/* ── Что такое АА ──────────────────────────────────── */
.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 36px; margin: 28px 0 32px; }
.about-text p { color: var(--ink-mid); margin-bottom: 14px; }
.about-text strong { color: var(--ink); }
.facts { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.facts li {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.facts b { display: block; font-family: 'Lora', serif; color: var(--blue); font-size: 1.05rem; margin-bottom: 4px; }
.facts span { font-size: .9rem; color: var(--ink-mid); line-height: 1.45; display: block; }
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .facts { grid-template-columns: 1fr; } }

.faq {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  margin-top: 10px; padding: 0 20px;
}
.faq summary {
  cursor: pointer; list-style: none; padding: 16px 0; font-weight: 600;
  display: flex; justify-content: space-between; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 1.4rem; line-height: 1; color: var(--blue); transition: transform .2s; }
.faq[open] summary::after { transform: rotate(45deg); }
.faq p { padding: 0 0 18px; color: var(--ink-mid); }

/* ── Размышление дня ───────────────────────────────── */
.reflection {
  position: relative;
  margin: 28px 0 16px;
  max-width: 760px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 32px 32px;
  overflow: hidden;
}
.reflection::before {
  content: '“'; position: absolute; right: 22px; top: -18px;
  font-family: 'Lora', serif; font-size: 9rem; color: var(--gold); opacity: .18; line-height: 1;
}
.reflection-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.reflection-head time { font-weight: 600; color: var(--blue); min-width: 0; }
.reflection-head time::first-letter { text-transform: uppercase; }
.nav-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border); background: transparent; color: var(--ink-mid);
  font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.nav-btn:hover { border-color: var(--blue); color: var(--blue); }
.reflection-slogan { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--gold); font-weight: 600; }
.reflection h3 { font-size: 1.6rem; margin: 4px 0 12px; }
.reflection-text { font-family: 'Lora', serif; font-size: 1.15rem; line-height: 1.7; color: var(--ink-mid); font-style: italic; }
.link-btn { margin-top: 16px; background: none; border: 0; color: var(--blue); font: inherit; text-decoration: underline; cursor: pointer; }
@media (max-width: 520px) { .reflection { padding: 22px 20px 26px; } }

/* ── Контакты ──────────────────────────────────────── */
.contacts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-top: 28px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px;
}
.card .btn, .card .btn-row { margin-top: auto; }
.card-accent { border-top: 4px solid var(--gold); }
.big { font-size: 1.1rem; font-weight: 600; }
.phone { font-family: 'Lora', serif; font-size: 1.35rem; font-weight: 700; text-decoration: none; color: var(--blue); }
.phone:hover { text-decoration: underline; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 900px) { .contacts-grid { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 20px; border-radius: 10px;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s;
  align-self: flex-start;
}
.btn-primary { background: var(--blue); color: #fff; border: 2px solid var(--blue); }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn-outline { background: transparent; color: var(--blue); border: 2px solid var(--blue); }
.btn-outline:hover { background: var(--blue); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-primary { color: #0f1a2c; } }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Ссылки ────────────────────────────────────────── */
.links-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-top: 28px; }
.link-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 22px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow);
  text-decoration: none; color: var(--ink);
  transition: transform .2s, border-color .2s;
}
.link-card:hover { transform: translateY(-3px); border-color: var(--blue); }
.link-card b { font-family: 'Lora', serif; font-size: 1.15rem; }
.link-card span { color: var(--ink-mid); font-size: .92rem; line-height: 1.45; }
.link-card em { margin-top: auto; padding-top: 8px; font-style: normal; color: var(--blue); font-weight: 600; font-size: .9rem; }

/* ── Подвал ────────────────────────────────────────── */
.footer { padding: 48px 0 56px; text-align: center; border-top: 1px solid var(--border); }
.footer-motto { font-family: 'Lora', serif; font-style: italic; color: var(--ink-mid); max-width: 640px; margin: 0 auto 14px; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ── Обновление: темы, бар, карта, ежедневник ─────── */
.hero-contact { margin-top: 16px; font-size: .95rem; opacity: .9; }
.hero-contact a { color: #fff; font-weight: 600; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.4); }

.open-banner {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 20px; margin-bottom: 18px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--open) 12%, var(--card));
  border: 1px solid color-mix(in srgb, var(--open) 35%, transparent);
  color: var(--ink-mid);
}
.open-banner .icon { color: var(--open); width: 26px; height: 26px; margin-top: 2px; }
.open-banner b { color: var(--ink); }

.themes { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 36px; }
.theme {
  padding: 16px; border-radius: var(--radius); background: var(--card);
  border: 1px solid var(--border); border-left: 4px solid var(--blue); box-shadow: var(--shadow);
}
.theme-gold { border-left-color: var(--gold); }
.theme b { display: block; font-family: 'Lora', serif; font-size: 1.05rem; margin-bottom: 4px; }
.theme span { display: block; font-size: .88rem; color: var(--ink-mid); line-height: 1.45; }
@media (max-width: 480px) { .themes { grid-template-columns: 1fr; } }

.week-title { margin-bottom: 14px; }
.day-date { font-size: .82rem; color: var(--ink-soft); }
.day.today .day-name { color: var(--blue); }
.day.past { opacity: .55; }
.day.special { border-top: 4px solid var(--gold); }
.day.special .day-topic { color: var(--gold); }
.tag-special { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); }
.tag-past { background: var(--border); color: var(--ink-soft); }
.dot-special { background: var(--gold); }
@media (max-width: 900px) {
  .day-head { flex-wrap: wrap; }
  .day-date { width: 100%; margin-top: -2px; }
}

.map-wrap { position: relative; margin-top: 16px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); }
.map { height: 380px; background: var(--bg-alt); }
.map-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; text-align: center; color: var(--ink-soft); }
.map-wrap.loaded .map-fallback { display: none; }
@media (max-width: 600px) { .map { height: 300px; } }
.aa-marker { background: none; border: 0; }
.aa-pin {
  width: 56px; height: 56px; margin: 0 auto; padding: 4px;
  background: #fff; border: 3px solid #d9452b; border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0,0,0,.3); position: relative;
}
.aa-pin::after {
  content: ''; position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%);
  border: 8px solid transparent; border-top: 10px solid #d9452b;
}
.aa-pin img { width: 100%; height: 100%; }
.aa-pin-label {
  position: absolute; left: 50%; top: 82px; transform: translateX(-50%); white-space: nowrap;
  font: 600 13px 'Golos Text', sans-serif; color: #b8361f; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff;
}
.leaflet-container { font-family: 'Golos Text', sans-serif; }

.reflection-quote {
  margin: 4px 0 18px; padding: 14px 18px;
  border-left: 3px solid var(--gold); background: color-mix(in srgb, var(--gold) 8%, transparent);
  border-radius: 0 10px 10px 0;
}
.reflection-quote p { font-family: 'Lora', serif; font-style: italic; color: var(--ink); }
.reflection-quote cite { display: block; margin-top: 6px; font-style: normal; font-size: .85rem; color: var(--ink-soft); }
.reflection-text p + p { margin-top: 12px; }
.reflection-read { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 22px; padding-top: 20px; border-top: 1px dashed var(--border); }
.reflection-quote cite { white-space: pre-line; }

/* Кнопки чатов — одинаковой ширины */
.chat-btns { width: 100%; }
.chat-btns .btn { flex: 1 1 0; min-width: 120px; align-self: stretch; }

/* Статичное расписание (до запуска скрипта) */
.week-static { grid-column: 1 / -1; list-style: none; display: grid; gap: 6px; color: var(--ink-mid); }
