/* «Помощь» — the studio's help page: a long reading page in the blog brand.
   Tokens, header, footer, request buttons and the FAQ rows come from ../style.css.
   Lime stays the caret, the main request button and focus; everything here is type, 1px rules and greys. */

.top-link[aria-current="page"] { color: var(--fg); }

/* page head */
.help-head { padding: 36px var(--gutter) 0; }
.help-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin: -10px 0 10px; font-size: 15px; font-weight: 600; color: var(--fg-2); text-decoration: none; }
.help-back svg { width: 20px; height: 20px; }
.help-back:hover { color: var(--fg); }
.help-head h1 { margin: 0; max-width: 13ch; font-size: 42px; line-height: .98; font-weight: 900; letter-spacing: -.04em; text-wrap: balance; }
.help-head .lead { margin-top: 14px; max-width: 44ch; }
.help-date { margin: 12px 0 0; font-size: 14px; color: var(--muted); }

.help { padding: 0 var(--gutter); }

/* table of contents: a collapsed <details> on phones, a sticky open column on wide screens (help.js) */
.toc { margin-top: 28px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.toc summary { position: relative; list-style: none; padding: 16px 36px 16px 0; cursor: pointer; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::before, .toc summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 14px; height: 2px; background: var(--fg-2); transition: transform .3s var(--ease); }
.toc summary::after { transform: rotate(90deg); }
.toc details[open] summary::after { transform: rotate(0); }
.toc ol { list-style: none; counter-reset: toc; margin: 0; padding: 0 0 14px; }
.toc li { counter-increment: toc; }
.toc a { display: grid; grid-template-columns: 30px 1fr; padding: 7px 0; font-size: 16px; line-height: 1.3; color: var(--fg-2); text-decoration: none; transition: color .2s var(--ease); }
.toc a::before { content: counter(toc); font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.toc a:hover, .toc a[aria-current] { color: var(--fg); }
.toc a[aria-current] { font-weight: 600; }
.toc a[aria-current]::before { color: var(--fg); }

/* sections */
.help-body { min-width: 0; }
.hs { padding: 44px 0 28px; border-top: 1px solid var(--rule); }
.help-body > .hs:first-child { border-top: 0; padding-top: 32px; }
.hs h2 { margin: 0; max-width: 24ch; font-size: 30px; line-height: 1.05; font-weight: 900; letter-spacing: -.035em; text-wrap: balance; }
.hs .sub { margin: 40px 0 0; font-size: 21px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; text-wrap: balance; }
.hs > p { margin: 14px 0 0; max-width: 68ch; color: var(--fg-2); line-height: 1.6; text-wrap: pretty; }
.hs .sub + p { margin-top: 8px; }
.hs b { color: var(--fg); font-weight: 700; }
.hs .btn b { color: inherit; } /* the lime «Спросить в Telegram» keeps its dark title, not warm white on lime */

/* links inside the reading text; outside links carry a small arrow (they open a new tab) */
.help-body a:not(.btn):not(.hash) { color: var(--fg); text-decoration-color: #55555d; text-decoration-thickness: 1px; text-underline-offset: 3px; transition: text-decoration-color .2s var(--ease); }
.help-body a:not(.btn):not(.hash):hover { text-decoration-color: var(--fg); }
.help-body a[target="_blank"]:not(.btn)::after { content: "↗"; display: inline-block; margin-left: 2px; font-size: .78em; color: var(--muted); text-decoration: none; }

/* a «#» link to each section, shown on hover where there is a pointer */
.hash { margin-left: 6px; color: var(--muted); font-weight: 700; text-decoration: none; opacity: 0; transition: opacity .2s var(--ease); }
.hs h2:hover .hash, .hash:focus-visible { opacity: 1; }
@media (hover: none) { .hash { display: none; } }

/* what a site needs */
.basics { margin: 20px 0 0; max-width: 860px; }
.basics div { padding: 14px 0; border-top: 1px solid var(--rule); }
.basics dt { font-size: 19px; font-weight: 800; letter-spacing: -.015em; }
.basics dd { margin: 4px 0 0; max-width: 52ch; color: var(--fg-2); text-wrap: pretty; }
.hs > .note { margin: 22px 0 0; max-width: 68ch; padding: 14px 16px; border-radius: 14px; background: var(--bg-2); font-size: 16px; line-height: 1.5; }

/* numbered steps */
.howto { list-style: none; counter-reset: st; display: grid; gap: 14px; max-width: 68ch; margin: 18px 0 0; padding: 0; }
.hs .sub + .howto { margin-top: 12px; }
.howto li { counter-increment: st; position: relative; padding-left: 36px; color: var(--fg-2); line-height: 1.6; text-wrap: pretty; }
.howto li::before { content: counter(st); position: absolute; left: 0; top: -2px; font-size: 22px; line-height: 1.25; font-weight: 900; letter-spacing: -.04em; color: var(--muted); font-variant-numeric: tabular-nums; }

/* where the site lives: four options */
.opts { list-style: none; display: grid; max-width: 860px; margin: 20px 0 0; padding: 0; }
.opts li { padding: 18px 0; border-top: 1px solid var(--rule); }
.opts h3 { margin: 0; font-size: 19px; line-height: 1.25; font-weight: 800; letter-spacing: -.015em; }
.opt-cost { margin: 4px 0 0; font-weight: 600; color: var(--fg); font-variant-numeric: tabular-nums; }
.opts p:last-child { margin: 8px 0 0; max-width: 60ch; color: var(--fg-2); line-height: 1.55; text-wrap: pretty; }

/* tables: a ruled table on wide screens, one stacked card per row on phones */
.tbl { width: 100%; margin: 16px 0 0; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.tbl thead th { padding: 0 16px 10px 0; text-align: left; vertical-align: bottom; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; border-bottom: 1px solid var(--rule); }
.tbl tbody th, .tbl td { padding: 12px 16px 12px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.tbl tr > :last-child { padding-right: 0; }
.tbl tbody th { font-size: 16px; font-weight: 700; color: var(--fg); }
.tbl tbody th small { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; color: var(--muted); }
.tbl .num { color: var(--fg); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl .txt { color: var(--fg-2); text-wrap: pretty; }
.tbl .zone { font-weight: 800; color: var(--fg); white-space: nowrap; }
.tbl .grp td { padding: 22px 0 8px; font-size: 14px; font-weight: 700; color: var(--fg); }
.tbl-cost tbody th { width: 30%; }
.tbl-dom tbody th, .tbl-host tbody th, .tbl-mail tbody th, .tbl-vps tbody th { width: 26%; }

/* yearly totals */
.totals { list-style: none; display: grid; max-width: 860px; margin: 14px 0 0; padding: 0; }
.totals li { display: grid; gap: 4px; padding: 18px 0; border-top: 1px solid var(--rule); }
.total-name { font-size: 16px; font-weight: 700; color: var(--fg-2); }
.total-sum { font-size: 28px; line-height: 1.05; font-weight: 900; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.total-what { max-width: 52ch; font-size: 15px; line-height: 1.5; color: var(--fg-2); text-wrap: pretty; }
.hs > p.fine { margin-top: 16px; font-size: 14px; line-height: 1.5; color: var(--muted); }

/* traps */
.traps { list-style: none; max-width: 68ch; margin: 18px 0 0; padding: 0; }
.traps li { padding: 14px 0; border-top: 1px solid var(--rule); color: var(--fg-2); line-height: 1.6; text-wrap: pretty; }
.traps li:last-child { border-bottom: 1px solid var(--rule); }

/* FAQ and the closing request block reuse the home page components, inside the reading column */
.help .hs.faq details p { line-height: 1.6; }
.help .hs.req { padding-bottom: 64px; margin-top: 0; }
.help .req-btns { max-width: 460px; }

@media (max-width: 719px) {
  .tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .tbl, .tbl tbody, .tbl tr { display: block; }
  .tbl tbody { border-top: 1px solid var(--rule); }
  .tbl tr { padding: 14px 0; border-bottom: 1px solid var(--rule); }
  .tbl tbody th, .tbl td { display: block; width: auto !important; padding: 0; border: 0; }
  .tbl tbody th { font-size: 17px; }
  .tbl .num { display: inline-block; margin: 8px 28px 0 0; vertical-align: top; font-size: 16px; }
  .tbl .num::before { content: attr(data-label); display: block; font-size: 12.5px; color: var(--muted); }
  .tbl .txt { margin-top: 8px; }
  .tbl-nat .zone, .tbl-nat tbody th { display: inline; }
  .tbl-nat .zone { margin-right: 8px; }
  /* one figure per row: the label sits on the same line, the figure starts a new line */
  .tbl-cost .num, .tbl-host .num, .tbl-nat .num, .tbl-mail .num { display: block; margin-right: 0; }
  .tbl-cost .num::before, .tbl-host .num::before, .tbl-nat .num::before, .tbl-mail .num::before { display: inline; margin-right: 8px; font-size: 13px; }
  .tbl .grp { padding: 20px 0 0; }
  .tbl .grp td { padding: 0; }
}

@media (min-width: 720px) {
  .basics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
  .opts, .totals { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
}

@media (min-width: 900px) {
  .help-head { padding-top: 64px; }
  .help-head h1 { font-size: 72px; }
  .hs { padding-top: 64px; padding-bottom: 40px; }
  .hs h2 { font-size: 40px; }
  .help .req-btns { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 720px; }
}

@media (min-width: 1024px) {
  .help { display: grid; grid-template-columns: 220px minmax(0, 1fr); column-gap: 64px; align-items: start; }
  .toc { position: sticky; top: 92px; max-height: calc(100vh - 112px); overflow-y: auto; margin-top: 44px; border: 0; scrollbar-width: thin; }
  .toc summary { padding: 0 0 10px; cursor: default; font-size: 14px; font-weight: 600; color: var(--muted); }
  .toc summary::before, .toc summary::after { display: none; }
  .toc a { grid-template-columns: 26px 1fr; padding: 6px 0; font-size: 15px; }
  .help-body > .hs:first-child { margin-top: 12px; border-top: 1px solid var(--rule); padding-top: 32px; }
}
