/* ========================================
   ASTERION — единый стиль всех страниц
   Dark / Violet / Minimal (чёрный фон)
   ======================================== */

:root {
  --asterion-bg: #000000;
  --asterion-surface: #0d0d12;
  --asterion-surface-hover: #15111d;
  --asterion-border: #25242d;
  --asterion-violet: #8b5cf6;
  --asterion-violet-light: #c4b5fd;
  --asterion-text-muted: #aaa6bb;
}

/* ---------- Глобальный чёрный фон ---------- */
[data-md-color-scheme="slate"] {
  --md-default-bg-color: #000000;
  --md-default-bg-color--light: #0c0c11;
  --md-default-bg-color--lighter: #101016;
  --md-default-bg-color--lightest: #15151c;
  --md-primary-fg-color: #000000;
  --md-primary-bg-color: #f4f0ff;
  --md-accent-fg-color: #a78bfa;
  --md-typeset-a-color: #b9a2ff;
  --md-code-bg-color: #14111d;
  --md-code-fg-color: #e6ddff;
  --md-footer-bg-color: #000000;
  --md-footer-bg-color--dark: #000000;
  --md-typeset-table-color: #25242d;
}

body,
.md-main {
  background: #000000;
}

.md-header,
.md-tabs {
  background: #000000;
  box-shadow: none;
}

.md-header {
  border-bottom: 1px solid #1a1822;
}

.md-tabs {
  border-bottom: 1px solid #14121a;
}

.md-footer,
.md-footer-meta {
  background: #000000;
}

.md-typeset code {
  color: #e6ddff;
  background: #17131f;
  border-radius: 5px;
}

.md-typeset hr {
  border-bottom-color: #1d1b25;
}

/* ---------- Главные блоки страниц ---------- */

/* Убираем стандартную карточку на страницах с hero */
body:has(.asterion-hero) .md-content__inner {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding-top: 1.2rem;
}

.asterion-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(1.5rem, 5vw, 3.5rem);
  margin: 1rem 0 2.5rem;
  background:
    radial-gradient(
      ellipse at 85% 0%,
      rgb(139 92 246 / 16%),
      transparent 48%
    ),
    linear-gradient(135deg, #130f1b 0%, #09090c 65%);
  border: 1px solid #302340;
  border-radius: 18px;
}

.asterion-hero::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -100px;
  width: 240px;
  height: 240px;
  border: 1px solid rgb(167 139 250 / 12%);
  border-radius: 50%;
  box-shadow:
    0 0 0 28px rgb(167 139 250 / 3%),
    0 0 0 56px rgb(167 139 250 / 2%);
  pointer-events: none;
}

.asterion-hero > * {
  position: relative;
  z-index: 1;
}

.asterion-eyebrow {
  margin: 0 0 1rem;
  color: var(--asterion-violet-light);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.asterion-hero h1 {
  max-width: 760px;
  margin: 0 0 1rem;
  color: #fff;
  font-size: clamp(2.2rem, 5.5vw, 4rem);
  font-weight: 850;
  line-height: 1.08;
  letter-spacing: -0.055em;
  background: linear-gradient(100deg, #fff 25%, #c4b5fd 85%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.asterion-hero > p:not(.asterion-eyebrow) {
  max-width: 650px;
  color: #c1bdce;
  font-size: 1rem;
  line-height: 1.85;
}

.asterion-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.8rem 0 1.4rem;
}

.asterion-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 44px;
  padding: 0.7rem 1.05rem;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 0.82rem;
  font-weight: 750;
  text-decoration: none !important;
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}

.asterion-button:hover {
  transform: translateY(-2px);
}

.asterion-button-primary {
  color: #fff !important;
  background: linear-gradient(110deg, #7c3aed, #8b5cf6);
  box-shadow: 0 5px 22px rgb(124 58 237 / 18%);
}

.asterion-button-primary:hover {
  color: #fff !important;
  background: linear-gradient(110deg, #6d28d9, #a78bfa);
}

.asterion-button-secondary {
  color: #e4dcff !important;
  background: rgb(255 255 255 / 3%);
  border-color: #443650;
}

.asterion-button-secondary:hover {
  background: #21182f;
  border-color: #8b5cf6;
}

.asterion-server-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  color: #c7c0d5;
  font-size: 0.77rem;
}

.asterion-server-status code {
  color: #e6ddff;
  background: #21182f;
  border: 1px solid #38264e;
}

.asterion-status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #a78bfa;
  box-shadow: 0 0 10px rgb(167 139 250 / 45%);
}

.asterion-status-divider {
  color: #62566e;
}

/* Заголовки разделов */
body:has(.asterion-hero) .md-typeset h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-size: 1.35rem;
  letter-spacing: -0.025em;
}

body:has(.asterion-hero) .md-typeset h3 {
  margin-top: 1.8rem;
  letter-spacing: -0.02em;
}

/* Карточки */
.md-typeset .asterion-cards > ul > li,
.md-typeset .asterion-community > ul > li {
  position: relative;
  overflow: hidden;
  padding: 1.15rem;
  background: linear-gradient(145deg, #101015, #0a0a0e);
  border: 1px solid var(--asterion-border);
  border-radius: 12px;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.md-typeset .asterion-cards > ul > li:hover,
.md-typeset .asterion-community > ul > li:hover {
  transform: translateY(-3px);
  background: linear-gradient(145deg, #171120, #0e0d13);
  border-color: #7652c7;
}

.asterion-icon {
  display: inline-block;
  margin-bottom: 0.65rem;
  color: var(--asterion-violet-light);
  font-size: 1.65rem;
}

.md-typeset .asterion-cards > ul > li > p:first-child,
.md-typeset .asterion-community > ul > li > p:first-child {
  margin-bottom: 0.6rem;
}

.md-typeset .asterion-cards strong,
.md-typeset .asterion-community strong {
  color: #f4f0ff;
  font-size: 0.98rem;
}

.md-typeset .asterion-cards hr,
.md-typeset .asterion-community hr {
  margin: 0.8rem 0;
  border-color: #25202c;
}

.md-typeset .asterion-cards a,
.md-typeset .asterion-community a {
  font-weight: 650;
  text-decoration: none;
}

.md-typeset .asterion-cards a:hover,
.md-typeset .asterion-community a:hover {
  color: #ddd0ff;
}

/* Информационные панели и таблицы */
.asterion-info-panel {
  padding: 1.2rem;
  background: #0b0b10;
  border: 1px solid #25242d;
  border-radius: 12px;
}

.asterion-info-panel + .asterion-info-panel {
  margin-top: 1rem;
}

.asterion-info-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  color: #e9e1ff;
}

.asterion-info-heading > span {
  width: 100%;
  color: var(--asterion-text-muted);
  font-size: 0.78rem;
}

.md-typeset .asterion-info-panel table:not([class]) {
  display: table;
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.md-typeset .asterion-info-panel table:not([class]) th {
  background: transparent;
  color: var(--asterion-text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.md-typeset .asterion-info-panel tr,
.md-typeset .asterion-info-panel td,
.md-typeset .asterion-info-panel th {
  border-color: #25242d;
}

.md-typeset .asterion-info-panel tr:last-child td {
  border-bottom: 0;
}

/* Блок «Последние обновления» */
.asterion-update {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  background:
    linear-gradient(115deg, rgb(139 92 246 / 9%), transparent 75%),
    #0b0b10;
  border: 1px solid #342746;
  border-radius: 12px;
}

.asterion-update-icon {
  display: flex;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  color: #d5c5ff;
  background: #281d3a;
  border-radius: 10px;
  font-size: 1.35rem;
}

.asterion-update > div:last-child {
  min-width: 0;
  flex: 1;
}

.asterion-update strong {
  color: #f2edff;
}

.asterion-update p {
  color: #b8b3c6;
}

.asterion-bottom-note {
  margin-top: 2.5rem;
  padding: 1.3rem 0 0.5rem;
  border-top: 1px solid #1f1b26;
  color: #8f879f;
  font-size: 0.8rem;
}

.asterion-bottom-note p {
  margin-bottom: 0.5rem;
}

.asterion-bottom-note strong {
  color: #c4b5fd;
  letter-spacing: 0.08em;
}

/* Записи в журнале обновлений */
.asterion-entry {
  margin: 0 0 1rem;
  padding: 1.2rem 1.3rem;
  background: #0b0b10;
  border: 1px solid #25242d;
  border-left: 3px solid #8b5cf6;
  border-radius: 12px;
}

.asterion-entry-date {
  margin: 0 0 0.5rem;
  color: var(--asterion-violet-light);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.asterion-entry h3 {
  margin-top: 0 !important;
}

/* Адаптация для мобильных устройств */
@media screen and (max-width: 600px) {
  body:has(.asterion-hero) .md-content__inner {
    padding: 0.75rem;
  }

  .asterion-hero {
    padding: 1.35rem;
    margin-top: 0.5rem;
    border-radius: 13px;
  }

  .asterion-hero h1 {
    font-size: clamp(2rem, 10vw, 2.8rem);
  }

  .asterion-hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .asterion-button {
    width: 100%;
    box-sizing: border-box;
  }

  .asterion-update {
    gap: 0.7rem;
    padding: 1rem;
  }

  .asterion-update-icon {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
  }
}

/* Уменьшенная анимация по настройкам системы */
@media (prefers-reduced-motion: reduce) {
  .asterion-button,
  .md-typeset .asterion-cards > ul > li,
  .md-typeset .asterion-community > ul > li {
    transition: none;
  }
}

/* Скрываем стандартный заголовок страницы, если он есть */
body:has(.asterion-hero) .md-content__inner > h1:first-child {
  display: none;
}

/* Поиск не нужен — убираем его из интерфейса */
.md-header__button[for="__search"],
.md-search {
  display: none !important;
}

/* Полностью чёрный фон на всех страницах */
html,
body,
.md-container,
.md-main,
.md-main__inner,
.md-content,
.md-sidebar,
.md-header,
.md-tabs,
.md-footer,
.md-footer-meta {
  background-color: #000000 !important;
}

/* ========================================
   Фиолетовая линия под шапкой
   ======================================== */
.md-header {
  border-bottom: 1px solid #2a1d45 !important;
  box-shadow: none !important;
}

.md-header[data-md-state="shadow"] {
  box-shadow: none !important;
}

.md-tabs {
  border-bottom: 1px solid #7c3aed !important;
  box-shadow: 0 2px 18px rgb(124 58 237 / 35%) !important;
}

/* Фиолетовые ссылки вместо синих */
.md-typeset a {
  color: #b9a2ff;
}

.md-typeset a:hover {
  color: #ddd0ff;
}

/* ========================================
   Свечение плит: фиолетово-синее
   ======================================== */
.asterion-hero,
.md-typeset .asterion-cards > ul > li,
.md-typeset .asterion-community > ul > li,
.asterion-info-panel,
.asterion-update,
.asterion-entry {
  border-color: #3a2f66;
  box-shadow:
    0 0 0 1px rgb(99 102 241 / 6%),
    0 0 22px rgb(99 102 241 / 16%),
    0 0 46px rgb(139 92 246 / 12%);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.25s ease;
}

.md-typeset .asterion-cards > ul > li:hover,
.md-typeset .asterion-community > ul > li:hover,
.asterion-info-panel:hover,
.asterion-update:hover,
.asterion-entry:hover {
  border-color: #7c6cf0;
  box-shadow:
    0 0 0 1px rgb(99 102 241 / 25%),
    0 0 28px rgb(99 102 241 / 38%),
    0 0 60px rgb(139 92 246 / 28%);
}

@media (prefers-reduced-motion: reduce) {
  .asterion-hero,
  .asterion-info-panel,
  .asterion-update,
  .asterion-entry {
    transition: none;
  }
}

/* ========================================
   Фиолетовая верхняя плашка (шапка и вкладки)
   ======================================== */
.md-header {
  background: linear-gradient(90deg, #1a0f33 0%, #2b1561 50%, #1a0f33 100%) !important;
  border-bottom: 1px solid #4c3a8f !important;
}

.md-tabs {
  background: #130b28 !important;
  border-bottom: 1px solid #7c3aed !important;
}

/* ========================================
   Скриншоты и галерея
   ======================================== */
.asterion-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.asterion-gallery > p {
  margin: 0;
}

.md-typeset img.asterion-shot {
  display: block;
  width: 100%;
  border: 1px solid #3a2f66;
  border-radius: 12px;
  box-shadow:
    0 0 22px rgb(99 102 241 / 22%),
    0 0 46px rgb(139 92 246 / 14%);
}

/* Небольшие изображения рецептов: без размытия и растягивания */
.md-typeset img.asterion-recipe {
  width: auto;
  max-width: min(100%, 484px);
  image-rendering: pixelated;
}

/* Общая палитра магазина и вики */
.asterion-hero {
  border-color: #45487b;
  background:
    radial-gradient(ellipse at 92% 0%, #525bad80, transparent 55%),
    radial-gradient(ellipse at 80% 120%, #7849c06b, transparent 55%),
    linear-gradient(120deg, #101226, #1b1a39);
}

.asterion-button-primary {
  background: linear-gradient(115deg, #454bb3, #6545b1);
}

.asterion-button-primary:hover {
  background: linear-gradient(115deg, #5058c5, #7451c6);
}
