/* Find logos online: a search box, then each brand with a grid of its logos
   (every variation), each one ready to add, copy or download. */

.sheet--logos {
  width: min(1040px, calc(100vw - 32px));
}

.lgs {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lgs__form {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lgs__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 52px;
  padding: 0 20px 0 48px;
  border: 1px solid var(--line-input);
  border-radius: 999px;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  transition: border-color 0.2s var(--ease);
}

.lgs__input:focus {
  border-color: color-mix(in srgb, var(--ink) 45%, transparent);
}

.lgs__input::placeholder {
  color: var(--faint);
}

.lgs__icon {
  position: absolute;
  left: 18px;
  width: 18px;
  height: 18px;
  color: var(--faint);
  pointer-events: none;
}

.lgs__form .btn {
  height: 52px;
}

.lgs__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  min-height: 36px;
}

.lgs__status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.lgs__status--error {
  color: var(--danger);
}

.lgs__status--warn {
  color: color-mix(in srgb, #b26b00 85%, var(--ink));
}

.lgs__where {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.lgs__where svg {
  width: 16px;
  height: 16px;
}

.lgs__results {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.lgs__group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lgs__ghead {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lgs__mark {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--soft-2);
  object-fit: cover;
}

.lgs__mark--letter {
  display: grid;
  place-items: center;
  background: var(--mark);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
}

.lgs__gtext {
  flex: 1 1 auto;
  min-width: 0;
}

.lgs__gname {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
}

.lgs__gsub {
  overflow: hidden;
  color: var(--faint);
  font-size: 13px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lgs__gsub span + span::before {
  content: ' · ';
}

.lgs__open {
  flex: 0 0 auto;
  width: 36px;
  padding: 0;
}

.lgs__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.lgs__tile {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg);
}

.lgs__art {
  --pad: 20px;
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  background: var(--tile);
  transition: background 0.2s var(--ease);
}

/* Fills the tile whatever size the file says it is (SVGs often say none). */
.lgs__art img {
  position: absolute;
  inset: var(--pad);
  width: calc(100% - 2 * var(--pad));
  height: calc(100% - 2 * var(--pad));
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}

/* As in the library's logo grid: white art gets a soft grey edge, black art a light tile. */
.lgs__art.is-light-art img {
  filter: drop-shadow(0 0 0.6px var(--light-art-edge)) drop-shadow(0 0 9px var(--light-art-glow));
}

.lgs__art.on-light {
  background: #f3f3f3;
}

.lgs__art.is-loaded img {
  opacity: 1;
}

.lgs__art.is-broken img {
  display: none;
}

.lgs__art.is-broken::after {
  content: 'No preview';
  color: var(--faint);
  font-size: 12px;
}

.lgs__info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px 2px;
}

.lgs__label {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.3;
}

.lgs__formats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.lgs__fmt {
  height: 22px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: var(--soft-2);
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.lgs__fmt:hover,
.lgs__fmt:focus-visible {
  background: var(--soft-3);
  color: var(--ink);
}

.lgs__fmt.is-busy {
  opacity: 0.5;
  pointer-events: none;
}

.lgs__license {
  color: var(--faint);
  font-size: 11.5px;
}

.lgs__actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
  padding: 8px 12px 12px;
}

.lgs__add {
  flex: 1 1 auto;
}

.lgs__add[disabled] {
  background: var(--soft-2);
  color: var(--muted);
  opacity: 1;
}

.lgs__icon-btn {
  flex: 0 0 auto;
  width: 36px;
  padding: 0;
}

.lgs__more {
  align-self: flex-start;
}

.lgs__none {
  color: var(--faint);
  font-size: 13px;
}

.lgs__foot {
  text-align: left;
}

/* In the search palette: the way to logos the library doesn't have. */
.result--web {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.result--web .result__thumb {
  display: grid;
  place-items: center;
}

.result--web .result__thumb svg {
  width: 18px;
  height: 18px;
  opacity: 0.8;
}

@media (max-width: 560px) {
  .lgs__form .btn {
    display: none;
  }

  .lgs__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .lgs__art {
    --pad: 12px;
  }

  /* Two tiles a row leave no room for three buttons side by side. */
  .lgs__actions {
    flex-wrap: wrap;
    padding: 6px 8px 10px;
  }

  .lgs__add {
    flex-basis: 100%;
  }

  .lgs__icon-btn {
    flex: 1 1 0;
    width: auto;
  }

  .lgs__where {
    width: 100%;
  }
}

.lgs-settings {
  max-width: 640px;
}
