/**
 * Imposter — brands directory (/marcas/).
 * Scoped to .imposter-brands-index — never global.
 * Editorial compact cards: shared shell for logo + typographic variants.
 */

.imposter-brands-index {
  --im-bi-ink: #04200f;
  --im-bi-muted: #576d80;
  --im-bi-line: rgba(4, 32, 15, 0.09);
  --im-bi-line-hover: rgba(4, 32, 15, 0.18);
  --im-bi-soft: #f7f8f7;
  --im-bi-soft-hover: #f1f4f2;
  --im-bi-green: #18b26b;
  --im-bi-radius: 14px;

  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px 12px;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 8px 0 48px;
  box-sizing: border-box;
}

.imposter-brands-index__empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--im-bi-muted);
  font-size: 15px;
}

/* Shared shell — logo and text occupy the same box */
.imposter-brands-index__card {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1.65 / 1;
  width: 100%;
  min-height: 0;
  padding: 0;
  text-decoration: none !important;
  color: var(--im-bi-ink);
  background: var(--im-bi-soft);
  border: 1px solid var(--im-bi-line);
  border-radius: var(--im-bi-radius);
  overflow: hidden;
  box-shadow: none;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    transform 0.2s ease;
}

.imposter-brands-index__card:hover,
.imposter-brands-index__card:focus-visible {
  background: var(--im-bi-soft-hover);
  border-color: var(--im-bi-line-hover);
  transform: scale(1.015);
  outline: none;
}

/* Corner arrow ↗ */
.imposter-brands-index__card::after {
  content: "↗";
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  color: var(--im-bi-ink);
  opacity: 0.22;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.imposter-brands-index__card:hover::after,
.imposter-brands-index__card:focus-visible::after {
  opacity: 0.7;
  transform: translate(1px, -1px);
}

/* Media + name share the same grid cell */
.imposter-brands-index__media {
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 18px 22px;
  box-sizing: border-box;
  background: transparent;
  overflow: hidden;
}

.imposter-brands-index__card--text .imposter-brands-index__media {
  display: none;
}

.imposter-brands-index__img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  transition: transform 0.22s ease;
}

.imposter-brands-index__card:hover .imposter-brands-index__img,
.imposter-brands-index__card:focus-visible .imposter-brands-index__img {
  transform: scale(1.03);
}

/* Typographic name — primary graphic when no logo */
.imposter-brands-index__name {
  grid-area: 1 / 1;
  place-self: center;
  z-index: 1;
  box-sizing: border-box;
  width: calc(100% - 12px);
  max-width: 100%;
  margin: 0;
  padding: 16px 20px;
  text-align: center;
  font-size: clamp(15px, 1.35vw, 19px);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.025em;
  color: var(--im-bi-ink);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: break-word;
}

.imposter-brands-index__card--text .imposter-brands-index__name {
  padding: 18px 22px;
  font-size: clamp(16px, 1.55vw, 21px);
  letter-spacing: -0.028em;
}

/* With logo: keep name for a11y, hide visually — logo is the graphic */
.imposter-brands-index__card--has-image .imposter-brands-index__name {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Legacy hint removed from visual system */
.imposter-brands-index__hint {
  display: none !important;
}

/* Page intro */
.imposter-brands-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 24px 0;
  box-sizing: border-box;
}

.imposter-brands-page__eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--im-bi-green, #18b26b);
}

.imposter-brands-page__title {
  margin: 0 0 12px;
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #04200f;
}

.imposter-brands-page__lede {
  margin: 0 0 36px;
  max-width: 36em;
  font-size: 17px;
  line-height: 1.5;
  font-weight: 400;
  color: #576d80;
}

/* Tablet: 3 cols */
@media (max-width: 960px) {
  .imposter-brands-index {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  .imposter-brands-index__card {
    aspect-ratio: 1.6 / 1;
  }

  .imposter-brands-index__card--text .imposter-brands-index__name {
    font-size: clamp(15px, 2.4vw, 18px);
    padding: 16px 18px;
  }

  .imposter-brands-page {
    padding: 36px 20px 0;
  }
}

/* Mobile: 2 cols */
@media (max-width: 640px) {
  .imposter-brands-index {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding-bottom: 36px;
  }

  .imposter-brands-index__card {
    aspect-ratio: 1.55 / 1;
  }

  .imposter-brands-index__media {
    padding: 14px 16px;
  }

  .imposter-brands-index__card--text .imposter-brands-index__name {
    font-size: clamp(14px, 3.8vw, 16px);
    padding: 14px 14px;
    line-height: 1.2;
  }

  .imposter-brands-index__card::after {
    top: 8px;
    right: 9px;
    font-size: 11px;
    opacity: 0.28;
  }

  .imposter-brands-page {
    padding: 28px 16px 0;
  }

  .imposter-brands-page__lede {
    font-size: 15px;
    margin-bottom: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .imposter-brands-index__card,
  .imposter-brands-index__img,
  .imposter-brands-index__card::after {
    transition: none;
  }

  .imposter-brands-index__card:hover,
  .imposter-brands-index__card:focus-visible {
    transform: none;
  }

  .imposter-brands-index__card:hover .imposter-brands-index__img,
  .imposter-brands-index__card:focus-visible .imposter-brands-index__img {
    transform: none;
  }
}
