/* Dillon Engineering — additions on top of Furo.
 * Brand colours are also set in conf.py (html_theme_options); keep both in sync.
 */

:root {
  --de-blue: #4a5b94;
  --de-blue-dark: #34416d;
  --de-blue-tint: #eef0f7;
  --de-accent: #b8752a;
  --de-rule: #d9dce6;

  /* sphinx-design buttons and cards follow the brand */
  --sd-color-primary: var(--de-blue);
  --sd-color-primary-highlight: var(--de-blue-dark);
  --sd-color-primary-text: #ffffff;
}

body[data-theme="dark"] {
  --de-blue: #9aaae0;
  --de-blue-dark: #b9c5ec;
  --de-blue-tint: #1d2232;
  --de-accent: #e0a35c;
  --de-rule: #2e3344;
  --sd-color-primary-text: #111522;
}
@media (prefers-color-scheme: dark) {
  body:not([data-theme="light"]) {
    --de-blue: #9aaae0;
    --de-blue-dark: #b9c5ec;
    --de-blue-tint: #1d2232;
    --de-accent: #e0a35c;
    --de-rule: #2e3344;
    --sd-color-primary-text: #111522;
  }
}

/* ---- Logo: the JPG has a white background, so frame it in dark mode ---- */
.sidebar-logo-container { margin-bottom: 0.25rem; }
.sidebar-logo { max-width: 100%; }
body[data-theme="dark"] .sidebar-logo {
  background: #fff; padding: 0.4rem 0.6rem; border-radius: 6px;
}
@media (prefers-color-scheme: dark) {
  body:not([data-theme="light"]) .sidebar-logo {
    background: #fff; padding: 0.4rem 0.6rem; border-radius: 6px;
  }
}

/* ---- Headings: a little tighter and more engineered ---- */
article h1 { letter-spacing: -0.01em; }
article h2 {
  border-bottom: 1px solid var(--de-rule);
  padding-bottom: 0.25rem;
}

/* ---- Home page hero ---- */
article div.de-hero {
  box-sizing: border-box;
  border-left: 4px solid var(--de-blue);
  background: var(--de-blue-tint);
  padding: 1.5rem 2rem 1.5rem 1.75rem !important;  /* beats theme .container rules */
  margin: 0 0 2rem;
  border-radius: 0 6px 6px 0;
}
article div.de-hero > p { font-size: 1.1rem; margin: 0.4rem 0 1.25rem; max-width: 40em; }
article div.de-hero > p.de-kicker { margin: 0 0 0.5rem; font-size: 0.78rem; }
article div.de-actions {
  display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center;
}
article div.de-actions > p { margin: 0; }
article div.de-actions .sd-btn { margin: 0; }

.de-kicker {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--de-accent);
  margin-bottom: 0.25rem;
}

/* ---- Cards ---- */
.sd-card { border-color: var(--de-rule); }
.sd-card.sd-card-hover:hover { border-color: var(--de-blue); }
.sd-card-title { color: var(--de-blue); }

/* ---- Spec tables from fftcores ---- */
table.fftcore-table { width: 100%; }
table.fftcore-specs td:first-child { font-weight: 600; white-space: nowrap; width: 30%; }
table.fftcore-table td.fftcore-tbd { color: var(--color-foreground-muted); font-style: italic; }

/* ---- Sidebar call to action ---- */
.sidebar-cta {
  margin: 1rem var(--sidebar-item-spacing-horizontal, 1rem) 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-sidebar-background-border);
  font-size: var(--sidebar-item-font-size, 0.875rem);
}
.sidebar-cta__button {
  display: block;
  text-align: center;
  padding: 0.5rem 0.75rem;
  border-radius: 5px;
  background: var(--de-blue);
  color: var(--sd-color-primary-text) !important;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 0.75rem;
}
.sidebar-cta__button:hover { background: var(--de-blue-dark); }
.sidebar-cta__line { margin: 0.2rem 0; }
.sidebar-cta__line a { color: var(--color-sidebar-link-text); text-decoration: none; }
.sidebar-cta__draft { margin-top: 0.75rem; }
.sidebar-cta__draft a { color: var(--de-accent); }

/* ---- News list ---- */
.de-date { color: var(--color-foreground-muted); font-size: 0.9rem; }

/* ---- Product headline numbers ---- */
.de-stats { margin: 1.25rem 0 1.5rem; }
.de-stats .sd-col > * {
  border-top: 3px solid var(--de-blue);
  padding-top: 0.5rem;
}
.de-stat-num {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--de-blue);
  font-variant-numeric: tabular-nums;
}
.de-stat-label {
  display: block;
  font-size: 0.85rem;
  color: var(--color-foreground-muted);
}

/* ---- Diagrams: SVGs have white backgrounds, so frame them in both modes ---- */
figure.de-diagram img {
  width: 100%;
  height: auto;
  border: 1px solid var(--de-rule);
  border-radius: 6px;
  background: #fff;
}

/* ---- Small "New" badge in card titles ---- */
.de-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
  background: var(--de-accent);
  border-radius: 3px;
  padding: 0.1rem 0.4rem;
  margin-left: 0.4rem;
  vertical-align: middle;
}

/* ---- Datasheet download link styled as a button ---- */
.de-download { margin: 1rem 0 1.5rem; }
.de-download a.download {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--de-blue);
  border-radius: 5px;
  color: var(--de-blue);
  font-weight: 600;
  text-decoration: none;
}
.de-download a.download:hover { background: var(--de-blue); color: var(--sd-color-primary-text); }
.de-download a.download code {
  font-family: inherit; font-size: inherit; font-weight: inherit;
  color: inherit; background: none; border: 0; padding: 0;
}

/* ---- Contact form ---- */
.de-form { max-width: 36rem; margin: 1.25rem 0 2rem; }
.de-form__row { margin-bottom: 1rem; }
.de-form label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
.de-form label span { color: var(--de-accent); }
.de-form input,
.de-form select,
.de-form textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 0.5rem 0.6rem;
  font: inherit;
  color: var(--color-foreground-primary);
  background: var(--color-background-primary);
  border: 1px solid var(--de-rule);
  border-radius: 5px;
}
.de-form textarea { resize: vertical; min-height: 8rem; }
.de-form input:focus,
.de-form select:focus,
.de-form textarea:focus { outline: 2px solid var(--de-blue); outline-offset: 1px; border-color: var(--de-blue); }
.de-form__submit {
  padding: 0.55rem 1.2rem;
  font: inherit;
  font-weight: 600;
  color: var(--sd-color-primary-text);
  background: var(--de-blue);
  border: 0;
  border-radius: 5px;
  cursor: pointer;
}
.de-form__submit:hover { background: var(--de-blue-dark); }
.de-form__note { font-size: 0.85rem; color: var(--color-foreground-muted); margin-top: 0.75rem; }
/* honeypot: off-screen for people, still present for bots */
.de-form__hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
