/* Commissioner Timeline Widget — berks-commissioners.css
   Inherits site theme CSS custom properties where possible.
   Uses .bct__ BEM namespace to avoid conflicts. */

.bct__wrapper {
  font-family: inherit;
  color: inherit;
}

.bct__loading {
  padding: 2em;
  text-align: center;
  opacity: 0.6;
}

/* ── Meta / Last Updated ───────────────────────────── */
.bct__meta {
  margin-bottom: 0.5em;
}

.bct__last-updated {
  font-size: 0.8em;
  opacity: 0.65;
  margin: 0 0 0.25em 0;
}

/* ── Filter Toggle ──────────────────────────────────── */
.bct__filter-toggle-wrap {
  margin-bottom: 1.5em;
}

.bct__filter-toggle-btn {
  background: transparent;
  border: solid 1px #c9c9c9;
  border-radius: 4px;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: 0.8em;
  font-weight: 600;
  letter-spacing: 0.1em;
  padding: 0.45em 0.9em;
  text-transform: uppercase;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.bct__filter-toggle-btn:hover {
  background: rgba(144, 144, 144, 0.1);
  border-color: #585858;
}

.bct__filter-toggle-btn--active {
  border-color: #585858;
  background: rgba(144, 144, 144, 0.1);
}

.bct__filter-icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  vertical-align: middle;
}

/* ── Filter Bar ─────────────────────────────────────── */
.bct__filter-bar--hidden {
  display: none !important;
}

.bct__filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5em;
  margin-top: 0.75em;
}

.bct__filter-label {
  font-size: 0.85em;
  font-weight: 600;
  letter-spacing: 0.05em;
}


.bct__filter-select {
  -moz-appearance: none;
  -webkit-appearance: none;
  appearance: none;
  background-color: transparent;
  border: solid 1px #c9c9c9;
  border-radius: 4px;
  color: inherit;
  cursor: pointer;
  font-size: 0.8em;
  font-weight: 600;
  height: 2.75em;
  letter-spacing: 0.1em;
  padding: 0 1.25em;
  text-transform: uppercase;
  transition: border-color 0.2s ease;
}

.bct__filter-select:hover,
.bct__filter-select:focus {
  border-color: #585858;
  outline: none;
}

/* ── Timeline List ──────────────────────────────────── */
.bct__list {
  display: flex;
  flex-direction: column;
  gap: 1em;
  position: relative;
}

.bct__list::before {
  content: '';
  position: absolute;
  left: 0.6em;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, #585858 0%, rgba(144,144,144,0.15) 100%);
  opacity: 0.25;
}

/* ── Meeting Card ───────────────────────────────────── */
.bct__card {
  background: rgba(144, 144, 144, 0.075);
  border: solid 1px #c9c9c9;
  border-radius: 4px;
  padding: 1.25em 1.5em;
  margin-left: 1.75em;
  position: relative;
  transition: border-color 0.2s ease;
}

.bct__card::before {
  content: '';
  position: absolute;
  left: -1.4em;
  top: 1.4em;
  width: 0.7em;
  height: 0.7em;
  border-radius: 50%;
  background: #585858;
  border: 2px solid #fff;
}

.bct__card:hover {
  border-color: #585858;
}

.bct__card-date {
  font-size: 0.75em;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.65;
  margin-bottom: 0.4em;
}

.bct__card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
  margin-bottom: 0.6em;
}

.bct__card-summary {
  margin: 0 0 0.75em 0;
  font-size: 0.95em;
  line-height: 1.5;
}

/* ── Badges ─────────────────────────────────────────── */
.bct__badge {
  display: inline-block;
  border-radius: 3px;
  font-size: 0.65em;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  padding: 0.35em 0.65em;
  text-transform: uppercase;
  white-space: nowrap;
}

.bct__badge--board-meeting {
  background: #1a3a6b;
  color: #fff;
}

.bct__badge--special-meeting {
  background: #7b2d8b;
  color: #fff;
}

.bct__badge--workshop {
  background: #3a6b1a;
  color: #fff;
}

.bct__badge--unanimous {
  background: #2c7a2c;
  color: #fff;
}

.bct__badge--split {
  background: #b8600a;
  color: #fff;
}

.bct__badge--pending {
  background: rgba(144, 144, 144, 0.3);
  color: inherit;
  border: 1px solid #c9c9c9;
}

/* ── Card Footer (expand button + PDF link row) ─────── */
.bct__card-footer {
  display: flex;
  align-items: center;
  gap: 1em;
}

/* ── Expand Button ──────────────────────────────────── */
.bct__card-expand-btn {
  background: transparent;
  border: solid 1px #c9c9c9;
  border-radius: 3px;
  color: inherit;
  cursor: pointer;
  font-size: 0.75em;
  font-weight: 600;
  letter-spacing: 0.1em;
  padding: 0.4em 0.9em;
  text-transform: uppercase;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.bct__card-expand-btn:hover {
  background: rgba(144, 144, 144, 0.1);
  border-color: #585858;
}

.bct__card-expand-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ── Card PDF Link ──────────────────────────────────── */
.bct__card-pdf-link {
  font-size: 0.75em;
  font-weight: 600;
  letter-spacing: 0.05em;
  opacity: 0.55;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.bct__card-pdf-link:hover {
  opacity: 1;
}

/* ── Modal ──────────────────────────────────────────── */
.bct__modal-open {
  overflow: hidden;
}

.bct__modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5em;
  animation: bct-fade-in 0.15s ease;
}

@keyframes bct-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.bct__modal {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  max-height: 88vh;
  width: 100%;
  max-width: 720px;
  animation: bct-slide-up 0.18s ease;
  overflow: hidden;
}

@keyframes bct-slide-up {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.bct__modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1em;
  padding: 1.25em 1.5em;
  border-bottom: 1px solid #e0e0e0;
  flex-shrink: 0;
}

.bct__modal-title {
  display: flex;
  flex-direction: column;
  gap: 0.4em;
}

.bct__modal-date {
  font-size: 0.8em;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.65;
}

.bct__modal-close {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 1.1em;
  opacity: 0.45;
  padding: 0.1em 0.3em;
  flex-shrink: 0;
  transition: opacity 0.15s ease;
}

.bct__modal-close:hover {
  opacity: 1;
}

.bct__modal-body {
  overflow-y: auto;
  padding: 1.5em;
  flex: 1;
}

/* ── Detail Panel ───────────────────────────────────── */
.bct__detail-panel {
  padding-top: 0;
}

.bct__pdf-link {
  display: inline-block;
  font-size: 0.8em;
  margin-bottom: 0.75em;
  opacity: 0.75;
}

.bct__pdf-link:hover {
  opacity: 1;
}

.bct__attendees {
  font-size: 0.8em;
  opacity: 0.65;
  margin: 0 0 1em 0;
  text-transform: capitalize;
}

.bct__detail-unavailable {
  font-size: 0.9em;
  opacity: 0.7;
  font-style: italic;
}

/* ── Agenda Items ───────────────────────────────────── */
.bct__agenda-item {
  border-left: 3px solid #e0e0e0;
  margin: 0.75em 0;
  padding: 0.5em 0 0.5em 1em;
}

.bct__agenda-item-header {
  font-size: 0.9em;
  font-weight: 600;
  margin-bottom: 0.4em;
}

.bct__item-num {
  color: #888;
}

.bct__no-vote {
  font-size: 0.85em;
  font-style: italic;
  opacity: 0.7;
  margin: 0.25em 0 0;
}

/* ── Vote Wrapper ───────────────────────────────────── */
.bct__vote-wrapper {
  margin-top: 0.4em;
}

.bct__unanimous-banner {
  display: inline-block;
  background: #2c7a2c;
  color: #fff;
  font-size: 0.65em;
  font-weight: 800;
  letter-spacing: 0.2em;
  padding: 0.3em 0.8em;
  border-radius: 3px;
  margin-bottom: 0.4em;
  text-transform: uppercase;
}

.bct__motion-text {
  font-size: 0.85em;
  font-style: italic;
  opacity: 0.8;
  margin: 0.25em 0 0.5em;
}

/* ── Vote Table ─────────────────────────────────────── */
.bct__vote-table {
  border-collapse: collapse;
  font-size: 0.82em;
  width: 100%;
  max-width: 480px;
}

.bct__vote-table th {
  border-bottom: 2px solid #c9c9c9;
  font-size: 0.75em;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0.35em 0.6em;
  text-align: left;
  text-transform: uppercase;
}

.bct__vote-table td {
  padding: 0.35em 0.6em;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  vertical-align: middle;
}

.bct__vote-cell--yes {
  color: #2c7a2c;
  font-weight: 700;
}

.bct__vote-cell--no {
  background: rgba(197, 48, 48, 0.08);
  color: #c53030;
  font-weight: 700;
}

.bct__vote-cell--abstain {
  background: rgba(184, 96, 10, 0.08);
  color: #b8600a;
  font-weight: 700;
}

.bct__vote-cell--absent {
  color: #888;
}

/* ── Role Badges ────────────────────────────────────── */
.bct__role-badge {
  display: inline-block;
  border-radius: 3px;
  font-size: 0.7em;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-left: 0.4em;
  padding: 0.15em 0.45em;
  text-transform: uppercase;
  vertical-align: middle;
}

.bct__role-badge--mover {
  background: #1a3a6b;
  color: #fff;
}

.bct__role-badge--seconder {
  background: rgba(26, 58, 107, 0.15);
  color: #1a3a6b;
  border: 1px solid #1a3a6b;
}

/* ── Related Items ──────────────────────────────────── */
.bct__related-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  margin-top: 0.5em;
}

.bct__related-link {
  display: inline-block;
  border: 1px solid #c9c9c9;
  border-radius: 3px;
  font-size: 0.75em;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.3em 0.7em;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.bct__related-link:hover {
  background: rgba(144, 144, 144, 0.1);
  border-color: #585858;
}

/* ── Item Original Text Toggle ──────────────────────── */
.bct__item-original-text {
  font-size: 0.85em;
  font-style: italic;
  opacity: 0.75;
  margin: 0.5em 0 0.25em;
  line-height: 1.5;
}

.bct__item-original-text--hidden {
  display: none;
}

/* CSS toggle switch */
.bct__switch {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  cursor: pointer;
  margin: 0.5em 0 0.25em;
  user-select: none;
}

.bct__switch input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.bct__switch-track {
  display: inline-block;
  width: 2.2em;
  height: 1.2em;
  background: #c9c9c9;
  border-radius: 0.6em;
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.bct__switch-track::after {
  content: '';
  position: absolute;
  top: 0.15em;
  left: 0.15em;
  width: 0.9em;
  height: 0.9em;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.bct__switch input[type="checkbox"]:checked ~ .bct__switch-track {
  background: #585858;
}

.bct__switch input[type="checkbox"]:checked ~ .bct__switch-track::after {
  transform: translateX(1em);
}

.bct__switch-label {
  font-size: 0.7em;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.65;
}

/* ── Theme Badges ───────────────────────────────────── */
.bct__badge--promotion {
  background: #2c5f2e;
  color: #fff;
}

.bct__badge--contract {
  background: #1a3a6b;
  color: #fff;
}

.bct__badge--grant {
  background: #7b3f00;
  color: #fff;
}

.bct__badge--emergency {
  background: #8b0000;
  color: #fff;
}

/* ── Empty State ────────────────────────────────────── */
.bct__empty {
  opacity: 0.55;
  font-style: italic;
  text-align: center;
  padding: 2em;
}

/* ── Responsive ─────────────────────────────────────── */
@media screen and (max-width: 736px) {
  .bct__card {
    margin-left: 1em;
    padding: 1em;
  }

  .bct__list::before {
    left: 0.3em;
  }

  .bct__card::before {
    left: -1.1em;
  }
}
