/* ==========================================================================
   Dar-us-Salam — Publishers (Brands) page
   Templates: catalog/brands.tpl + catalog/_partials/miniatures/brand.tpl
   ========================================================================== */

/* Publishers page — outer section spacing */
#main.brands-page {
  padding-bottom: 30px;
}

/* Publishers page header — H1 + SEO intro, centred above the grid */
.brands-page .brands-header {
  max-width: 820px;
  margin: 0 auto 28px;
  text-align: center;
}

/* Publishers page H1 — pulled from SEO & URLs meta title */
.brands-page .brands-title {
  margin: 0 0 10px;
  font-family: var(--title-font-family, Heebo), sans-serif;
  font-size: 28px;
  line-height: 1.25;
  color: var(--secondary-color, #111111);
}

/* Publishers page H1 — brand-yellow underline accent */
.brands-page .brands-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  margin: 12px auto 0;
  background: var(--primary-color, #fad505);
  border-radius: var(--border-radius, 5px);
}

/* Publishers page intro paragraph — pulled from SEO & URLs meta description */
.brands-page .brands-intro {
  margin: 0;
  font-family: var(--body-font-family, Heebo), sans-serif;
  font-size: var(--body-font-size, 15px);
  line-height: 1.6;
  color: #555555;
}

/* Publishers grid — auto-fill columns, replaces the old stacked row list */
.brands-page .brands-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Publishers grid — kill any legacy float/width rules on the old #brand_list li */
.brands-page .brands-grid > li {
  float: none;
  width: auto;
  list-style: none;
}

/* Publisher card — one grid cell */
.brands-page .brand-card {
  display: flex;
  background: #ffffff;
  border: 1px solid #e6e6e6;
  border-radius: var(--border-radius, 5px);
  overflow: hidden;
  transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease;
}

/* Publisher card — hover lift with brand-yellow border */
.brands-page .brand-card:hover {
  border-color: var(--primary-color, #fad505);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .10);
  transform: translateY(-3px);
}

/* Publisher card link — makes the entire tile clickable */
.brands-page .brand-card-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 16px 14px 14px;
  text-align: center;
  text-decoration: none;
  color: inherit;
}

/* Publisher logo box — fixed height so every card aligns */
.brands-page .brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100px;
  margin-bottom: 12px;
}

/* Publisher logo image — contained, never upscaled or distorted */
.brands-page .brand-logo img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Publisher name — <h2> for SEO, sized down visually */
.brands-page .brand-name {
  margin: 0 0 6px;
  font-family: var(--title-font-family, Heebo), sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--secondary-color, #111111);
  transition: color .2s ease;
}

/* Publisher name — hover uses the theme link colour */
.brands-page .brand-card:hover .brand-name {
  color: var(--link-hover-color, #0961b3);
}

/* Publisher short description — clamped to 2 lines to keep cards even */
.brands-page .brand-desc {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.45;
  color: #777777;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Publisher product counter — auto top margin pins it above the CTA */
.brands-page .brand-count {
  margin: auto 0 10px;
  font-size: 13px;
  color: #888888;
}

/* Publisher CTA — styled as a button, not a nested link */
.brands-page .brand-cta {
  display: inline-block;
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--secondary-color, #111111);
  background: var(--box-bodybkg-color, #F0F0F0);
  border-radius: var(--border-radius, 5px);
  transition: background .2s ease;
}

/* Publisher CTA — fills with brand yellow on card hover */
.brands-page .brand-card:hover .brand-cta {
  background: var(--primary-color, #fad505);
}

/* Publisher card — muted state for publishers with no live products */
.brands-page .brand-card--empty {
  opacity: .55;
}

/* Publisher card — keyboard focus ring for accessibility */
.brands-page .brand-card-link:focus-visible {
  outline: 2px solid var(--link-hover-color, #0961b3);
  outline-offset: 2px;
}

/* Publishers grid — tablet: slightly tighter cards */
@media (max-width: 991px) {
  .brands-page .brands-grid {
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 14px;
  }
  .brands-page .brand-logo {
    height: 88px;
  }
}

/* Publishers grid — phone: fixed 2 columns, description hidden */
@media (max-width: 575px) {
  .brands-page .brands-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .brands-page .brands-title {
    font-size: 22px;
  }
  .brands-page .brand-logo {
    height: 78px;
  }
  .brands-page .brand-desc {
    display: none;
  }
  .brands-page .brand-card-link {
    padding: 12px 10px 10px;
  }
}

/* Publisher card — disable hover transform for reduced-motion users */
@media (prefers-reduced-motion: reduce) {
  .brands-page .brand-card,
  .brands-page .brand-card:hover {
    transform: none;
    transition: none;
  }
}
