/* voting-styles.css
   This file only styles voting-records.html.
   Keep your existing homepage styles.css unchanged. */

.voting-page .site-header {
  position: relative;
}

.voting-header {
  padding: 38px 7vw;
}

.voting-header-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 28px;
}

/* Hamburger menu */
.menu-wrapper {
  position: relative;
  flex: 0 0 auto;
}

.menu-toggle {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 12px;
  background: #111827;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.menu-toggle span {
  width: 23px;
  height: 3px;
  background: white;
  border-radius: 20px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle:hover {
  background: #24334d;
}

.menu-toggle.is-open span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.menu-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.is-open span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

.site-menu {
  position: absolute;
  right: 0;
  top: 58px;
  z-index: 3000;
  width: 230px;
  display: none;
  padding: 10px;
  background: white;
  border: 1px solid #dbe2ea;
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
}

.site-menu.open {
  display: block;
}

.site-menu a {
  display: block;
  padding: 12px;
  color: #111827;
  border-radius: 9px;
  font-weight: 700;
  text-decoration: none;
}

.site-menu a:hover,
.site-menu a[aria-current="page"] {
  background: #f1f5f9;
}

.voting-shell {
  margin-top: 24px;

  width: min(1500px, calc(100% - 40px));
  max-width: 1500px;

  margin-left: auto;
  margin-right: auto;
}

.template-notice {
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 1px solid #f4d46e;
  border-radius: 14px;
  background: #fff9e6;
  color: #704f00;
  line-height: 1.55;
}

.bill-card,
.vote-summary-card {
  display: grid;
  grid-template-columns: minmax(230px, 300px) 1fr;
  gap: 28px;
  padding: 24px;
  margin-bottom: 20px;
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border, #d9dee7);
  border-radius: var(--radius, 22px);
  box-shadow: var(--shadow, 0 18px 45px rgba(16, 24, 40, 0.08));
}

.bill-picker {
  align-self: start;
}

.field-help,
.legend-explanation {
  margin: 8px 0 0;
  color: var(--muted, #667085);
  line-height: 1.5;
  font-size: 0.88rem;
}

.field-help code {
  padding: 2px 5px;
  background: #f1f5f9;
  border-radius: 5px;
}

.bill-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.bill-kicker,
.summary-eyebrow {
  margin: 0 0 6px;
  color: var(--muted, #667085);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.bill-heading-row h2,
.vote-summary-card h2 {
  margin: 0;
  line-height: 1.15;
}

.outcome-badge {
  flex: 0 0 auto;
  max-width: 260px;
  padding: 8px 11px;
  border-radius: 999px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 800;
}

.outcome-passed {
  color: #136c32;
  background: #dff7e7;
}

.outcome-not-passed {
  color: #a71d19;
  background: #ffe2df;
}

.outcome-unknown {
  color: #775e00;
  background: #fff5bd;
}

.bill-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.bill-facts div {
  padding: 13px;
  background: #f8fafc;
  border: 1px solid var(--border, #d9dee7);
  border-radius: 13px;
}

.bill-facts dt {
  margin-bottom: 6px;
  color: var(--muted, #667085);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.bill-facts dd {
  margin: 0;
  font-weight: 700;
  line-height: 1.4;
}

.bill-description {
    padding-top: 4px;
    white-space: pre-line;
}

.bill-description h3 {
    margin: 0 0 4px;
    font-size: 1rem;
}

.bill-description p {
    margin: 0;
    line-height: 1.65;
}

.voting-controls {
  grid-template-columns: minmax(180px, 260px) 1fr auto;
}

.voting-legend-card {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 28px;
}

.legend-section h2 {
  margin: 0 0 5px;
}

.vote-legend {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.vote-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px;
  border: 1px solid var(--border, #d9dee7);
  border-radius: 12px;
  background: #fbfcfe;
}

.vote-swatch {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 50%;
  flex: 0 0 18px;
}

.chair-swatch {
  background: #000;
}

.vote-legend-item strong,
.vote-legend-item small {
  display: block;
}

.vote-legend-item small {
  margin-top: 2px;
  color: var(--muted, #667085);
  line-height: 1.25;
}

.vote-summary-card {
  align-items: center;
}

.vote-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.vote-total {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border: 1px solid var(--border, #d9dee7);
  border-radius: 15px;
  background: white;
}

.vote-total::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--summary-colour);
}

.vote-total-label {
  display: block;
  color: var(--muted, #667085);
  font-size: 0.82rem;
  font-weight: 800;
}

.vote-total strong {
  display: block;
  margin-top: 6px;
  font-size: 1.65rem;
}

/* Important: this prevents a tooltip from being clipped at the map edge. */
.voting-map-card,
.voting-seating-map,
.voting-seat-layer {
  overflow: visible !important;
}

.voting-map-card {
  position: relative;
  z-index: 1;
}

.voting-seating-map {
  z-index: 2;
}

.voting-plan-image {
  opacity: 0.08;
}

.voting-seat[data-view-mode="split"] {
  background: linear-gradient(
    90deg,
    var(--vote-colour) 0%,
    var(--vote-colour) 50%,
    var(--party-colour) 50%,
    var(--party-colour) 100%
  );

  border: 1px solid #111;
}

/* =========================================================
   PARTY & VOTE VIEW

   Left half  = TD vote
   Right half = TD party

   The small black section in the middle creates the divider.
========================================================= */

/* PARTY & VOTE VIEW
   Left = TD vote
   Right = TD party
*/

.voting-seat[data-view-mode="split"] {
  background:

    /* BLACK DIVIDER */
    linear-gradient(
      #111,
      #111
    )
    center / 1px 100% no-repeat,

    /* VOTE + PARTY COLOURS */
    linear-gradient(
      90deg,
      var(--vote-colour) 0%,
      var(--vote-colour) 50%,
      var(--party-colour) 50%,
      var(--party-colour) 100%
    );

  border: 1px solid #111;
  border-radius: 50%;
}


/* =========================================================
   VOTES ONLY VIEW

   Entire seat = TD vote
========================================================= */

.voting-seat[data-view-mode="vote-only"] {
  background: var(--vote-colour);
  border: 1px solid #111;
  border-radius: 50%;
}

.voting-seat:hover,
.voting-seat:focus-visible {
  z-index: 100;
}

.voting-tooltip {
  z-index: 1000;
}

.vote-text-ta {
  color: #83da76 !important;
  font-weight: 800;
}

.vote-text-nil {
  color: #ed1c24 !important;
  font-weight: 800;
}

.vote-text-not-recorded {
  color: #535353 !important;
  font-weight: 800;
}

.vote-text-abstention {
  color: #1e1e93;
  font-weight: 800;
}

.tooltip-action {
  margin-top: 9px !important;
  color: #ffffff !important;
  font-weight: 700;
}

.chair-marker {
  --chair-size: 3.38%;
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--chair-size);
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  border: 2px solid white;
  border-radius: 50%;
  background: #000000;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  z-index: 8;
}

.voting-footer {
  margin-top: 40px;
}

/* Footer fallback styling, in case it is not already in your styles.css. */
.site-footer {
  background: #111827;
  color: white;
  padding: 42px 24px 20px;
}

.footer-content {
  width: min(1100px, 100%);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}

.site-footer h2,
.site-footer h3 {
  margin-top: 0;
  margin-bottom: 12px;
}

.site-footer h2 {
  font-size: 1.35rem;
}

.site-footer h3 {
  font-size: 1rem;
}

.site-footer p {
  margin: 7px 0;
  color: #d1d5db;
  line-height: 1.6;
}

.footer-contact a {
  color: #93c5fd;
  text-decoration: none;
}

.footer-contact a:hover {
  text-decoration: underline;
}

.footer-bottom {
  width: min(1100px, 100%);
  margin: 30px auto 0;
  padding-top: 18px;
  border-top: 1px solid #374151;
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .bill-card,
  .vote-summary-card,
  .voting-legend-card {
    grid-template-columns: 1fr;
  }

  .bill-facts,
  .vote-summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 650px) {
  .voting-header-inner {
    gap: 16px;
  }

  .menu-toggle {
    width: 44px;
    height: 44px;
  }

  .voting-controls {
    grid-template-columns: 1fr;
  }

  .bill-heading-row {
    display: block;
  }

  .outcome-badge {
    display: inline-block;
    margin-top: 12px;
  }
}
.view-toggle-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 16px 0 20px;
}

.toggle-label {
  font-weight: 600;
  color: #374151;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 58px;
  height: 30px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.25s;
}

.slider::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 4px;
  top: 4px;
  background: white;
  border-radius: 50%;
  transition: 0.25s;
}

.toggle-switch input:checked + .slider {
  background: #2563eb;
}

.toggle-switch input:checked + .slider::before {
  transform: translateX(28px);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 58px;
  height: 30px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 999px;
  cursor: pointer;
  transition: .3s;
}

.slider::before {
  content: "";
  position: absolute;
  height: 22px;
  width: 22px;
  left: 4px;
  top: 4px;
  background: white;
  border-radius: 50%;
  transition: .3s;
}

.toggle-switch input:checked + .slider {
  background: #2563eb;
}

.toggle-switch input:checked + .slider::before {
  transform: translateX(28px);
}
/* =========================================================
   NEW VOTING PAGE LAYOUT
   Left sidebar + large seating map
========================================================= */

.voting-main-layout {
  display: grid;

  /* Left sidebar | Main seating plan */
  grid-template-columns: 380px minmax(0, 1fr);

  gap: 24px;

  align-items: start;

  width: 100%;

  margin-top: 20px;
}


/* =========================================================
   LEFT SIDEBAR
========================================================= */

.voting-sidebar {
  display: flex;
  flex-direction: column;

  gap: 20px;

  min-width: 0;
}


/* Remove old large-card margins */

.voting-sidebar .bill-card,
.voting-sidebar .vote-summary-card {
  width: 100%;
  margin: 0;
}


/* Make bill card suitable for narrow sidebar */

.sidebar-bill-card {
  padding: 20px;
}


/* Bill dropdown should fill sidebar */

.sidebar-bill-card .bill-picker {
  width: 100%;
}

.sidebar-bill-card #billSelect {
  width: 100%;
}


/* Bill heading becomes vertical */

.sidebar-bill-card .bill-heading-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;

  gap: 10px;
}


/* Slightly smaller title */

.sidebar-bill-card #billCardTitle {
  font-size: 1.25rem;
  line-height: 1.25;
}


/* Date / proposer / result stack vertically */

.sidebar-bill-card .bill-facts {
  display: grid;

  grid-template-columns: 1fr;

  gap: 10px;

  margin-top: 16px;
}


/* Individual information boxes */

.sidebar-bill-card .bill-facts > div {
  width: 100%;
}


/* Bill description */

.sidebar-bill-card .bill-description {
  margin-top: 10px;
}

.sidebar-bill-card .bill-description p {
  font-size: 0.9rem;
  line-height: 1.55;
}


/* =========================================================
   VOTING SUMMARY IN SIDEBAR
========================================================= */

.sidebar-summary-card {
  display: block;

  padding: 20px;
}


.sidebar-summary-card .vote-summary-grid {
  display: grid;

  /* One vote result per row */
  grid-template-columns: 1fr;

  gap: 10px;

  margin-top: 16px;
}


/* =========================================================
   RIGHT-HAND MAP
========================================================= */

.voting-map-column {
  width: 100%;
  min-width: 0;
}


.voting-map-column .voting-map-card {
  width: 100%;
  margin: 0;
}


/* Keep seating plan nicely centred */

.voting-map-column .voting-seating-map {
  margin-left: auto;
  margin-right: auto;
}


/* =========================================================
   FILTER BAR
========================================================= */

.voting-controls {
  width: 100%;

  margin-bottom: 0;
}


/* =========================================================
   RESPONSIVE LAYOUT
========================================================= */

@media (max-width: 1050px) {

  .voting-main-layout {
    grid-template-columns: 1fr;
  }


  .voting-sidebar {
    width: 100%;
  }


  .voting-map-column {
    width: 100%;
  }


  .sidebar-summary-card .vote-summary-grid {
    grid-template-columns:
      repeat(auto-fit, minmax(150px, 1fr));
  }

}
/* =========================================================
   FIX BILL CARD INSIDE LEFT SIDEBAR
========================================================= */

.voting-sidebar .bill-card {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 20px;
  box-sizing: border-box;
}


/* Bill selector */

.voting-sidebar .bill-picker {
  width: 100%;
  margin-bottom: 20px;
}

.voting-sidebar .bill-picker select {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}


/* Main bill information */

.voting-sidebar .bill-details {
  display: block;
  width: 100%;
  min-width: 0;
}


/* Selected division heading */

.voting-sidebar .bill-heading-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
}


/* Bill title */

.voting-sidebar #billCardTitle {
  width: 100%;
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.3;

  /* Prevent long titles overflowing */
  overflow-wrap: anywhere;
}


/* Passed / Rejected badge */

.voting-sidebar .outcome-badge {
  align-self: flex-start;
}


/* Date / Proposed By / Result */

.voting-sidebar .bill-facts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  width: 100%;
  margin-top: 18px;
}

.voting-sidebar .bill-facts > div {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}


/* Allow long proposer names to wrap */

.voting-sidebar .bill-facts dd {
  overflow-wrap: anywhere;
  word-break: normal;
}


/* About this bill */

.voting-sidebar .bill-description {
  display: block;
  width: 100%;
  margin-top: 10px;
}

.voting-sidebar .bill-description p {
  width: 100%;
  font-size: 0.9rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
/* =========================================================
   FIX VOTING SUMMARY INSIDE LEFT SIDEBAR
========================================================= */

.voting-sidebar .vote-summary-card {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 20px;
  box-sizing: border-box;
}

.voting-sidebar .vote-summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  width: 100%;
  margin-top: 16px;
}
.voting-map-column {
  min-width: 0;
  width: 100%;
}

.voting-map-card {
  width: 100%;
  box-sizing: border-box;
}
/* =========================================================
   COMPACT VOTING SUMMARY INSIDE RESULT BOX
========================================================= */

.result-with-summary {
  display: block;
}


/* Space between "Passed" and the vote totals */

.result-with-summary #billResult {
  display: block;
  margin-bottom: 12px;
}


/* Compact 2-column voting summary */

.result-vote-summary {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;

  gap: 8px;

  width: 100%;
  margin-top: 10px;
}


/* Make the generated vote boxes smaller */

.result-vote-summary .vote-total {
  min-width: 0;
  padding: 9px 10px;

  border-radius: 8px;

  box-sizing: border-box;
}


/* Smaller vote labels */

.result-vote-summary .vote-total-label {
  font-size: 0.72rem;
  line-height: 1.15;
}


/* Make numbers prominent */

.result-vote-summary .vote-total strong {
  display: block;

  margin-top: 3px;

  font-size: 1.1rem;
  line-height: 1;
}
/* Reduce spacing inside the bill-information sidebar */

.sidebar-bill-card .bill-description {
  margin-top: -50px;
}

.sidebar-bill-card .bill-facts {
  margin-bottom: 0;
}
.sidebar-bill-card .bill-description h3 {
  margin-top: 0;
  margin-bottom: 10px;
}

.sidebar-bill-card .bill-description p {
  margin-top: -30px;
}
/* Hide the green Passed/Failed badge beside Selected Division */
#billOutcome {
  display: none;
}