/* Bagmutskiy — public offer
   Formal contract document 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;
}

html:has(body.bagmutskiy-terms) {
  overflow-x: visible;
}

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

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

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

.offer {
  --paper: #f4f2ee;
  --paper-2: #ece9e3;
  --ink: #1a1916;
  --muted: #5c5a55;
  --line: #d9d4cb;
  --accent: #1a3a32;
  --header-offset: 7.5rem;
  --measure: 40.5rem;
  --num: 3.1rem;
  counter-reset: offer-sec;
  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.6;
  padding: 1.75rem 0 5.5rem;
  overflow-wrap: break-word;
}

.offer :where(h1, h2, h3, p, ul, ol, dl, pre, nav) {
  margin: 0;
}

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

.offer a:hover {
  color: #12291f;
}

.offer a:focus-visible,
.offer button:focus-visible,
.offer summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.offer-layout {
  display: grid;
  grid-template-columns: 13.25rem minmax(0, var(--measure));
  grid-template-areas:
    "toc mast"
    "toc intro"
    "toc rest";
  column-gap: 3.5rem;
  row-gap: 1.35rem;
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.offer-toc-desktop {
  grid-area: toc;
}

.offer-toc-mobile {
  display: none;
}

.offer-mast {
  grid-area: mast;
}

.offer-intro {
  grid-area: intro;
}

.offer-doc {
  grid-area: rest;
}

.offer-toc {
  position: sticky;
  top: calc(var(--header-offset) + 12px);
  align-self: start;
  z-index: 2;
  font-size: 0.8125rem;
  line-height: 1.35;
  max-height: calc(100vh - var(--header-offset) - 2rem);
  overflow: auto;
}

.offer-toc-label {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.offer-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 1px solid var(--line);
}

.offer-toc a {
  display: block;
  padding: 0.22rem 0 0.22rem 0.8rem;
  color: var(--muted);
  text-decoration: none;
  box-shadow: inset 2px 0 0 transparent;
}

.offer-toc a:hover,
.offer-toc a[aria-current="true"] {
  color: var(--ink);
  box-shadow: inset 2px 0 0 var(--ink);
}

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

.offer-mast h1 {
  font-size: clamp(1.65rem, 2.6vw, 2.05rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.offer-party {
  margin-top: 0.65rem;
  color: var(--ink);
  font-size: 1.02rem;
}

.offer-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem 1.25rem;
  margin-top: 1.15rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

.offer-meta div {
  min-width: 0;
}

.offer-meta dt {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.offer-meta dd {
  margin-top: 0.15rem;
  font-weight: 600;
}

.offer-plain {
  margin-top: 1rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.offer-intro p + p {
  margin-top: 0.75rem;
}

.offer-note {
  margin-top: 1rem;
  padding: 0.8rem 0 0.15rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.offer-section {
  counter-increment: offer-sec;
  margin-top: 2.35rem;
  padding-top: 0.15rem;
}

.offer-section[id],
.offer-mast,
.offer-intro,
.offer #contact {
  scroll-margin-top: calc(var(--header-offset) + 14px);
}

.offer-section:target > h2 {
  box-shadow: inset 0 -2px 0 var(--ink);
}

.offer h1,
.offer h2,
.offer h3 {
  color: var(--ink);
}

.offer-section > h2 {
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 0.95rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
}

.offer-section > h2::before {
  content: counter(offer-sec) ".\00a0";
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.offer h3 {
  font-size: 0.98rem;
  font-weight: 600;
  margin: 1.15rem 0 0.4rem;
}

.offer-section .clauses {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: offer-cl;
}

.offer-section .clauses > li {
  counter-increment: offer-cl;
  position: relative;
  padding-left: var(--num);
  margin-top: 0.85rem;
}

.offer-section .clauses > li:first-child {
  margin-top: 0;
}

.offer-section .clauses > li::before {
  content: counter(offer-sec) "." counter(offer-cl);
  position: absolute;
  left: 0;
  top: 0;
  width: calc(var(--num) - 0.55rem);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem;
  line-height: 1.6;
}

.offer-section .clauses > li > p + p,
.offer-section .clauses > li > ul,
.offer-section .clauses > li > ol {
  margin-top: 0.55rem;
}

.offer-section .clauses ul,
.offer-section .clauses ol.sub {
  padding-left: 1.15rem;
}

.offer-section .clauses li + li {
  margin-top: 0.35rem;
}

.offer-section .clauses ul > li {
  padding-left: 0;
}

.offer-section .clauses ul > li::before {
  content: none;
}

.offer dt {
  font-weight: 600;
}

.offer dd {
  margin: 0.15rem 0 0.7rem;
}

.offer-defs {
  margin-top: 0.35rem;
}

.offer-defs > div + div {
  margin-top: 0.65rem;
}

.offer-defs dt {
  font-weight: 600;
}

.offer-defs dd {
  margin: 0.1rem 0 0;
  color: var(--ink);
}

.requisites {
  margin-top: 0.7rem;
  padding: 1rem 1rem 1.1rem;
  background: #fffdf9;
  border: 1px solid var(--line);
}

.requisites-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.copy-btn {
  appearance: none;
  border: 1px solid var(--ink);
  background: #fffdf9;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  min-height: 44px;
}

.copy-btn:hover {
  background: var(--ink);
  color: #fffdf9;
}

.copy-btn:active {
  transform: translateY(1px);
}

.copy-btn.is-copied {
  background: var(--ink);
  color: #fffdf9;
}

.copy-status {
  font-size: 0.85rem;
  color: var(--muted);
}

.requisites-text {
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

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

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

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

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

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

.offer-contact {
  margin-top: 2.75rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}

.offer-section.offer-related {
  counter-increment: none;
}

.offer-section.offer-related > h2 {
  border-bottom: 0;
  padding-bottom: 0;
}

.offer-related > h2::before,
.offer-contact h2::before {
  content: none;
}

.offer-contact h2 {
  font-size: 1.18rem;
  font-weight: 600;
  margin-bottom: 0.55rem;
  border: 0;
  padding: 0;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
  margin-top: 0.7rem;
}

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

@media (max-width: 900px) {
  .offer-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "mast"
      "toc"
      "intro"
      "rest";
    max-width: 42rem;
    row-gap: 1.15rem;
  }

  .offer-toc-desktop {
    display: none;
  }

  .offer-toc-mobile {
    display: block;
    grid-area: toc;
    position: static;
    max-height: none;
    overflow: visible;
  }

  .offer-toc-mobile details {
    border: 1px solid var(--line);
    background: #fffdf9;
  }

  .offer-toc-mobile summary {
    cursor: pointer;
    list-style: none;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1rem;
    font-weight: 600;
    font-size: 0.95rem;
  }

  .offer-toc-mobile summary::-webkit-details-marker {
    display: none;
  }

  .offer-toc-mobile summary::after {
    content: "";
    width: 0.45rem;
    height: 0.45rem;
    border-right: 1.5px solid var(--ink);
    border-bottom: 1.5px solid var(--ink);
    transform: rotate(45deg);
    margin-top: -0.2rem;
  }

  .offer-toc-mobile details[open] summary::after {
    transform: rotate(-135deg);
    margin-top: 0.15rem;
  }

  .offer-toc-mobile ol {
    border-left: 0;
    padding: 0 0.85rem 0.85rem;
  }

  .offer-toc-mobile a {
    padding: 0.38rem 0.35rem;
    min-height: 40px;
    display: flex;
    align-items: center;
    box-shadow: none;
  }

  .offer-toc-mobile a:hover,
  .offer-toc-mobile a[aria-current="true"] {
    box-shadow: none;
    color: var(--ink);
    text-decoration: underline;
  }

  .offer-meta {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }

  .offer-section[id],
  .offer-mast,
  .offer-intro,
  .offer #contact {
    scroll-margin-top: calc(var(--header-offset) + 12px);
  }
}

@media (max-width: 430px) {
  .offer-toc-mobile details {
    margin-right: 3.25rem;
  }
}

@media (max-width: 720px) {
  .offer {
    --header-offset: 6.5rem;
    --num: 2.7rem;
    font-size: 1rem;
    line-height: 1.58;
    padding: 1.25rem 0 calc(6.25rem + env(safe-area-inset-bottom, 0px));
  }

  .offer-section .clauses > li::before {
    font-size: 0.88rem;
  }

  .requisites {
    padding: 0.85rem;
  }
}

@media (max-width: 360px) {
  .offer {
    --num: 2.45rem;
    font-size: 0.98rem;
  }

  .offer-layout {
    padding: 0 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .copy-btn:active {
    transform: none;
  }

  html {
    scroll-behavior: auto;
  }
}

@media print {
  .offer-toc,
  .copy-btn,
  .copy-status,
  .requisites-toolbar {
    display: none !important;
  }

  body.bagmutskiy-terms header,
  body.bagmutskiy-terms #masthead,
  body.bagmutskiy-terms footer,
  body.bagmutskiy-terms #colophon,
  body.bagmutskiy-terms .elementor-location-header,
  body.bagmutskiy-terms .elementor-location-footer,
  body.bagmutskiy-terms .ast-desktop-header-wrap,
  body.bagmutskiy-terms .ast-mobile-header-wrap,
  body.bagmutskiy-terms .ast-header-break-point,
  body.bagmutskiy-terms a:has(img[alt="chat"]),
  body.bagmutskiy-terms img[alt="chat"] {
    display: none !important;
  }

  .offer {
    padding: 0;
    overflow: visible;
    background: #fff;
    color: #000;
    font-size: 11pt;
    line-height: 1.45;
  }

  .offer-meta dt,
  .offer-plain,
  .docs span,
  .offer-kicker,
  .offer-toc-label {
    color: #000;
  }

  .offer-layout {
    display: block;
    max-width: none;
    padding: 0;
  }

  .offer a {
    color: #000;
    text-decoration: none;
  }

  .offer-section {
    break-inside: auto;
    margin-top: 1.4rem;
  }

  .offer-section > h2 {
    break-after: avoid;
    break-inside: avoid;
  }

  .offer-section .clauses > li {
    break-inside: avoid;
  }

  .offer-meta,
  .offer-mast,
  .offer-intro,
  .requisites {
    break-inside: avoid;
  }

  .offer-contact {
    break-inside: avoid;
  }

  .requisites {
    background: transparent;
    border-color: #ccc;
  }
}
