/*
 * Froodx CMS admin — dark theme defaults + editing tweaks.
 * Wagtail 6.4 native dark mode: https://docs.wagtail.org/en/stable/advanced_topics/customisation/admin_templates.html
 */

/* ── Froodx dark palette (matches www.froodx.net) ── */
.w-theme-dark {
  --w-color-primary-hue: 174;
  --w-color-primary-saturation: 62%;
  --w-color-primary-lightness: 38%;

  --w-color-secondary-hue: 174;
  --w-color-secondary-saturation: 45%;
  --w-color-secondary-lightness: 22%;

  --w-color-surface-page: #0a1018;
  --w-color-surface-header: #0d1520;
  --w-color-surface-menu: #111b28;
  --w-color-surface-menu-item-active: #1a2838;
  --w-color-surface-field: #141e2b;
  --w-color-surface-field-active: #1a2838;
  --w-color-surface-tooltip: #1e2d3d;
  --w-color-surface-button-default: #1a2838;
  --w-color-surface-button-default-hover: #243448;
  --w-color-surface-button-secondary: transparent;
  --w-color-surface-button-secondary-hover: #1a2838;
  --w-color-surface-dashboard-panel: #111b28;
  --w-color-surface-dashboard-panel-hover: #1a2838;
  --w-color-surface-panel: #111b28;
  --w-color-surface-panel-translucent: rgb(17 27 40 / 0.92);
  --w-color-surface-panel-selected: #1a2838;
  --w-color-surface-panel-selected-hover: #243448;
  --w-color-surface-popup: #141e2b;
  --w-color-surface-popup-hover: #1a2838;
  --w-color-surface-sticky: #0d1520;
  --w-color-surface-header-panel: #111b28;
  --w-color-surface-overlay: rgb(4 8 12 / 0.75);

  --w-color-text-label: #b8c5d4;
  --w-color-text-label-menus-default: #c8d4e0;
  --w-color-text-label-menus-active: #e8f0f8;
  --w-color-text-meta: #8a9bb0;
  --w-color-text-link-default: #5ec4b8;
  --w-color-text-link-hover: #7dd8cc;
  --w-color-text-button: #e8f0f8;
  --w-color-text-button-secondary: #b8c5d4;
  --w-color-text-button-secondary-hover: #e8f0f8;

  --w-color-border-field-default: #2a3a4d;
  --w-color-border-field-hover: #3d5268;
  --w-color-border-field-active: #5ec4b8;
  --w-color-border-furniture: #1e2d3d;
  --w-color-border-furniture-menus-default: #243448;
  --w-color-border-furniture-menus-active: #3d5268;
  --w-color-border-button-small-default: #3d5268;
  --w-color-border-button-small-hover: #5ec4b8;
}

/* Login page (always light markup — force dark shell) */
.w-login {
  background: #0a1018;
}

.w-login .w-login__container {
  background: #111b28;
  border: 1px solid #1e2d3d;
  box-shadow: 0 8px 32px rgb(0 0 0 / 0.45);
}

.w-login .w-field__label,
.w-login h1 {
  color: #e8f0f8;
}

.w-login input[type="text"],
.w-login input[type="password"],
.w-login input[type="email"] {
  background: #141e2b;
  border-color: #2a3a4d;
  color: #e8f0f8;
}

/* ── Article editing ── */
.w-panel .w-field__label {
  font-weight: 600;
}

.c-sf-block .w-field__input {
  min-height: 2rem;
}

.c-sf-block[data-contentpath="body"] .Draftail-Editor,
.c-sf-block .Draftail-Editor {
  min-height: 320px;
  font-size: 1.05rem;
  line-height: 1.65;
}

.c-sf-block .Draftail-Editor .public-DraftEditor-content {
  min-height: 280px;
  padding: 0.75rem 1rem;
}

.w-theme-dark .c-sf-block .Draftail-Editor {
  background: #141e2b;
  color: #e8f0f8;
}

.w-theme-dark .c-sf-block[data-block-type="rich_text"] .w-field__label {
  color: #5ec4b8;
}

/* Preview panel */
.w-theme-dark .preview-panel {
  background: #0a1018;
}

.w-theme-dark .preview-panel__iframe {
  border-color: #2a3a4d;
}
