/* =========================================================
   BellyDay — baby name generator
   Page-scoped additions only. Shared components live in assets/site.css.
   Loads after /assets/site.css.
   ========================================================= */

body.bn {
  --ink-55: rgba(44, 27, 42, 0.66);
  background:
    radial-gradient(circle at 3% -8%, rgba(77, 107, 85, 0.09), transparent 36%),
    radial-gradient(circle at 100% 1%, rgba(224, 138, 95, 0.08), transparent 30%),
    var(--bone);
}

/* ---------- Breadcrumbs and hero ---------- */

.bn .crumbs { padding-top: 14px; font-size: 11.5px; color: var(--ink-55); }
.bn .crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0; padding: 0; list-style: none; }
.bn .crumbs li + li::before { content: "›"; margin-right: 8px; color: var(--ink-55); }
.bn .crumbs a { color: inherit; }
.bn .crumbs a:hover { color: var(--ink); }
.bn .crumbs [aria-current="page"] { color: var(--ink-70); }

.bn-hero { padding-top: clamp(8px, 1.5vw, 18px); padding-bottom: clamp(6px, 1vw, 12px); }
.bn .hero h1 { max-width: 24ch; font-size: clamp(30px, 4vw, 50px); line-height: 1.08; }
.bn .hero__lede { max-width: 82ch; margin-top: 6px; font-size: clamp(12px, 1.1vw, 14px); line-height: 1.4; }
.bn .hero__meta {
  display: flex; flex-wrap: wrap; gap: 5px 16px; margin-top: 7px;
  font-size: 11px; color: var(--ink-55);
}
.bn .hero__meta span { display: inline-flex; align-items: center; gap: 6px; }
.bn .hero__meta span::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--sage); }
.bn .hero__meta span:first-child::before { display: none; }

/* ---------- Tool card ---------- */

.bn-tool { grid-template-columns: minmax(0, 1fr); padding-bottom: 4px; }
.bn-panel { min-width: 0; border: 1px solid var(--line-strong); background: var(--paper); box-shadow: 5px 5px 0 var(--rose-tint); }
.bn-card { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); }
.bn-card__col { min-width: 0; padding: clamp(11px, 1.8vw, 22px); }
.bn-card__col--filters { border-right: 1px solid var(--line); }
.bn-card__col--results { background: var(--bone); }

.bn-kicker {
  margin-bottom: 5px; font-size: 10px; font-weight: 600;
  letter-spacing: 0.11em; text-transform: uppercase; color: var(--rose-deep);
}
.bn-card__col--filters h2 {
  font-family: var(--font-display); font-size: clamp(18px, 1.9vw, 24px); font-weight: 600;
  letter-spacing: -0.02em; line-height: 1.2; text-wrap: balance;
}

.bn-letter, .bn-origin, .bn-syllables, .bn-sibling, .bn-usage { min-width: 0; margin: 10px 0 0; padding: 0; border: 0; }
.bn-letter legend, .bn-origin legend, .bn-syllables legend, .bn-sibling legend, .bn-usage legend {
  float: left; width: 100%; margin-bottom: 4px; padding: 0;
  font-size: 11px; font-weight: 600; color: var(--ink-70);
}
.bn-letter legend + *, .bn-origin legend + *, .bn-syllables legend + *,
.bn-sibling legend + *, .bn-usage legend + * { clear: both; }
.bn-optional { font-weight: 400; color: var(--ink-55); }
.bn-hint { margin-top: 4px; font-size: 10px; line-height: 1.35; color: var(--ink-55); }
.bn-noscript { margin-top: 8px; font-size: 10px; line-height: 1.4; color: var(--ink-55); }

/* Starting letter: compact tiles so all 26 wrap without clipping at 320px. */
.bn-letter__row { display: flex; flex-wrap: wrap; gap: 4px; }
.bn-letter__btn {
  min-width: 24px; height: 28px; padding: 0 3px;
  border: 1px solid var(--line-strong); border-radius: 0;
  background: var(--paper); color: var(--ink-70);
  font: 600 10px/1 "Inter Tight", system-ui, sans-serif;
  cursor: pointer;
}
.bn-letter__btn:hover { border-color: var(--rose); }
.bn-letter__btn.is-on { border-color: var(--rose); background: var(--rose-tint); color: var(--ink); }
.bn-letter__btn:focus-visible, .bn-origin__chip:focus-visible,
.bn-card button:focus-visible, .bn-card input:focus-visible, .bn-more summary:focus-visible {
  outline: 2px solid var(--rose-deep); outline-offset: 2px;
}

/* Origins: generated from the controlled vocabulary in data.js. On small
   screens the chips scroll sideways so the filter stays above the results. */
.bn-origin__chips { display: flex; flex-wrap: wrap; gap: 4px; }
.bn-origin__chip {
  min-height: 24px; padding: 0 7px;
  border: 1px solid var(--line-strong); border-radius: 0;
  background: var(--paper); color: var(--ink-70);
  font: 500 10px/1.2 "Inter Tight", system-ui, sans-serif;
  cursor: pointer;
}
.bn-origin__chip[aria-pressed="true"] { border-color: var(--rose); background: var(--rose-tint); color: var(--ink); }

/* More filters: open on desktop, closed on mobile. State is never stored. */
.bn-more { min-width: 0; margin-top: 10px; border-top: 1px solid var(--line); }
.bn-more > summary {
  padding: 8px 0 2px; font-size: 11px; font-weight: 600; color: var(--ink-70); cursor: pointer;
}
.bn-more__body { padding-bottom: 2px; }
.bn-radio__row { display: flex; flex-wrap: wrap; gap: 5px; }
.bn-radio__row label {
  display: inline-flex; align-items: center; gap: 4px; min-height: 26px; padding: 0 8px;
  border: 1px solid var(--line-strong); background: var(--paper);
  font-size: 10.5px; font-weight: 600; color: var(--ink-70); cursor: pointer;
}
.bn-radio__row label:has(input:checked) { border-color: var(--rose); background: var(--rose-tint); color: var(--ink); }
.bn-radio__row input { margin: 0; accent-color: var(--rose-deep); }
.bn-sibling .field__control {
  width: 100%; min-width: 0; height: 34px; padding: 0 8px;
  border: 1px solid var(--line-strong); border-radius: 0; background: var(--paper); font-size: 11px;
}

/* ---------- Caveat and circumstances: always visible, never collapsed ---------- */

.bn-caveat, .bn-sensitive {
  min-width: 0; padding: 9px 11px; border: 1px solid var(--line); background: var(--paper);
}
.bn-sensitive { margin-top: 7px; background: rgba(255, 253, 248, 0.75); }
.bn-caveat h3, .bn-sensitive h3 { font-family: var(--font-display); font-size: 11.5px; font-weight: 600; }
.bn-caveat p, .bn-sensitive p { margin-top: 3px; font-size: 10px; line-height: 1.42; color: var(--ink-70); }

/* ---------- Result header, chips and list ---------- */

.bn-status { margin-top: 8px; min-height: 20px; }
.bn-count { font-size: 11px; font-weight: 600; color: var(--ink-70); }
.bn-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.bn-chip {
  display: inline-flex; align-items: center; gap: 5px; min-height: 22px; padding: 0 4px 0 7px;
  border: 1px solid var(--line-strong); background: var(--paper);
  font-size: 10px; color: var(--ink-70);
}
.bn-chip button {
  width: 16px; height: 16px; padding: 0; border: 0; background: var(--rose-tint);
  color: var(--rose-deep); font: 600 11px/16px system-ui, sans-serif; cursor: pointer;
}
.bn-clear-all { min-height: 22px; padding: 0 7px; border: 1px solid var(--line-strong); background: var(--paper); font-size: 10px; color: var(--ink-70); cursor: pointer; }
.bn-empty { margin-top: 7px; padding: 9px 11px; border-left: 3px solid var(--apricot); background: var(--apricot-soft); }
.bn-empty p { font-size: 11px; line-height: 1.45; color: var(--ink-70); }
.bn-empty__actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.bn-empty__actions button { min-height: 24px; padding: 0 8px; border: 1px solid var(--line-strong); background: var(--paper); font-size: 10px; color: var(--ink-70); cursor: pointer; }
.bn-sibling-notes { margin-top: 6px; }
.bn-sibling-note { margin-top: 3px; font-size: 10px; line-height: 1.4; color: var(--ink-70); }
.bn-list { margin: 6px 0 0; padding: 0; list-style: none; }
.bn-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px;
  padding: 7px 0; border-bottom: 1px solid var(--line);
}
.bn-item:first-child { border-top: 1px solid var(--line); }
.bn-item__name { font-family: var(--font-display); font-size: 15px; font-weight: 600; line-height: 1.2; }
.bn-item__meta { margin-top: 2px; font-size: 10px; line-height: 1.4; color: var(--ink-55); }
.bn-item__meaning { margin-top: 3px; font-size: 10.5px; line-height: 1.4; color: var(--ink-70); }
.bn-item__source { margin-top: 2px; font-size: 9.5px; font-style: italic; color: var(--ink-55); }
.bn-item__reason { margin-top: 3px; font-size: 10px; line-height: 1.4; color: var(--rose-deep); }
.bn-star {
  width: 30px; height: 30px; padding: 0; border: 1px solid var(--line-strong);
  background: var(--paper); color: var(--ink-55); font-size: 15px; line-height: 1; cursor: pointer;
}
.bn-star[aria-pressed="true"] { border-color: var(--rose); background: var(--rose-tint); color: var(--rose-deep); }
.bn-show-more { margin-top: 9px; min-height: 32px; }
.bn-privacy { margin-top: 9px; font-size: 10px; line-height: 1.4; color: var(--ink-55); }

/* ---------- Shortlist tray ---------- */

.bn-tray {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 9px 12px; border-top: 1px solid var(--line-strong); background: var(--bone-deep);
}
.bn-tray__count { margin: 0; font-size: 11px; color: var(--ink-70); }
.bn-tray__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.bn-tray__actions .btn { min-height: 28px; padding: 0 10px; font-size: 10.5px; }
.bn-tray__hint { margin: 0; font-size: 10px; color: var(--ink-55); }
.bn-trust { margin: 9px 0 0; font-size: 10.5px; line-height: 1.4; color: var(--ink-55); }

/* ---------- Pillar ---------- */

.bn .section__head { max-width: none; }
.bn .section h2 { font-size: clamp(22px, 2.4vw, 31px); line-height: 1.22; }
.bn .prose > p { margin-top: 10px; font-size: 13.5px; line-height: 1.68; color: var(--ink-70); }
.bn .prose > p:first-child { margin-top: 4px; }
.bn-table-scroll { overflow-x: auto; margin: 13px 0; border: 1px solid var(--line); }
.bn-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.bn-table caption { padding: 8px 11px; text-align: left; font-size: 11.5px; font-weight: 600; background: var(--bone-deep); }
.bn-table th, .bn-table td { padding: 8px 11px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.bn-table thead th { font-size: 11px; color: var(--ink-70); background: rgba(255, 253, 248, 0.65); }
.bn-table tbody tr:last-child td { border-bottom: 0; }
.bn .sources { padding-left: 1.3em; }
.bn .sources li { margin-top: 7px; font-size: 12.5px; line-height: 1.55; }
.bn .faq__body p { margin-top: 5px; font-size: 12.5px; line-height: 1.6; color: var(--ink-70); }

/* ---------- Print-only shortlist ---------- */

.bn-print { display: none; }

/* ---------- Responsive ---------- */

@media (min-width: 901px) {
  .bn-tray { position: sticky; bottom: 0; }
}

@media (max-width: 900px) {
  .bn-card { grid-template-columns: minmax(0, 1fr); }
  .bn-card__col--filters { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 560px) {
  .bn .crumbs { padding-top: 8px; font-size: 10px; }
  .bn-hero { padding-top: 3px; padding-bottom: 3px; }
  .bn .hero h1 { font-size: 29px; }
  .bn .hero__lede { margin-top: 4px; font-size: 11.5px; line-height: 1.3; }
  .bn .hero__meta { display: none; }

  .bn-panel { box-shadow: 3px 3px 0 var(--rose-tint); }
  .bn-card__col { padding: 8px 9px; }
  .bn-kicker, .bn-noscript { display: none; }
  .bn-card__col--filters h2 { font-size: 14px; line-height: 1.15; }
  .bn-letter, .bn-origin { margin-top: 6px; }
  .bn-letter legend, .bn-origin legend { font-size: 10px; margin-bottom: 2px; }
  .bn-letter__row { flex-wrap: nowrap; overflow-x: auto; gap: 4px; padding-bottom: 2px; }
  .bn-letter__btn { flex: 0 0 26px; height: 28px; font-size: 10px; }
  .bn-letter__btn[data-letter="Any"] { flex: 0 0 34px; }
  .bn-origin__chips { flex-wrap: nowrap; overflow-x: auto; gap: 3px; padding-bottom: 2px; }
  .bn-origin__chip { flex: 0 0 auto; min-height: 22px; padding: 0 6px; font-size: 9.5px; }
  .bn-hint { font-size: 9px; margin-top: 2px; }
  .bn-more { margin-top: 5px; }
  .bn-more > summary { padding: 5px 0 0; font-size: 10px; }
  .bn-more__body[hidden], .bn-more[open] .bn-more__body { display: block; }
  .bn-radio__row label { min-height: 24px; padding: 0 6px; font-size: 9.5px; }
  .bn-sibling .field__control { height: 30px; font-size: 10px; }

  .bn-caveat, .bn-sensitive { padding: 6px 8px; }
  .bn-caveat h3, .bn-sensitive h3 { font-size: 10px; }
  .bn-caveat p, .bn-sensitive p { font-size: 9px; line-height: 1.35; }
  .bn-status { margin-top: 5px; }
  .bn-count { font-size: 10px; }
  .bn-chip { font-size: 9px; min-height: 20px; }
  .bn-empty { margin-top: 5px; padding: 6px 8px; }
  .bn-empty p { font-size: 10px; }
  .bn-item { padding: 5px 0; gap: 5px; }
  .bn-item__name { font-size: 14px; }
  .bn-item__meta { font-size: 9px; }
  .bn-item__meaning { font-size: 9.5px; }
  .bn-item__source, .bn-item__reason { font-size: 9px; }
  .bn-star { width: 27px; height: 27px; font-size: 13px; }
  .bn-privacy { margin-top: 6px; font-size: 9px; }
  .bn-tray { padding: 7px 9px; gap: 6px; }
  .bn-trust { font-size: 9.5px; }
  .bn .section h2 { font-size: 21px; }
}

@media (max-width: 359px) {
  .bn-card__col { padding: 7px 8px; }
  .bn-item__meaning { font-size: 9px; }
}

/* ---------- Print: shortlist or visible names, no chrome ---------- */

@media print {
  body.bn { background: #fff; }
  .masthead, .crumbs, .skip, .bn-hero, .bn-panel, .bn-trust,
  .section, .footer, .dock { display: none !important; }
  .bn-tool { display: block; padding: 0; }
  .bn-print {
    display: block; color: #000; font-size: 11pt; line-height: 1.45;
  }
  .bn-print h2 { font-family: Georgia, serif; font-size: 16pt; margin-bottom: 8pt; }
  .bn-print h3 { font-family: Georgia, serif; font-size: 12pt; margin-top: 10pt; }
  .bn-print ol { margin: 0; padding-left: 1.4em; }
  .bn-print li { margin-bottom: 7pt; }
  .bn-print p { margin-top: 4pt; font-size: 9pt; }
}
