/* ============================================================
   "Summera" — the AI summary overlay behind a feed card.

   Structure mirrors the KPI explainer (.kx-*) so the two AI panels in the
   product read as one system; the tokens are the shared --brand-* ones that
   feed-card.css and panel-head.css use, so this inherits the site palette
   rather than carrying a second one.

   Driven by core_data/js/feed_summary.js.
   ============================================================ */

/* ── The Summera button on the card ──────────────────────────────────────── */
/* Only colour differs from a plain .fc-btn — it is one action among several,
   not the card's primary. The icon carries the "this is AI" signal. */
.fc-btn.fc-summarize {
  color: var(--brand-color-accent-strong, #1157bf);
  border-color: var(--brand-color-accent-soft, rgba(15, 136, 242, 0.28));
}

.fc-btn.fc-summarize:hover:not(:disabled) {
  background: var(--brand-color-accent-soft, rgba(15, 136, 242, 0.12));
  border-color: var(--brand-color-accent, #0f88f2);
  color: var(--brand-color-accent-strong, #1157bf);
}

.fc-btn.fc-summarize:disabled {
  opacity: 0.55;
  cursor: progress;
}

/* Without Premium. The accent says "ready to use", which fights the padlock,
   so the locked button drops back to the neutral card palette — the same
   is-locked class subscription.BUTTON_CLASSES names for gated controls. It
   stays fully clickable: pressing it opens the upsell, so it must not look
   disabled. */
.fc-btn.fc-summarize.is-locked {
  color: var(--brand-color-text-muted, #5d6c80);
  border-color: var(--brand-color-border, rgba(18, 32, 51, 0.12));
}

.fc-btn.fc-summarize.is-locked:hover {
  background: var(--brand-color-surface-muted, #f5f8fc);
  border-color: rgba(18, 32, 51, 0.24);
  color: var(--brand-color-text, #122033);
}

/* ── Overlay ─────────────────────────────────────────────────────────────── */
.fs-overlay {
  position: fixed;
  inset: 0;
  z-index: 1080;            /* above Bootstrap's modal-backdrop (1050) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(11, 22, 38, 0.55);
  backdrop-filter: blur(2px);
}

.fs-overlay[hidden] {
  display: none;
}

/* Stops the page behind from scrolling under the dialog. */
body.fs-open {
  overflow: hidden;
}

.fs-dialog {
  display: flex;
  flex-direction: column;
  width: min(640px, 100%);
  max-height: min(80vh, 640px);
  background: var(--brand-color-surface, #ffffff);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(11, 22, 38, 0.3);
  overflow: hidden;
}

.fs-dialog:focus {
  outline: none;
}

/* ── Head ────────────────────────────────────────────────────────────────── */
.fs-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.15rem 0.85rem;
  border-bottom: 1px solid var(--brand-color-border, rgba(18, 32, 51, 0.12));
}

.fs-head-main {
  flex: 1 1 auto;
  min-width: 0;
}

.fs-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand-color-accent-strong, #1157bf);
}

.fs-title {
  margin: 0.3rem 0 0;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--brand-color-heading, #0d1b2c);
}

.fs-source {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: var(--brand-color-text-muted, #5d6c80);
}

.fs-close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--brand-color-border, rgba(18, 32, 51, 0.12));
  border-radius: 8px;
  background: var(--brand-color-surface, #fff);
  color: var(--brand-color-text-muted, #5d6c80);
  cursor: pointer;
}

.fs-close:hover {
  background: var(--brand-color-surface-muted, #f5f8fc);
  color: var(--brand-color-text, #122033);
}

.fs-close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-color-accent-soft, rgba(15, 136, 242, 0.25));
}

/* ── Body ────────────────────────────────────────────────────────────────── */
.fs-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1rem 1.15rem;
  min-height: 7rem;
}

.fs-prose p {
  margin: 0 0 0.7rem;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--brand-color-text, #122033);
}

.fs-prose p:last-child {
  margin-bottom: 0;
}

.fs-loading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.86rem;
  color: var(--brand-color-text-muted, #5d6c80);
}

.fs-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--brand-color-accent-soft, rgba(15, 136, 242, 0.25));
  border-top-color: var(--brand-color-accent, #0f88f2);
  border-radius: 50%;
  animation: fs-spin 0.7s linear infinite;
}

@keyframes fs-spin {
  to { transform: rotate(360deg); }
}

/* Readers who ask for less motion get a static ring, not a spinning one —
   the text beside it already says what is happening. */
@media (prefers-reduced-motion: reduce) {
  .fs-spinner { animation: none; }
}

.fs-error {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.86rem;
  color: var(--brand-color-danger, #b42318);
}

/* ── Foot ────────────────────────────────────────────────────────────────── */
.fs-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem 1.15rem 0.9rem;
  border-top: 1px solid var(--brand-color-border, rgba(18, 32, 51, 0.12));
  background: var(--brand-color-surface-muted, #f5f8fc);
}

/* Not fine print by accident: an AI summary of someone else's reporting has to
   say so, and point back at the original. Same register as kallkritik_modal. */
.fs-disclaimer {
  flex: 1 1 16rem;
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--brand-color-text-muted, #5d6c80);
}

.fs-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.fs-btn-primary {
  background: var(--brand-color-accent, #0f88f2);
  border-color: var(--brand-color-accent, #0f88f2);
  color: #fff;
}

.fs-btn-primary:hover {
  filter: brightness(0.95);
  color: #fff;
}

.fs-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-color-accent-soft, rgba(15, 136, 242, 0.25));
}

@media (max-width: 480px) {
  .fs-dialog {
    max-height: 92vh;
  }
  .fs-foot .fs-btn {
    width: 100%;
    justify-content: center;
  }
}
