/**
 * Brands directory — A–Z listing of product_brand terms.
 */

/* Hide Kadence page hero when directory markup is present (pre-theme-sync). */
.entry-hero:has(+ * .vp-brands),
.entry-header:has(+ * .vp-brands),
.wp-site-blocks .entry-hero:has(~ * .vp-brands) {
  display: none !important;
}

body.page-slug-brands .entry-hero,
body.page-id-22207 .entry-hero,
.vp-brands-page ~ .entry-hero {
  display: none !important;
}

/* Fallback: if hero wraps title above content */
.page-id-22207 .entry-hero,
.page-id-22207 .entry-header.entry-hero-container {
  display: none !important;
}

.vp-brands-page {
  background: #f7f8fa;
  color: var(--vp-ink, #1d1d1d);
}

.vp-brands-page__inner {
  width: min(100% - 2rem, var(--global-content-width, 1290px));
  margin: 0 auto;
  padding: clamp(2rem, 4vw, 3.25rem) 0 clamp(3rem, 6vw, 4.5rem);
}

.vp-brands__hero {
  margin-bottom: 1.75rem;
}

.vp-brands__eyebrow {
  margin: 0 0 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7280;
}

.vp-brands__title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.85rem, 3.2vw, 2.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.vp-brands__lede {
  margin: 0;
  max-width: 36rem;
  font-size: 1rem;
  line-height: 1.55;
  color: #4b5563;
}

.vp-brands__letters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 2rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--vp-line, #e8eaee);
  border-bottom: 1px solid var(--vp-line, #e8eaee);
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(247, 248, 250, 0.96);
  backdrop-filter: blur(6px);
}

.vp-brands__letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.45rem;
  border-radius: 4px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--vp-ink, #1d1d1d);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.vp-brands__letter:hover,
.vp-brands__letter:focus-visible {
  background: #151922;
  color: #fff;
  outline: none;
}

.vp-brands__sections {
  display: grid;
  gap: 1.75rem;
}

.vp-brands__section-title {
  margin: 0 0 0.75rem;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.vp-brands__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.75rem;
}

.vp-brands__link {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  height: 100%;
  min-height: 0;
  padding: 0.85rem 0.75rem 0.75rem;
  background: #fff;
  border: 1px solid var(--vp-line, #e8eaee);
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.vp-brands__link:hover,
.vp-brands__link:focus-visible {
  border-color: #151922;
  box-shadow: 0 2px 8px rgba(21, 25, 34, 0.06);
  outline: none;
}

.vp-brands__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 3 / 2;
  padding: 0.5rem;
  background: #f3f4f6;
  border-radius: 6px;
  overflow: hidden;
}

.vp-brands__logo-img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
}

.vp-brands__item:not(.has-logo) .vp-brands__logo {
  background: #151922;
  padding: 0.65rem 0.75rem;
}

.vp-brands__logo-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  max-width: 100%;
  margin: 0;
  color: #fff;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: clamp(0.7rem, 2.4vw, 0.95rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-align: center;
  text-wrap: balance;
  word-break: break-word;
}

.vp-brands__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem;
  min-height: 1.35rem;
}

.vp-brands__name {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
}

.vp-brands__count {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: #6b7280;
}

.vp-brands__empty {
  margin: 2rem 0;
  color: #6b7280;
}

@media (max-width: 640px) {
  .vp-brands__grid {
    grid-template-columns: 1fr 1fr;
  }

  .vp-brands__letters {
    top: 0;
  }
}
