/* ============================================
   css/results.css
   2021 Results Page — Mobile First
   ============================================ */

/* ── Shared section wrapper ─────────────────── */
.results-section {
  padding: var(--gap-lg) var(--gap-xl);
  background: var(--color-bg);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--gap-lg);
}

.section-title {
  font-size: var(--font-xl);
  font-weight: 800;
  color: var(--color-dark);
}

.section-viewall-btn {
  background: var(--color-primary);
  color: var(--color-white);
  font-size: var(--font-sm);
  font-weight: 700;
  padding: 8px 20px;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background 0.2s;
  border: none;
  outline: none;
  cursor: pointer;
}

.section-viewall-btn:hover {
  background: #c94832;
}

.section-viewall-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 132, 95, 0.3);
}

/* ── SECTION 1: Hero (Map + Chart) ──────────── */
.results-hero {
  display: grid;
  grid-template-columns: 1fr;
  background: #EAF1FB;
  min-height: 480px;
}

@media (min-width: 993px) {
  .results-hero {
    grid-template-columns: 42% 58%;
  }
}

/* Map column */
.results-map-col {
  display: flex;
  flex-direction: column;
  padding: var(--gap-md);
}

.results-page-title {
  font-size: var(--font-xl);
  font-weight: 800;
  color: var(--color-dark);
  margin-bottom: var(--gap-md);
}

.results-map-wrap {
  flex: 1;
  min-height: 360px;
  max-height: 460px;
}

/* Chart column */
.results-chart-col {
  display: flex;
  flex-direction: column;
  padding: var(--gap-md) var(--gap-md) var(--gap-md) 0;
  gap: var(--gap-md);
  /* background: var(--color-white); */
}

/* ── Parliament Semicircle ───────────────────── */
.parliament-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gap-sm) 0 0;
}

#parliament-chart {
  display: block;
  width: 100%;
  max-width: 460px;
  height: auto;
}

.parliament-center {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.parliament-total {
  font-size: 36px;
  font-weight: 900;
  color: var(--color-dark);
  line-height: 1;
}

.parliament-label {
  font-size: var(--font-xs);
  color: var(--color-muted);
  font-weight: 600;
  margin-top: 2px;
}

/* ── Alliance Results Table ─────────────────── */
.alliance-results-table {
  width: 100%;
  border-top: 1px solid var(--color-border);
}

.alliance-results-table__header-row {
  display: grid;
  grid-template-columns: 1fr 1px 1fr 1px 1fr;
}

.alliance-results-table__header {
  padding: 9px var(--gap-md);
  font-size: var(--font-md);
  font-weight: 800;
  color: var(--color-white);
  text-align: center;
  letter-spacing: 0.05em;
}

.alliance-results-table__header--nda {
  background: #e05a46;
}

.alliance-results-table__header--spa {
  background: #5b68b8;
}

.alliance-results-table__header--others {
  background: #8a93a8;
}

.alliance-results-table__subheader-row {
  display: grid;
  grid-template-columns: 1fr 1px 1fr 1px 1fr;
}

.alliance-results-table__subheader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px var(--gap-md);
  font-size: var(--font-sm);
  font-weight: 700;
  border-right: 1px solid var(--color-border);
}

.alliance-results-table__subheader:last-child {
  border-right: none;
}

.alliance-results-table__subheader--nda {
  color: #e05a46;
  background-color: #FCEBE8;
  padding: 4px 12px 4px 12px;
  border-radius: 12px;
}

.alliance-results-table__subheader--spa {
  color: #5b68b8;
  background-color: #EEF4FF;
  padding: 4px 12px 4px 12px;
  border-radius: 12px;
}

.alliance-results-table__subheader--others {
  color: #8a93a8;
  background-color: #F9FAFB;
  padding: 4px 12px 4px 12px;
  border-radius: 12px;
}

.alliance-results-table__body-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}

.alliance-results-table__col {
  border-right: 1px solid var(--color-border);
}

.alliance-results-table__col:last-child {
  border-right: none;
}

.alliance-results-table__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-sm);
  width: 100%;
  padding: 7px var(--gap-md);
  border-bottom: 1px solid #f5f5f5;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  appearance: none;
}

.alliance-results-table__row:last-child {
  border-bottom: none;
}

.alliance-results-table__row--active {
  background-color: rgba(96, 165, 250, 0.12);
}

.alliance-results-table__party-button:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.85);
  outline-offset: 2px;
}

.alliance-results-table__party-info {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
}

.alliance-results-table__party-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: contain;
  flex-shrink: 0;
}

.alliance-results-table__party-initials {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  font-size: 8px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.alliance-results-table__party-name {
  font-size: 12px;
  color: var(--color-dark);
  font-weight: 600;
}

.alliance-results-table__won {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-dark);
}

.alliance-results-table__won--dash {
  color: #cbd5e1;
}

/* ── Popular Candidates — winner/runner badges ─ */
.results-candidates-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px 16px;
  /* padding-top: 100px; */
}

@media (min-width: 577px) {
  .results-candidates-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 993px) {
  .results-candidates-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* Badge on top of card */
.result-card {
  position: relative;
  margin-top: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: default;
}

.result-card__badge {
  position: absolute;
  top: -96px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  padding: 3px 14px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  z-index: 2;
  letter-spacing: 0.04em;
}

.result-card__badge--winner {
  background: #16a34a;
}

.result-card__badge--runner {
  background: #e05a46;
}

.result-card__photo-wrap {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 148px;
  border-radius: 80px;
  overflow: hidden;
  background: #e2e8f0;
  z-index: 1;
}

.result-card__photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.result-card__body {
  width: 100%;
  min-height: 176px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-top: 64px;
  overflow: hidden;
}

.result-card__footer {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.result-card__name {
  font-size: var(--font-sm);
  font-weight: 700;
  padding: 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

.result-card__constituency {
  font-size: 10px;
  color: var(--color-muted);
  padding: 2px 8px;
}

.result-card__votes {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
}

.result-card__margin {
  font-size: 10px;
  padding: 0 8px 4px;
}

.result-card__party-strip {
  width: 100%;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-card__party-tag {
  font-size: var(--font-sm);
  font-weight: 800;
}

/* ── Big Fights 2021 ────────────────────────── */
/* Reuses fight-card from bigfights.css          */
/* Override progress bar for actual 2021 results */

.fight-bar-wrap {
  margin-top: 6px;
}

.fight-bar {
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}

.fight-bar--winner {
  background: #16a34a;
  color: #fff;
}

.fight-bar--loser {
  background: #e05a46;
  color: #fff;
}

.fight-bar__votes {
  flex: 1;
}

.fight-bar__label {
  font-size: 11px;
  font-weight: 800;
}

/* ── Tables section ─────────────────────────── */
.results-tables-row {
  /* background: #ffffff; */
  /* border: 1px solid #e0e0e0; */
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  /* flex-direction: column; */
  justify-content: center;
  gap: 16px;
  box-sizing: border-box;
  flex-shrink: 0;
  /* width: 100%; */
}

@media (min-width: 993px) {
  .results-tables-row {
    grid-template-columns: 1fr 1fr;
  }
}

.results-table-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
  padding: var(--gap-md);
}

.results-table-card__title {
  font-size: var(--font-md);
  font-weight: 800;
  color: var(--color-dark);
  margin-bottom: 4px;
}

.results-table-card__sub {
  font-size: var(--font-xs);
  color: var(--color-muted);
  margin-bottom: var(--gap-md);
}

.results-table {
  border-collapse: collapse;
  table-layout: fixed;
  border: 1px solid #EAECF0;
}

.results-table th {
  text-align: left;
  padding: 8px 10px;
  font-weight: 700;
  color: var(--color-muted);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.results-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #f5f5f5;
  vertical-align: middle;
  font-size: 12px;
  color: #222222;
  font-family: 'Nunito', sans-serif;
  overflow: hidden;
}

.results-table tr:last-child td {
  border-bottom: none;
}

.results-table tr:hover td {
  background: #fafafa;
}

.results-table .cand-name {
  font-weight: 700;
  color: var(--color-dark);
  display: block;
}

.results-table .cand-party {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.results-table .cand-party img {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  object-fit: contain;
}

.results-table .cand-party span {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-muted);
}

.results-table .votes-cell {
  font-weight: 600;
  color: var(--color-dark);
  white-space: nowrap;
}

.results-table .margin-cell {
  font-weight: 700;
  color: #16a34a;
  white-space: nowrap;
}

/* ── Responsive ─────────────────────────────── */
@media (max-width: 992px) {

  .results-section,
  .results-tables-row {
    padding: var(--gap-md);
  }

  .results-chart-col {
    padding: var(--gap-md);
  }

  .results-map-wrap {
    min-height: 320px;
    max-height: 380px;
  }
}

@media (max-width: 576px) {
  .results-candidates-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .results-tables-row {
    flex-direction: column;
  }

  .table-container {
    overflow-y: auto;
    scrollbar-width: none;
    /* Enables vertical scrolling */
    border: 1px solid #ddd;
  }
}



/* ── Modal for View All ─────────────────────── */

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: #fefefe;
  margin: 5% auto;
  padding: 0px 20px 20px 20px;
  border: 1px solid #888;
  width: 90%;
  max-width: 1200px;
  max-height: 80%;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  scrollbar-width: none;
  z-index: 1000;

  .modal-header {
    position: sticky;
    top: 0;
    background: #fefefe;
    z-index: 10;
    height: 44px;
  }
}

.close-modal {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close-modal:hover,
.close-modal:focus {
  color: black;
  text-decoration: none;
}

.modal-content h2 {
  margin-top: 0;
  color: var(--color-dark);
}

#candidate-2021-modal .c-modal {
  width: min(900px, 95vw);
  max-width: 900px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  gap: 24px;
}

#candidate-2021-modal #modal-candidate-left-panel,
#candidate-2021-modal #modal-candidate-right-panel {
  overflow-y: auto;
  max-height: 85vh;
}

#candidate-2021-modal #modal-candidate-left-panel {
  width: 260px;
  min-width: 220px;
  background: linear-gradient(180deg, #fbfcff 0%, #f6f7fb 100%);
  border-right: 1px solid #e5e5e5;
  padding: 24px;
}

#candidate-2021-modal #modal-candidate-right-panel {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

#candidate-2021-modal .candidate-summary-card {
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
  background: #fff;
}

#candidate-2021-modal .candidate-summary-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  color: #fff;
}

#candidate-2021-modal .candidate-summary-card__badge {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

#candidate-2021-modal .candidate-summary-card__title {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
  color: #ffffff;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#candidate-2021-modal .candidate-summary-card__meta {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 4px;
}

#candidate-2021-modal .candidate-summary-card__pill {
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

#candidate-2021-modal .candidate-summary-card__content {
  padding: 18px;
  display: grid;
  gap: 14px;
  background: #f7f9fb;
}

#candidate-2021-modal .candidate-summary-card__stat-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

#candidate-2021-modal .candidate-summary-card__stat-label {
  display: block;
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

#candidate-2021-modal .candidate-summary-card__stat-value {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
}

#candidate-2021-modal .candidate-details-section {
  background: #fff;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

#candidate-2021-modal .candidate-details-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
  color: #334155;
}

#candidate-2021-modal .candidate-details-row:last-child {
  border-bottom: none;
}

#candidate-2021-modal .candidate-details-row span {
  color: #64748b;
}

#candidate-2021-modal .candidate-details-row strong {
  font-weight: 700;
  color: #0f172a;
}





.results-candidates-grid {
  /* flex-shrink: 0;
  width: 100%; */
  display: flex;
  flex-wrap: wrap;
  /* margin-right: -15px; */
  /* margin-left: -15px; */
  padding: 10px;
  background-color: white;
  border-radius: 8px;

  .custom-container {
    position: relative;
    background: linear-gradient(to right, rgba(217, 242, 252, 255), rgba(190, 234, 241, 255));
    border-radius: 10px;
    padding: 0;
    margin: 0.725rem !important;
    max-height: 172px;
    max-width: 300px;
    box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
    box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
    margin: 1rem;
    /* height: 18.75rem; */
    animation: loader 3s;
    animation: loader 3s infinite linear;
    transition: all 0.5s ease;
    width: 100%;

    .ribbon {
      --f: .5em;
      position: absolute;
      top: 0;
      right: 0;
      line-height: 1.8;
      padding-inline: 1lh;
      padding-bottom: var(--f);
      border-image: conic-gradient(#0008 0 0) 51% / var(--f);
      clip-path: polygon(100% calc(100% - var(--f)), 100% 100%, calc(100% - var(--f)) calc(100% - var(--f)), var(--f) calc(100% - var(--f)), 0 100%, 0 calc(100% - var(--f)), 999px calc(100% - var(--f) - 999px), calc(100% - 999px) calc(100% - var(--f) - 999px));
      transform: translate(calc((1 - cos(45deg)) * 100%), -100%) rotate(45deg);
      transform-origin: 0% 100%;
      background-color: rgba(240, 68, 56, 255);
      font-size: 0.75rem;
      font-weight: bold;
      color: #fff;
    }

    .custom-temp {
      width: 70%;
      padding-bottom: 1.5rem;
      height: 100%;

      .card-body {
        padding: 0.725rem 0 0 0.725rem;
        margin-bottom: 7px;
        width: 100%;
        min-height: 1px;

        .card-title {
          margin-bottom: 5px;
          font-size: 16px;
          font-weight: 700;
        }

        .card-title.custom-card-title {
          margin-bottom: 5px;
          font-size: 16px;
          font-weight: 700;
        }

        .custom-subheaders {
          align-items: center;
          display: flex;
          gap: 15px;

          .logo {
            .custom-img {
              width: 16px;
            }
          }

          .card-text.custom-card-text-votes {
            color: #FF9933;
            font-size: 12px;
            font-weight: 700;
          }
        }

        .custom-card-text {
          color: rgb(48, 48, 48);
          font-size: 12px;
          font-weight: 400;
        }
      }

      .iribbon {
        --r: 25px;
        padding-right: calc(var(--r) + .25em);
        line-height: 1;
        clip-path: polygon(-100vw 0, calc(100% - var(--r)) 0, 100% 50%, calc(100% - var(--r)) 100%, -100vw 100%);
        border-image: conic-gradient(#45ada8 0 0) fill 0 / 100vw;
        width: 150px;
        font-size: 1.125rem;
        font-weight: bold;
        color: #fff;
        margin-bottom: 0.75rem;
        padding: 0.2rem 0.5rem;

        .card-text {
          margin-bottom: .25rem !important;
        }

        .custom-iribbon-text {
          font-weight: 100;
          font-size: small;
        }

        .custom-iribbon-text-votes {
          font-size: 18px;
          font-weight: 700;
        }
      }

      .custom-iribbon {
        align-items: start;
      }
    }

    .custom-person-image img {
      position: absolute;
      bottom: 0;
      right: 0;
      object-fit: cover;
      border-radius: 0 1.25rem 1.25rem 0;
      width: 100px;
      max-width: 120px;
      min-width: 100px;
    }

    .person-image {
      display: flex;
      width: 50%;
      align-items: center;

      .custom-person-image {
        position: absolute;
        bottom: 0;
        right: 0;
        object-fit: cover;
        border-radius: 0 1.25rem 1.25rem 0;
        width: 100px;
        max-width: 120px;
        min-width: 100px;

      }


      .wid {
        margin-right: 10px;
        transition: all 0.5s ease;
        width: 100px;
        height: 100px;
      }

      img {
        vertical-align: middle;
        border-style: none;
      }
    }
  }
}

.result2021-info-container {
  display: none;
}



.results-hero {
  .result2021-info-container {
    .result2021-container-wrapper {
      padding: 10px;

      .row>* {
        flex-shrink: 0;
        width: 100%;
      }

      .custom-container {
        position: relative;
        background: linear-gradient(to right, rgba(217, 242, 252, 255), rgba(190, 234, 241, 255));
        border-radius: 10px;
        padding: 0;
        margin: 0.725rem !important;
        max-height: 172px;
        max-width: 300px;
        box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
        box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
        margin: 1rem;
        /* height: 18.75rem; */
        animation: loader 3s;
        animation: loader 3s infinite linear;
        transition: all 0.5s ease;
        width: 100%;

        .ribbon {
          --f: .5em;
          position: absolute;
          top: 0;
          right: 0;
          line-height: 1.8;
          padding-inline: 1lh;
          padding-bottom: var(--f);
          border-image: conic-gradient(#0008 0 0) 51% / var(--f);
          clip-path: polygon(100% calc(100% - var(--f)), 100% 100%, calc(100% - var(--f)) calc(100% - var(--f)), var(--f) calc(100% - var(--f)), 0 100%, 0 calc(100% - var(--f)), 999px calc(100% - var(--f) - 999px), calc(100% - 999px) calc(100% - var(--f) - 999px));
          transform: translate(calc((1 - cos(45deg)) * 100%), -100%) rotate(45deg);
          transform-origin: 0% 100%;
          background-color: rgba(240, 68, 56, 255);
          font-size: 0.75rem;
          font-weight: bold;
          color: #fff;
        }

        .custom-temp {
          width: 70%;
          padding-bottom: 1.5rem;
          height: 100%;

          .card-body {
            padding: 0.725rem 0 0 0.725rem;
            margin-bottom: 7px;
            width: 100%;
            min-height: 1px;

            .card-title {
              margin-bottom: 5px;
              font-size: 16px;
              font-weight: 700;
            }

            .card-title.custom-card-title {
              margin-bottom: 5px;
              font-size: 16px;
              font-weight: 700;
            }

            .custom-subheaders {
              align-items: center;
              display: flex;
              gap: 15px;

              .logo {
                .custom-img {
                  width: 16px;
                }
              }

              .card-text.custom-card-text-votes {
                color: #FF9933;
                font-size: 12px;
                font-weight: 700;
              }
            }

            .custom-card-text {
              color: rgb(48, 48, 48);
              font-size: 12px;
              font-weight: 400;
            }
          }

          .iribbon {
            --r: 25px;
            padding-right: calc(var(--r) + .25em);
            line-height: 1;
            clip-path: polygon(-100vw 0, calc(100% - var(--r)) 0, 100% 50%, calc(100% - var(--r)) 100%, -100vw 100%);
            border-image: conic-gradient(#45ada8 0 0) fill 0 / 100vw;
            width: 150px;
            font-size: 1.125rem;
            font-weight: bold;
            color: #fff;
            margin-bottom: 0.75rem;
            padding: 0.2rem 0.5rem;

            .card-text {
              margin-bottom: .25rem !important;
            }

            .custom-iribbon-text {
              font-weight: 100;
              font-size: small;
            }

            .custom-iribbon-text-votes {
              font-size: 18px;
              font-weight: 700;
            }
          }

          .custom-iribbon {
            align-items: start;
          }
        }

        .custom-person-image img {
          position: absolute;
          bottom: 0;
          right: 0;
          object-fit: cover;
          border-radius: 0 1.25rem 1.25rem 0;
          width: 100px;
          max-width: 120px;
          min-width: 100px;
        }

        .person-image {
          display: flex;
          width: 50%;
          align-items: center;

          .custom-person-image {
            position: absolute;
            bottom: 0;
            right: 0;
            object-fit: cover;
            border-radius: 0 1.25rem 1.25rem 0;
            width: 100px;
            max-width: 120px;
            min-width: 100px;

          }


          .wid {
            margin-right: 10px;
            transition: all 0.5s ease;
            width: 100px;
            height: 100px;
          }

          img {
            vertical-align: middle;
            border-style: none;
          }
        }
      }


      .pie-wrapper {
        position: relative;
        width: 150px;

        .pie-chart {
          display: flex;
          align-items: center;
          justify-content: center;
          color: white;
          font-weight: bold;

          .pie-center {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);

            /* background: white; */
            /* gives donut effect */
            width: 70px;
            height: 70px;
            border-radius: 50%;

            display: flex;
            align-items: center;
            justify-content: center;

            font-weight: bold;
            font-size: 14px;
          }
        }

        .pie-label {
          margin-top: 10px;
          font-size: 14px;
        }
      }

    }
  }
}


@media (min-width: 768px) {}

@media (max-width: 992px) {
  .home-section {
    padding: var(--gap-md);
  }

  /* Hide the grouped headers row and grouped sub-headers row
     — we add per-column colored headers via ::before instead */
  .alliance-results-table__header-row,
  .alliance-results-table__subheader-row {
    display: none;
  }

  /* Hide vertical dividers */
  .alliance-table__vdivider,
  .alliance-table__vdivider-head {
    display: none;
  }

  /* Stack the 3 columns vertically */
  .alliance-results-table__body-row {
    display: flex;
    flex-direction: column;
  }

  /* Each column gets its own colored header via ::before */
  .alliance-results-table__col {
    border-bottom: 6px solid var(--color-bg);
  }

  .alliance-results-table__col:last-child {
    border-bottom: none;
  }

  /* NDA column header */
  #alliance-col-nda::before {
    content: "NDA";
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e05a46;
    color: #fff;
    font-size: var(--font-md);
    font-weight: 800;
    padding: 10px var(--gap-md);
    letter-spacing: 0.05em;
  }

  /* SPA column header */
  #alliance-col-spa::before {
    content: "SPA";
    display: flex;
    align-items: center;
    justify-content: center;
    background: #5b68b8;
    color: #fff;
    font-size: var(--font-md);
    font-weight: 800;
    padding: 10px var(--gap-md);
    letter-spacing: 0.05em;
  }

  /* Others column header */
  #alliance-col-others::before {
    content: "Others";
    display: flex;
    align-items: center;
    justify-content: center;
    background: #8a93a8;
    color: #fff;
    font-size: var(--font-md);
    font-weight: 800;
    padding: 10px var(--gap-md);
    letter-spacing: 0.05em;
  }

  .stats-wrapper {
    display: flex !important;
    flex-direction: column !important;
    gap: 35px;
  }
}


@media (max-width: 576px) {
  .results-hero {
    .results-chart-col {
      .parliament-wrap {
        .parliament-center {
          bottom: -12px;
        }
      }
    }
  }

  .alliance-table__party-name {
    font-size: 11px;
  }

  .alliance-table__seats {
    font-size: 11px;
  }

  #constituency-2021-modal {
    padding: 10px;
    align-items: unset !important;

    .c-modal {
      flex-direction: column;
      overflow: scroll !important;
      align-items: center;
      padding: 5px;
      scrollbar-width: none;

      #close-const-modal {
        position: fixed !important;
      }

      #modal-left-panel {
        width: unset !important;

        #const-mini-svg {
          background-color: white;
        }
      }

      #modal-right-panel {
        overflow: unset !important;

        .custom-container {
          position: relative;
          background: linear-gradient(to right, rgba(217, 242, 252, 255), rgba(190, 234, 241, 255));
          border-radius: 10px;
          padding: 0;
          margin: 0.725rem !important;
          max-height: 172px;
          max-width: 300px;
          box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
          box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
          margin: 1rem;
          /* height: 18.75rem; */
          animation: loader 3s;
          animation: loader 3s infinite linear;
          transition: all 0.5s ease;
          width: 100%;

          .ribbon {
            --f: .5em;
            position: absolute;
            top: 0;
            right: 0;
            line-height: 1.8;
            padding-inline: 1lh;
            padding-bottom: var(--f);
            border-image: conic-gradient(#0008 0 0) 51% / var(--f);
            clip-path: polygon(100% calc(100% - var(--f)), 100% 100%, calc(100% - var(--f)) calc(100% - var(--f)), var(--f) calc(100% - var(--f)), 0 100%, 0 calc(100% - var(--f)), 999px calc(100% - var(--f) - 999px), calc(100% - 999px) calc(100% - var(--f) - 999px));
            transform: translate(calc((1 - cos(45deg)) * 100%), -100%) rotate(45deg);
            transform-origin: 0% 100%;
            background-color: rgba(240, 68, 56, 255);
            font-size: 0.75rem;
            font-weight: bold;
            color: #fff;
          }

          .custom-temp {
            width: 70%;
            padding-bottom: 1.5rem;
            height: 100%;

            .card-body {
              padding: 0.725rem 0 0 0.725rem;
              margin-bottom: 7px;
              width: 100%;
              min-height: 1px;

              .card-title {
                margin-bottom: 5px;
                font-size: 16px;
                font-weight: 700;
              }

              .card-title.custom-card-title {
                margin-bottom: 5px;
                font-size: 16px;
                font-weight: 700;
              }

              .custom-subheaders {
                align-items: center;
                display: flex;
                gap: 15px;

                .logo {
                  .custom-img {
                    width: 16px;
                  }
                }

                .card-text.custom-card-text-votes {
                  color: #FF9933;
                  font-size: 12px;
                  font-weight: 700;
                }
              }

              .custom-card-text {
                color: rgb(48, 48, 48);
                font-size: 12px;
                font-weight: 400;
              }
            }

            .iribbon {
              --r: 25px;
              padding-right: calc(var(--r) + .25em);
              line-height: 1;
              clip-path: polygon(-100vw 0, calc(100% - var(--r)) 0, 100% 50%, calc(100% - var(--r)) 100%, -100vw 100%);
              border-image: conic-gradient(#45ada8 0 0) fill 0 / 100vw;
              width: 150px;
              font-size: 1.125rem;
              font-weight: bold;
              color: #fff;
              margin-bottom: 0.75rem;
              padding: 0.2rem 0.5rem;

              .card-text {
                margin-bottom: .25rem !important;
              }

              .custom-iribbon-text {
                font-weight: 100;
                font-size: small;
              }

              .custom-iribbon-text-votes {
                font-size: 18px;
                font-weight: 700;
              }
            }

            .custom-iribbon {
              align-items: start;
            }
          }

          .custom-person-image img {
            position: absolute;
            bottom: 0;
            right: 0;
            object-fit: cover;
            border-radius: 0 1.25rem 1.25rem 0;
            width: 100px;
            max-width: 120px;
            min-width: 100px;
          }

          .person-image {
            display: flex;
            width: 50%;
            align-items: center;

            .custom-person-image {
              position: absolute;
              bottom: 0;
              right: 0;
              object-fit: cover;
              border-radius: 0 1.25rem 1.25rem 0;
              width: 100px;
              max-width: 120px;
              min-width: 100px;

            }


            .wid {
              margin-right: 10px;
              transition: all 0.5s ease;
              width: 100px;
              height: 100px;
            }

            img {
              vertical-align: middle;
              border-style: none;
            }
          }
        }
      }
    }
  }
}



#constituency-2021-modal {
  .c-modal {

    #modal-left-panel {
      #const-mini-svg {
        background-color: white;
        border-radius: 8px;
      }
    }

    #modal-right-panel {

      .custom-container {
        position: relative;
        background: linear-gradient(to right, rgba(217, 242, 252, 255), rgba(190, 234, 241, 255));
        border-radius: 10px;
        padding: 0;
        margin: 0.725rem !important;
        max-height: 172px;
        max-width: 300px;
        box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
        box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
        margin: 1rem;
        /* height: 18.75rem; */
        animation: loader 3s;
        animation: loader 3s infinite linear;
        transition: all 0.5s ease;
        width: 100%;

        .ribbon {
          --f: .5em;
          position: absolute;
          top: 0;
          right: 0;
          line-height: 1.8;
          padding-inline: 1lh;
          padding-bottom: var(--f);
          border-image: conic-gradient(#0008 0 0) 51% / var(--f);
          clip-path: polygon(100% calc(100% - var(--f)), 100% 100%, calc(100% - var(--f)) calc(100% - var(--f)), var(--f) calc(100% - var(--f)), 0 100%, 0 calc(100% - var(--f)), 999px calc(100% - var(--f) - 999px), calc(100% - 999px) calc(100% - var(--f) - 999px));
          transform: translate(calc((1 - cos(45deg)) * 100%), -100%) rotate(45deg);
          transform-origin: 0% 100%;
          background-color: rgba(240, 68, 56, 255);
          font-size: 0.75rem;
          font-weight: bold;
          color: #fff;
        }

        .custom-temp {
          width: 70%;
          padding-bottom: 1.5rem;
          height: 100%;

          .card-body {
            padding: 0.725rem 0 0 0.725rem;
            margin-bottom: 7px;
            width: 100%;
            min-height: 1px;

            .card-title {
              margin-bottom: 5px;
              font-size: 16px;
              font-weight: 700;
            }

            .card-title.custom-card-title {
              margin-bottom: 5px;
              font-size: 16px;
              font-weight: 700;
            }

            .custom-subheaders {
              align-items: center;
              display: flex;
              gap: 15px;

              .logo {
                .custom-img {
                  width: 16px;
                }
              }

              .card-text.custom-card-text-votes {
                color: #FF9933;
                font-size: 12px;
                font-weight: 700;
              }
            }

            .custom-card-text {
              color: rgb(48, 48, 48);
              font-size: 12px;
              font-weight: 400;
            }
          }

          .iribbon {
            --r: 25px;
            padding-right: calc(var(--r) + .25em);
            line-height: 1;
            clip-path: polygon(-100vw 0, calc(100% - var(--r)) 0, 100% 50%, calc(100% - var(--r)) 100%, -100vw 100%);
            border-image: conic-gradient(#45ada8 0 0) fill 0 / 100vw;
            width: 150px;
            font-size: 1.125rem;
            font-weight: bold;
            color: #fff;
            margin-bottom: 0.75rem;
            padding: 0.2rem 0.5rem;

            .card-text {
              margin-bottom: .25rem !important;
            }

            .custom-iribbon-text {
              font-weight: 100;
              font-size: small;
            }

            .custom-iribbon-text-votes {
              font-size: 18px;
              font-weight: 700;
            }
          }

          .custom-iribbon {
            align-items: start;
          }
        }

        .custom-person-image img {
          position: absolute;
          bottom: 0;
          right: 0;
          object-fit: cover;
          border-radius: 0 1.25rem 1.25rem 0;
          width: 100px;
          max-width: 120px;
          min-width: 100px;
        }

        .person-image {
          display: flex;
          width: 50%;
          align-items: center;

          .custom-person-image {
            position: absolute;
            bottom: 0;
            right: 0;
            object-fit: cover;
            border-radius: 0 1.25rem 1.25rem 0;
            width: 100px;
            max-width: 120px;
            min-width: 100px;

          }


          .wid {
            margin-right: 10px;
            transition: all 0.5s ease;
            width: 100px;
            height: 100px;
          }

          img {
            vertical-align: middle;
            border-style: none;
          }
        }
      }
    }
  }
}


/*alliance result table*/
#alliance-table {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

/* Party highlight on map */
.party-highlighted {
  stroke: #ff6b35 !important;
  stroke-width: 1px !important;
}@media (max-width: 768px) {
  .results-hero {
    grid-template-columns: 1fr;
    gap: var(--gap-md);
  }

  .results-map-wrap {
    min-height: auto;
    max-height: none;
  }

  .results-chart-col {
    padding: var(--gap-md);
  }

  .parliament-wrap {
    padding-top: var(--gap-md);
    margin-bottom: 1.5rem;
  }

  .parliament-center {
    bottom: 0;
  }

  #alliance-table {
    margin-top: 1.5rem;
  }
}
@media (max-width: 768px) {
  .results-hero {
    grid-template-columns: 1fr;
    gap: var(--gap-md);
  }

  .results-map-wrap {
    min-height: auto;
    max-height: none;
  }

  .results-chart-col {
    padding: var(--gap-md);
  }

  .parliament-wrap {
    padding-top: var(--gap-md);
    margin-bottom: 1.5rem;
  }

  .parliament-center {
    bottom: 0;
  }

  #alliance-table {
    margin-top: 1.5rem;
  }
}

@media (max-width: 768px) {
  .results-hero {
    grid-template-columns: 1fr;
    gap: var(--gap-md);
  }

  .results-map-wrap {
    min-height: auto;
    max-height: none;
  }

  .results-chart-col {
    padding: var(--gap-md);
  }

  .parliament-wrap {
    padding-top: var(--gap-md);
    margin-bottom: 1.5rem;
  }

  .parliament-center {
    bottom: 0;
  }

  #alliance-table {
    margin-top: 1.5rem;
  }
}

