/*
 * Candidates page (generated by GECandidate) additions on top of the Election Hub
 * style.css / shell.css. Load after both.
 */

/* Cards: hidden filter state and candidate photos inside the round avatar. */
.candidate-card[hidden],
.candidate-controls[hidden] {
  display: none !important;
}
.candidate-card.is-static {
  cursor: default;
}
.candidate-card.is-static:hover {
  border-color: var(--line);
  box-shadow: none;
}
.candidate-avatar {
  flex: 0 0 auto;
  overflow: hidden;
}
.candidate-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.candidates-empty-state {
  margin: 8px 0 0;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  color: var(--muted);
  text-align: center;
}

/* Drawer: quick facts, social links and seat link. */
.drawer-info > .drawer-facts,
.drawer-info > .drawer-social {
  margin: 3px 0 20px;
}
.drawer-facts p {
  margin: 0 0 8px;
}
.drawer-facts .candidate-fact-section h3 {
  margin: 12px 0 2px;
  font-size: .8rem;
  font-weight: 700;
}
.drawer-social {
  display: flex;
  gap: 10px;
}
.drawer-social a {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
}
.drawer-social a[hidden] {
  display: none;
}
.drawer-social img {
  width: 16px;
  height: 16px;
}
.drawer-info [hidden] {
  display: none !important;
}
a.drawer-seat {
  color: inherit;
  text-decoration: none;
}
a.drawer-seat:hover {
  border-color: #6687bc;
}
.drawer-actions .is-copied {
  border-color: #1f8a4c;
  color: #1f8a4c;
}

/* Header and page icons are Material Symbols ligatures. The hosted styles size
   header icons, but not the card chevron. */
.show-more > .material-symbols-outlined,
.drawer-close > .material-symbols-outlined,
.drawer-actions .material-symbols-outlined {
  display: inline-grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  font-size: 24px;
  line-height: 1;
}
.show-more > .material-symbols-outlined svg,
.drawer-close > .material-symbols-outlined svg,
.drawer-actions .material-symbols-outlined svg {
  display: block;
  width: 24px;
  height: 24px;
  fill: currentColor;
}
/* Staging draws search and the card chevron at 1.5rem. */
.support-search .material-symbols-outlined,
.candidate-card > .material-symbols-outlined {
  font-size: 1.5rem;
}
.candidate-card > .material-symbols-outlined {
  display: inline-grid;
  place-items: center;
  flex: 0 0 1.5rem;
  width: 1.5rem;
  height: 1.5rem;
  margin-left: auto;
  line-height: 1;
}
.support-search .material-symbols-outlined svg, 
.candidate-card > .material-symbols-outlined svg {
  display: block;
  width: 1.2rem;
  height: 1.2rem;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 0.3px;
}

/* Hosted style.css draws a coloured dot. Staging uses a filled coalition chip. */
.candidate-party-line .coalition-tag,
.drawer-party-line .coalition-tag,
.history-party-line .coalition-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 22px;
  margin: 0;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--election-bn);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.candidate-party-line .coalition-tag.ph,
.drawer-party-line .coalition-tag.ph,
.history-party-line .coalition-tag.ph {
  background: var(--election-ph);
}
.candidate-party-line .coalition-tag.pn,
.drawer-party-line .coalition-tag.pn,
.history-party-line .coalition-tag.pn {
  background: var(--election-pn);
}
.candidate-party-line .coalition-tag.oth,
.drawer-party-line .coalition-tag.oth,
.history-party-line .coalition-tag.oth {
  background: var(--election-oth);
}
.candidate-party-line .coalition-tag::before,
.drawer-party-line .coalition-tag::before,
.history-party-line .coalition-tag::before {
  content: none;
}

/* Hosted style.css uses a yellow incumbent label. Staging uses an outlined pill. */
.candidate-copy em,
.incumbent-badge {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff;
  box-shadow: inset 0 0 0 1px #c3c9d2;
  color: #3b4350;
  font-size: .75rem;
  font-style: normal;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
  white-space: nowrap;
  vertical-align: middle;
}

.candidate-drawer.open {
    margin-top: 20px;
}

body[data-page="constituency-details"] #candidate-drawer-body .seat-share-actions img {
  width: 80%;
  height: 80%;
}
