/* Правки снимка Gamma: без их JS кнопки редактора остаются видны */
.card-divider, .insert-card-button, .insert-ai-card-button, .card-divider-button-group, [data-print-hidden="true"] { display: none !important; }

/* раскрывающиеся блоки Gamma (без их JS) */
.toggle[data-open="false"] [data-node-view-content-inner="toggle"] > :not(.node-toggleSummary) { display: none; }
.toggle [data-testid="toggle-button"] svg { transition: transform .15s ease; }
.toggle[data-open="true"] [data-testid="toggle-button"] svg { transform: rotate(90deg); }
.node-toggleSummary { cursor: pointer; }

/* Адаптивность: у Gamma мобильную раскладку включает их JS, в снимке делаем это сами */
html { -webkit-text-size-adjust: 100%; }
.gml-heading, .gml-title, h1, h2, h3 { overflow-wrap: break-word !important; word-break: normal !important; hyphens: auto !important; -webkit-hyphens: auto !important; }
img { max-width: 100%; }

@media (max-width: 900px) {
  /* плитки (smart layout, сетка из 18 колонок) и сетки колонок (grid layout) — по две в ряд */
  .node-smartLayout .themed-shape-outside-text, .node-gridLayout .grid-col-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .node-smartLayout .grid-item { grid-column: auto !important; grid-row: auto !important; }
}

@media (max-width: 640px) {
  /* карточка «текст + картинка»: одна колонка, картинка сверху */
  .card-content > [data-node-view-content-inner="card"] {
    display: flex !important; flex-direction: column !important; grid-template-columns: none !important;
  }
  .card-content > [data-node-view-content-inner="card"] > .node-cardAccentLayoutItem {
    order: -1; width: 100% !important; flex: none !important;
  }
  /* картинка лежит абсолютно внутри обёртки — без высоты обёртки её не видно */
  .card-content > [data-node-view-content-inner="card"] > .node-cardAccentLayoutItem > div { min-height: 62vw; flex: 1 1 auto; }
  .card-content > [data-node-view-content-inner="card"] > .node-cardLayoutItem { width: 100% !important; flex: none !important; }
  /* плитки и колонки — по одной в ряд */
  .node-smartLayout .themed-shape-outside-text, .node-gridLayout .grid-col-controls {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  /* крупный текст Gamma на телефоне */
  .document-content { --card-font-scale: 0.8 !important; }
  .document-content h1.gml-heading, .document-content .gml-title { font-size: clamp(26px, 7.6vw, 40px) !important; line-height: 1.15 !important; }
  .document-content h2.gml-heading { font-size: clamp(22px, 6.4vw, 32px) !important; }
  /* обложка: на телефоне сразу текст, без картинки и пустоты над ним */
  .node-card.first-block .node-cardAccentLayoutItem { display: none !important; }
  .node-card.first-block [data-node-view-content-inner="card"],
  .node-card.first-block .node-cardLayoutItem, .node-card.first-block .node-cardLayoutItem > div,
  .node-card.first-block .card-layout-cell-bg { min-height: 0 !important; height: auto !important; justify-content: flex-start !important; }
  .node-card.first-block .card-layout-cell-bg { padding-top: 28px !important; padding-bottom: 28px !important; }
  .node-card.first-block .card-layout-cell-bg > div { padding-top: 0 !important; padding-bottom: 0 !important; }
  /* кнопки: подпись целиком, в несколько строк, а не «Записатьс…» */
  .node-buttonGroup [data-node-view-content-inner="buttonGroup"], .node-buttonGroup .button-group { flex-wrap: wrap !important; }
  .chakra-button.button, .chakra-button.button * { white-space: normal !important; text-overflow: clip !important; overflow: visible !important; }
  .chakra-button.button { height: auto !important; min-height: 44px; }
}
