/*
 * brief.css — Track K: Daily Brief mobile surface (V5)
 *
 * Mobile-first responsive layout for the /brief route.
 * Standalone: does NOT import any sibling page stylesheet.
 * Depends on styles.css (Track A) for design tokens + base classes.
 *
 * Layout contract (§6.A — PARALLEL_PLAN.md):
 *   All colours reference CSS variables from styles.css.
 *   All type is set via --serif, --sans, --mono families.
 *   No hardcoded hex values; no gradients on semantic surfaces; no emoji.
 *
 * Breakpoints:
 *   default  — 360px mobile card, full-bleed to viewport
 *   ≥480px   — card max-width 420px, centred
 *   ≥768px   — card max-width 480px, centred
 */

/* ── Page shell ──────────────────────────────────────────────────────────── */
.brief-root {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: var(--paper-2);
  padding: 0;
}

/* ── Card container ──────────────────────────────────────────────────────── */
.brief-card {
  width: 100%;
  max-width: 360px;
  min-height: 100vh;
  background: var(--paper);
  border-left: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
}

@media (min-width: 480px) {
  .brief-root {
    padding: 24px 16px;
    align-items: flex-start;
  }
  .brief-card {
    max-width: 420px;
    min-height: auto;
    border: 1px solid var(--rule);
  }
}

@media (min-width: 768px) {
  .brief-card {
    max-width: 480px;
  }
}

/* ── Masthead ────────────────────────────────────────────────────────────── */
.brief-masthead {
  padding: 18px 22px 14px;
  border-bottom: 2px solid var(--ink);
  flex-shrink: 0;
}

.brief-masthead__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.brief-masthead__title {
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 1.1;
  white-space: nowrap;
  color: var(--ink);
}

.brief-masthead__date {
  font-size: 9px;
  color: var(--ink-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.brief-masthead__sub {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 4px;
}

/* ── Navigation strip ────────────────────────────────────────────────────── */
.brief-nav {
  display: flex;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
}

.brief-nav__btn {
  flex: 1;
  /* ≥44pt tap target */
  min-height: 44px;
  padding: 10px 0;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  font-weight: 400;
  cursor: pointer;
  transition: color 0.1s ease, background 0.1s ease;
}

.brief-nav__btn[aria-selected="true"] {
  background: var(--paper-2);
  color: var(--ink);
  border-bottom-color: var(--ink);
  font-weight: 600;
}

.brief-nav__btn:focus-visible {
  outline: 2px solid var(--civic);
  outline-offset: -2px;
}

/* ── Item pane ───────────────────────────────────────────────────────────── */
.brief-item {
  padding: 22px 22px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ── Tag + time row ─────────────────────────────────────────────────────── */
.brief-tag-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.brief-when {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
}

/* ── Headline ────────────────────────────────────────────────────────────── */
.brief-headline {
  font-size: 22px;
  margin: 0 0 14px;
  line-height: 1.2;
  color: var(--ink);
  text-wrap: pretty;
}

/* ── Impact callout ─────────────────────────────────────────────────────── */
.brief-impact {
  background: var(--paper-2);
  padding: 12px 14px;
  border-left: 2px solid var(--risk);
  margin-bottom: 18px;
}

.brief-impact__label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--risk);
  margin-bottom: 4px;
}

.brief-impact__text {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink);
}

/* ── Three-tap stance grid ──────────────────────────────────────────────── */
.brief-stance {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin-bottom: 14px;
}

.brief-stance__btn {
  /* ≥44pt tap target */
  min-height: 44px;
  padding: 9px 0;
  font-family: var(--sans);
  font-size: 12px;
  border: 1px solid var(--rule);
  background: var(--paper);
  cursor: pointer;
  color: var(--ink-2);
  border-radius: 2px;
  transition: background 0.1s ease, border-color 0.1s ease, color 0.1s ease;
}

.brief-stance__btn:focus-visible {
  outline: 2px solid var(--civic);
  outline-offset: -2px;
}

.brief-stance__btn[data-stance="support"].active {
  background: var(--support-soft);
  border-color: var(--support);
  color: oklch(32% 0.08 150);
}

.brief-stance__btn[data-stance="neutral"].active {
  background: var(--civic-soft);
  border-color: var(--civic);
  color: oklch(32% 0.08 195);
}

.brief-stance__btn[data-stance="oppose"].active {
  background: var(--risk-soft);
  border-color: var(--risk);
  color: oklch(32% 0.09 30);
}

/* ── Primary CTA button ─────────────────────────────────────────────────── */
.brief-cta {
  /* ≥44pt tap target */
  min-height: 44px;
  width: 100%;
  padding: 11px;
  font-size: 13px;
}

/* ── Delegate override hint ─────────────────────────────────────────────── */
.brief-delegate {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10.5px;
  color: var(--ink-3);
}

.brief-delegate__vote-for {
  color: var(--risk);
  font-weight: 700;
}

.brief-delegate__vote-against {
  color: var(--support);
  font-weight: 700;
}

.brief-delegate__override {
  font-family: var(--mono);
  font-size: 10px;
  text-decoration: underline;
  text-decoration-color: var(--ink-4);
  text-underline-offset: 2px;
  cursor: pointer;
  color: var(--ink-3);
  background: none;
  border: none;
  padding: 0;
  /* ≥44pt tap target via padding */
  padding: 8px 0;
}

.brief-delegate__override:focus-visible {
  outline: 2px solid var(--civic);
  outline-offset: 2px;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.brief-footer {
  padding: 12px 22px;
  background: var(--paper-2);
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--ink-3);
  flex-shrink: 0;
  border-top: 1px solid var(--rule);
}

/* ── Loading state ───────────────────────────────────────────────────────── */
.brief-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 0;
  flex: 1;
}

.brief-loading__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-3);
  animation: brief-pulse 1.2s ease-in-out infinite;
}

.brief-loading__dot:nth-child(2) { animation-delay: 0.2s; }
.brief-loading__dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes brief-pulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40%            { opacity: 1;   transform: scale(1);   }
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.brief-empty {
  padding: 40px 22px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.brief-empty__icon {
  width: 32px;
  height: 32px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--paper-2);
}

.brief-empty__headline {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--ink);
  margin-top: 8px;
}

.brief-empty__sub {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.5;
  max-width: 260px;
}
