/* ==========================================================================
   NHV-18 — Manufacturer pages
   ==========================================================================
   Only the brand index needs its own styles. The brand product listing reuses
   blocks/category.css, the shared listing stylesheet. */

/* --- A-Z jump list --------------------------------------------------------- */

.nhv-brand-index {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 0 0 24px;
  padding: 12px 14px;
  background: var(--nhv-sand);
  border: 1px solid var(--nhv-rule-warm);
  border-radius: var(--nhv-radius-sm);
}
.nhv-brand-index-label {
  font-family: var(--nhv-font-display);
  font-size: var(--nhv-fs-small);
  font-weight: var(--nhv-fw-bold);
  color: var(--nhv-navy);
}
.nhv-brand-index ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nhv-brand-index a {
  display: block;
  min-width: 26px;
  padding: 3px 6px;
  font-family: var(--nhv-font-display);
  font-size: var(--nhv-fs-small);
  font-weight: var(--nhv-fw-semi);
  text-align: center;
  color: var(--nhv-navy);
  background: var(--nhv-cream-bright);
  border: 1px solid var(--nhv-rule-warm);
  border-radius: var(--nhv-radius-sm);
  text-decoration: none;
}
.nhv-brand-index a:hover,
.nhv-brand-index a:focus { color: var(--nhv-cream-bright); background: var(--nhv-copper); border-color: var(--nhv-copper); }
.nhv-brand-index a:focus-visible { outline: 2px solid var(--nhv-copper); outline-offset: 2px; }

/* --- Letter groups --------------------------------------------------------- */

.nhv-brand-group { margin: 0 0 26px; }

.nhv-brand-letter {
  margin: 0 0 12px;
  padding: 0 0 8px;
  font-family: var(--nhv-font-display);
  font-size: var(--nhv-fs-h4, 18px);
  font-weight: var(--nhv-fw-bold);
  color: var(--nhv-navy);
  border-bottom: 2px solid var(--nhv-copper);
  /* The jump links land here; without this the heading sits under nothing but
     the very top of the viewport. */
  scroll-margin-top: 16px;
}

/* --- Brand cards ----------------------------------------------------------- */

.nhv-brand-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nhv-brand-grid > li { display: flex; }

.nhv-brand-card {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--nhv-cream-bright);
  border: 1px solid var(--nhv-rule-warm);
  border-radius: var(--nhv-radius-sm);
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.nhv-brand-card:hover,
.nhv-brand-card:focus { border-color: var(--nhv-copper); background: var(--nhv-sand); text-decoration: none; }
.nhv-brand-card:focus-visible { outline: 2px solid var(--nhv-copper); outline-offset: 2px; }

/* The chip carries --nhv-brand-ground because the logo JPGs have #3F3F3F baked
   in — the same reasoning as the NHV-11 filter chips and the NHV-04 strip. */
.nhv-brand-card-media {
  flex: 0 0 auto;
  display: block;
  width: 42px;
  height: 42px;
  overflow: hidden;
  background: var(--nhv-brand-ground);
  border-radius: var(--nhv-radius-sm);
}
.nhv-brand-card-media img { width: 100%; height: 100%; object-fit: contain; display: block; }

.nhv-brand-card-name {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--nhv-font-body);
  font-size: var(--nhv-fs-small);
  font-weight: var(--nhv-fw-semi);
  line-height: 1.3;
  color: var(--nhv-navy);
}
.nhv-brand-card:hover .nhv-brand-card-name { color: var(--nhv-copper); }

/* Roughly a third of the brands have no logo file. Rather than reserve an empty
   chip, the name takes the whole card and the row stays the same height. */
.nhv-brand-card.is-imageless { min-height: 60px; }

@media (max-width: 991px) { .nhv-brand-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 767px) { .nhv-brand-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 479px) { .nhv-brand-grid { grid-template-columns: 1fr; } }
