/*
 * Content Panel — дополнительные утилиты, которых нет в скомпилированном styles.css Metronic.
 * Подключается после styles.css.
 */

/* Spacing (шкала Tailwind v4: --spacing = 0.25rem) */
.p-5\.5 { padding: calc(var(--spacing, 0.25rem) * 5.5); }
.lg\:mt-7\.5 { margin-top: calc(var(--spacing) * 7.5); }
.gap-x-10 { column-gap: calc(var(--spacing, 0.25rem) * 10); }
.gap-x-20 { column-gap: calc(var(--spacing, 0.25rem) * 20); }
.gap-y-3 { row-gap: calc(var(--spacing, 0.25rem) * 3); }

/* Grid */
@media (min-width: 48rem) {
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 64rem) {
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg\:mt-7\.5 { margin-top: calc(var(--spacing) * 7.5); }
  .lg\:ps-7 { padding-inline-start: calc(var(--spacing) * 7); }
}

/* Типографика и текст */
.whitespace-pre-wrap { white-space: pre-wrap; }
.leading-relaxed { line-height: 1.625; }
.leading-snug { line-height: 1.375; }
.break-words { overflow-wrap: break-word; }

/* Прочее */
.rounded { border-radius: 0.25rem; }
.mt-auto { margin-top: auto; }
.overflow-y-auto { overflow-y: auto; }

/* Выпадающий список kt-select: прокрутка длинных списков (страны, языки) */
.kt-select-dropdown .kt-select-options {
  max-height: 250px;
  overflow-y: auto;
}

/* Дерево категорий: раскрывающаяся иерархия */
.kt-cat-tree summary { list-style: none; }
.kt-cat-tree summary::-webkit-details-marker { display: none; }
.kt-cat-tree summary .chev { transition: transform .15s ease; }
.kt-cat-tree details[open] > summary .chev { transform: rotate(90deg); }

/* Аккордеон методов API */
details.api-method > summary { list-style: none; }
details.api-method > summary::-webkit-details-marker { display: none; }
details.api-method[open] > summary .chev { transform: rotate(90deg); }
.min-w-\[280px\] { min-width: 280px; }
.min-w-\[210px\] { min-width: 210px; }
.max-w-\[720px\] { max-width: 720px; }
.max-w-\[640px\] { max-width: 640px; }
.max-w-\[560px\] { max-width: 560px; }
.max-w-\[520px\] { max-width: 520px; }
.max-w-\[480px\] { max-width: 480px; }
.max-w-\[160px\] { max-width: 160px; }
.top-\[8\%\] { top: 8%; }
.top-\[12\%\] { top: 12%; }
.hover\:text-destructive:hover { color: var(--destructive); }

/* Фильтры статей в шапке таблицы */
.bg-blue-500 { background-color: #3b82f6; }
.af-btn {
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  border: 1px solid transparent;
  transition: all .15s ease;
  cursor: pointer;
}
.af-btn:hover {
  background: var(--accent);
}
.af-btn.af-active {
  color: var(--primary);
  border-color: var(--primary);
  background: color-mix(in oklab, var(--primary) 8%, transparent);
}

/* Заблокированная кнопка/вкладка с подсказкой (title работает, т.к. нет атрибута disabled) */
.af-locked {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: auto;
}

/* CSS-подсказка для заблокированных кнопок и вкладок (появляется сразу при наведении) */
[data-tip] { position: relative; }
[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--mono, #1e1e2d);
  color: var(--background, #fff);
  font-size: 12px;
  line-height: 1.4;
  font-weight: normal;
  padding: 7px 10px;
  border-radius: 0.5rem;
  width: max-content;
  max-width: 280px;
  white-space: normal;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 80;
  pointer-events: none;
}
[data-tip]:hover::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--mono, #1e1e2d);
  border-bottom: none;
  z-index: 80;
  pointer-events: none;
}

/* Статья: типографика присылаемого HTML (article.php, moderate.php) */
.article-content h1 { font-size: 1.3rem; font-weight: 600; line-height: 1.3; margin: 0 0 1rem; }
.article-content h2 { font-size: 1.1rem; font-weight: 600; margin: 1.5rem 0 0.5rem; }
.article-content h3 { font-size: 1rem; font-weight: 600; margin: 1.1rem 0 0.4rem; }
.article-content p { margin: 0.65rem 0; }
.article-content ul, .article-content ol { margin: 0.65rem 0; padding-inline-start: 1.5rem; }
.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }
.article-content li { margin: 0.3rem 0; }
.article-content table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: 0.8rem; }
.article-content th, .article-content td { border: 1px solid var(--border, #e5e5e5); padding: 0.5rem 0.65rem; text-align: left; vertical-align: top; }
.article-content th { background: var(--accent, #f5f5f5); font-weight: 600; }

/* Визуальные блоки <visual> в статье: «картинка» с телом внутри, промт скрыт */
.visual-block {
  border: 1.5px dashed color-mix(in oklab, var(--muted-foreground, #9ca3af) 45%, transparent);
  background: color-mix(in oklab, var(--accent, #f5f5f5) 55%, transparent);
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
  margin: 1.1rem 0;
}
.visual-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted-foreground, #6b7280);
  margin-bottom: 0.4rem;
}
.visual-body {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--foreground, #111827);
  overflow-wrap: break-word;
}
/* Кнопка «Скрыть описания» на просмотре статьи — прячет тела и метки
   визуальных блоков («Обложка статьи», «Визуал #N · инфографика» и т.п.),
   остаётся только сама картинка */
.article-content.hide-visual-desc .visual-body,
.article-content.hide-visual-desc .visual-head {
  display: none;
}
.article-content.hide-visual-desc .visual-block {
  border: none;
  background: transparent;
  padding: 0;
}
/* Сгенерированная картинка внутри визуального блока (обложка/визуал) */
.visual-image { margin: 0.2rem 0 0.6rem; }
.visual-image img {
  display: block;
  max-width: 100%;
  max-height: 420px;
  width: auto;
  height: auto;
  border-radius: 0.6rem;
  border: 1px solid var(--border, #e5e5e5);
}

/* Кружок-уведомление у счётчиков мини-дашборда: число ждущих модерации */
.af-notify-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.35rem;
  border-radius: 9999px;
  background: #f97316; /* orange-500 */
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}
.af-notify-badge:hover { background: #ea580c; color: #fff; }

/* Превью картинки в таблицах «Обложки»/«Картинки»: крупный тамбнейл + зум при наведении */
.img-thumb {
  display: block;
  height: 96px;
  width: auto;
  max-width: 100%;
  transition: transform .15s ease;
  cursor: zoom-in;
}
/* Плавающее увеличенное изображение при наведении на .img-thumb */
#img-zoom-preview {
  position: fixed;
  z-index: 120;
  pointer-events: none;
  background: #fff;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: .75rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
  padding: 4px;
  transform: translate(-50%, -50%);
}
#img-zoom-preview img {
  display: block;
  max-height: 70vh;
  max-width: min(60vw, 640px);
  width: auto;
  height: auto;
  border-radius: .5rem;
}
