/* Shared header + footer (Owner refs: doroga_k_hramu / library composition) */

:root {
  --cs-top-drop: 5mm; /* gap above header ribbon + gap header→plaque */
  --cs-top-h: 3.75rem;
}

body.lfm-chrome {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #14110f;
  font-family: "Lato", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 300;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}
body.lfm-chrome > main { flex: 1 0 auto; }

/* Header — solid white/frosted ribbon; scrolls away with the page (all pages) */
.cs-top {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px clamp(16px, 4vw, 36px);
  min-height: var(--cs-top-h);
  box-sizing: border-box;
  background: #fff !important;
  border-bottom: none;
}

/*
  Hero pages — mental model:
  - Hero IMAGE stays fixed in the viewport
  - Header, plaque, body sheet + footer all scroll UP over that image
*/
body.lfm-chrome:has(> .cs-hero--parallax) {
  --cs-sheet: var(--cs-pearl, #f2f6fa);
  --cs-sheet-overlap: clamp(72px, 12vh, 140px);
  /* Extra gap so hero fog/sheet edge clears the plaque */
  --cs-sheet-drop: 20mm;
  /* Transparent so the fixed hero image shows through above the sheet */
  background: transparent;
}
/* Fixed hero artwork + veil — do not scroll */
body.lfm-chrome:has(> .cs-hero--parallax) > .cs-hero--parallax > .cs-hero__parallax,
body.lfm-chrome:has(> .cs-hero--parallax) > .cs-hero--parallax > .cs-hero__veil {
  position: fixed !important;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background-attachment: scroll !important;
  z-index: 0;
  pointer-events: none;
}
body.lfm-chrome:has(> .cs-hero--parallax) > .cs-top {
  position: relative;
  margin-top: var(--cs-top-drop);
  z-index: 3;
  /* Ribbon sits on the fixed hero image, then scrolls away with the page */
}
body.lfm-chrome:has(> .cs-hero--parallax) > .cs-hero--parallax {
  /* Transparent stage over the fixed image; plaque centers in the open band
     (header → sheet fog), not in the zone the sheet will cover */
  margin-top: calc(-1 * (var(--cs-top-h) + var(--cs-top-drop)));
  padding-top: calc(var(--cs-top-h) + var(--cs-top-drop));
  padding-bottom: calc(
    max(0px, var(--cs-sheet-overlap) - var(--cs-sheet-drop)) + clamp(24px, 4vw, 40px)
  );
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  z-index: 1;
  background: transparent !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
body.lfm-chrome:has(> .cs-hero--parallax) > .cs-hero--parallax > .cs-hero__inner {
  position: relative;
  z-index: 2;
  padding-bottom: 16px;
}
/*
  Full-bleed pearl sheet + footer — scrolls over the fixed hero with header/plaque
*/
body.lfm-chrome:has(> .cs-hero--parallax) > .cs-main,
body.lfm-chrome:has(> .cs-hero--parallax) > .cs-auth-shell,
body.lfm-chrome:has(> .cs-hero--parallax) > .site-foot,
body.lfm-chrome:has(> .cs-hero--parallax) > footer.site-foot {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  box-sizing: border-box;
  background-color: var(--cs-sheet);
}
body.lfm-chrome:has(> .cs-hero--parallax) > .cs-main,
body.lfm-chrome:has(> .cs-hero--parallax) > .cs-auth-shell {
  /* Less pull-up (+20mm) → more open hero, fog clears the plaque */
  margin-top: calc(-1 * var(--cs-sheet-overlap) + var(--cs-sheet-drop));
  padding-top: calc(var(--cs-sheet-overlap) + clamp(32px, 5vw, 52px));
  padding-left: max(clamp(16px, 4vw, 28px), calc((100% - var(--cs-max, 740px)) / 2));
  padding-right: max(clamp(16px, 4vw, 28px), calc((100% - var(--cs-max, 740px)) / 2));
  box-shadow:
    0 -24px 40px 10px color-mix(in srgb, var(--cs-sheet) 85%, transparent),
    0 -48px 72px 28px color-mix(in srgb, var(--cs-sheet) 48%, transparent);
}
body.lfm-chrome:has(> .cs-hero--parallax) > .site-foot,
body.lfm-chrome:has(> .cs-hero--parallax) > footer.site-foot {
  /* White footer band under the pearl sheet */
  background-color: #fff !important;
}

.cs-top__brand {
  font-weight: 300;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: #14110f;
  font-size: 0.98rem;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
}
.cs-top__brand span {
  font-weight: 600;
  letter-spacing: 0.04em;
}
.cs-top__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: flex-end;
  font-size: 0.82rem;
}
.cs-top__nav a {
  text-decoration: none;
  color: #6e6860;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.cs-top__nav a:hover,
.cs-top__nav a[aria-current="page"] {
  color: #7a5253;
  font-weight: 600;
}

/* Legal document pages — no hero, plain title */
.legal-wrap {
  width: min(100% - 2.5rem, 42rem);
  margin: 0 auto;
  padding: clamp(36px, 6vw, 64px) 0 72px;
}
/* Same voice as home «Идея школы» (cs-main h2 light-exp) */
.legal-title {
  margin: 0 0 2rem;
  text-align: center;
  color: #14110f;
  font-family: "Lato", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.legal-title__main {
  display: block;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 500; /* thicker than body */
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.55rem;
}
.legal-title__sub {
  display: block;
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: none;
  color: #3f3b36;
}
.legal-body h2 {
  margin: 2rem 0 0.75rem;
  font-family: "Lato", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 500; /* 1. Общие положения, 2. Предмет оферты… */
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
  color: #14110f;
}

/* Thin circle + check — return home (Owner: replace ← На главную) */
.cs-home-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  color: #5c534c;
  text-decoration: none;
  background: transparent;
  border: 0;
  transition: color 0.2s ease, opacity 0.2s ease;
}
.cs-home-check:hover { color: #7a5253; opacity: 0.92; }
.cs-home-check:focus-visible {
  outline: 2px solid #14110f;
  outline-offset: 3px;
  border-radius: 50%;
}
.cs-home-check svg {
  width: 44px;
  height: 44px;
  display: block;
}
.legal-home {
  margin-top: 2.5rem;
}
.legal-body p {
  margin: 0 0 1rem;
  font-size: 1.02rem;
  font-weight: 400;
  color: #2c2622;
}
.legal-body .legal-lead {
  font-weight: 400;
  margin-bottom: 1.5rem;
}

/* Footer — brand | menu | socials (fixed columns, no overlap) */
.site-foot {
  margin-top: auto;
  background: #fff !important;
  border-top: none;
  padding: clamp(36px, 5vw, 56px) clamp(16px, 4vw, 36px) 28px;
  color: #5c534c;
  font-size: 0.95rem;
}
.site-foot__grid {
  display: grid;
  grid-template-columns: minmax(12rem, 1.4fr) 1fr 1fr;
  gap: 28px 40px;
  max-width: 1100px;
  margin: 0 auto 28px;
  align-items: start;
}
.site-foot__brand {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.site-foot__brand-name {
  text-decoration: none;
  color: #14110f;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.95rem;
}
.site-foot__brand-name span { font-weight: 600; }
.site-foot__brand a.mail {
  color: #8a3f1c;
  text-decoration: none;
  font-weight: 400;
}
.site-foot__brand a.mail:hover { text-decoration: underline; }
.site-foot__col h3 {
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  color: #8a8278;
}
.site-foot__col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.site-foot__col a {
  color: #8a3f1c;
  text-decoration: none;
  font-weight: 400;
}
.site-foot__col a:hover { text-decoration: underline; }
.site-foot__bottom {
  max-width: 1100px;
  margin: 0 auto;
  padding-top: 18px;
  border-top: 1px solid #e0dbd3;
  display: flex;
  flex-wrap: nowrap;
  align-items: center; /* desktop: legal line + © on one baseline */
  justify-content: space-between;
  gap: 12px 28px;
  font-size: 0.88rem;
  color: #8a8278;
}
.site-foot__accept {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.45;
}
.site-foot__accept a {
  color: #8a3f1c;
  text-decoration: none;
}
.site-foot__accept a:hover { text-decoration: underline; }
.site-foot__copy {
  margin: 0;
  flex: 0 0 auto;
  white-space: nowrap;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .site-foot__grid { grid-template-columns: 1fr; gap: 22px; }
  .cs-top { flex-direction: column; align-items: flex-start; }
  .site-foot__bottom {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .site-foot__copy { white-space: normal; }
}
