/* ============================================================
   Beside · Components
   ------------------------------------------------------------
   Buttons, cards, badges, forms, post / feed primitives.
   These are the design-system primitives that BuddyBoss
   templates (in /buddyboss/) call into.
   ============================================================ */

/* ============================================================
   1. BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-button);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn--primary {
  background: var(--accent);
  color: var(--white);
}
.btn--primary:hover,
.btn--primary:focus {
  background: var(--accent-dark);
  color: var(--white);
  text-decoration: none;
}

.btn--ghost {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn--ghost:hover,
.btn--ghost:focus {
  background: var(--accent-light);
  text-decoration: none;
}

.btn--soft {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn--soft:hover,
.btn--soft:focus {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

.btn--sm { padding: 8px 14px; font-size: var(--fs-small); }
.btn--block { width: 100%; }

/* ============================================================
   2. BADGES & PILLS
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--teal-light);
  color: var(--teal-text);
  padding: 4px 10px;
  border-radius: var(--radius-input);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.badge--accent {
  background: var(--accent-light);
  color: var(--accent);
}

.badge--neutral {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

/* ============================================================
   3. CARDS
   ============================================================ */

.card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-3);
}

.card--warm  { background: var(--bg-secondary); }
.card--accent-rule { border-left: 4px solid var(--teal); }
.card--padded { padding: 28px; }

.card__eyebrow {
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--teal-text);
  font-weight: 600;
  margin-bottom: var(--space-2);
  display: block;
}

.card__title {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 600;
  margin: 0 0 var(--space-1);
}

/* ============================================================
   4. AVATARS
   ============================================================ */

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--teal { background: var(--teal-light); color: var(--teal-text); }
.avatar--sm { width: 24px; height: 24px; font-size: 11px; }
.avatar--lg { width: 56px; height: 56px; font-size: 22px; }
.avatar--xl { width: 64px; height: 64px; font-size: 26px; }

/* ============================================================
   5. FORMS / COMPOSER
   ============================================================ */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="tel"],
textarea,
select {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 10px 14px;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

textarea { resize: vertical; min-height: 96px; }

label {
  display: block;
  font-size: var(--fs-small);
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
}

/* ============================================================
   6. POSTS & FEED ITEMS
   ============================================================ */

.post {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 22px 24px;
  margin-bottom: 14px;
}

.post__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.post__author {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
}

.post__meta {
  font-size: var(--fs-label);
  color: var(--text-secondary);
  margin-top: 2px;
}

.post__body {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.post__foot {
  display: flex;
  gap: 22px;
  font-size: var(--fs-small);
  color: var(--text-secondary);
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.post__foot a       { color: var(--text-secondary); font-weight: 500; }
.post__foot a:hover { color: var(--accent); text-decoration: none; }
.post__foot .replies { color: var(--text-primary); font-weight: 600; }

.post__pin {
  margin-left: auto;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================================
   7. CALLOUTS
   ============================================================ */

.callout {
  background: var(--teal-light);
  border: 1px solid var(--teal);
  border-radius: var(--radius-card);
  padding: 28px 32px;
}

.callout__label {
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--teal-text);
  font-weight: 700;
  margin-bottom: 10px;
  display: block;
}

.callout--accent {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
}
.callout--accent .callout__label { color: var(--accent); }

/* ============================================================
   8. NAVIGATION (top bar)
   ============================================================ */

.topbar {
  height: var(--nav-height);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--space-3);
  gap: var(--space-3);
  position: sticky;
  top: 0;
  z-index: 50;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.01em;
  text-decoration: none;
}
.wordmark:hover { text-decoration: none; }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-button);
  border: 1px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}
.icon-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}
.icon-btn .badge--dot {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--accent);
  color: var(--white);
  border-radius: var(--radius-pill);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-primary);
}

/* ============================================================
   9. TABS
   ============================================================ */

.tabs {
  display: flex;
  gap: 32px;
  border-bottom: 1px solid var(--border);
}

.tab {
  padding: 14px 0;
  font-size: var(--fs-small);
  color: var(--text-secondary);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tab:hover { color: var(--text-primary); text-decoration: none; }
.tab.is-active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* ============================================================
   10. UTILS (sparingly)
   ============================================================ */

.stack > * + * { margin-top: var(--space-2); }
.stack-lg > * + * { margin-top: var(--space-4); }

.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.muted { color: var(--text-secondary); }
.balance { text-wrap: balance; }

/* ============================================================
   SITE FOOTER  (.bh-footer)
   ============================================================ */

.bh-footer {
  border-top: 1px solid var(--border);
  padding: 56px 32px 40px;
  background: var(--bg-primary);
}
.bh-foot-inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.bh-foot-brand p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; max-width: 260px; margin-top: 12px; }
.bh-foot-col h4 {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 14px;
}
.bh-foot-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.bh-foot-col a { color: var(--text-primary); font-size: 15px; text-decoration: none; }
.bh-foot-col a:hover { color: var(--accent); }
.bh-foot-bottom {
  max-width: var(--content-wide);
  margin: 48px auto 0;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
  flex-wrap: wrap;
  gap: 16px;
}

@media (max-width: 900px) {
  .bh-footer { padding: 40px 20px 32px; }
  .bh-foot-inner { grid-template-columns: 1fr 1fr; gap: 32px; }
}

/* ============================================================
   APP CHROME — topbar, avatar, buttons, icon buttons
   Shared between app-head.php templates and ReadyLaunch pages.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

.bh-topbar { height: 64px; background: var(--bg-primary); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 24px; gap: 16px; position: sticky; top: 0; z-index: 50; }
.bh-wordmark { font-family: var(--font-display); font-size: 22px; font-weight: 600; color: var(--accent); letter-spacing: -0.01em; flex-shrink: 0; }
.bh-wordmark:hover { text-decoration: none; }
.bh-topbar-spacer { flex: 1; }

.bh-icon-btn { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-primary); color: var(--text-secondary); display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; transition: all 0.15s; flex-shrink: 0; text-decoration: none; }
.bh-icon-btn:hover { background: var(--bg-secondary); color: var(--text-primary); text-decoration: none; }
.bh-badge { position: absolute; top: -4px; right: -4px; background: var(--accent); color: var(--white); border-radius: 999px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg-primary); }

.bh-user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--border); cursor: pointer; flex-shrink: 0; }
.bh-user-chip:hover { background: var(--bg-secondary); }
.bh-user-chip .bh-chip-name { font-size: 14px; font-weight: 500; color: var(--text-primary); }

.bh-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-light); color: var(--accent); font-family: var(--font-display); font-weight: 600; font-size: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bh-avatar.teal { background: var(--teal-light); color: var(--teal-text); }
.bh-avatar.lg { width: 56px; height: 56px; font-size: 22px; }
.bh-avatar.sm { width: 28px; height: 28px; font-size: 12px; }

.bh-ic { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.6; fill: none; flex-shrink: 0; }

.bh-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 8px; font-family: var(--font-body); font-size: 15px; font-weight: 500; cursor: pointer; transition: all 0.15s; border: 1px solid transparent; text-decoration: none; }
.bh-btn:hover { text-decoration: none; }
button.bh-btn { appearance: none; -webkit-appearance: none; }
button.bh-btn:not(.bh-btn-primary):not(.bh-btn-ghost) { background: none; }
.bh-btn-primary { background: var(--accent); color: var(--white); }
.bh-btn-primary:hover { background: var(--accent-dark); color: var(--white); }
.bh-btn-ghost { background: transparent; color: var(--text-primary); border-color: var(--border); }
.bh-btn-ghost:hover { background: var(--bg-primary); border-color: var(--text-primary); }
.bh-btn-soft { background: var(--bg-secondary); color: var(--text-primary); border-color: var(--border); }
.bh-btn-soft:hover { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }

.bh-eyebrow { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sage); font-weight: 600; margin-bottom: 8px; }

/* User chip dropdown — profile + logout menu */
.bh-user-chip-wrap { position: relative; flex-shrink: 0; }
button.bh-user-chip { background: none; font-family: inherit; border: 1px solid var(--border); }
.bh-user-menu { position: absolute; top: calc(100% + 8px); right: 0; background: var(--bg-primary); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 4px 24px rgba(0,0,0,0.12); min-width: 192px; z-index: 200; overflow: hidden; opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity 0.15s, transform 0.15s; }
.bh-user-menu.open { opacity: 1; transform: none; pointer-events: auto; }
.bh-user-menu a { display: flex; align-items: center; gap: 10px; padding: 11px 16px; font-size: 14px; color: var(--text-primary); }
.bh-user-menu a:hover { background: var(--bg-secondary); text-decoration: none; }
.bh-user-menu-sep { height: 1px; background: var(--border); }

@media (max-width: 800px) {
  .bh-topbar { padding: 0 16px; gap: 12px; }
}
