/* CPS_GLOBAL_LOGO_SIZE_FIX_V1
   Brand-logo sizing only. Institution/student/photo/card artwork is intentionally excluded. */
:root {
  --cps-brand-logo-max-width: 148px;
  --cps-brand-logo-max-height: 46px;
}

/* Shared CPS Digital Solutions image used by the logo runtime/replacer. */
img.cps-company-logo-image,
img.cps-company-logo,
img.cps-digital-solutions-header-logo,
img[alt*="CPS Digital Solutions" i],
img[title*="CPS Digital Solutions" i],
img[src*="cps-digital-solutions-logo" i] {
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: min(var(--cps-brand-logo-max-width), 18vw) !important;
  max-height: var(--cps-brand-logo-max-height) !important;
  object-fit: contain !important;
}

/* Main application login and welcome artwork: keep the brand mark compact. */
.cps-promo-brand img,
.cps-login-card-brand img,
.cps-welcome img,
.welcome-art img,
.cps-welcome .cps-company-logo-image {
  width: auto !important;
  height: auto !important;
  max-width: 142px !important;
  max-height: 44px !important;
  object-fit: contain !important;
}

/* Advanced Designer's older header rules used viewport-based logo widths. */
header .brand.cps-brand-logo {
  width: auto !important;
  max-width: 178px !important;
  min-width: 0 !important;
  flex: 0 1 auto !important;
  gap: 8px !important;
}
header .brand.cps-brand-logo .cps-digital-solutions-header-logo {
  width: auto !important;
  max-width: 108px !important;
  height: auto !important;
  max-height: 38px !important;
  object-fit: contain !important;
}
header .brand.cps-brand-logo .cps-designer-brand-copy {
  min-width: 0 !important;
}
header .brand.cps-brand-logo .cps-designer-brand-title {
  font-size: 15px !important;
  line-height: 1.15 !important;
}
header .brand.cps-brand-logo .cps-designer-brand-copy small {
  font-size: 8px !important;
}

/* Welcome overlay logo should not consume a large part of the viewport. */
#cpsAdvancedWelcomeOverlayV1 .cps-aw-logo {
  min-height: 48px !important;
  margin-bottom: 12px !important;
}
#cpsAdvancedWelcomeOverlayV1 .cps-aw-logo img {
  width: auto !important;
  max-width: 180px !important;
  max-height: 54px !important;
}

/* Keep small square CPS marks compact without affecting school/institute logos. */
.top .logo,
.brand-mark,
.brand .brand-mark,
.side-brand .brand-mark,
.bw-brand-mark {
  flex-shrink: 0;
}

/* On narrow screens retain a readable but smaller company wordmark. */
@media (max-width: 700px) {
  :root {
    --cps-brand-logo-max-width: 112px;
    --cps-brand-logo-max-height: 36px;
  }
  .cps-promo-brand img,
  .cps-login-card-brand img,
  .cps-welcome img,
  .welcome-art img {
    max-width: 108px !important;
    max-height: 34px !important;
  }
  header .brand.cps-brand-logo .cps-digital-solutions-header-logo {
    max-width: 82px !important;
    max-height: 30px !important;
  }
}