/* ==========================================================================
   RUS.DO — Гайды. Редакционная вёрстка: сплошные поверхности, никакого стекла под текстом.
   ========================================================================== */

/* ---------- Каталог и рубрики ---------- */
.gd-head .btn { flex: none; }
.gd-chips { margin-bottom: var(--s-5); }
.gd-chips .chip { gap: 6px; }
.gd-chip-n { font-size: 12px; font-weight: 600; color: var(--ink-3); background: var(--surface-2); border-radius: var(--r-pill); padding: 1px 7px; }
.gd-chips .chip.is-active .gd-chip-n { background: transparent; color: inherit; opacity: .75; }

.gd-top { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: var(--s-5); align-items: stretch; }
.gd-top .gcard--big { min-height: 440px; }
.gd-top .gcard--big h3 { font-size: clamp(24px, 2.6vw, 32px); max-width: 22ch; }
.gd-top .gcard--big p { max-width: 56ch; font-size: 16px; }

.gd-start { padding: var(--s-5); display: flex; flex-direction: column; }
.gd-start h2 { font-size: var(--fs-lg); margin-bottom: var(--s-3); }
.gd-path { display: grid; counter-reset: none; }
.gd-path li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); position: relative; }
.gd-path li:first-child { border-top: 0; }
.gd-path__n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--teal-50); color: var(--teal-600); }
.gd-path li:first-child .gd-path__n { background: var(--teal); color: #fff; }
.gd-path a { display: grid; gap: 2px; }
.gd-path b { font-weight: 600; line-height: 1.35; }
.gd-path a:hover b { color: var(--teal-600); }
.gd-path small { color: var(--ink-3); font-size: 13px; }

.gd-cathead { display: flex; gap: var(--s-4); align-items: center; }
.gd-cathead__ic { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; background: var(--teal-50); color: var(--teal-600); flex: none; }

.gd-cta { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s-5); align-items: center; padding: var(--s-5) var(--s-6); background: var(--sand-2); border-color: var(--line); }
.gd-cta__ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--coral-50); color: var(--coral-600); }
.gd-cta h2 { font-size: var(--fs-lg); }
.gd-cta p { color: var(--ink-2); margin-top: 4px; max-width: 60ch; }

@media (max-width: 1024px) {
  .gd-top { grid-template-columns: 1fr; }
  .gd-top .gcard--big { min-height: 360px; }
}
@media (max-width: 640px) {
  .gd-top .gcard--big { min-height: 320px; }
  .gd-cta { grid-template-columns: 1fr; padding: var(--s-5); gap: var(--s-3); }
  .gd-cta .btn { width: 100%; }
  .gd-head .btn { width: 100%; }
  .gd-cathead__ic { width: 48px; height: 48px; border-radius: 14px; }
}

/* ---------- Статья: три колонки ---------- */
.gd-article { max-width: 1320px; padding-bottom: var(--s-8); }
.gd-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr) 270px; gap: var(--s-7); align-items: start; }
.gd-main { min-width: 0; max-width: 72ch; width: 100%; justify-self: center; }
/* Гайд без оглавления (меньше двух заголовков): колонки статья + боковая панель, без пустой левой. */
@media (min-width: 1181px) { .gd-layout--notoc { grid-template-columns: minmax(0, 1fr) 300px; } }

/* Левое оглавление */
.gd-toc { position: sticky; top: calc(var(--hdr-h) + 24px); max-height: calc(100vh - var(--hdr-h) - 48px); overflow-y: auto; padding: var(--s-2) 0 var(--s-4); scrollbar-width: thin; }
.gd-toc__h { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: var(--s-3); }
.toc { display: grid; gap: 2px; border-left: 2px solid var(--line); }
.toc a { display: block; font-size: 14px; line-height: 1.4; color: var(--ink-3); padding: 6px 0 6px 14px; margin-left: -2px; border-left: 2px solid transparent; transition: color var(--dur), border-color var(--dur); }
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--teal-600); border-left-color: var(--teal); font-weight: 600; }
.toc .lv3 a { padding-left: 26px; font-size: 13.5px; }

/* Мобильное оглавление */
.gd-tocm { display: none; margin: var(--s-5) 0 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); }
.gd-tocm summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 16px; font-weight: 600; cursor: pointer; }
.gd-tocm summary::-webkit-details-marker { display: none; }
.gd-tocm summary > .i:last-child { margin-left: auto; transition: transform var(--dur); }
.gd-tocm[open] summary > .i:last-child { transform: rotate(180deg); }
.gd-tocm summary .muted { font-weight: 400; font-size: 14px; }
.gd-tocm__list { display: grid; padding: 0 16px 12px; border-top: 1px solid var(--line); }
.gd-tocm__list a { display: block; padding: 10px 0; font-size: 15px; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.gd-tocm__list li:last-child a { border-bottom: 0; }
.gd-tocm__list .lv3 a { padding-left: 16px; font-size: 14px; color: var(--ink-3); }

/* Шапка статьи */
.gd-status { margin-bottom: var(--s-5); }
.gd-hdr { display: grid; gap: var(--s-3); padding-top: var(--s-2); }
.gd-cat { display: inline-flex; align-items: center; gap: 6px; justify-self: start; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--teal-600); }
.gd-cat:hover { color: var(--teal); }
.gd-hdr h1 { font-size: clamp(30px, 4.2vw, 44px); line-height: 1.12; letter-spacing: -.028em; }
.gd-lead { font-size: 20px; line-height: 1.5; color: var(--ink-2); max-width: 62ch; }

.gd-stamp { display: inline-flex; align-items: flex-start; gap: 8px; justify-self: start; padding: 8px 14px; border-radius: 12px; background: var(--palm-50); color: var(--palm); font-weight: 700; font-size: 14.5px; line-height: 1.35; border: 1px solid color-mix(in srgb, var(--palm) 22%, transparent); }
.gd-stamp .i { margin-top: 1px; }
.gd-stamp > span { display: grid; gap: 1px; }
.gd-stamp small { font-weight: 500; font-size: 13px; }
.gd-stamp--warn { background: var(--amber-50); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 25%, transparent); }

.gd-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; color: var(--ink-3); font-size: 14px; padding-top: var(--s-2); }
.gd-meta__i { display: inline-flex; align-items: center; gap: 6px; }
.gd-author { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.gd-author > span:last-child { display: grid; line-height: 1.25; }
.gd-author small { color: var(--ink-3); font-size: 12px; }
.gd-author a, .gd-author b { font-weight: 600; }
.gd-author a:hover { color: var(--teal-600); }
.gd-author__logo { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--teal); color: #fff; }
.gd-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); padding-top: var(--s-2); }
.gd-actions .btn.is-on, .gd-util--save .btn.is-on { color: var(--teal-600); border-color: var(--teal); background: var(--teal-50); }

.gd-cover-img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; border-radius: var(--r); margin-top: var(--s-6); background: var(--surface-3); }

/* Текст */
.gd-prose { font-size: 18px; line-height: 1.72; margin-top: var(--s-6); }
.gd-prose > p:first-child { font-size: 19px; }
.gd-prose h2 { font-size: 27px; padding-top: .2em; }
.gd-prose img { border-radius: var(--r-sm); }
.gd-prose .callout { font-size: 16.5px; }

/* Конец статьи */
.gd-end { display: grid; gap: var(--s-4); margin-top: var(--s-7); padding-top: var(--s-6); border-top: 1px solid var(--line); }
.gd-vote { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); flex-wrap: wrap; padding: var(--s-5); }
.gd-vote h2 { font-size: var(--fs-lg); margin-bottom: 4px; }
.gd-vote__btns { display: flex; gap: var(--s-2); }
.gd-vote__btns .btn { min-width: 96px; }
.gd-vote__btns .btn.is-on { background: var(--teal); border-color: var(--teal); color: #fff; }
.gd-vote__btns .btn:last-child.is-on { background: var(--ink-2); border-color: var(--ink-2); color: var(--surface); }

.gd-suggest summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: var(--s-4) var(--s-5); cursor: pointer; color: var(--ink-2); }
.gd-suggest summary::-webkit-details-marker { display: none; }
.gd-suggest summary b { color: var(--ink); }
.gd-suggest summary > .i:first-child { color: var(--teal-600); }
.gd-suggest summary > .i:last-child { margin-left: auto; transition: transform var(--dur); }
.gd-suggest[open] summary > .i:last-child { transform: rotate(180deg); }
.gd-suggest form { padding: 0 var(--s-5) var(--s-5); }
.gd-suggest .form-actions { margin-top: 0; }

.gd-disc { padding: var(--s-5); display: grid; gap: var(--s-4); justify-items: start; }
.gd-disc__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); width: 100%; }
.gd-disc__head h2 { font-size: var(--fs-lg); }
.gd-disc__list { display: grid; gap: var(--s-4); width: 100%; }
.gd-disc__list li { display: grid; grid-template-columns: auto 1fr; gap: 12px; }
.gd-disc__list p { font-size: 15.5px; color: var(--ink-2); }
.gd-disc__who { font-size: 14px !important; margin-bottom: 2px; }
.gd-disc__who b { color: var(--ink); }


/* Правая колонка: утилиты */
.gd-side { position: sticky; top: calc(var(--hdr-h) + 24px); display: grid; gap: var(--s-4); }
.gd-util { padding: var(--s-4) var(--s-5) var(--s-5); display: grid; gap: var(--s-3); }
.gd-util h2 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.gd-util h2 .i { color: var(--teal-600); }
.gd-util > p { color: var(--ink-3); font-size: 14px; line-height: 1.5; }
.gd-specs { display: grid; gap: 4px; }
.gd-specs a { display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: start; padding: 8px; margin: 0 -8px; border-radius: var(--r-sm); }
.gd-specs a:hover { background: var(--surface-2); }
.gd-specs .ava { width: 40px; height: 40px; }
.gd-specs b { display: block; font-size: 14.5px; line-height: 1.3; }
.gd-specs small { display: block; color: var(--ink-3); font-size: 13px; }
.gd-specs__row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.gd-specs__row .vbadge { font-size: 11.5px; padding: 2px 7px; }
.gd-specs__rate { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 600; color: var(--amber); }

.gd-related { max-width: 1200px; margin: 0 auto; }

/* Планшет и мобайл: оглавление в <details>, утилиты под статьёй */
@media (max-width: 1180px) {
  .gd-layout { grid-template-columns: minmax(0, 1fr); gap: var(--s-6); }
  .gd-toc { display: none; }
  .gd-tocm { display: block; }
  .gd-side { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 72ch; width: 100%; justify-self: center; }
}
@media (max-width: 640px) {
  .gd-side { grid-template-columns: 1fr; }
  .gd-lead { font-size: 18px; }
  .gd-prose { font-size: 17.5px; }
  .gd-prose > p:first-child { font-size: 18px; }
  .gd-prose h2 { font-size: 23px; }
  .gd-cover-img { aspect-ratio: 16 / 9; border-radius: var(--r-sm); margin-top: var(--s-5); }
  .gd-meta { gap: 8px 14px; font-size: 13.5px; }
  .gd-meta .gd-author { width: 100%; }
  .gd-vote { padding: var(--s-4); }
  .gd-vote__btns { width: 100%; }
  .gd-vote__btns .btn { flex: 1; }
  .gd-suggest summary { padding: var(--s-4); align-items: flex-start; }
  .gd-suggest form { padding: 0 var(--s-4) var(--s-4); }
  .gd-disc, .gd-util { padding: var(--s-4); }
}

/* ---------- Редактор ---------- */
.gd-editor__grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s-5); align-items: start; padding-bottom: var(--s-7); }
.gd-body-input { min-height: 460px !important; font-size: 16px; line-height: 1.6 !important; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 14.5px; }
.gd-lead-input { min-height: 72px !important; }
.gd-covers { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.gd-cover { position: relative; cursor: pointer; border-radius: 12px; overflow: hidden; border: 2px solid transparent; transition: border-color var(--dur); }
.gd-cover img { aspect-ratio: 16 / 10; width: 100%; object-fit: cover; background: var(--surface-3); }
.gd-cover input { position: absolute; opacity: 0; pointer-events: none; }
.gd-cover:has(input:checked) { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-50); }
.gd-cover:has(input:checked)::after { content: "✓"; position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--teal); color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.gd-cover:has(input:focus-visible) { outline: 2.5px solid var(--focus); outline-offset: 2px; }
.gd-preview { margin: var(--s-4) 0; padding: var(--s-5); border: 1px dashed var(--line-2); border-radius: var(--r-sm); background: var(--bg); }
.gd-cheat { position: sticky; top: calc(var(--hdr-h) + 16px); display: grid; gap: var(--s-4); }
.gd-cheat dl { display: grid; gap: 10px; margin: 0; }
.gd-cheat dt code { display: block; white-space: pre; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; background: var(--surface-2); padding: 6px 10px; border-radius: 8px; color: var(--ink); overflow-x: auto; }
.gd-cheat dd { margin: 4px 0 0; font-size: 13px; color: var(--ink-3); }
.gd-cheat .callout { font-size: 14px; }
@media (max-width: 1024px) {
  .gd-editor__grid { grid-template-columns: 1fr; }
  .gd-cheat { position: static; }
}
@media (max-width: 640px) {
  .gd-editor .form-card { padding: var(--s-4); }
  .gd-covers { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .gd-body-input { min-height: 360px !important; }
  .gd-editor .form-actions .btn { flex: 1; }
}
