/* PollWatch Bahamas - Neutral Constituency Race Grid */

.pollwatch-race-grid {
  padding: 24px 0 8px;
}

.pollwatch-race-grid__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.pollwatch-race-grid__headline h2 {
  margin: 0;
  font-size: clamp(2rem, 3.4vw, 3rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  font-weight: 800;
  text-transform: uppercase;
  color: #243b7a;
}

.pollwatch-race-grid__headline p {
  margin: 10px 0 0;
  max-width: 720px;
  font-size: 1rem;
  line-height: 1.55;
  color: #5e6683;
}

.pollwatch-race-grid__filter select {
  min-width: 180px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid #93a7d1;
  border-radius: 10px;
  background: #fff;
  color: #243b7a;
  font-size: 0.95rem;
  box-shadow: none;
}

.pollwatch-race-grid__header {
  padding: 22px 24px;
  border: 1px solid #e3eaf6;
  border-radius: 22px;
  background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
  box-shadow: 0 14px 30px rgba(31, 53, 102, 0.07);
}

.pollwatch-race-grid__headline {
  flex: 1 1 640px;
}

.pollwatch-race-grid__filter {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.pollwatch-race-grid__filter select {
  min-width: 220px;
  height: 46px;
  padding: 0 16px;
  border: 1px solid #c8d6ee;
  border-radius: 999px;
  background: #ffffff;
  color: #243b7a;
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(36, 59, 122, 0.08);
  appearance: none;
}

@media (max-width: 767px) {
  .pollwatch-race-grid__header {
    padding: 18px 16px;
    border-radius: 18px;
  }

  .pollwatch-race-grid__filter {
    width: 100%;
  }

  .pollwatch-race-grid__filter select {
    width: 100%;
    min-width: 0;
  }
}

.pollwatch-race-grid__cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 42px 32px;
}

.pollwatch-race-card {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.pollwatch-race-card__top {
  margin-bottom: 12px;
  text-align: center;
}

.pollwatch-race-card__constituency {
  font-size: 1rem;
  line-height: 1.35;
  font-weight: 600;
  color: #2d3b73;
}

.pollwatch-race-card__viewport {
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
  isolation: isolate;
}

.pollwatch-race-card__track {
  position: relative;
  min-height: 520px;
  display: flex;
  width: 100%;
  max-width: 100%;
  transition: transform 0.28s ease;
  will-change: transform;
}

.pollwatch-race-slide {
  display: block;
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.pollwatch-race-slide.is-active {
  display: block;
}

.pollwatch-race-slide__media {
  position: relative;
  overflow: hidden;
  border-radius: 24px 24px 0 0;
  background: linear-gradient(180deg, #eef3fb 0%, #e0e8f6 100%);
  min-height: 380px;
}

.pollwatch-race-slide__media img,
.pollwatch-race-slide__placeholder {
  width: 100%;
  height: 380px;
  display: block;
}

.pollwatch-race-slide__media img {
  object-fit: cover;
  object-position: center center;
}

.pollwatch-race-slide__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  font-weight: 800;
  color: #6f80aa;
}

.pollwatch-race-slide__badges {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
}

.pollwatch-race-slide__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.94);
  color: #24304f;
  box-shadow: 0 6px 18px rgba(22, 33, 64, 0.12);
}

.pollwatch-race-slide__panel {
  border-radius: 0 0 24px 24px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 16px 34px rgba(25, 40, 79, 0.08);
  border: 1px solid #e4ebf5;
  border-top: 0;
  min-height: 140px;
  display: flex;
  flex-direction: column;
}

.pollwatch-race-slide__titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  color: #fff;
}

.pollwatch-race-slide__name {
  font-size: 1rem;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.pollwatch-race-slide__party {
  flex: 0 0 auto;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.32);
  font-size: 0.8rem;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pollwatch-race-slide__content {
  padding: 16px 16px 18px;
  background: #fff;
  min-height: 88px;
}

.pollwatch-race-slide__content p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.58;
  color: #56607b;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pollwatch-race-slide__panel.party-plp .pollwatch-race-slide__titlebar {
  background: #f2c100;
  color: #1f2c4f;
}

.pollwatch-race-slide__panel.party-plp .pollwatch-race-slide__party {
  border-left-color: rgba(31, 44, 79, 0.2);
}

.pollwatch-race-slide__panel.party-fnm .pollwatch-race-slide__titlebar {
  background: #d62828;
  color: #fff;
}

.pollwatch-race-slide__panel.party-coi .pollwatch-race-slide__titlebar {
  background: #15b8d6;
  color: #fff;
}

.pollwatch-race-slide__panel.party-dna .pollwatch-race-slide__titlebar {
  background: #1f8f55;
  color: #fff;
}

.pollwatch-race-slide__panel.party-ind .pollwatch-race-slide__titlebar,
.pollwatch-race-slide__panel.party-independent .pollwatch-race-slide__titlebar {
  background: #7c3aed;
  color: #fff;
}

.pollwatch-race-slide__media {
  position: relative;
  overflow: hidden;
}

.pollwatch-race-slide__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(140, 140, 140, 0.00);
  pointer-events: none;
  transition: background 0.18s ease;
  z-index: 2;
}

.pollwatch-race-card:hover .pollwatch-race-slide__media::after,
.pollwatch-race-card:focus-within .pollwatch-race-slide__media::after {
  background: rgba(140, 140, 140, 0.16);
}

.pollwatch-race-card__nav {
  position: absolute;
  top: 0;
  bottom: 124px;
  z-index: 4;
  width: 64px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(to right, rgba(120, 120, 120, 0.16) 0%, rgba(120, 120, 120, 0.08) 42%, rgba(120, 120, 120, 0.00) 100%) !important;
  color: #ffffff;
  font-size: 2.5rem;
  font-weight: 500;
  line-height: 1;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.40);
  box-shadow: none;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s ease, background 0.18s ease;
}

.pollwatch-race-card:hover .pollwatch-race-card__nav,
.pollwatch-race-card:focus-within .pollwatch-race-card__nav {
  opacity: 1;
}

.pollwatch-race-card__nav:hover {
  opacity: 1;
}

.pollwatch-race-card__nav--prev {
  left: 0;
  background: linear-gradient(to right, rgba(120, 120, 120, 0.20) 0%, rgba(120, 120, 120, 0.10) 44%, rgba(120, 120, 120, 0.00) 100%) !important;
}

.pollwatch-race-card__nav--next {
  right: 0;
  background: linear-gradient(to left, rgba(120, 120, 120, 0.20) 0%, rgba(120, 120, 120, 0.10) 44%, rgba(120, 120, 120, 0.00) 100%) !important;
}

.pollwatch-race-card__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding-top: 14px;
}

.pollwatch-race-card__dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #d5dced;
}

.pollwatch-race-card__dot.is-active {
  background: #243b7a;
}

@media (max-width: 1100px) {
  .pollwatch-race-grid__cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .pollwatch-race-grid {
    padding-top: 10px;
  }

  .pollwatch-race-grid__header {
    margin-bottom: 20px;
  }

  .pollwatch-race-grid__headline h2 {
    font-size: 2rem;
  }

  .pollwatch-race-grid__cards {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .pollwatch-race-card__track {
    min-height: 530px;
  }

  .pollwatch-race-slide__media {
    min-height: 350px;
  }

  .pollwatch-race-slide__media img,
  .pollwatch-race-slide__placeholder {
    height: 350px;
  }

  .pollwatch-race-card__nav {
    display: none;
  }
}

/* Uniform card sizing */
.pollwatch-race-card {
  height: 100%;
}

.pollwatch-race-card__track {
  min-height: 0 !important;
}

.pollwatch-race-slide {
  height: 100%;
}

.pollwatch-race-slide__media {
  height: 380px !important;
  min-height: 380px !important;
}

.pollwatch-race-slide__media img,
.pollwatch-race-slide__placeholder {
  width: 100%;
  height: 380px !important;
  object-fit: cover;
}

.pollwatch-race-slide__panel {
  min-height: 124px;
  display: flex;
  flex-direction: column;
}

.pollwatch-race-slide__content {
  flex: 1 1 auto;
}

@media (max-width: 767px) {
  .pollwatch-race-slide__media {
    height: 220px !important;
    min-height: 220px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f7fb;
    overflow: hidden;
  }

  .pollwatch-race-slide__media img,
  .pollwatch-race-slide__placeholder {
    width: auto;
    max-width: 100%;
    height: 220px !important;
    margin: 0 auto;
  }

  .pollwatch-race-slide__media img {
    object-fit: contain !important;
    object-position: center center !important;
    background: #f4f7fb;
    transform: none !important;
  }

  .pollwatch-race-slide__titlebar {
    display: block;
    padding: 12px 14px;
  }

  .pollwatch-race-slide__name {
    display: block;
    font-size: 0.9rem;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .pollwatch-race-slide__party {
    display: block;
    margin-top: 6px;
    padding-left: 0;
    border-left: 0;
    font-size: 0.74rem;
    line-height: 1.2;
  }
}



/* === Uniform candidate card sizing + profile clamp === */
.pollwatch-race-card {
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

.pollwatch-race-slide {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.pollwatch-race-slide__panel {
  display: flex;
  flex-direction: column;
  min-height: 250px;
}

.pollwatch-race-slide__content {
  flex: 1 1 auto;
  display: flex;
  align-items: flex-start;
}

.pollwatch-race-slide__content p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

@media (max-width: 767px) {
  .pollwatch-race-card {
    max-width: 560px;
  }

  .pollwatch-race-slide__panel {
    min-height: 210px;
  }

  .pollwatch-race-slide__content p {
    -webkit-line-clamp: 3;
  }
}
