/*
 * Media layer contract
 * ---------------------
 * visual-assets.js returns complete inline SVGs with the classes below.
 * `.card-artwork` is the compact 320×112 category strip; `.category-glyph`
 * and `.ui-icon` are currentColor line icons. The selectors intentionally
 * work both when an SVG is inserted directly and when a parent wrapper gets
 * the class, so callers can choose the most convenient template shape.
 *
 * This file loads after style.css. It adds the editorial media layer and
 * leaves the existing page layout, palette, and component APIs intact.
 */

:root {
  --media-paper: var(--papel);
  --media-ink: var(--tinta);
  --media-muted: var(--tinta-2);
  --media-line: var(--linea);
  --media-green: var(--seleccion);
  --media-dark: var(--tinta);
  --media-coral: var(--peligro);
  --media-focus: var(--foco);
}

.category-glyph,
.ui-icon {
  display: inline-block;
  flex: 0 0 auto;
  vertical-align: middle;
  color: currentColor;
  forced-color-adjust: auto;
}

.category-glyph {
  width: 24px;
  height: 24px;
  color: var(--tinta-2);
}

.category-glyph svg,
.ui-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

svg.category-glyph,
svg.ui-icon {
  display: block;
  overflow: visible;
}

.ui-icon {
  --ui-icon-size: 1.25rem;
  width: var(--ui-icon-size);
  height: var(--ui-icon-size);
  color: currentColor;
}

button > .ui-icon,
a > .ui-icon {
  pointer-events: none;
}

.model-badge,
.brand-stack {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.model-badge {
  gap: 6px;
  min-height: 30px;
  max-width: 100%;
  padding: 4px 10px 4px 6px;
  border: var(--borde-fino);
  border-radius: var(--radio-pildora);
  background: var(--hoja);
  color: var(--tinta);
  font-weight: 700;
  white-space: nowrap;
}

.model-logo {
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  object-fit: contain;
  object-position: center;
  filter: none;
  opacity: 1;
  mix-blend-mode: normal;
}

/* Claude Code ships as a wide official lockup rather than a square mark.
   Preserve its ratio and source colours; the other provider marks stay at
   the compact 20/24px sizes above. */
.model-badge[data-brand="claude-code"] .model-logo {
  width: 90px;
  height: 20px;
  flex-basis: 90px;
}

.brand-stack {
  gap: 8px;
  flex: 0 0 auto;
}

.model-badge {
  vertical-align: middle;
  white-space: normal;
}

.model-badge > span:last-child {
  overflow-wrap: anywhere;
}

/* In sentences and controls the logo follows the name without an extra box. */
.test-intro .model-badge,
.test-summary .model-badge,
.test-models .model-badge,
.test-block summary .model-badge,
.test-shot figcaption .model-badge,
.ts-control .model-badge,
.ts-dropdown .model-badge {
  border: 0;
  padding: 0;
  min-height: 24px;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
}

.test-models .model-badge {
  display: inline-flex;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chip .category-glyph {
  width: 18px;
  height: 18px;
  color: currentColor;
}

.save[aria-pressed="true"] .ui-icon {
  fill: var(--acento);
}

.brand-stack .model-logo {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
}

.model-badge strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 650;
}

.model-badge:focus-visible,
.ui-icon:focus-visible,
.category-glyph:focus-visible {
  outline: 3px solid var(--media-focus);
  outline-offset: 3px;
}

.model-badge {
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 740px) {
  .filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    gap: 10px;
  }

  .filters > label,
.filters .ts-wrapper {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .filters #clear-filters {
    justify-self: start;
  }
}

@media (max-width: 390px) {
  .model-logo {
    width: 20px;
    height: 20px;
    flex-basis: 20px;
  }
}


@media (forced-colors: active) {
  .model-badge {
    border: 1px solid CanvasText;
    background: Canvas;
    color: CanvasText;
  }
}
