/*
 * css/targets.css · The Long Game — Grow tab / Targets feature styles
 * Purpose: feature-scoped styles for the Targets (Grow tab) UI: target cards,
 *          North Star card, activity summary, link-call rows, resting section,
 *          and the target detail overlay body. All selectors are prefixed .tgt-*
 *          to avoid collisions with app-level classes in styles.css.
 * Key classes: .tgt-card, .tgt-card--resting, .tgt-card-title/why/meta/end,
 *              .tgt-activity-card, .tgt-activity-row, .tgt-activity-lean,
 *              .tgt-link-row, .tgt-link-btn, .tgt-resting-section,
 *              .tgt-calls-header, .tgt-calls-empty, .tgt-capacity-note,
 *              .tgt-rest-hint, .tgt-why-block, .tgt-meta-row, .tgt-pill--resting
 * Related: js/targets.js (renders into these), css/styles.css (tokens + base classes)
 */

/* ===== TARGET CARD LIST ===== */
.tgt-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

/* ===== INDIVIDUAL TARGET CARD ===== */
/* Tier 1 elevated card — the primary touch target. */
.tgt-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 14px 16px 18px;
  cursor: pointer;
  min-height: var(--tap);
  transition: background 0.12s, transform 0.10s;
  -webkit-tap-highlight-color: transparent;
  /* Accent left edge for active targets */
  border-left: 3px solid var(--accent);
}
.tgt-card:hover {
  background: color-mix(in srgb, var(--accent) 4%, var(--surface));
}
.tgt-card:active {
  transform: scale(0.99);
}
.tgt-card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Resting cards are muted — still accessible but visually receded */
.tgt-card--resting {
  border-left-color: var(--line);
  opacity: 0.72;
  box-shadow: none;
  background: var(--surface-2);
}
.tgt-card--resting:hover {
  opacity: 1;
  background: var(--surface-2);
}

/* Card body — takes all remaining space */
.tgt-card-body {
  flex: 1;
  min-width: 0;
}

.tgt-card-title {
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--ink);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.tgt-card-why {
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-bottom: var(--space-2);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.tgt-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--space-2);
}

/* Right-hand end of the card: rest button + chevron */
.tgt-card-end {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
  flex-shrink: 0;
}

.tgt-card-chevron {
  color: var(--ink-soft);
  font-size: 1.2rem;
  line-height: 1;
  opacity: 0.5;
}

/* Quick rest/resume button on the card (secondary action) */
.tgt-card-rest-btn {
  padding: 4px 10px;
  min-height: var(--tap);  /* 44px — meets touch target minimum */
  font: 500 0.78rem/1 var(--sans);
  color: var(--ink-soft);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.tgt-card-rest-btn:hover {
  background: var(--accent);
  color: var(--btn-text);
  border-color: var(--accent);
}
.tgt-card-rest-btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ===== NORTH STAR CARD (inline in Grow) ===== */
.tgt-northstar-card {
  margin-bottom: var(--space-4);
}

/* ===== CAPACITY NOTE (gentle, non-shame nudge) ===== */
.tgt-capacity-note {
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.55;
  text-align: center;
  padding: var(--space-3) var(--space-4);
  margin-top: var(--space-3);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

/* ===== RESTING SECTION (collapsible) ===== */
.tgt-resting-section {
  border-top: 1px solid var(--line);
  padding-top: var(--space-4);
}

.tgt-resting-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2) 0;
  min-height: var(--tap);
  -webkit-tap-highlight-color: transparent;
}
.tgt-resting-toggle:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.tgt-resting-chevron {
  font-size: 1.2rem;
  color: var(--ink-soft);
  transition: transform 0.18s ease;
}
.tgt-resting-toggle[aria-expanded="true"] .tgt-resting-chevron {
  transform: rotate(90deg);
}

.tgt-resting-list {
  margin-top: var(--space-3);
}

/* ===== TARGET DETAIL OVERLAY BODY ===== */

/* Why block */
.tgt-why-block {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: var(--space-4);
}

/* Meta row of pills */
.tgt-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--space-4);
}

/* Resting pill color */
.tgt-pill--resting {
  background: var(--surface-2);
  color: var(--ink-soft);
  font-style: italic;
}

/* ===== ACTIVITY SUMMARY CARD ===== */
/* Never a bar, never a %. Just warm data. */
.tgt-activity-card {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-4);
}

.tgt-activity-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
  padding: 6px 0;
  border-top: 1px solid var(--line);
}
.tgt-activity-row:first-child {
  border-top: none;
  padding-top: 0;
}

.tgt-activity-label {
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.tgt-activity-value {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
}

/* Gentle outcome lean — italic, centered, non-numerical */
.tgt-activity-lean {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.55;
  padding-top: var(--space-3);
  margin-top: var(--space-2);
  border-top: 1px solid var(--line);
  text-align: center;
}

/* ===== LINKED CALLS HEADER (in detail overlay) ===== */
.tgt-calls-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.tgt-link-calls-btn {
  min-height: var(--tap);  /* 44px — meets touch target minimum; was 36px */
  font-size: 0.82rem;
  padding: 6px 12px;
  white-space: nowrap;
}

/* ===== CALLS EMPTY STATE (in detail overlay) ===== */
.tgt-calls-empty {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 20px 16px;
  text-align: center;
}
.tgt-calls-empty-text {
  font-size: 0.92rem;
  color: var(--ink);
  font-weight: 600;
  margin: 0 0 6px;
}
.tgt-calls-empty-sub {
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0;
}

/* ===== RESTING HINT (in detail overlay) ===== */
.tgt-rest-hint {
  font-size: 0.82rem;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: var(--space-2) 0 0;
}

/* ===== LINK-CALL SHEET ROWS ===== */
.tgt-link-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-top: 1px solid var(--line);
}
.tgt-link-row:first-child {
  border-top: none;
}

.tgt-link-row__glyph {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.tgt-link-row__body {
  flex: 1;
  min-width: 0;
}

.tgt-link-row__title {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  line-height: 1.35;
}

.tgt-link-row__meta {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 2px;
}

/* Link / Linked button in the link sheet */
.tgt-link-btn {
  flex-shrink: 0;
  padding: 7px 14px;
  min-height: var(--tap);
  font: 500 0.82rem/1 var(--sans);
  color: var(--ink-soft);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.tgt-link-btn:hover {
  background: var(--accent);
  color: var(--btn-text);
  border-color: var(--accent);
}
.tgt-link-btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Linked state — filled accent */
.tgt-link-btn--linked {
  background: var(--accent);
  color: var(--btn-text);
  border-color: var(--accent);
}
.tgt-link-btn--linked:hover {
  opacity: 0.85;
}

/* ===== REDUCED-MOTION: kill all transitions/animations instantly ===== */
@media (prefers-reduced-motion: reduce) {
  .tgt-card,
  .tgt-card-rest-btn,
  .tgt-link-btn,
  .tgt-resting-chevron,
  .tgt-resting-toggle {
    transition: none !important;
    animation: none !important;
  }
  .tgt-card:active {
    transform: none;
  }
}
