/*
 * Homepage and discovery modules.
 *
 * Compact by intent: no full-viewport hero, no decorative whitespace blocks.
 * Every module below is only rendered when it has data, so the spacing here
 * assumes sections may be absent and must not leave gaps.
 */

.nbd-home {
  padding-block: var(--nbd-space-5) var(--nbd-space-7);
}

/* ------------------------------------------------------------------ intro */

.nbd-home__intro {
  padding-bottom: var(--nbd-space-5);
  margin-bottom: var(--nbd-space-5);
  border-bottom: var(--nbd-hairline);
}

.nbd-home__title {
  font-size: var(--nbd-text-2xl);
  max-width: 22ch;
  margin-bottom: var(--nbd-space-3);
}

@media (min-width: 768px) {
  .nbd-home__title {
    font-size: var(--nbd-text-3xl);
    max-width: 28ch;
  }
}

.nbd-home__lede {
  max-width: 62ch;
  color: var(--nbd-muted);
  margin-bottom: var(--nbd-space-3);
}

/* ----------------------------------------------------------------- search */

.nbd-home__search { margin-bottom: var(--nbd-space-4); }

/* Visible label, not a placeholder-as-label: a placeholder disappears on focus
   and is not reliably announced. */
.nbd-home__search-label {
  display: block;
  font-size: var(--nbd-text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--nbd-muted);
  margin-bottom: var(--nbd-space-2);
}

.nbd-home__search-row {
  display: flex;
  gap: var(--nbd-space-2);
  max-width: 34rem;
}

.nbd-home__search-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: var(--nbd-space-2) var(--nbd-space-3);
  border: 1px solid var(--nbd-border-strong);
  border-radius: var(--nbd-radius);
  background: var(--nbd-white);
  color: var(--nbd-ink);
  font-family: inherit;
  font-size: var(--nbd-text-base);
}

.nbd-home__search .nbd-btn { flex: none; }

/* Visually distinct from a country chip: this one goes to a different kind of
   page, and looking identical would imply it filters like the others. */
.nbd-chip--more {
  font-weight: 600;
  border-style: dashed;
}

.nbd-home__stats {
  font-family: var(--nbd-font-mono);
  font-size: var(--nbd-text-sm);
  color: var(--nbd-muted);
  margin: 0;
}

/* --------------------------------------------------------------- sections */

.nbd-home__section {
  margin-bottom: var(--nbd-space-6);
}

.nbd-home__section-title {
  font-size: var(--nbd-text-lg);
  padding-bottom: var(--nbd-space-2);
  margin-bottom: var(--nbd-space-3);
  border-bottom: var(--nbd-hairline);
}

.nbd-home__note {
  color: var(--nbd-muted);
  font-size: var(--nbd-text-sm);
  max-width: 60ch;
  margin-bottom: var(--nbd-space-3);
}

/* ------------------------------------------------------------------ chips */

.nbd-chiplist {
  display: flex;
  flex-wrap: wrap;
  gap: var(--nbd-space-2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nbd-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--nbd-space-2);
  /* 44px target: these are the primary discovery controls and are used on
     touch devices more than anything else on the page. */
  min-height: 44px;
  padding: var(--nbd-space-2) var(--nbd-space-3);
  background: var(--nbd-white);
  border: var(--nbd-hairline);
  border-radius: var(--nbd-radius);
  color: var(--nbd-ink);
  font-size: var(--nbd-text-sm);
  font-weight: 600;
  text-decoration: none;
  transition: border-color 120ms ease;
}

.nbd-chip:hover,
.nbd-chip:focus-visible {
  border-color: var(--nbd-ink);
  color: var(--nbd-ink);
}

.nbd-chip__count {
  color: var(--nbd-muted);
  font-family: var(--nbd-font-mono);
  font-size: var(--nbd-text-xs);
  font-weight: 500;
}

/* ------------------------------------------------------------------- grid */

.nbd-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--nbd-space-3);
}

@media (min-width: 600px) {
  .nbd-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1000px) {
  .nbd-grid { grid-template-columns: repeat(3, 1fr); }
}

.nbd-product-card .nbd-card__summary {
  color: var(--nbd-muted);
  font-size: var(--nbd-text-sm);
  margin-bottom: var(--nbd-space-3);
}

/* Compact fact rows inside a card: single column even on wide screens, since
   the card itself is narrow. */
.nbd-facts--compact {
  border-top: var(--nbd-hairline);
  margin-top: auto;
}

.nbd-facts--compact .nbd-facts__row {
  padding: var(--nbd-space-2) 0;
}

@media (min-width: 768px) {
  .nbd-facts--compact .nbd-facts__row {
    grid-template-columns: minmax(110px, 45%) 1fr;
    gap: var(--nbd-space-2);
  }
}

/* Equal-height cards with facts pinned to the bottom. */
.nbd-product-card {
  display: flex;
  flex-direction: column;
}

/* ------------------------------------------------------------------ lists */

.nbd-list {
  list-style: none;
  margin: 0 0 var(--nbd-space-3);
  padding: 0;
  border-top: var(--nbd-hairline);
}

.nbd-list__item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--nbd-space-2);
  padding: var(--nbd-space-3) 0;
  border-bottom: var(--nbd-hairline);
}

.nbd-list__meta {
  color: var(--nbd-muted);
  font-family: var(--nbd-font-mono);
  font-size: var(--nbd-text-xs);
  margin-left: auto;
}

/* ------------------------------------------------------------------ split */

.nbd-home__split {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--nbd-space-6);
  margin-bottom: var(--nbd-space-6);
}

@media (min-width: 900px) {
  .nbd-home__split { grid-template-columns: 1fr 1fr; gap: var(--nbd-space-7); }
}

.nbd-home__compare {
  padding: var(--nbd-space-5);
  background: var(--nbd-white);
  border: var(--nbd-hairline);
  border-radius: var(--nbd-radius);
}

.nbd-home__compare .nbd-home__section-title {
  border-bottom: 0;
  padding-bottom: 0;
}

/* -------------------------------------------------------------- discovery nav */

.nbd-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--nbd-space-1);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nbd-nav__link {
  display: inline-flex;
  align-items: center;
  gap: var(--nbd-space-2);
  min-height: 44px;
  padding: var(--nbd-space-2) var(--nbd-space-3);
  color: var(--nbd-ink);
  font-size: var(--nbd-text-sm);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.nbd-nav__link:hover,
.nbd-nav__link:focus-visible {
  color: var(--nbd-red-deep);
  border-bottom-color: var(--nbd-red);
}

.nbd-nav__link[aria-current="page"] {
  color: var(--nbd-red-deep);
  border-bottom-color: var(--nbd-red-deep);
}

.nbd-nav__count {
  color: var(--nbd-muted);
  font-family: var(--nbd-font-mono);
  font-size: var(--nbd-text-xs);
  font-weight: 500;
}

.nbd-subnav {
  background: var(--nbd-white);
  border-bottom: var(--nbd-hairline);
}

.nbd-subnav__inner {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ------------------------------------------------------------- card logo */

.nbd-card__header {
  align-items: center;
}

/* Contained, not cropped: app icons are square but provider logos may not be,
   and cropping a logo distorts a brand mark. */
.nbd-card__logo {
  width: 40px;
  height: 40px;
  flex: none;
  object-fit: contain;
  border: var(--nbd-hairline);
  border-radius: var(--nbd-radius);
  background: var(--nbd-white);
}

.nbd-card__header .nbd-card__title {
  flex: 1 1 auto;
  min-width: 0;
}

@media (min-width: 600px) {
  .nbd-card__logo { width: 48px; height: 48px; }
}
