* {
  padding: 0;
  margin: 0;
}

.navbar-brand {
  display: inline-block;
  height: 50px;
  width: 140px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.legend-item {
  display: flex;
  align-items: center;
  margin-bottom: 1rem; /* optional spacing */
  font-size: 0.95rem;
}

.legend-color {
  width: 16px;
  height: 16px;
  background-color: #ffe6e6;
  border: 1px solid #ccc;
  margin-right: 8px;
  display: inline-block;
}

.legend-label {
  color: #333;
}

/* For different statuses */
.status-new-portfolio {
  border: 3px solid var(--theme-ui-colors-main);
}

.status-new-office-holder {
  border: 3px solid var(--theme-ui-colors-surreal);
}

.flourish-credit {
  display: none !important;
}

ul,
li {
  list-style: none;
  padding: 0;
}

h1 {
  display: none;
}

td {
  text-wrap: pretty;
}

.publish {
  font-size: 0.9em;
  width: 80%;
  padding: 1em 0;
  margin: 1em auto 0 auto;
  border-top: 1px solid rgba(239, 239, 239, 1);
  text-align: center;
}

body.theme-dark .publish a, body.theme-default .publish a {
  color: var(--theme-ui-colors-secondary) !important;
}

.desktop {
  display: block;
}

.mobile {
  display: none;
}

/* navigation bar */
#main-nav {
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  background-color: #f2f2f2;
  opacity: 0.97;
  padding: 2em 0 1em 0;
  width: 100%;
  transition: all 0.1s ease-in-out;
  z-index: 100;
}

.nav-link {
  background-color: #f2f2f2 !important;
  color: var(--theme-ui-colors-black);
}

.nav-link:hover {
  background-color: var(--theme-ui-colors-main) !important;
  color: var(--theme-ui-colors-white);
}

.sticky {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.container-fluid {
  justify-content: center !important;
}

.active {
  background-color: var(--theme-ui-colors-main) !important;
  color: var(--theme-ui-colors-white) !important;
}

/* content */
section {
  width: 700px;
  margin: auto;
  padding: 2em;
}

section h2 {
  text-align: center;
  font-weight: 700;
  font-size: 2.5rem;
}

h3 {
  font-weight: 700;
  margin: 1em 0;
}

.article-standfirst,
.article-text {
  text-align: left;
}

.article-standfirst {
  padding-top: 2em;
}

/* cabinet filters */
.filter-container {
  display: flex;
  justify-content: center;
}

.filter-dropdown {
  position: relative;
  display: inline-block;
  line-height: 1rem;
  text-align: left;
}

.filter-btn img {
  width: 12px;
}

.filter-btn {
  border: 1px solid #333;
  background-color: var(--theme-ui-colors-white);
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100px;
  height: 40px;
  border-radius: 4px;
  padding: 0.5em;
  font-size: 0.8rem;
  line-height: 0.9rem;
  text-align: left;
  cursor: pointer;
}

.search-input {
  position: relative;
  margin: auto;
  margin-top: 20px;
  width: 300px;
}

.search-box {
  background-image: url("../img/icon-search-grey.svg");
  background-repeat: no-repeat;
  background-position: 12px center;
  background-size: 16px 16px;
  font-size: 0.9rem !important;
  padding-left: 36px !important;
}

.btn-secondary {
  height: 40px;
  background: var(--theme-ui-colors-black) !important;
}

.custom-dropdown {
  position: absolute;
  background-color: var(--theme-ui-colors-white);
  border: 1px solid var(--theme-ui-colors-light-grey);
  z-index: 10000;
  width: 100px;
  position: absolute;
  box-sizing: border-box;
}

.custom-dropdown li {
  padding: 0.5em;
  font-size: 0.9rem;
  width: 100%;
  box-sizing: border-box;
  cursor: pointer;
}

.custom-dropdown li:nth-child(even) {
  background-color: #f2f2f2;
}

.custom-dropdown li:hover {
  background-color: var(--theme-ui-colors-light-grey);
}

/* cabinet cards */
#main-container {
  width: 80%;
}

.col-md-2 {
  width: calc(100% / 5);
}

.card {
  min-height: 380px;
}

.card .btn {
  padding: 0;
}

.member-img {
  display: flex;
  align-items: center;
  background-color: #f2f2f2;
  border-radius: 0;
  height: 100%;
}

.card-status,
.new-mp {
  padding: 4px 8px;
  display: inline-block;
  font-size: 0.9rem;
  position: absolute;
  margin: -1px;
  font-weight: 600;
}

.card-status {
  right: 0;
}

.status-new-portfolio .card-status {
  background-color: var(--theme-ui-colors-main);
  color: var(--theme-ui-colors-white);
}

.status-new-office-holder .card-status {
  background-color: var(--theme-ui-colors-surreal);
}

.new-mp {
  background-color: var(--theme-ui-colors-focus);
  left: 0;
}

.card-body p {
  margin: 0;
}

.member-cards {
  margin-bottom: 1.5em;
}

.card-name {
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--theme-ui-colors-grey);
  margin: 0;
}

.card-zhName {
  font-size: 1.3rem;
  line-height: 2rem;
  font-weight: 700;
  margin: 0;
}

.card-text {
  font-size: 0.875rem;
  line-height: 1.2rem;
}

.expand {
  width: 0.7em;
  margin: 0 10px 5px 0;
  position: absolute;
  right: 0;
  bottom: 0;
  display: block;
}

/* cabinet modal */
.modal-content,
.modal-header {
  border: 0;
  border-radius: 0;
}

.modal-body {
  padding: 0 4em;
}
.member-modal-img {
  padding-bottom: 0.5em;
}
.member-content img {
  width: 150px;
}

.member-description {
  height: 60vh;
  overflow: scroll;
  padding: 0 2em;
}

.member-cn {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1em;
}

.member-enName {
  font-size: 0.8rem;
  color: var(--theme-ui-colors-grey);
  margin: 0;
}

.member-zhName {
  font-size: 1.2rem;
  line-height: 2rem;
  font-weight: 700;
  margin: 0;
}

.member-text,
.member-constituency {
  font-size: 0.9rem;
  line-height: 1.2rem;
  margin: 0;
}

.member-constituency {
  line-height: 2rem;
}

table {
  text-align: left;
  font-size: 1rem;
}

tr:nth-child(even) {
  background-color: #f2f2f2;
}

.changes {
  background-color: var(--theme-ui-colors-main);
  color: var(--theme-ui-colors-white);
  padding: 3px;
  border-radius: 1rem;
  font-weight: bold;
  font-size: 0.6rem;
}

/* scrollbar */
.modal-body::-webkit-scrollbar,
.member-description::-webkit-scrollbar {
  -webkit-appearance: none;
}

.modal-body::-webkit-scrollbar:vertical,
.member-description::-webkit-scrollbar:vertical {
  width: 7px;
}

.modal-body::-webkit-scrollbar-thumb,
.member-description::-webkit-scrollbar-thumb {
  border-radius: 1rem;
  background: var(--theme-ui-colors-main);
  background-clip: padding-box;
}

@media (max-width: 1280px) {
  .card {
    min-height: 330px;
  }
}

@media (min-width: 1000px) and (max-width: 1200px) {
  .col-md-2 {
    width: calc(100% / 4);
  }
}

@media (min-width: 750px) and (max-width: 999px) {
  .col-md-2 {
    width: calc(100% / 3);
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .modal-body {
    padding: 0 2em;
  }

  .member-name-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .member-description {
    height: 30vh;
    padding: 0 2em;
  }
}

@media (max-width: 767px) {
  .desktop {
    display: none;
  }

  .mobile {
    display: block;
  }

  section h2 {
    font-size: 2rem;
  }

  #main-container {
    width: 100%;
  }

  #main-nav {
    padding: 1em 0 1em 0;
  }

  .mb-3 {
    margin-bottom: 0 !important;
  }

  .my-4 {
    margin-top: 0 !important;
  }

  .col-md-2 {
    width: calc(100% / 3);
  }

  .modal-body {
    padding: 0 1em;
  }

  .modal-body .d-flex {
    flex-direction: column;
  }

  .member-content {
    width: 100%;
  }

  .member-modal-img {
    text-align: center;
  }

  .member-modal-img img {
    width: 150px;
  }

  .member-img {
    justify-content: center;
  }

  .member-description {
    height: 100%;
    overflow: hidden;
    padding: 0;
  }

  .member-enName, .member-position {
    text-align: center;
  }

  .member-cn {
    justify-content: center;
  }
}

@media (min-width: 701px) and (max-width: 767px) {
  .modal-body {
    height: 80vh;
    overflow: scroll;
  }
}

@media (max-width: 700px) {
  section {
    width: 100%;
  }

  .col-md-2 {
    width: 100%;
  }

  .card {
    min-height: auto;
  }

  .card .btn {
    display: flex;
    flex-direction: row;
  }

  .member-cards {
    margin-bottom: 0.5em;
  }

  .member-card {
    display: flex;
    align-items: center;
    min-height: 70px;
  }

  .card-img-top {
    width: 90px;
  }

  .card-body {
    text-align: left;
    align-content: center;
  }

  .modal-body {
    height: 70vh;
    overflow: scroll;
  }

  .member-name {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5em;
  }

  .card-zhName {
    font-size: 1rem;
  }

  .filter-btn img {
    width: 8px;
  }

  .filter-btn {
    width: 60px;
  }

  .new-mp {
    position: absolute;
    right: 0;
    left: auto;
    top: 0;
  }

  .new-mp.offset-right {
    right: 74px;
  }
}

@media (max-width: 424px) {
  .member-name {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: start;
    gap: 5px;
  }

  .card-status,
  .new-mp {
    font-size: 0.75rem;
  }

  .new-mp.offset-right {
    right: 64px;
  }

  .card-name {
    width: 150px;
    line-height: 0.9rem;
  }
}

@media (max-width: 320px) {
  .filter-container {
    flex-wrap: wrap;
  }

  .filter-btn {
    width: 80px;
  }

  .search-input {
    width: 240px;
  }

  .card-img-top {
    width: 70px;
  }

  .member-name {
    flex-wrap: wrap;
    justify-content: start;
  }

  .card-status,
  .new-mp {
    padding: 4px;
  }

  .card-body {
    width: 160px;
  }

  .card-text {
    font-size: 0.8rem;
  }

  .new-mp.offset-right {
    right: 0px;
    top: 28px;
  }
}
