/* Protect the Protocol — components. Every value comes from tokens.css. */

/* Buttons ------------------------------------------------------------ */
.pp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: var(--space-3) var(--space-5);
  border: var(--stroke-box) solid var(--violet);
  border-radius: var(--radius-0);
  background: transparent;
  color: var(--violet);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
}
.pp-btn:hover { border-color: var(--violet-deep); color: var(--violet-deep); }

/* The vote button: the only red fill. Text stays 19px+ bold so white on red is large text. */
.pp-btn--vote {
  border-color: var(--red);
  background: var(--red);
  color: var(--on-red);
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: var(--space-4) var(--space-6);
}
.pp-btn--vote:hover { border-color: var(--red-ink); background: var(--red-ink); color: var(--on-red); }

/* On a violet field */
.pp-btn--field { border-color: var(--on-field); color: var(--on-field); }
.pp-btn--field:hover { background: var(--on-field); color: var(--field); border-color: var(--on-field); }

.pp-link {
  color: var(--violet);
  font-family: var(--font-display);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.pp-link:hover { color: var(--violet-deep); }

.pp-btn:focus-visible,
.pp-link:focus-visible,
.pp-option:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.pp-on-field :focus-visible { outline-color: var(--on-field); }

/* The NO: red, heavy underline like the sticker */
.pp-no {
  color: var(--red);
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.1em;
}
.pp-bang { color: var(--red); }

/* Status bar -------------------------------------------------------- */
.pp-status {
  background: var(--field);
  color: var(--on-field);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pp-status__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2) var(--space-5);
  padding-block: var(--space-3);
}
.pp-status__live::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: var(--space-2);
  border-radius: var(--radius-round);
  background: var(--on-field-accent);
  vertical-align: 1px;
}

/* Wordmark ----------------------------------------------------------- */
.pp-wordmark {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--violet);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  text-decoration: none;
}
.pp-wordmark img { width: 40px; height: 40px; }

/* Sheet: the white ballot paper inside a violet frame ---------------- */
.pp-sheet {
  position: relative;
  padding: var(--stroke-frame);
  background: var(--field);
}
.pp-sheet__paper {
  background: var(--paper);
  color: var(--ink);
  padding: var(--space-6);
}
.pp-sheet__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2);
  padding-bottom: var(--space-3);
  border-bottom: var(--stroke-heavy) solid var(--violet);
  color: var(--violet);
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Ballot: a question and its boxes ----------------------------------- */
.pp-ballot {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  border: var(--stroke-heavy) solid var(--violet);
  background: var(--paper);
  color: var(--ink);
  padding: var(--space-6);
}
.pp-ballot__question {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.2;
  text-wrap: balance;
}
/* Yes and No side by side; each half of the row is its own tap target. */
.pp-ballot__options { display: flex; gap: var(--space-4); }

.pp-option {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: 56px;
  padding: var(--space-1) 0;
  border: 0;
  background: none;
  color: var(--violet);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}
/* The NO label stays violet: its red is the check, one of the three reds on a surface. */
.pp-option--no { color: var(--violet); }
.pp-option--no .pp-box path { stroke: var(--red); }

.pp-box {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  box-sizing: border-box;
  border: var(--stroke-heavy) solid var(--violet);
}
.pp-box svg { width: 40px; height: 40px; overflow: visible; }
.pp-box path {
  fill: none;
  stroke: currentColor;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 36;
  stroke-dashoffset: 36;
  transition: stroke-dashoffset 450ms ease-out;
}
.pp-option[aria-pressed="true"] .pp-box path,
.pp-box--checked path { stroke-dashoffset: 0; }

/* Measure: a numbered statement with its boxes ----------------------- */
.pp-measure {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  border: var(--stroke-box) solid var(--violet);
  padding: var(--space-5);
  background: var(--paper);
  color: var(--ink);
}
.pp-measure__n {
  color: var(--violet);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pp-measure__text { margin: 0; font-family: var(--font-serif); font-size: 22px; line-height: 1.3; }
.pp-measure__marks {
  margin-top: auto;
  display: flex;
  gap: var(--space-5);
  color: var(--violet);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
}
.pp-measure__marks span { display: inline-flex; align-items: center; gap: var(--space-2); }
.pp-measure__marks .pp-box { width: 24px; height: 24px; border-width: var(--stroke-box); }
.pp-measure__marks .pp-box svg { width: 22px; height: 22px; }

/* Notice: label / value rows (WHO, MISSION, GOAL, ASK, WHERE) --------- */
.pp-notice { display: flex; flex-direction: column; }
.pp-notice__row {
  display: grid;
  grid-template-columns: minmax(96px, 9em) 1fr;
  align-items: baseline;
  gap: var(--space-5);
  padding-block: var(--space-3);
  border-bottom: var(--stroke-rule) solid var(--rule);
}
.pp-notice__row:last-child { border-bottom: 0; }
.pp-notice__key {
  color: var(--violet-soft);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pp-notice__val {
  min-width: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.15;
  text-wrap: balance;
}
.pp-notice__val--ask { color: var(--red); font-weight: 900; }

/* Sticker: the original artwork, slapped on at a tilt ---------------- */
.pp-sticker {
  display: block;
  width: 190px;
  height: auto;
  aspect-ratio: 1;
  transform: rotate(var(--sticker-tilt));
  filter: drop-shadow(var(--shadow-sticker));
}
.pp-sticker--slap { animation: pp-slap 420ms cubic-bezier(0.2, 1.6, 0.4, 1) both; }
@keyframes pp-slap {
  from { transform: scale(1.9) rotate(-24deg); opacity: 0; }
  to   { transform: scale(1) rotate(var(--sticker-tilt)); opacity: 1; }
}

/* Receipt ------------------------------------------------------------ */
.pp-receipt {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  max-width: 380px;
  padding: var(--space-4) var(--space-5);
  border-top: var(--stroke-box) dashed var(--violet);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 1.5;
}
.pp-receipt__head { color: var(--violet); font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; }
.pp-receipt strong { color: var(--ink); }

/* Endorsement: a round badge, like a sticker on a laptop -------------- */
.pp-endorse {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.pp-endorse__badge {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  box-sizing: border-box;
  padding: var(--space-3);
  border: 6px solid var(--paper);
  border-radius: var(--radius-round);
  background: var(--field);
  color: var(--on-field);
  box-shadow: var(--shadow-sticker);
  font-size: 13px;
  font-weight: 900;
  transform: rotate(var(--tilt, -4deg));
}
.pp-endorse__badge img { width: 100%; height: 100%; object-fit: contain; border-radius: var(--radius-round); }

/* Update row --------------------------------------------------------- */
.pp-update {
  display: grid;
  grid-template-columns: 7.5em 1fr;
  gap: var(--space-2) var(--space-5);
  padding-block: var(--space-4);
  border-top: var(--stroke-rule) solid var(--violet);
}
.pp-update time { color: var(--violet); font-family: var(--font-display); font-weight: 700; }
.pp-update p { margin: 0; min-width: 0; font-family: var(--font-serif); font-size: 18px; line-height: 1.5; }

/* Link list: big rows that leave the page ---------------------------- */
.pp-links { margin: 0; padding: 0; list-style: none; border-bottom: var(--stroke-rule) solid var(--violet); }
.pp-links a {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: var(--space-1) var(--space-5);
  padding-block: var(--space-4);
  border-top: var(--stroke-rule) solid var(--violet);
  color: var(--violet);
  text-decoration: none;
}
/* Arrow drawn as a heavy stroke in currentColor (the fonts are latin-subset, no arrow glyph). */
.pp-links a::after {
  content: "";
  grid-column: 2;
  grid-row: 1;
  width: 28px;
  height: 20px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 20'%3E%3Cpath d='M2 10h22M16 2l8 8-8 8' fill='none' stroke='%23000' stroke-width='4' stroke-linecap='square'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 20'%3E%3Cpath d='M2 10h22M16 2l8 8-8 8' fill='none' stroke='%23000' stroke-width='4' stroke-linecap='square'/%3E%3C/svg%3E") center / contain no-repeat;
}
.pp-links__title { font-family: var(--font-display); font-size: clamp(22px, 3vw, 30px); font-weight: 900; line-height: 1.1; }
.pp-links__note { grid-column: 1; color: var(--ink-muted); font-family: var(--font-serif); font-size: 16px; }
.pp-links a:hover .pp-links__title { color: var(--violet-deep); text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 5px; }
.pp-links a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

@media (max-width: 560px) {
  .pp-notice__row, .pp-update { grid-template-columns: 1fr; gap: var(--space-1); }
  .pp-ballot, .pp-sheet__paper { padding: var(--space-5); }
}

@media (prefers-reduced-motion: reduce) {
  .pp-box path { transition: none; }
  .pp-sticker--slap { animation: none; }
}
