/*Overrides*/

:root {
  --bulma-text: #282828;
  --bulma-link: #235390;
  --bulma-link-h: #235390;
  --bulma-dropdown-divider-background-color: #d7dae0;
}

.card {
  --bulma-card-radius: 1.2rem;
}

.notification.is-success.is-light {
  --bulma-notification-background-l: 93%;
}

.button.is-link.is-ghost {
  color: #235390;
}

/*Fonts*/

@font-face {
  font-family: "SF Pro";
  src: url(../fonts/SF-Pro-Text-Regular.otf) format("opentype");
}

@font-face {
  font-family: "SF Pro";
  font-weight: 300;
  src: url(../fonts/SF-Pro-Text-Light.otf) format("opentype");
}

@font-face {
  font-family: "SF Pro";
  font-weight: 800;
  src: url(../fonts/SF-Pro-Text-Bold.otf) format("opentype");
}

@font-face {
  font-family: "SF Pro";
  font-weight: 500;
  src: url(../fonts/SF-Pro-Text-Medium.otf) format("opentype");
}

@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 400;
  src: local("Lato"), local("Lato-Regular"),
    url(../fonts/Lato-Regular.ttf) format("truetype");
}

@font-face {
  font-family: "Material Icons";
  font-style: normal;
  font-weight: 400;
  src: local("Material Icons"), local("MaterialIcons-Regular"),
    url(../fonts/MaterialIcons-Regular.ttf) format("truetype");
}

.is-font-lato {
  font-family: "Lato";
}

.material-icons {
  font-family: "Material Icons";
  font-weight: normal;
  font-style: normal;
  font-size: 24px; /* Preferred icon size */
  display: inline-block;
  line-height: 1;
  text-transform: none;
  letter-spacing: normal;
  word-wrap: normal;
  white-space: nowrap;
  direction: ltr;

  /* Support for all WebKit browsers. */
  -webkit-font-smoothing: antialiased;
  /* Support for Safari and Chrome. */
  text-rendering: optimizeLegibility;

  /* Support for Firefox. */
  -moz-osx-font-smoothing: grayscale;

  /* Support for IE. */
  font-feature-settings: "liga";
}

.material-icons.md-30 {
  font-size: 30px;
}

/*Main*/

body {
  font-family: "SF Pro";
  padding-bottom: 4rem;
  line-height: 1.2;
}

.primary-button {
  background: #235390;
  min-width: 150px;
  color: #fff;
}

.container {
  max-width: unset !important;
}

.card {
  box-shadow: 0px 4px 16px 0px #30303026 !important;
}

.notification {
  border-radius: 1rem;
}

/*Navbar*/
.navbar {
  min-height: unset !important;
}

.navbar-item.is-active {
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 7px;
}

@media screen and (max-width: 1023px) {
  .dropdown-item.is-active {
    background: rgba(178, 212, 255, 0.12);
    font-weight: 800;
    color: #235390;
  }
}

.logo {
  font-size: 20px;
}

@media screen and (max-width: 1023px) {
  .logo {
    font-size: 18px;
  }
}

.logo-img {
  margin-right: 1rem !important;
  width: 40px !important;
  height: 40px !important;
  max-width: unset !important;
  max-height: unset !important;
}

@media screen and (max-width: 1023px) {
  .logo-img {
    margin-right: 0.5rem !important;
  }
}

.top-info {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

/*Desktop spacing*/

@media screen and (min-width: 1024px) {
  /*Main*/

  body {
    padding-bottom: 8rem;
  }

  /*Navbar*/
  .navbar {
    min-height: 107px;
  }

  /*Top Info*/

  .top-info {
    padding-left: 4.5rem !important;
    padding-right: 4.5rem !important;
  }

  .top-info h1 {
    font-size: 3em;
  }
}

/* ---------- Revamp: grouped results ---------- */

.race-group {
  margin-top: 1.75rem;
}

.race-group-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.25rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #e5e7eb;
}

.race-group-title {
  font-size: 1.05rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #4b5563;
  margin: 0;
}

.race-group-count {
  font-size: 0.85rem;
  color: #6b7280;
  font-weight: 500;
}

/* ---------- Revamp: race card ---------- */

.address-card {
  margin-bottom: 1rem;
}

.race-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.5rem;
}

.race-note {
  background: #f3f4f6;
  border-left: 3px solid #9ca3af;
  border-radius: 0.5rem;
  padding: 0.65rem 0.85rem;
  color: #374151;
  font-size: 0.95rem;
  line-height: 1.4;
}

.note-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6b7280;
  margin-right: 0.5rem;
}

/* ---------- Revamp: candidate card ---------- */

.candidate-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.candidate-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  border-left: 4px solid #d1d5db;
  background: #ffffff;
  transition: box-shadow 0.15s ease, transform 0.05s ease;
}

.candidate-card:hover {
  box-shadow: 0 2px 10px rgba(17, 24, 39, 0.08);
}

.candidate-card--recommended {
  background: #f0fdf4;
  border-color: #bbf7d0;
  border-left-color: #16a34a;
}

.candidate-card--dis-recommended {
  background: #fef2f2;
  border-color: #fecaca;
  border-left-color: #dc2626;
}

.candidate-card--neutral {
  border-left-color: #d1d5db;
}

.candidate-main {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex: 1 1 auto;
  min-width: 0;
}

.candidate-icon {
  flex: 0 0 auto;
  min-width: 30px;
  padding-top: 0.1rem;
}

.candidate-body {
  flex: 1 1 auto;
  min-width: 0;
}

.candidate-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.candidate-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  line-height: 1.25;
}

.candidate-party {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  color: #6b7280;
}

.candidate-note {
  flex-basis: 100%;
  width: 100%;
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #374151;
  padding: 0.5rem 0.65rem;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 0.5rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Collapsible long notes (candidate-note + race-note) */
.note-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.note-toggle {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #2563eb;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}

.note-toggle:hover {
  color: #1d4ed8;
}

.candidate-list-toggle {
  margin-top: 0.5rem;
  margin-left: 0.25rem;
}

.candidate-actions {
  flex: 0 0 auto;
}

/* Mobile: shrink the candidate "Info" link to an icon-only button and
   anchor it to the top-right of the card so it never wraps to its own
   line. Also drop the verbose "Recommended"/"Not recommended" pills —
   the colored status icon already conveys the same meaning. */
@media (max-width: 1023px) {
  .candidate-card {
    position: relative;
    padding-right: 2.5rem;
  }
  .candidate-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
  }
  .candidate-info-link {
    padding: 0.25rem;
    height: auto;
    min-width: 0;
    border: 0;
    background: transparent;
  }
  .candidate-info-link .material-icons {
    font-size: 22px;
    color: #2563eb;
    line-height: 1;
  }
  .candidate-name-row .pill {
    display: none;
  }
}

.icon-success {
  color: #16a34a !important;
}

.icon-danger {
  color: #dc2626 !important;
}

.icon-neutral {
  color: #cbd5e1 !important;
}

/* ---------- Revamp: pills ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}

.pill--success {
  background: #dcfce7;
  color: #166534;
}

.pill--danger {
  background: #fee2e2;
  color: #991b1b;
}

/* ---------- Revamp: sticky search bar ---------- */

.container > [x-data="searchForm"] > form {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #ffffff;
  padding: 0.75rem 0;
  margin: 0 -0.25rem;
}

/* Dropdown needs to float above sticky-scrolled content below */
.dropdown-menu {
  z-index: 25;
}

/* ---------- Revamp: skeleton loader ---------- */

@keyframes skeleton-shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton {
  display: block;
  background: linear-gradient(90deg, #f3f4f6 0%, #e5e7eb 50%, #f3f4f6 100%);
  background-size: 800px 100%;
  animation: skeleton-shimmer 1.4s linear infinite;
  border-radius: 0.4rem;
}

.skeleton-title {
  width: 45%;
  height: 1.25rem;
  margin-bottom: 0.5rem;
}

.skeleton-heading {
  width: 65%;
  height: 1.1rem;
  margin-bottom: 0.75rem;
}

.skeleton-line {
  width: 100%;
  height: 0.85rem;
  margin-bottom: 0.5rem;
}

.skeleton-line--short {
  width: 55%;
}
