/* brand-brain.css — section-specific layout for the Brand Brain panel.
   Consumes notion.css tokens (see public/css/notion.css). All styling under
   the [data-notion-theme="light"] scope inherits Notion design language
   from notion.css; this file only adds Brand Brain layout primitives
   (7-card grid, sticky chrome, status chips, coverage badges).

   Layout plan (selectors):
     .brand-brain-panel              — 2-col grid container (desktop), 1-col ≤ 768px
     .brand-brain-card               — Notion-styled section card
     .brand-brain-card--full         — spans both grid columns (Campaigns row)
     .brand-brain-card__title        — section heading
     .brand-brain-card__body         — content area
     .brand-selector-chrome          — sticky top bar (z-index: 10)
       .brand-selector-chrome__brand
       .brand-selector-chrome__dropdown
       .brand-selector-chrome__refresh
       .brand-selector-chrome__refreshed-at
       .brand-selector-chrome__coverage
     .live-state-chip{.ok,.stale,.unauth,.error}
     .coverage-badge{.core,.legacy,.mixed}

   Section order (matches T15 design spec):
     1. Identity   2. Voice & DNA   3. Personas   4. Differentiation
     5. Strategy   6. Live state    7. Campaigns (full-width row)

   Note on status colors: chip/badge background tints intentionally use
   inline rgba() / status-color literals where notion.css does not expose a
   matching semantic token. Foreground text colors all bind to var(--success),
   var(--warning), var(--danger), var(--info) declared on
   [data-notion-theme="light"] in notion.css.
*/

/* ─── Sticky brand-selector chrome ──────────────────────────────────────── */

[data-notion-theme="light"] .brand-selector-chrome {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 20px;
  background: var(--notion-warm-panel);
  border-bottom: 1px solid var(--notion-border);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-ui);
  color: var(--notion-text);
}

[data-notion-theme="light"] .brand-selector-chrome__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--notion-text);
}

[data-notion-theme="light"] .brand-selector-chrome__brand img,
[data-notion-theme="light"] .brand-selector-chrome__brand svg {
  width: 18px;
  height: 18px;
  border-radius: var(--btn-radius);
}

[data-notion-theme="light"] .brand-selector-chrome__dropdown {
  padding: 6px 10px;
  background: var(--notion-page);
  border: 1px solid var(--notion-border);
  border-radius: var(--btn-radius);
  color: var(--notion-text);
  font-family: var(--font-ui);
  font-size: 13px;
}

[data-notion-theme="light"] .brand-selector-chrome__refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: var(--notion-page);
  border: 1px solid var(--notion-border);
  border-radius: var(--btn-radius);
  color: var(--notion-muted);
  cursor: pointer;
}

[data-notion-theme="light"] .brand-selector-chrome__refresh:hover {
  background: var(--notion-warm-white);
  color: var(--notion-text);
}

[data-notion-theme="light"] .brand-selector-chrome__refreshed-at {
  color: var(--notion-muted);
  font-size: 12px;
}

[data-notion-theme="light"] .brand-selector-chrome__coverage {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ─── 7-card grid panel ─────────────────────────────────────────────────── */

[data-notion-theme="light"] .brand-brain-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  padding: 24px;
  font-family: var(--font-ui);
  color: var(--notion-text);
  background: transparent;
}

[data-notion-theme="light"] .brand-brain-card {
  background: var(--notion-page);
  border: 1px solid var(--notion-border);
  border-radius: var(--card-radius);
  box-shadow: var(--notion-card-shadow);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

[data-notion-theme="light"] .brand-brain-card--full {
  grid-column: 1 / -1;
}

[data-notion-theme="light"] .brand-brain-card__title {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--notion-muted);
  margin: 0;
}

[data-notion-theme="light"] .brand-brain-card__body {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  color: var(--notion-text);
  min-height: 24px;
}

/* ─── Live-state chips ──────────────────────────────────────────────────── */
/* Background tints use rgba() over the semantic color token where possible;
   notion.css doesn't expose pre-tinted backgrounds, so the rgba() literals
   are status-indicator pragmatism per the T17 spec note. */

[data-notion-theme="light"] .live-state-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  border-radius: 9999px;
  border: 1px solid var(--notion-border);
  background: var(--notion-warm-white);
  color: var(--notion-muted);
  line-height: 1.6;
}

[data-notion-theme="light"] .live-state-chip.ok {
  color: var(--success);
  background: rgba(34, 197, 94, 0.10);
  border-color: rgba(34, 197, 94, 0.28);
}

[data-notion-theme="light"] .live-state-chip.stale {
  color: var(--notion-muted);
  background: var(--notion-warm-white);
  border-color: var(--notion-soft-border);
}

[data-notion-theme="light"] .live-state-chip.unauth {
  color: var(--warning);
  background: rgba(234, 179, 8, 0.12);
  border-color: rgba(234, 179, 8, 0.30);
}

[data-notion-theme="light"] .live-state-chip.error {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(239, 68, 68, 0.28);
}

/* ─── Coverage badges ───────────────────────────────────────────────────── */

[data-notion-theme="light"] .coverage-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 4px;
  border: 1px solid var(--notion-border);
  background: var(--notion-warm-white);
  color: var(--notion-muted);
}

[data-notion-theme="light"] .coverage-badge.core {
  color: var(--success);
  background: rgba(34, 197, 94, 0.10);
  border-color: rgba(34, 197, 94, 0.28);
}

[data-notion-theme="light"] .coverage-badge.legacy {
  color: var(--warning);
  background: rgba(234, 179, 8, 0.12);
  border-color: rgba(234, 179, 8, 0.30);
}

[data-notion-theme="light"] .coverage-badge.mixed {
  color: var(--info);
  background: rgba(59, 130, 246, 0.10);
  border-color: rgba(59, 130, 246, 0.28);
}

/* ─── Responsive: collapse to 1 column on mobile ────────────────────────── */
/* Matches fa-hubs-notion.css mobile breakpoint (@media max-width 768px). */

@media (max-width: 768px) {
  [data-notion-theme="light"] .brand-brain-panel {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 14px;
  }

  [data-notion-theme="light"] .brand-brain-card--full {
    /* On 1-col layouts there's nothing to span — keep it natural width. */
    grid-column: auto;
  }

  [data-notion-theme="light"] .brand-selector-chrome {
    padding: 10px 14px;
    gap: 8px;
  }

  [data-notion-theme="light"] .brand-selector-chrome__coverage {
    margin-left: 0;
  }
}
