/* ═══════════════════════════════════════════════════════════════════════
   kk-freshness.css — Trust Score time-relevance badges & helpers
   Single source of truth for the four freshness states. Load AFTER
   kk-tokens.css. Pages can use:
     <span class="kk-fresh-badge" data-fresh="up_to_date">Up to date</span>
   The data-fresh attribute drives the color & label. JS in kk-freshness.js
   can set this attribute from API responses.
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── Badge — compact pill, lives next to Trust Score ─────────────────── */
.kk-fresh-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1.4;
  border: 1px solid;
  background: var(--surface);
}

.kk-fresh-badge::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Up to date — confident olive (matches Trust Score color) */
.kk-fresh-badge[data-fresh="up_to_date"] {
  color: var(--olive);
  border-color: var(--olive-dim);
  background: var(--olive-faint);
}
.kk-fresh-badge[data-fresh="up_to_date"]::before { background: var(--olive); }

/* Fresh — light olive, still good */
.kk-fresh-badge[data-fresh="fresh"] {
  color: var(--olive-mid);
  border-color: var(--olive-dim);
  background: var(--olive-faint);
}
.kk-fresh-badge[data-fresh="fresh"]::before { background: var(--olive-light); }

/* Aging — amber, calls for action */
.kk-fresh-badge[data-fresh="aging"] {
  color: var(--amber);
  border-color: #f0d9a8;
  background: #fbf3e2;
}
.kk-fresh-badge[data-fresh="aging"]::before { background: var(--amber); }

/* Stale — red, urgent */
.kk-fresh-badge[data-fresh="stale"] {
  color: var(--red);
  border-color: #e8c8c8;
  background: #fbebea;
}
.kk-fresh-badge[data-fresh="stale"]::before { background: var(--red); }


/* ─── Adjacent layout — for use next to Trust Score ────────────────────
   Wrap the Trust Score number/bar AND the freshness badge in this wrapper
   so they read as one unit. Used on profile.html and similar dense pages.
*/
.kk-trust-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}


/* ─── Last-updated line — small grey caption ──────────────────────────── */
.kk-fresh-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.kk-fresh-meta strong {
  color: var(--text);
  font-weight: 600;
}


/* ─── Confirm-current button — top-of-dashboard CTA ────────────────────
   Always present on advisor dashboard. Visual weight scales with state:
   compact when up-to-date, prominent when aging or stale.
*/
.kk-confirm-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: 20px;
  transition: background 0.15s, border-color 0.15s;
}
.kk-confirm-bar[data-fresh="up_to_date"],
.kk-confirm-bar[data-fresh="fresh"] {
  background: var(--olive-faint);
  border-color: var(--olive-dim);
}
.kk-confirm-bar[data-fresh="aging"] {
  background: #fbf3e2;
  border-color: #f0d9a8;
}
.kk-confirm-bar[data-fresh="stale"] {
  background: #fbebea;
  border-color: #e8c8c8;
}

.kk-confirm-bar-text {
  flex: 1 1 auto;
  min-width: 200px;
}
.kk-confirm-bar-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.kk-confirm-bar-sub {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}

.kk-confirm-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--olive);
  background: var(--olive);
  color: var(--white);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.kk-confirm-btn:hover {
  background: #3a4818;
  border-color: #3a4818;
}
.kk-confirm-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* When state is up_to_date or fresh, render the button as quieter outline */
.kk-confirm-bar[data-fresh="up_to_date"] .kk-confirm-btn,
.kk-confirm-bar[data-fresh="fresh"] .kk-confirm-btn {
  background: var(--surface);
  color: var(--olive);
  border-color: var(--olive);
}
.kk-confirm-bar[data-fresh="up_to_date"] .kk-confirm-btn:hover,
.kk-confirm-bar[data-fresh="fresh"] .kk-confirm-btn:hover {
  background: var(--olive-faint);
}


/* ─── Republish-pending banner (advisor view) ─────────────────────────── */
.kk-republish-pending {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 10px;
  background: #fbebea;
  border: 1px solid #e8c8c8;
  margin-bottom: 20px;
}
.kk-republish-pending-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  font-family: var(--font-display);
}
.kk-republish-pending-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}
.kk-republish-pending-text strong {
  color: var(--red);
  font-weight: 600;
}


/* ─── Hidden-from-search banner (advisor view, when staleness unpublished) */
.kk-unpublished-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 10px;
  background: #fbebea;
  border: 2px solid var(--red);
  margin-bottom: 20px;
}
