/* ==========================================
   SCORE - Candidate Announcements
========================================== */

/* Page width */
.tertiary .main-content.candidate-page {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
}

.candidate-page {
    min-width: 0;
    padding: 32px 0 44px;
}

/* ==========================================
     Header / Purple Banner
  ========================================== */

.candidate-header {
    position: relative;
    background: #4c0f9e;
}

.container.pad {
    padding: 12px 20px 36px;
}

.candidate-header .sub-header {
    position: relative;
    margin: 0;
    min-height: 180px;
    background-size: auto 100% !important;
    background-position: right center !important;
    background-repeat: no-repeat !important;
}

/* If the decorative image is on a pseudo-element */
.candidate-header .sub-header::before,
.candidate-header .sub-header::after {
    background-size: auto 100%;
    background-position: right center;
    background-repeat: no-repeat;
}

/* ==========================================
     Punjab Tab
  ========================================== */

.candidate-state-container {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 40px;
    transform: none;
    box-sizing: border-box;
    z-index: 5;
    pointer-events: none;
}

.candidate-state-container .state-tabs {
    display: flex;
    align-items: flex-end;
    padding: 0;
    margin: 0;
    background: transparent;
    pointer-events: auto;
}

.candidate-state-container .state-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    margin: 0;
    padding: 10px 24px;
    min-height: 46px;
    border: 0;
    border-radius: 12px 12px 0 0;
    background: #f1effb;
    color: #4c0f9e;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.candidate-state-container .state-icon {
    display: block;
    width: auto;
    height: 32px;
}

/* ==========================================
     Filters
  ========================================== */

.candidate-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 16px;
}

.candidate-filters label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 140px;
    padding: 6px 12px;
    border: 1px solid #E3DDF5;
    border-radius: 10px;
    background: #ECEBF1;
    box-sizing: border-box;
}

.candidate-filters label span {
    color: #2F1A8D70;
    font-size: 10px;
    font-weight: 400;
    line-height: 1.3;
}

.candidate-filters select {
    display: block;
    width: 100%;
    max-width: 114px;
    min-height: 16px;
    padding: 0;
    border: 0;
    background-color: transparent;
    color: #2F1A8D;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    outline-offset: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.candidate-filters select,
.candidate-filters select:focus,
.candidate-filters select:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* ==========================================
     Table Scroll Container
  ========================================== */

.candidate-table-scroll {
    position: relative;
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid #ded8ee;
    border-radius: 12px;
    background: #fff;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

/* ==========================================
     Table
  ========================================== */

.candidate-table {
    width: max-content;
    min-width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
    color: #272036;
    font-family: inherit;
    font-size: 12px;
}

.candidate-table th,
.candidate-table td {
    position: relative;
    min-width: 160px;
    padding: 14px 16px;
    border: 0;
    border-bottom: 1px solid #e4def0;
    background: #fff;
    color: inherit;
    text-align: left;
    vertical-align: middle;
    box-sizing: border-box;
}

/* Table header */
.candidate-table thead th {
    background: #e5def4;
    font-weight: 700;
    white-space: nowrap;
}

.candidate-table thead th strong {
    display: block;
    font-weight: 700;
}

.candidate-table thead th small {
    display: block;
    margin-top: 4px;
    color: #887e9b;
    font-size: 10px;
    font-weight: 400;
    white-space: nowrap;
}

/* ==========================================
     Sticky First Column
  ========================================== */

/*
    The constituency column is the first TH
    in both thead and tbody.
  
    It must remain inside .candidate-table-scroll.
  */

.candidate-table thead tr> :first-child,
.candidate-table tbody tr> :first-child {
    position: -webkit-sticky !important;
    position: sticky !important;
    left: 0 !important;
    right: auto !important;
    z-index: 10;
    width: 168px;
    min-width: 168px;
    max-width: 168px;
    background: #fff !important;
    box-shadow: none;
}

/* Show shadow when horizontally scrolled */
.candidate-table-scroll.is-scrolled .candidate-table tr> :first-child {
    box-shadow: 5px 0 9px -5px rgba(37, 20, 68, 0.25);
}

/* First header cell */
.candidate-table thead tr> :first-child {
    z-index: 11;
    background: #e5def4 !important;
}

/* First-column content */
.candidate-table tbody th strong {
    display: block;
    color: #2c1378;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}

.candidate-table tbody th small {
    display: block;
    margin-top: 5px;
    color: #8d849a;
    font-size: 10px;
    font-weight: 400;
    line-height: 1.4;
}

/* ==========================================
     Table Rows
  ========================================== */

.candidate-table tbody tr:last-child th,
.candidate-table tbody tr:last-child td {
    border-bottom: 0;
}

.candidate-table tbody tr:hover td,
.candidate-table tbody tr:hover th {
    background: #faf8ff;
}

.candidate-table tbody tr:hover> :first-child {
    background: #faf8ff !important;
}

/* ==========================================
     Party Indicators
  ========================================== */

.candidate-dot {
    display: none;
    width: 10px;
    height: 10px;
    margin-right: 4px;
    border-radius: 50%;
    vertical-align: middle;
}

.candidate-muted {
    color: #96919e !important;
}

/* ==========================================
     Empty State
  ========================================== */

#candidate-empty {
    padding: 20px;
    margin: 0;
    color: #887e9b;
    text-align: center;
}

#candidate-empty[hidden] {
    display: none;
}

/* ==========================================
     Tablet
  ========================================== */

@media (max-width: 991px) {
    .candidate-header .sub-header {
        min-height: 220px;
    }

    .candidate-filters {
        gap: 8px;
    }

    .candidate-table th,
    .candidate-table td {
        padding: 12px 14px;
    }
}

/* ==========================================
     Mobile
  ========================================== */

@media (max-width: 767px) {
    .container.pad {
        padding: 24px 20px 64px;
    }

    .candidate-header .sub-header {
        min-height: 180px;
        background-size: auto 100% !important;
    }

    .candidate-page {
        padding-top: 20px;
        padding-bottom: 32px;
    }

    .candidate-state-container {
        padding: 0 20px;
    }

    .candidate-state-container .state-tab {
        min-height: 42px;
        padding: 8px 18px;
        font-size: 13px;
    }

    .candidate-state-container .state-icon {
        height: 26px;
    }

    .candidate-filters {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .candidate-filters label {
        min-width: 0;
    }

    .candidate-filters select {
        max-width: 100%;
        font-size: 12px;
    }

    .candidate-table {
        font-size: 11px;
    }

    .candidate-table th,
    .candidate-table td {
        min-width: 140px;
        padding: 12px;
    }

    .candidate-table thead tr> :first-child,
    .candidate-table tbody tr> :first-child {
        width: 140px;
        min-width: 140px;
        max-width: 140px;
    }

    .candidate-table tbody th strong {
        font-size: 11px;
    }

    .candidate-table tbody th small {
        font-size: 9px;
    }
}

/* ==========================================
   Migrated from policy-layout.css
   Candidate page only - no policy table rules
========================================== */

.candidate-announcements #main {
    min-height: calc(100vh - 402px);
}

.candidate-announcements #main>.container {
    max-width: 1366px;
    width: 100%;
    margin: 0 auto;
    padding: 20px 20px 48px;
    box-sizing: border-box;
}

.candidate-announcements .candidate-page {
    padding: 0;
}

.candidate-announcements .main-content.candidate-page {
    max-width: none;
}

.candidate-announcements .candidate-header .sub-header {
    background-image: url("./images/press-release-bg.png");
    background-color: #4c0f9e;
    background-position: right center;
    background-repeat: no-repeat;
    background-size: auto 100%;
}

/* Isolate candidate table from generic table styling. */
.candidate-announcements .candidate-table {
    overflow: visible !important;
    border-collapse: separate !important;
    border-spacing: 0;
    table-layout: auto;
}

.candidate-announcements .candidate-table-scroll {
    overflow-x: auto;
    overflow-y: hidden;
}

.candidate-announcements .candidate-table thead tr> :first-child,
.candidate-announcements .candidate-table tbody tr> :first-child {
    position: sticky !important;
    left: 0 !important;
    z-index: 10;
    background: #fff !important;
}

.candidate-announcements .candidate-table thead tr> :first-child {
    z-index: 11;
    background: #e5def4 !important;
}