/* MP leasehold voting-record tool. Builds on site.css tokens. */

.mp-page { max-width: 860px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.mp-breadcrumb { font-size: .85rem; color: var(--muted-on-light); margin-bottom: 1.25rem; }
.mp-breadcrumb a { color: var(--muted-on-light); }

/* Hero */
.mp-hero { display: flex; gap: 1.25rem; align-items: center; margin-bottom: 2rem; }
.mp-hero--index { display: block; text-align: center; }
.mp-photo { border-radius: 50%; object-fit: cover; border: 3px solid var(--border-light); background: var(--bg-light); }
.mp-hero h1 { margin: .1rem 0; font-size: clamp(1.6rem, 4vw, 2.2rem); }
.mp-con { color: var(--muted-on-light); margin: 0; }
.mp-party {
  display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .03em;
  text-transform: uppercase; color: #fff; background: var(--party, #5b5b5b);
  padding: .2rem .6rem; border-radius: 999px;
}

/* Sections */
.mp-section { margin: 2.25rem 0; }
.mp-section > h2 { font-size: 1.35rem; margin-bottom: .35rem; }
.mp-section-sub { color: var(--muted-on-light); margin: 0 0 1rem; font-size: .95rem; }

/* Score card */
.mp-score {
  display: flex; gap: 1.25rem; align-items: center; background: var(--surface-light);
  border: 1px solid var(--border-light); border-radius: var(--radius); padding: 1.5rem;
  box-shadow: var(--shadow);
}
.mp-grade {
  flex: 0 0 auto; width: 96px; height: 96px; border-radius: var(--radius);
  display: grid; place-items: center; font-size: 3.2rem; font-weight: 800; color: #fff;
  background: #5b6584;
}
.mp-grade--na { background: var(--border-light); color: var(--muted-on-light); font-size: 2.5rem; }
.mp-score--grade-A .mp-grade { background: #12b886; }
.mp-score--grade-B .mp-grade { background: #66b032; }
.mp-score--grade-C .mp-grade { background: #f0a202; }
.mp-score--grade-D .mp-grade { background: #f0640a; }
.mp-score--grade-F .mp-grade { background: #d64550; }
.mp-score-pct { font-size: 1.3rem; font-weight: 700; margin: 0 0 .25rem; }
.mp-score-basis { margin: 0 0 .5rem; }
.mp-score-label { margin: 0; font-size: .8rem; color: var(--muted-on-light); font-style: italic; }

/* Votes table */
.mp-votes { width: 100%; border-collapse: collapse; font-size: .92rem; }
.mp-votes th { text-align: left; padding: .6rem .5rem; border-bottom: 2px solid var(--border-light); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted-on-light); }
.mp-votes td { padding: .8rem .5rem; border-bottom: 1px solid var(--border-light); vertical-align: top; }
.mp-div-date { white-space: nowrap; color: var(--muted-on-light); }
.mp-div-what strong { display: block; }
.mp-div-title { display: block; font-size: .85rem; color: var(--muted-on-light); margin: .1rem 0; }
.mp-div-plain { display: block; margin: .35rem 0; }
.mp-div-dir { display: block; font-size: .8rem; color: var(--muted-on-light); }
.mp-vote { white-space: nowrap; }
.mp-vote span { display: block; font-size: .78rem; margin-top: .2rem; }
.mp-vote--pro { color: #0e8f6b; }
.mp-vote--against { color: #c23b46; }
.mp-vote--absent { color: var(--muted-on-light); }

.mp-method { margin-top: 1rem; font-size: .9rem; }
.mp-method summary { cursor: pointer; font-weight: 600; color: var(--text-on-light); }
.mp-method p { color: var(--muted-on-light); margin-top: .5rem; }

/* Speeches + interests */
.mp-speeches, .mp-interests { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.mp-speeches blockquote {
  margin: .35rem 0 0; padding-left: .9rem; border-left: 3px solid var(--brand-orange);
  color: var(--text-on-light);
}
.mp-speech-meta { font-size: .85rem; color: var(--muted-on-light); margin: 0; }
.mp-interests li { background: var(--surface-light); border: 1px solid var(--border-light); border-radius: var(--radius-sm); padding: .9rem 1rem; }
.mp-interest-cat { font-size: .8rem; color: var(--muted-on-light); margin: 0 0 .35rem; }
.mp-interest-sum { margin: 0; white-space: pre-line; }

/* Letter form */
.mp-letter-section { background: var(--surface-light); border: 1px solid var(--border-light); border-radius: var(--radius); padding: 1.5rem; }
.mp-field { margin-bottom: 1rem; display: flex; flex-direction: column; }
.mp-field label { font-weight: 600; margin-bottom: .35rem; }
.mp-field label span { font-weight: 400; color: var(--muted-on-light); }
.mp-field input, .mp-field textarea, .mp-lookup input {
  font: inherit; padding: .7rem .8rem; border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); background: #fff; color: var(--text-on-light);
}
.mp-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.mp-consent { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; color: var(--muted-on-light); margin-bottom: 1.1rem; }
.mp-consent input { margin-top: .2rem; }
.mp-letter-output { margin-top: 1.5rem; }
.mp-letter-text { width: 100%; font: inherit; padding: 1rem; border: 1px solid var(--border-light); border-radius: var(--radius-sm); }
.mp-letter-note { font-size: .85rem; color: var(--muted-on-light); }
.mp-letter-actions { margin-top: .75rem; }

/* Lookup box */
.mp-lookup label { font-weight: 700; font-size: 1.1rem; }
.mp-lookup-sub { color: var(--muted-on-light); margin: .25rem 0 .75rem; }
.mp-lookup-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.mp-lookup-row input { flex: 1 1 220px; }
.mp-lookup-status { margin: .6rem 0 0; color: var(--muted-on-light); }

/* CTA */
.mp-cta { background: var(--bg-dark); color: var(--text-on-dark); border-radius: var(--radius); padding: 2rem; text-align: center; }
.mp-cta h2 { color: #fff; }
.mp-cta p { color: var(--muted-on-dark); max-width: 46ch; margin: .5rem auto 1.25rem; }

.mp-generated { text-align: center; font-size: .8rem; color: var(--muted-on-light); margin-top: 2rem; }
.footer-attribution { font-size: .8rem; }

/* Registered-interests factual flag (near top) */
.mp-flag {
  display: flex; gap: .75rem; align-items: flex-start;
  background: #fff7e6; border: 1px solid #f0c14b; border-left: 4px solid #f0a202;
  border-radius: var(--radius-sm); padding: .85rem 1rem; margin: 0 0 1.75rem;
}
.mp-flag-icon { font-size: 1.2rem; line-height: 1.3; }
.mp-flag-text { font-size: .92rem; color: var(--text-on-light); }

/* Related housing votes lane — deliberately distinct from the grade */
.mp-related {
  border: 1px solid var(--border-light); border-left: 4px solid #6b7bb0;
  border-radius: var(--radius); padding: 1.25rem 1.5rem; background: #f7f8fc;
}
.mp-related-head { display: flex; flex-direction: column; gap: .35rem; }
.mp-lane-tag {
  align-self: flex-start; font-size: .7rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: #45507d; background: #e4e8f6;
  padding: .2rem .55rem; border-radius: 999px;
}
.mp-related-tally {
  font-size: 1.05rem; margin: .25rem 0 1rem;
  background: #fff; border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); padding: .7rem .9rem;
}
.mp-votes--related th { color: #45507d; }

/* Index */
.mp-idx-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.mp-idx-list li { display: flex; align-items: center; gap: .75rem; padding: .5rem .6rem; border-bottom: 1px solid var(--border-light); }
.mp-idx-list a { display: flex; flex-direction: column; text-decoration: none; color: var(--text-on-light); }
.mp-idx-list a span { font-size: .82rem; color: var(--muted-on-light); }
.mp-idx-grade { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; color: #fff; font-size: .9rem; background: #8a93ad; }
.mp-idx-grade--A { background: #12b886; } .mp-idx-grade--B { background: #66b032; }
.mp-idx-grade--C { background: #f0a202; } .mp-idx-grade--D { background: #f0640a; }
.mp-idx-grade--F { background: #d64550; }
.mp-idx-grade--na { background: var(--border-light); color: var(--muted-on-light); }

@media (max-width: 560px) {
  .mp-field-row { grid-template-columns: 1fr; }
  .mp-hero { flex-direction: column; text-align: center; }
  .mp-votes, .mp-votes thead, .mp-votes tbody, .mp-votes tr, .mp-votes td { display: block; }
  .mp-votes thead { display: none; }
  .mp-votes td { border: none; padding: .25rem .5rem; }
  .mp-votes tr { border-bottom: 1px solid var(--border-light); padding: .6rem 0; }
}
