/* ============================================================
   FMI Masonry Gallery — R2 navigation + home-screen pill policy
   v2.2.0
   ============================================================ */

/* ------------------------------------------------------------
   1. HOME SCREEN: no category pills.
   The pill row is a navigation control for lower-tier pages. On the
   home/showcase view the hero and the blended grid carry the page, so the
   row is suppressed and the space it occupied is reclaimed. Every other
   view — theme, category, subcategory, browse, filtered, favorites —
   renders the row exactly as before.
   ------------------------------------------------------------ */
/* Every pill goes — including any the core script injected dynamically. */
.fmi-mg-wrap.fmi-home-view .fmi-mg-category-btn {
  display: none !important;
}

/* No flash on load. The class is rendered server-side by the template, so the
   pill row is hidden in the very first paint; the scripts are in the footer and
   would otherwise let the full lavender row paint and then vanish. On a page
   that is NOT the home view the JS removes the class before anything renders
   below the hero. */

/* No pills and nothing else in the row (logged-out): collapse the whole block
   so the grid rises to meet the hero instead of leaving a gap. */
.fmi-mg-wrap.fmi-home-view .fmi-mg-category-buttons:not(.fmi-has-lb) {
  display: none !important;
}

/* Logged in, the Lightbox button lives in this row and must stay reachable.
   Keep a slim strip for it — it is absolutely positioned against the row. */
.fmi-mg-wrap.fmi-home-view .fmi-mg-category-buttons.fmi-has-lb {
  margin-bottom: 28px !important;
}
.fmi-mg-wrap.fmi-home-view .fmi-mg-category-buttons.fmi-has-lb .fmi-mg-category-row {
  min-height: 42px;
  padding-right: 0;
  gap: 0;
}

/* Breadcrumb and subcategory rows are lower-tier furniture — never on home. */
.fmi-mg-wrap.fmi-home-view .fmi-mg-breadcrumb,
.fmi-mg-wrap.fmi-home-view .fmi-mg-subcat-row {
  display: none !important;
}

/* ------------------------------------------------------------
   2. BREADCRUMB (Theme > Category > Subcategory)
   ------------------------------------------------------------ */
.fmi-mg-breadcrumb {
  padding: 0 6%;
  margin: 0 0 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

.fmi-mg-breadcrumb[hidden] { display: none; }

.fmi-mg-crumb {
  background: none;
  border: none;
  padding: 2px 0;
  margin: 0;
  font: inherit;
  color: var(--hero-purple, #71559c);
  cursor: pointer;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.fmi-mg-crumb:hover {
  border-bottom-color: var(--hero-purple, #71559c);
}

.fmi-mg-crumb-current,
.fmi-mg-crumb[aria-current="page"] {
  color: #444;
  cursor: default;
  font-weight: 500;
}
.fmi-mg-crumb-current:hover { border-bottom-color: transparent; }

.fmi-mg-crumb-sep {
  color: #b9b9b9;
  user-select: none;
}

/* ------------------------------------------------------------
   3. SUBCATEGORY PILLS
   Visually subordinate to the category pills above them: smaller, outlined
   rather than filled, so the hierarchy reads at a glance.
   ------------------------------------------------------------ */
.fmi-mg-subcat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.fmi-mg-subcat-row[hidden] { display: none; }

.fmi-mg-subcat-pill {
  background: transparent;
  border: 1px solid #d9cfe8;
  border-radius: 4px;
  padding: 7px 14px;
  font-family: 'Poppins', sans-serif;
  font-size: 13.5px;
  font-weight: 400;
  color: #6f6f6f;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.fmi-mg-subcat-pill:hover {
  border-color: #bfacd1;
  background: #f4f0f9;
  color: #444;
  transform: translateY(-1px);
}

.fmi-mg-subcat-pill.active {
  background: #d9cfe8;
  border-color: #bfacd1;
  color: #333;
  font-weight: 500;
}

.fmi-mg-subcat-count {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  color: #9a9a9a;
}

.fmi-mg-subcat-pill.active .fmi-mg-subcat-count { color: #6b6b6b; }

/* ------------------------------------------------------------
   4. RESPONSIVE
   ------------------------------------------------------------ */
@media (max-width: 768px) {
  .fmi-mg-breadcrumb { font-size: 13px; margin-bottom: 14px; }
  .fmi-mg-subcat-row { padding-right: 0; gap: 8px; }
  .fmi-mg-subcat-pill { font-size: 12.5px; padding: 6px 12px; }
}
