/* Home Crew — фирменная тема поверх Docmost (baza.homecrew.ru).
   Подключается nginx-ом (sub_filter) в каждую HTML-страницу, код Docmost не меняется.
   Цвета: крем #FBF5E4, бумага #F7F3ED, какао #3F1F18, рыжий #E8842F, шалфей #8FBF9E. */

:root, :root[data-mantine-color-scheme="light"] {
  --hc-cream: #FBF5E4; --hc-paper: #FBF8F2; --hc-cocoa: #3F1F18; --hc-ink2: #5A5148;
  --hc-ginger: #E8842F; --hc-ginger-d: #C9681C; --hc-ginger-t: #FCEBD9; --hc-sage: #8FBF9E; --hc-sage-t: #E3F0E7;
  --hc-rule: #E6DDCC;

  /* главный цвет Mantine (кнопки, ссылки, выделения) — рыжий вместо синего */
  --mantine-primary-color-filled: #E8842F;
  --mantine-primary-color-filled-hover: #C9681C;
  --mantine-primary-color-light: rgba(232, 132, 47, .13);
  --mantine-primary-color-light-hover: rgba(232, 132, 47, .2);
  --mantine-primary-color-light-color: #A9561A;
  --mantine-primary-color-contrast: #fff;
  --mantine-color-anchor: #A9561A;
  --mantine-color-blue-0: #FFF4EA; --mantine-color-blue-1: #FCE3CC; --mantine-color-blue-2: #F8C79C;
  --mantine-color-blue-3: #F3A96A; --mantine-color-blue-4: #EE9446; --mantine-color-blue-5: #E8842F;
  --mantine-color-blue-6: #D9761F; --mantine-color-blue-7: #C9681C; --mantine-color-blue-8: #A9561A; --mantine-color-blue-9: #8A4515;
  --mantine-color-blue-filled: #E8842F; --mantine-color-blue-filled-hover: #C9681C;
  --mantine-color-blue-light: rgba(232, 132, 47, .13); --mantine-color-blue-light-hover: rgba(232, 132, 47, .2);
  --mantine-color-blue-light-color: #A9561A; --mantine-color-blue-outline: #D9761F;

  --mantine-color-body: #FBF8F2;
  --mantine-color-text: #2A1E19;
  --mantine-color-default-border: #E2D8C6;
  --mantine-font-family-headings: Georgia, "Iowan Old Style", "Times New Roman", serif;
}
:root[data-mantine-color-scheme="dark"] {
  --mantine-primary-color-filled: #E8842F;
  --mantine-primary-color-filled-hover: #F29A4E;
  --mantine-primary-color-light: rgba(232, 132, 47, .18);
  --mantine-primary-color-light-color: #F2A76A;
  --mantine-color-anchor: #F2A76A;
  --mantine-color-blue-filled: #E8842F; --mantine-color-blue-light-color: #F2A76A;
}

/* шапка и левое меню — крем, как в макете */
[data-mantine-color-scheme="light"] .mantine-AppShell-header { background: var(--hc-cream); border-bottom-color: var(--hc-rule); }
[data-mantine-color-scheme="light"] .mantine-AppShell-navbar { background: var(--hc-cream); border-right-color: var(--hc-rule); }
[data-mantine-color-scheme="light"] .mantine-AppShell-aside { background: var(--hc-paper); }

/* логотип вместо «Docmost» (элемент помечает brand.js) */
[data-hc-brand] { display: inline-flex !important; align-items: center; gap: 9px; font-size: 0 !important; line-height: 1; text-decoration: none; }
[data-hc-brand] > *, [data-hc-brand] svg, [data-hc-brand] img { display: none !important; }
[data-hc-brand]::before { content: ""; width: 34px; height: 34px; background: url(/homecrew-brand/cat-64.png) center/contain no-repeat; flex: none; }
[data-hc-brand]::after { content: "Home Crew"; font: 700 20px/1 Georgia, "Iowan Old Style", serif; color: var(--hc-cocoa); letter-spacing: -.01em; }
[data-mantine-color-scheme="dark"] [data-hc-brand]::after { color: #F6EEDF; }

/* заголовки страниц и документов — с засечками, какао */
.ProseMirror h1, .ProseMirror h2, .ProseMirror h3 { font-family: Georgia, "Iowan Old Style", serif; letter-spacing: -.005em; }
[data-mantine-color-scheme="light"] .ProseMirror h1,
[data-mantine-color-scheme="light"] .ProseMirror h2,
[data-mantine-color-scheme="light"] .ProseMirror h3 { color: var(--hc-cocoa); }
.ProseMirror blockquote { border-left-color: var(--hc-ginger); }
[data-mantine-color-scheme="light"] .ProseMirror table th { background: #F4EDE1; }

/* ---------- экран входа, восстановления пароля, приглашения ---------- */
html.hc-auth body { background: var(--hc-paper) !important; }
.hc-auth-art { display: none; }
html.hc-auth .hc-auth-art {
  display: flex; position: fixed; inset: 0 auto 0 0; width: 46vw; z-index: 0;
  flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: #FDF9E7; border-right: 1px solid var(--hc-rule); padding: 40px;
}
.hc-auth-art img { width: min(70%, 420px); height: auto; mix-blend-mode: multiply; -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent 100%); mask-image: radial-gradient(closest-side, #000 72%, transparent 100%); }
.hc-auth-art b { font: 700 44px/1 Georgia, serif; color: var(--hc-cocoa); letter-spacing: -.015em; }
.hc-auth-art span { font-size: 16px; color: var(--hc-ink2); text-align: center; max-width: 30ch; }
html.hc-auth #root { position: relative; z-index: 1; margin-left: 46vw; min-height: 100vh; background: transparent; }
html.hc-auth #root [data-hc-brand] { display: none !important; } /* на экране входа логотип уже слева */
html.hc-auth #root form { font-size: 15px; }
html.hc-auth #root [class*="_containerBox_"] { border-radius: 16px; box-shadow: 0 12px 40px rgba(63, 31, 24, .08); border: 1px solid var(--hc-rule); }
html.hc-auth #root h1 { font-family: Georgia, serif; color: var(--hc-cocoa); }
@media (max-width: 820px) {
  html.hc-auth .hc-auth-art { position: static; width: auto; border-right: 0; border-bottom: 1px solid var(--hc-rule); padding: 26px 16px 18px; }
  .hc-auth-art img { width: 150px; }
  .hc-auth-art b { font-size: 30px; }
  html.hc-auth #root { margin-left: 0; min-height: 0; }
}

/* иконки страниц в дереве: эмодзи прячем, показываем нарисованную (brand.js ставит data-hc-icon и --hc-ic) */
.mantine-ActionIcon-icon[data-hc-icon] {
  font-size: 0 !important; width: 20px !important; height: 20px !important;
  background: var(--hc-ic) center / contain no-repeat;
}
