/* Admin theme in Rachel's palette (maroon + gold), overriding Django's
   default blue via the admin CSS custom properties. */

/* html[data-theme] too: the ◐ theme button stamps it on the page, and
   Django's own light/dark rules for it would otherwise win over :root. */
:root, html[data-theme] {
  --primary: #603649;            /* maroon */
  --secondary: #603649;
  --accent: #E9A924;             /* gold */
  --primary-fg: #ffffff;

  --header-color: #f3e9ec;
  --header-branding-color: #E9A924;
  --header-bg: #603649;
  --header-link-color: #ffffff;

  --breadcrumbs-bg: #4c2b3a;
  --breadcrumbs-fg: #f3e9ec;
  --breadcrumbs-link-fg: #E9A924;

  --link-fg: #603649;
  --link-hover-color: #102375;   /* brand blue */
  --link-selected-fg: #7a4a5f;

  --button-bg: #603649;
  --button-fg: #ffffff;
  --button-hover-bg: #7a4a5f;
  --default-button-bg: #4c2b3a;  /* Save = deep maroon, readable white text */
  --default-button-hover-bg: #603649;
  --close-button-bg: #8a8a8a;
  --close-button-hover-bg: #6f6f6f;

  --object-tools-bg: #603649;
  --object-tools-hover-bg: #7a4a5f;

  --selected-row: #faf3e2;
  --selected-bg: #f3e7ea;
  --message-success-bg: #eef7f0;
}

/* Section header bars: maroon with white text (good contrast both modes). */
.module h2, .module caption, .inline-group h2 {
  background: var(--primary);
  color: #ffffff;
}

/* Dark mode: Django flips to a near-black background, where maroon links and
   dark-blue hovers fail contrast. Use light gold links + lighter buttons. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --link-fg: #f0c25a;
    --link-hover-color: #ffd873;
    --link-selected-fg: #f0c25a;
    --breadcrumbs-link-fg: #f7d67e;
    --button-bg: #7a4a5f;
    --button-hover-bg: #8f5a70;
    --default-button-bg: #7a4a5f;
    --default-button-hover-bg: #8f5a70;
    --object-tools-bg: #7a4a5f;
    --object-tools-hover-bg: #8f5a70;
    --selected-row: #3a2e12;
    --selected-bg: #33232a;
  }
}
html[data-theme="dark"] {
  --link-fg: #f0c25a;
  --link-hover-color: #ffd873;
  --link-selected-fg: #f0c25a;
  --breadcrumbs-link-fg: #f7d67e;
  --button-bg: #7a4a5f;
  --button-hover-bg: #8f5a70;
  --default-button-bg: #7a4a5f;
  --default-button-hover-bg: #8f5a70;
  --object-tools-bg: #7a4a5f;
  --object-tools-hover-bg: #8f5a70;
  --selected-row: #3a2e12;
  --selected-bg: #33232a;
}

/* Make the "Add" object tools clearly tappable. */
.object-tools a:link, .object-tools a:visited {
  font-weight: 600;
}

/* Friendly, roomier links in the app list. */
#content-related .module h2, .dashboard .module table th { font-weight: 600; }
