/* opinions.inwaynesboro.com — components layered on brand.css.
   Every colour and measure here comes from a brand.css custom property.
   Nothing is hardcoded except the three vote-response hues, which need to
   read as distinct signals and are declared once, below. */

:root {
  --agree:    #2F6F4F;   /* the only three colours this app adds: a vote is */
  --disagree: #A33A3A;   /* a directional signal and needs to read at a     */
  --pass:     var(--ink-faint);  /* glance, distinct from brand violet.     */
}

/* --- the statement card: one statement, three responses ------------------ */

.op-card {
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem 1.5rem;
  margin: 1.5rem 0;
}
.op-statement {
  font-family: var(--font-voice);
  font-size: 1.35rem;
  line-height: 1.4;
  margin: 0 0 1.5rem;
  color: var(--ink);
}
.op-origin {
  display: inline-block;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.75rem;
}
.op-votes { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.op-vote {
  flex: 1 1 8rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms, color 120ms, border-color 120ms;
}
.op-vote:hover { border-color: currentColor; }
.op-vote:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
/* Colour only on real hover-capable pointers. On touch, :hover sticks after a
   tap and would look like a pre-selected answer. */
@media (hover: hover) and (pointer: fine) {
  .op-vote[data-v="1"]:hover  { background: var(--agree);    color: #fff; }
  .op-vote[data-v="-1"]:hover { background: var(--disagree); color: #fff; }
  .op-vote[data-v="0"]:hover  { background: var(--ink-faint); color: #fff; }
}

/* After a vote the statement swaps but the cursor is still sitting on the
   button, so :hover persists and reads as an answer already chosen for the NEW
   statement. Suppress hover until the pointer actually moves again. */
.op-votes.op-nohover .op-vote:hover {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--rule-strong);
}

.op-progress {
  font-size: 0.8125rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  margin-top: 1rem;
}
.op-progress-bar {
  height: 3px; background: var(--rule); border-radius: 2px;
  margin-top: 0.4rem; overflow: hidden;
}
.op-progress-bar i { display: block; height: 100%; background: var(--violet); }

/* --- the opinion map: the signature element ----------------------------- */

.op-map { margin: 1.5rem 0; }
.op-map svg { width: 100%; height: auto; display: block; }
.op-map-frame { fill: var(--paper-raised); stroke: var(--rule); }
.op-axis { stroke: var(--rule); stroke-dasharray: 2 4; }
.op-pt { opacity: 0.85; }
.op-pt-you { stroke: var(--ink); stroke-width: 2; }

.op-groups { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 0.75rem; }
.op-group-key { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8125rem; }
.op-group-key i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }

/* --- statement result rows ---------------------------------------------- */

.op-result {
  border-bottom: 1px solid var(--rule);
  padding: 0.9rem 0;
}
.op-result:last-child { border-bottom: 0; }
.op-result-text { margin: 0 0 0.5rem; }
.op-bars { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.op-bar {
  flex: 1 1 5rem; font-size: 0.75rem; color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.op-bar .track {
  height: 6px; background: var(--rule); border-radius: 3px;
  overflow: hidden; margin-top: 0.2rem;
}
.op-bar .track i { display: block; height: 100%; }

.op-stat-line {
  display: flex; gap: 1.5rem; flex-wrap: wrap;
  font-size: 0.8125rem; color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  margin: 0.5rem 0 1.5rem;
}
.op-stat-line b { color: var(--ink); font-weight: 600; }

.op-note {
  background: var(--violet-tint);
  border-left: 3px solid var(--violet);
  padding: 0.85rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.875rem;
  margin: 1.25rem 0;
}

.op-submit textarea {
  width: 100%; font: inherit; padding: 0.6rem;
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
  background: var(--paper-raised); color: var(--ink); resize: vertical;
}
.op-submit button {
  margin-top: 0.5rem; padding: 0.55rem 1.1rem;
  border: 0; border-radius: var(--radius);
  background: var(--violet); color: #fff; font: inherit; font-weight: 600;
  cursor: pointer;
}
.op-submit button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.op-charcount { font-size: 0.75rem; color: var(--ink-faint); float: right; }

.op-tablist { display: flex; gap: 1rem; margin: 1.5rem 0 0.5rem; }
.op-tablist a { font-size: 0.875rem; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Conversation framing. Open by default when voting (people should see who is
   running this before they vote), collapsed on the results page. */
.op-context {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--ink-faint);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.op-context summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
  font-size: 0.8125rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.op-context > div { margin-top: 0.6rem; }
.op-context p { margin: 0 0 0.5rem; }
