/* TUF_UNIVERSAL_LOGO_FRAME_V3_MIDNIGHT_CARRIER
 * Official logo artwork remains untouched.
 * The default carrier owns geometry only. Product Radar adds one restrained,
 * shared light carrier for image-backed marks in Midnight.
 */

.tuf-universal-logo-frame {
  --tuf-logo-frame-size: 44px;
  --tuf-logo-frame-pad: 7px;
  display: inline-grid !important;
  place-items: center !important;
  flex: 0 0 var(--tuf-logo-frame-size) !important;
  width: var(--tuf-logo-frame-size) !important;
  height: var(--tuf-logo-frame-size) !important;
  min-width: var(--tuf-logo-frame-size) !important;
  min-height: var(--tuf-logo-frame-size) !important;
  box-sizing: border-box !important;
  padding: var(--tuf-logo-frame-pad) !important;
  margin: 0 !important;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: inherit !important;
  line-height: 1 !important;
  isolation: isolate;
}

.tuf-universal-logo-frame__image {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
  opacity: 1 !important;
}

.tuf-universal-logo-frame__fallback {
  display: grid !important;
  place-items: center !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #152236 !important;
  font: 800 16px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

.tuf-universal-logo-frame--directory {
  --tuf-logo-frame-size: 64px;
  --tuf-logo-frame-pad: 10px;
}

/* Let HONOR's wide official wordmark use more of the existing directory frame. */
body.tuf-b2-radar .tuf-product-mark[class*="tuf-product-mark--honor-"] {
  --tuf-logo-frame-pad: 4px;
}

/* Let Samsung's wide official wordmark use more of the existing directory frame. */
body.tuf-b2-radar .tuf-product-mark[class*="tuf-product-mark--samsung-"] {
  --tuf-logo-frame-pad: 4px;
}

/* Let Relume's wide official logo use more of the existing directory frame. */
body.tuf-b2-radar .tuf-product-mark[class*="tuf-product-mark--relume"] {
  --tuf-logo-frame-pad: 4px;
}

/* Let UX Pilot's wide official wordmark use more of the existing directory frame. */
body.tuf-b2-radar .tuf-product-mark[class*="tuf-product-mark--ux-pilot"] {
  --tuf-logo-frame-pad: 4px;
}

/* Let DaFont's wide official wordmark use more of the existing directory frame. */
body.tuf-b2-radar .tuf-product-mark[class*="tuf-product-mark--dafont"] {
  --tuf-logo-frame-pad: 4px;
}

/* Let Pixabay's official mark use more of the existing directory frame. */
body.tuf-b2-radar .tuf-product-mark[class*="tuf-product-mark--pixabay"] {
  --tuf-logo-frame-pad: 4px;
}

/* Preserve the original detail identity footprint (88px), but remove its plate. */
.tuf-product-detail__icon.tuf-universal-logo-frame--detail,
.tuf-universal-logo-frame--detail {
  --tuf-logo-frame-size: 88px;
  --tuf-logo-frame-pad: 8px;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: inherit !important;
}

.tuf-universal-logo-frame--detail .tuf-universal-logo-frame__fallback {
  font-size: 22px !important;
}

.tuf-radar-list .tuf-universal-logo-frame {
  --tuf-logo-frame-size: 36px;
  --tuf-logo-frame-pad: 6px;
}

.tuf-category-products .tuf-universal-logo-frame {
  --tuf-logo-frame-size: 44px;
  --tuf-logo-frame-pad: 7px;
}

.tuf-home-product-grid .tuf-universal-logo-frame {
  --tuf-logo-frame-size: 52px;
  --tuf-logo-frame-pad: 8px;
}

.tuf-radar-list a,
.tuf-product-detail__identity,
.tuf-category-products a {
  align-items: center;
}

/* Kill every legacy product-mark/detail paint once the universal carrier is present. */
.tuf-product-mark.tuf-universal-logo-frame,
.tuf-product-detail__icon.tuf-universal-logo-frame,
.tuf-universal-logo-frame[class*="chatgpt"],
.tuf-universal-logo-frame[class*="claude"],
.tuf-universal-logo-frame[class*="notion"],
.tuf-universal-logo-frame[class*="figma"],
.tuf-universal-logo-frame[class*="mark"],
.tuf-universal-logo-frame[class*="icon"],
html[data-tuf-style="original"] .tuf-universal-logo-frame,
html[data-tuf-style="midnight"] .tuf-universal-logo-frame,
html[data-tuf-style="sage"] .tuf-universal-logo-frame,
html[data-tuf-style="lavender"] .tuf-universal-logo-frame {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Never let theme-specific styling alter the brand artwork itself. */
.tuf-product-mark.tuf-universal-logo-frame img,
.tuf-product-detail__icon.tuf-universal-logo-frame img,
html[data-tuf-style] .tuf-universal-logo-frame__image {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  filter: none !important;
  mix-blend-mode: normal !important;
}

/*
 * Midnight contrast is a shared presentation concern, not product metadata.
 * :has() limits the carrier to image-backed frames, leaving letter fallbacks
 * and browser-broken images on their existing path. The one-pixel padding
 * adjustment offsets the border, preserving the current artwork footprint.
 */
html[data-tuf-style="midnight"] body.tuf-b2-radar
  .tuf-universal-logo-frame:has(> .tuf-universal-logo-frame__image),
html[data-tuf-style="midnight"] body.tuf-b2-product-detail
  .tuf-universal-logo-frame:has(> .tuf-universal-logo-frame__image) {
  padding: calc(var(--tuf-logo-frame-pad) - 1px) !important;
  overflow: hidden !important;
  border: 1px solid #d8e1eb !important;
  border-radius: 11px !important;
  background: #f7f9fc !important;
  box-shadow: none !important;
}
