/* top.css — top page layout; pairs with heroui.css + chrome.css.
   Source of truth: benri-renewal/design/Main.dc.html (its inline styles live here).
   Colours: HeroUI semantic tokens only (var(--background) etc.), no raw values.
   Own classes use the bt- prefix so they never clash with HeroUI's BEM roots. */

a { color: inherit; }
a:hover { color: inherit; }

/* Search + tabs need top.js; html.js is set by the inline script in the page head. */
html:not(.js) [data-js-only] { display: none; }

/* ---- Hero ------------------------------------------------------------ */
.bt-hero {
  padding-top: clamp(48px, 9vw, 112px);
  padding-bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
}

.bt-hero__title {
  margin: 0;
  font-size: clamp(34px, 6vw, 60px);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.035em;
}

.bt-hero__lead {
  margin: 0;
  max-width: 520px;
  font-size: 16px;
  line-height: 28px;
  color: var(--muted);
}

.bt-search {
  width: 100%;
  max-width: 560px;
  margin-top: 12px;
  text-align: start;
}

.bt-search__group {
  height: 52px;
  border-radius: 26px;
  padding-inline: 8px;
}

.bt-search__input { font-size: 15px; }
/* The clear button replaces the browser's own one. */
.bt-search__input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

/* ---- Tabs + tool list ----------------------------------------------- */
.bt-main {
  padding-bottom: 48px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  scroll-margin-top: 16px;
}

.bt-tabs {
  display: flex;
  overflow-x: auto;
}
/* auto margins (not justify-content: center) keep the start reachable when it scrolls */
.bt-tabs > .tabs__list-container {
  flex: none;
  margin-inline: auto;
}
.bt-tabs .tabs__tab {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  white-space: nowrap;
}
/* `font: inherit` above resets the size HeroUI gives tabs */
.bt-tabs .tabs__tab { font-size: 14px; font-weight: 500; }

.bt-tool-list {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.bt-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-margin-top: 16px;
}

.bt-group__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.bt-group__title {
  margin: 0;
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.bt-group__count {
  font-size: 13px;
  color: var(--muted);
}

.bt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 16px;
}

/* ---- Tool card ------------------------------------------------------- */
.bt-tool-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  min-height: 172px;
  box-sizing: border-box;
  text-decoration: none;
  transition: box-shadow 200ms ease, transform 250ms ease;
}
.bt-tool-card:hover {
  box-shadow: var(--overlay-shadow);
  transform: translateY(-2px);
}
.bt-tool-card:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.bt-tool-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bt-tool-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: color-mix(in oklch, var(--accent) 12%, transparent);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bt-tool-card__arrow {
  width: 32px;
  height: 32px;
  border-radius: 16px;
  background: var(--default);
  color: var(--default-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms, color 150ms;
}
.bt-tool-card:hover .bt-tool-card__arrow,
.bt-tool-card:focus-visible .bt-tool-card__arrow {
  background: var(--foreground);
  color: var(--background);
}

.bt-tool-card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bt-tool-card__title {
  margin: 0;
  font-size: 15px;
  line-height: 22px;
  font-weight: 600;
}

.bt-tool-card__desc {
  margin: 0;
  font-size: 13px;
  line-height: 20px;
  color: var(--muted);
}

/* ---- Empty state ----------------------------------------------------- */
.bt-empty {
  align-items: center;
  gap: 12px;
  padding: 56px 24px;
  text-align: center;
}
.bt-empty__icon { display: flex; color: var(--muted); }
.bt-empty__title { margin: 0; font-size: 15px; font-weight: 600; }
.bt-empty__text { margin: 0; font-size: 14px; color: var(--muted); }

/* ---- Sister site ----------------------------------------------------- */
.bt-sister {
  margin-top: 24px;
  padding: clamp(28px, 5vw, 48px);
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  scroll-margin-top: 16px;
}

.bt-sister__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 320px;
}

.bt-sister__eyebrow {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.bt-sister__title {
  margin: 0;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.bt-sister__text {
  margin: 0;
  font-size: 15px;
  line-height: 24px;
  color: var(--muted);
}

/* ---- Motion ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .bt-tool-card,
  .bt-tool-card__arrow { transition: none; }
  .bt-tool-card:hover { transform: none; }
}
