/* ============================================================================
   BeamHello — components.css
   Buttons, inputs, cards, avatars, pills, chips, toggles, tabs, toasts,
   skeletons, empty states. Everything reads theme tokens (--accent, --surface,
   --ink…) so it reskins by [data-theme]. Requires colors_and_type.css.
   ============================================================================ */

/* --- Buttons ----------------------------------------------------------- */
.bh-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 22px;
  font-family: var(--bh-font-body); font-weight: 600; font-size: 16px;
  line-height: 1; border-radius: var(--bh-r-pill); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .15s ease, filter .15s ease, background .15s ease,
              border-color .15s ease, box-shadow .15s ease;
}
.bh-btn:active { transform: scale(.97); }
.bh-btn .bh-ic { width: 18px; height: 18px; }

/* Primary CTA is SOLID by default. The gradient is reserved for the single
 * "feature" gesture per rendered view — opt in by adding `.bh-btn-feature`
 * to that one primary button. This is the gradient-restraint rule from the
 * brand refresh: every screen gets at most one gradient element. */
.bh-btn-primary {
  color: #fff; background: var(--accent);
  box-shadow: var(--bh-shadow-md);
}
.bh-btn-primary:hover { filter: brightness(1.06); }

/* The opt-in gradient modifier. One per view. */
.bh-btn-feature { background: var(--accent-grad, var(--bh-signal)); }
.bh-btn-feature:hover { filter: brightness(1.05); }

/* Legacy alias — kept so existing markup compiles. Same as .bh-btn-primary. */
.bh-btn-solid { color: #fff; background: var(--accent); box-shadow: var(--bh-shadow-md); }
.bh-btn-solid:hover { filter: brightness(1.06); }

.bh-btn-secondary {
  color: var(--ink); background: var(--surface);
  border-color: var(--line); box-shadow: var(--bh-shadow-sm);
}
.bh-btn-secondary:hover { border-color: var(--accent); background: var(--accent-soft); }

.bh-btn-ghost { color: var(--ink-soft); background: transparent; }
.bh-btn-ghost:hover { color: var(--accent); background: var(--accent-soft); }

.bh-btn-sm  { min-height: 36px; padding: 0 14px; font-size: 14px; }
.bh-btn-lg  { min-height: 52px; padding: 0 28px; font-size: 18px; }
.bh-btn-block { width: 100%; }

/* --- Inputs ------------------------------------------------------------ */
.bh-field { display: flex; flex-direction: column; gap: 6px; }
.bh-field > label {
  font-family: var(--bh-font-mono); font-weight: 500; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted);
}
.bh-input, .bh-textarea {
  width: 100%; box-sizing: border-box;
  min-height: 44px; padding: 11px 14px;
  font-family: var(--bh-font-body); font-size: 16px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--bh-r-md); outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.bh-textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.bh-input::placeholder, .bh-textarea::placeholder { color: var(--muted); }
.bh-input:focus, .bh-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent-soft);
}
.bh-input.is-error, .bh-textarea.is-error { border-color: var(--bh-error); }
.bh-help { font-size: 13px; color: var(--muted); }
.bh-help.is-error { color: var(--bh-error); }

/* --- Cards / surfaces -------------------------------------------------- */
.bh-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius, var(--bh-r-lg));
  box-shadow: var(--bh-shadow-sm);
}
.bh-card-pad { padding: 24px; }
.bh-card-hover { transition: transform .18s ease, box-shadow .18s ease; }
.bh-card-hover:hover { transform: translateY(-2px); box-shadow: var(--bh-shadow-md); }

/* --- Avatar ------------------------------------------------------------ */
.bh-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; overflow: hidden; background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--accent);
  font-family: var(--bh-font-display); font-weight: 600; color: var(--accent);
}
.bh-avatar img { width: 100%; height: 100%; object-fit: cover; }
/* Monogram fallback: solid accent by default; gradient only when explicitly
 * flagged as the per-view featured avatar (card header on a recipient page). */
.bh-avatar-mono { background: var(--accent); color: #fff; }
.bh-avatar-mono.is-featured { background: var(--accent-grad, var(--accent)); }

/* --- Status pill ------------------------------------------------------- */
.bh-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--bh-r-pill);
  font-family: var(--bh-font-mono); font-weight: 500; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.bh-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.bh-pill-draft     { color: var(--muted); background: var(--accent-soft); background: rgba(111,109,133,.10); }
.bh-pill-published { color: var(--bh-success); background: rgba(21,168,107,.10); }

/* --- Chip (action row) ------------------------------------------------- */
.bh-chip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  font-family: var(--bh-font-body); font-weight: 600; font-size: 15px;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--bh-r-md);
  cursor: pointer; transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.bh-chip .bh-ic { width: 18px; height: 18px; color: var(--accent); }
.bh-chip:active { transform: scale(.97); border-color: var(--accent); background: var(--accent-soft); }

/* --- Toggle ------------------------------------------------------------ */
.bh-toggle {
  position: relative; width: 46px; height: 28px; border-radius: 999px;
  background: var(--line); border: none; cursor: pointer; padding: 0;
  transition: background .2s ease;
}
.bh-toggle::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: var(--bh-shadow-sm); transition: transform .2s ease;
}
.bh-toggle[aria-checked="true"] { background: var(--accent); }
.bh-toggle[aria-checked="true"]::after { transform: translateX(18px); }

/* --- Tabs -------------------------------------------------------------- */
.bh-tabs { display: inline-flex; gap: 2px; padding: 4px; background: var(--bg); border-radius: var(--bh-r-md); }
.bh-tab {
  padding: 8px 16px; border-radius: 9px; border: none; background: transparent;
  font-family: var(--bh-font-body); font-weight: 600; font-size: 14px;
  color: var(--muted); cursor: pointer; transition: all .15s ease;
}
.bh-tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--bh-shadow-sm); }

/* --- Toast ------------------------------------------------------------- */
.bh-toast {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--bh-r-md);
  background: var(--bh-ink); color: var(--bh-dark-text);
  font-family: var(--bh-font-body); font-size: 14px; font-weight: 500;
  box-shadow: var(--bh-shadow-lg);
}
.bh-toast .bh-ic { width: 18px; height: 18px; color: var(--accent-2); }

/* --- Skeleton ---------------------------------------------------------- */
.bh-skeleton {
  background: linear-gradient(100deg, var(--line) 30%, var(--bg) 50%, var(--line) 70%);
  background-size: 200% 100%; border-radius: var(--bh-r-sm);
  animation: bh-shimmer 1.4s ease-in-out infinite;
}
@keyframes bh-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* --- Eyebrow / label motif -------------------------------------------- */
.bh-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--bh-font-mono); font-weight: 500; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent);
}
.bh-eyebrow::before {
  content: ""; width: 18px; height: 2px; border-radius: 2px;
  background: var(--accent-grad, var(--accent));
}

/* --- The beam: signature atmosphere ----------------------------------- */
/* Subtle diagonal sweep behind hero headers (theme-tinted, low opacity). */
.bh-beam-sweep {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
.bh-beam-sweep::before {
  content: ""; position: absolute; inset: -40% -10%;
  background: var(--accent-grad, var(--bh-signal));
  opacity: .06; filter: blur(40px);
  transform: rotate(-18deg);
}

/* --- Reduced motion ---------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .bh-skeleton { animation: none; }
  * { scroll-behavior: auto !important; }
}
