/* Sardine CMS admin — overlay on top of vendored AdminLTE 4 (ADR-0017).
   AdminLTE (MIT, ColorlibHQ) ships verbatim in vendor/adminlte with its
   license and states the design: this file never restyles it. The font it
   asks for loads from vendor/source-sans; this file holds only the
   accessibility fixes and CSP-safe transpositions of the reference pages'
   inline bits. */

/* The reference sets this width inline on the color-mode dropdown; the CSP
   forbids inline styles, so the same value lives here. */
.admin-theme-menu { --bs-dropdown-min-width: 8rem; }

/* Skip link */
.admin-skip {
  position: absolute;
  left: -100vw;
  top: 0;
  z-index: 2000;
  padding: .5rem 1rem;
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
}
.admin-skip:focus { left: 0; }

/* Editors and helpers */
.admin-preview {
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  background: var(--bs-body-bg);
  padding: .5rem 1rem;
  overflow-x: auto;
}
.admin-textarea { font-family: var(--bs-font-monospace); font-size: .85rem; }
.admin-thumb { object-fit: cover; }
.admin-media-preview img { max-width: 100%; height: auto; }
.admin-coverage { display: inline-flex; align-items: center; gap: .5rem; }
.admin-coverage progress { accent-color: var(--bs-primary); }
.admin-empty { color: var(--bs-secondary-color); }
.admin-source dt {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
}
.admin-source dd { margin-bottom: .6rem; }
.admin-field-value { min-width: 12rem; }
.admin-target-pick { min-width: 8rem; }

.admin-breadcrumb a { color: var(--bs-secondary-color); text-decoration: none; }
.admin-breadcrumb a:hover { text-decoration: underline; }

/* Links inside prose must not rely on color alone (axe link-in-text-block) */
.card-body p a, .form-text a { text-decoration: underline; text-underline-offset: 2px; }

/* Bootstrap's default code pink is 4.27:1 on white — one shade darker for
   AA, in the light palette only (the dark palette's default passes). */
:root:not([data-bs-theme="dark"]) code { color: #a02766; }

/* EasyMDE (ADR-0023) ships light-only styles; map its surfaces onto the
   active Bootstrap palette so the editor follows the color mode. */
.EasyMDEContainer .CodeMirror {
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
  border-color: var(--bs-border-color);
}
.EasyMDEContainer .CodeMirror-cursor { border-left-color: var(--bs-body-color); }
.EasyMDEContainer .editor-toolbar {
  background: var(--bs-body-bg);
  border-color: var(--bs-border-color);
}
.EasyMDEContainer .editor-toolbar button { color: var(--bs-body-color); }
.EasyMDEContainer .editor-toolbar button.active,
.EasyMDEContainer .editor-toolbar button:hover {
  background: var(--bs-tertiary-bg);
  border-color: var(--bs-border-color);
}
.EasyMDEContainer .editor-toolbar i.separator {
  border-left-color: var(--bs-border-color);
  border-right-color: var(--bs-border-color);
}

/* Bootstrap's outline-secondary reads 4.39:1 on the content area's
   tertiary background — one shade stronger per palette for WCAG AA. */
.app-content .btn-outline-secondary {
  --bs-btn-color: #565e64;
  --bs-btn-border-color: #565e64;
  --bs-btn-hover-bg: #565e64;
  --bs-btn-hover-border-color: #565e64;
}
[data-bs-theme="dark"] .app-content .btn-outline-secondary {
  --bs-btn-color: #adb5bd;
  --bs-btn-border-color: #adb5bd;
  --bs-btn-hover-bg: #adb5bd;
  --bs-btn-hover-color: #000;
  --bs-btn-hover-border-color: #adb5bd;
}

/* Design preview (ADR-0027): the themed entry framed from /preview/. */
.admin-design-preview {
  display: block;
  width: 100%;
  height: 70vh;
  border: 0;
}
