/* Delta Drivers: the header brand (mark + name).
   Loaded in every page's <head> by templates/partials/brand_head.html; the
   markup is templates/partials/brand_logo.html.

   The selectors on the mark are deliberately specific: main.css shrinks any
   header logo image to `width: 80%` below 576px, which would size the mark
   from the width of the link around it. */

.dd-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  line-height: 1;
  text-decoration: none;
  /* --color-dark-1 is the theme's ink; it turns white in dark mode */
  color: var(--color-dark-1, #140342);
  -webkit-tap-highlight-color: transparent;
}
.dd-brand:hover { color: var(--color-dark-1, #140342); text-decoration: none; }
.dd-brand:focus-visible { outline: 2px solid #D97706; outline-offset: 4px; border-radius: 6px; }

.header__logo a.dd-brand > img.dd-brand__mark {
  display: block;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
}

/* Coloured on the text itself: the theme colours header links a soft slate,
   and the name should carry the same ink as the page headings. */
.header__logo .dd-brand__word,
.dd-brand__word {
  font-family: "Work Sans", "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--color-dark-1, #140342);
}
.dd-brand__word b { font-weight: 700; }

/* Phones */
@media (max-width: 575px) {
  .dd-brand { gap: 8px; }
  .header__logo a.dd-brand > img.dd-brand__mark { width: 32px; height: 32px; }
  .header__logo .dd-brand__word, .dd-brand__word { font-size: 17px; }
}

/* Small phones (iPhone SE first generation, compact Androids): less space
   before the logo (the theme's margin utilities are !important) so the name
   keeps clear of the notification bell. */
@media (max-width: 359px) {
  .dd-brand { gap: 7px; }
  .header .header__logo.ml-30 { margin-left: 14px !important; }
  .header__logo a.dd-brand > img.dd-brand__mark { width: 28px; height: 28px; }
  .header__logo .dd-brand__word, .dd-brand__word { font-size: 15px; }
}

/* The PMT dashboards put an "Override" alert beside the logo. On a phone
   there is not room for the name, the alert, the bell and the profile
   picture, and the picture used to be pushed off the right edge. So on a
   phone the name gives way (the mark stays) and the alert shrinks to its
   icon and count; its tooltip still says what it is. `.header` outranks the
   page's own .hdr-alert rules, which load after this file. */
@media (max-width: 480px) {
  .header__logo:has(+ .hdr-alert) .dd-brand__word { display: none; }
  .header .hdr-alert { font-size: 0; gap: 6px; padding: 6px 10px; margin-left: 12px; }
  .header .hdr-alert i { font-size: 13px; }
}
