/* Bagmutskiy — business identity / legal document hub
   Informational page inside the live site chrome. */

.bagmutskiy-terms .entry-header,
.bagmutskiy-terms-main .entry-header {
  display: none;
}

body.bagmutskiy-terms,
body.bagmutskiy-terms #page,
body.bagmutskiy-terms #content,
body.bagmutskiy-terms #primary,
body.bagmutskiy-terms .site-main,
body.bagmutskiy-terms .ast-container {
  background: #f4f2ee;
}

/* Inherited system-page pattern: keep overflow visible so sticky
   theme chrome is not clipped. Do not set overflow-x: hidden here. */
html:has(body.bagmutskiy-terms) {
  overflow-x: visible;
}

body.bagmutskiy-terms {
  overflow-x: visible;
}

body.bagmutskiy-terms footer,
body.bagmutskiy-terms #colophon {
  overflow-x: clip;
}

.bagmutskiy-terms #primary,
.bagmutskiy-terms-main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.legal-hub {
  --paper: #f4f2ee;
  --paper-2: #ece9e3;
  --ink: #1a1916;
  --muted: #5c5a55;
  --line: #d9d4cb;
  --accent: #1a3a32;
  --measure: 48rem;
  background: var(--paper);
  color: var(--ink);
  font-family: "Graphik Compact", "Source Sans 3", system-ui, -apple-system, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  padding: 1.75rem 0 3.5rem;
  overflow-wrap: break-word;
}

.legal-hub *,
.legal-hub *::before,
.legal-hub *::after {
  box-sizing: border-box;
}

.legal-hub :where(h1, h2, p, ul, dl) {
  margin: 0;
}

.legal-hub a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.legal-hub a:hover {
  color: #12291f;
}

.legal-hub a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.legal-hero,
.legal-section {
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
  padding: 0 1.25rem;
}

.legal-kicker {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.7rem;
}

.legal-hero h1 {
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.legal-lead {
  margin-top: 0.85rem;
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 1.4;
}

.legal-section {
  margin-top: 2.4rem;
}

.legal-hub h2 {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.85rem;
}

.legal-section p + p {
  margin-top: 0.7rem;
}

.legal-facts {
  display: grid;
  border-top: 1px solid var(--line);
}

.legal-facts > div {
  display: grid;
  grid-template-columns: 12.5rem minmax(0, 1fr);
  gap: 0.45rem 1.25rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}

.legal-facts dt,
.legal-facts dd {
  margin: 0;
}

.legal-facts dt {
  color: var(--muted);
  font-weight: 400;
}

.legal-facts dd {
  font-weight: 600;
  min-width: 0;
}

.legal-facts .legal-prose {
  font-weight: 400;
}

.legal-id {
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.legal-address {
  display: block;
}

.legal-note {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 400;
}

.legal-bank-route {
  margin-top: 0.85rem;
}

.legal-bank-route a {
  font-weight: 600;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.legal-bank-route a:hover {
  text-decoration: underline;
}

.legal-docs {
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--line);
}

.legal-docs li {
  display: grid;
  gap: 0.15rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
  margin: 0;
}

.legal-docs a {
  font-weight: 600;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.legal-docs a:hover {
  text-decoration: underline;
}

.legal-docs span {
  color: var(--muted);
  font-size: 0.95rem;
}

.legal-contact {
  margin-top: 2.6rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.legal-contact a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

@media (max-width: 720px) {
  .legal-hub {
    font-size: 1rem;
    padding: 1.4rem 0 calc(3.25rem + env(safe-area-inset-bottom, 0px));
  }

  .legal-facts > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.15rem;
  }

  .legal-lead {
    font-size: 1.08rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media print {
  body.bagmutskiy-terms > header,
  body.bagmutskiy-terms .site-header,
  body.bagmutskiy-terms #masthead,
  body.bagmutskiy-terms .elementor-location-header,
  body.bagmutskiy-terms footer,
  body.bagmutskiy-terms #colophon,
  body.bagmutskiy-terms .elementor-location-footer,
  body.bagmutskiy-terms .b24-widget-button,
  .preview-header,
  .preview-footer,
  .preview-chat {
    display: none !important;
  }

  .legal-hub {
    padding: 0;
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  .legal-hub a {
    color: #000;
  }

  .legal-docs a,
  .legal-bank-route a,
  .legal-contact a {
    display: inline;
    min-height: 0;
    align-items: unset;
  }

  .legal-docs a[href]::after,
  .legal-bank-route a[href]::after,
  .legal-contact a[href^="http"]::after {
    content: " — " attr(href);
    font-weight: 400;
    font-size: 0.85em;
    color: #333;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .legal-kicker {
    text-transform: none;
    letter-spacing: 0;
  }
}
