/**
 * Albi — brands.css
 *
 * Stranica "Robne marke" (template-robne-marke.php). A–Ž indeks + grupe po slovu
 * + grid kartica (logo + naziv) koje linkaju na archive marke. Učitava se samo
 * na toj stranici (vidi inc/enqueue.php). Scope: `.albi-brands`.
 */

.albi-brands {
  padding-block: var(--space-8, 32px) var(--space-12, 48px);
}

/* ---------------- Head + A–Ž indeks ---------------- */
.albi-brands__head {
  margin-bottom: var(--space-8, 32px);
}
.albi-brands__title {
  margin: 0 0 var(--space-4, 16px);
  font: 800 clamp(1.8rem, 1.2rem + 2vw, 2.6rem)/1.1 'Inter', sans-serif;
  color: var(--ink-1, #18181b);
}
.albi-brands__index {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  font-family: 'Inter', sans-serif;
}
.albi-brands__index-label {
  color: var(--ink-3, #52525b);
  font-size: var(--text-sm, .9rem);
  margin-right: 4px;
}
.albi-brands__index-link {
  color: var(--red, #dc2626);
  font-weight: 700;
  font-size: var(--text-md, 1rem);
  text-decoration: none;
  line-height: 1;
  transition: color .12s ease;
}
.albi-brands__index-link:hover { color: var(--red-deep, #b91c1c); text-decoration: underline; }

.albi-brands__intro { margin-bottom: var(--space-8, 32px); }

/* ---------------- Grupe po slovu ---------------- */
.albi-brands__group {
  /* anchor scroll offset ispod sticky headera (desktop header ~186px) */
  scroll-margin-top: 200px;
  margin-bottom: var(--space-10, 40px);
}
.albi-brands__letter {
  margin: 0 0 var(--space-5, 20px);
  font: 800 1.8rem/1 'Inter', sans-serif;
  color: var(--ink-1, #18181b);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-2, #e4e4e7);
}

/* ---------------- Grid kartica ---------------- */
.albi-brands__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-5, 20px);
}
.albi-brands__item { min-width: 0; }

.albi-brands__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  height: 100%;
  padding: 14px 12px;
  border-radius: var(--radius-md, 8px);
  text-decoration: none;
  transition: background .14s ease, box-shadow .14s ease, transform .14s ease;
}
.albi-brands__card:hover {
  background: #fff;
  box-shadow: 0 8px 22px -12px rgba(0, 0, 0, .22);
  transform: translateY(-2px);
}

.albi-brands__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 110px;
  background: #fff;
  border: 1px solid var(--line-2, #e4e4e7);
  border-radius: var(--radius-sm, 6px);
  padding: 12px;
}
.albi-brands__logo-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.albi-brands__name {
  text-align: center;
  color: var(--red, #dc2626);
  font: 600 var(--text-sm, .9rem)/1.3 'Inter', sans-serif;
  /* dugi naziv bez razmaka (npr. URL-like supplier string) ne smije razbiti grid */
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

/* Kartica bez logoa (rijetko — npr. 1 marka) ostaje vizualno balansirana. */
.albi-brands__card--no-logo {
  justify-content: center;
  min-height: 120px;
}
.albi-brands__card:hover .albi-brands__name { color: var(--red-deep, #b91c1c); }

.albi-brands__empty {
  color: var(--ink-3, #52525b);
  font-family: 'Inter', sans-serif;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 600px) {
  .albi-brands__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4, 16px);
  }
  .albi-brands__logo { height: 88px; }
  .albi-brands__letter { font-size: 1.5rem; }
  .albi-brands__group { scroll-margin-top: 180px; } /* mobilni header ~164px */
}
