/* ==========================================================================
   CJS Portal — Front-end CSS
   Loaded only on pages containing one of the plugin's shortcodes.
   ========================================================================== */

/* ---------- Hearing Tracker ---------- */
.cjs-tracker {
  background: #fff;
  border: 1px solid #e5ddd4;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 4px 14px rgba(26, 20, 16, 0.08);
  margin: 24px 0;
  font-family: Inter, system-ui, sans-serif;
  color: #1a1410;
}
.cjs-tracker__filters {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
  padding-bottom: 18px;
  border-bottom: 1px solid #e5ddd4;
  margin-bottom: 18px;
}
.cjs-tracker__filter { flex: 1 1 200px; }
.cjs-tracker__filter label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1a1410;
  margin-bottom: 6px;
}
.cjs-tracker__filter select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #c8c0b4;
  border-radius: 6px;
  background: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  color: #1a1410;
}
.cjs-tracker__refresh {
  padding: 10px 22px;
  background: #e85a1a;
  color: #fff;
  border: 2px solid #e85a1a;
  border-radius: 6px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all .15s ease;
}
.cjs-tracker__refresh:hover { background: #b8410d; border-color: #b8410d; }

.cjs-tracker__results { min-height: 200px; }
.cjs-tracker__loading {
  text-align: center;
  color: #5a4a3e;
  font-style: italic;
  padding: 40px 0;
}
.cjs-tracker__count {
  margin-top: 14px;
  font-size: 0.85rem;
  color: #5a4a3e;
  text-align: right;
  border-top: 1px solid #e5ddd4;
  padding-top: 12px;
}

.cjs-hearing-row {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 18px;
  align-items: center;
  background: #faf7f4;
  border: 1px solid #e5ddd4;
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 12px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.cjs-hearing-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(26, 20, 16, 0.10);
}
.cjs-hearing-row .date-block {
  text-align: center;
  background: #1a1410;
  color: #fff;
  border-radius: 6px;
  padding: 10px 6px;
}
.cjs-hearing-row .date-block .mo {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #f4a548;
}
.cjs-hearing-row .date-block .day {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
}
.cjs-hearing-row .date-block .yr {
  display: block;
  font-size: 0.7rem;
  color: #c8b9a8;
  margin-top: 2px;
}
.cjs-hearing-row h4 {
  margin: 0 0 4px;
  color: #1a1410;
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.1rem;
  line-height: 1.3;
}
.cjs-hearing-row h4 a { color: #1a1410; text-decoration: none; }
.cjs-hearing-row h4 a:hover { color: #e85a1a; }
.cjs-hearing-row .meta {
  margin: 0;
  font-size: 0.85rem;
  color: #5a4a3e;
  line-height: 1.5;
}
.cjs-hearing-row .meta strong { color: #1a1410; }
.cjs-hearing-row .status {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.cjs-hearing-row .status.lo-open    { background: #fde8de; color: #b8410d; }
.cjs-hearing-row .status.lo-closed  { background: #e8e3dc; color: #5a4a3e; }
.cjs-hearing-row .status.lo-pending { background: #fff5e8; color: #b8870d; }

.cjs-tracker__empty {
  text-align: center;
  padding: 40px 20px;
  color: #5a4a3e;
}
.cjs-tracker__empty h4 {
  font-family: 'Source Serif 4', Georgia, serif;
  color: #1a1410;
  margin: 0 0 8px;
}

@media (max-width: 600px) {
  .cjs-hearing-row { grid-template-columns: 75px 1fr; }
  .cjs-hearing-row .status { grid-column: 2; justify-self: start; margin-top: 6px; }
}

/* ---------- US State Map ---------- */
.cjs-map-wrap {
  background: #fff;
  border: 1px solid #e5ddd4;
  border-radius: 10px;
  padding: 32px;
  box-shadow: 0 4px 14px rgba(26, 20, 16, 0.08);
  margin: 24px 0;
  font-family: Inter, system-ui, sans-serif;
}
.cjs-map-intro h2 {
  font-family: 'Source Serif 4', Georgia, serif;
  color: #1a1410;
  margin: 0 0 8px;
}
.cjs-map-intro p {
  color: #5a4a3e;
  max-width: 720px;
  margin: 0 0 24px;
}
.cjs-map {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  display: block;
  text-align: center;
}
.cjs-map svg {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}
.cjs-map-legend {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: #5a4a3e;
}
.cjs-map-legend .dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: middle;
  border: 1px solid #1a1410;
}
.cjs-map-legend .dot-empty { background: #ffffff; }
.cjs-map-legend .dot-some  { background: #f4a548; }
.cjs-map-legend .dot-many  { background: #e85a1a; }

/* State detail panel that slides in below the map */
.cjs-map-detail {
  position: relative;
  margin-top: 30px;
  background: #faf7f4;
  border: 1px solid #e5ddd4;
  border-left: 4px solid #e85a1a;
  border-radius: 0 6px 6px 0;
  padding: 28px 32px;
  animation: cjsSlideIn .25s ease;
}
@keyframes cjsSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cjs-map-detail__close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: #5a4a3e;
  cursor: pointer;
  padding: 4px 10px;
}
.cjs-map-detail__close:hover { color: #e85a1a; }
.cjs-map-detail h3 {
  font-family: 'Source Serif 4', Georgia, serif;
  color: #1a1410;
  margin: 0 0 16px;
  font-size: 1.6rem;
}
.cjs-map-detail h4 {
  font-family: Inter, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #1a1410;
  margin: 24px 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid #e85a1a;
  display: inline-block;
}
.cjs-map-detail ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.cjs-map-detail ul li {
  padding: 10px 0;
  border-bottom: 1px solid #e5ddd4;
}
.cjs-map-detail ul li:last-child { border-bottom: none; }
.cjs-map-detail ul li a {
  color: #1a1410;
  text-decoration: none;
  font-weight: 600;
}
.cjs-map-detail ul li a:hover { color: #e85a1a; }
.cjs-map-detail ul li .meta {
  display: block;
  font-size: 0.82rem;
  color: #5a4a3e;
  font-weight: 400;
  margin-top: 2px;
}
.cjs-map-detail .empty {
  color: #5a4a3e;
  font-style: italic;
  font-size: 0.9rem;
}

/* ---------- State Directory (A-Z grid) ---------- */
.cjs-state-dir {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin: 24px 0;
}
.cjs-state-dir__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #e5ddd4;
  border-left: 3px solid #e5ddd4;
  border-radius: 0 6px 6px 0;
  text-decoration: none;
  transition: all .15s ease;
}
.cjs-state-dir__item.has-content { border-left-color: #e85a1a; }
.cjs-state-dir__item:hover {
  background: #faf7f4;
  border-left-color: #e85a1a;
  transform: translateX(2px);
}
.cjs-state-dir__item .abbr {
  font-family: Inter, monospace;
  font-weight: 700;
  font-size: 0.9rem;
  color: #e85a1a;
  background: #fde8de;
  padding: 4px 8px;
  border-radius: 3px;
}
.cjs-state-dir__item .name {
  flex: 1;
  color: #1a1410;
  font-size: 0.92rem;
}
.cjs-state-dir__item .count {
  background: #1a1410;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  min-width: 24px;
  text-align: center;
}

/* ==========================================================================
   ARCHIVE TEMPLATES — styled pages for CPT archives
   Used when someone lands on /hearings-archive/, /pb-members-archive/, or
   /documented-hirings/, optionally filtered by ?cjs_state=<slug>.
   ========================================================================== */

.cjs-archive {
  background: #faf7f4;
  min-height: 60vh;
  padding: 60px 0 80px;
  font-family: Inter, system-ui, sans-serif;
  color: #1a1410;
}
.cjs-archive__container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.cjs-archive__header {
  text-align: center;
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid #e5ddd4;
}
.cjs-archive__eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #e85a1a;
  margin-bottom: 12px;
}
.cjs-archive__title {
  font-family: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
  color: #1a1410;
  font-size: clamp(2rem, 4.2vw, 2.8rem);
  margin: 0 0 16px;
  line-height: 1.15;
}
.cjs-archive__intro {
  max-width: 680px;
  margin: 16px auto 0;
  font-size: 1.08rem;
  color: #5a4a3e;
  line-height: 1.6;
}
.cjs-archive__filter {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fff5e8;
  border: 1px solid #f4a548;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 0.9rem;
  margin: 0 auto;
}
.cjs-archive__filter strong {
  color: #b8410d;
}
.cjs-archive__clear {
  color: #b8410d;
  text-decoration: none;
  font-weight: 700;
  border-left: 1px solid #f4a548;
  padding-left: 10px;
  transition: color .15s ease;
}
.cjs-archive__clear:hover {
  color: #1a1410;
}

/* --- Card grid (shared across all three CPTs) --- */
.cjs-archive__grid {
  display: grid;
  gap: 24px;
  margin-bottom: 48px;
}
.cjs-archive__grid--hearings,
.cjs-archive__grid--hirings {
  grid-template-columns: 1fr;
}
.cjs-archive__grid--members {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

/* --- Base card --- */
.cjs-card {
  background: #fff;
  border: 1px solid #e5ddd4;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(26, 20, 16, 0.06);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.cjs-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(26, 20, 16, 0.12);
}

.cjs-card__body {
  padding: 24px 28px;
}

.cjs-card__type {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #e85a1a;
  background: #fde8de;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 10px;
}
.cjs-card__type--warning {
  color: #b8410d;
  background: #fde8de;
}

.cjs-card__title {
  font-family: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
  font-size: 1.3rem;
  line-height: 1.25;
  margin: 0 0 8px;
}
.cjs-card__title a {
  color: #1a1410;
  text-decoration: none;
}
.cjs-card__title a:hover {
  color: #e85a1a;
}

.cjs-card__subtitle {
  font-size: 0.92rem;
  color: #5a4a3e;
  font-style: italic;
  margin: 0 0 14px;
}

.cjs-card__meta {
  list-style: none;
  padding: 0;
  margin: 14px 0;
}
.cjs-card__meta li {
  font-size: 0.88rem;
  color: #5a4a3e;
  padding: 4px 0;
  line-height: 1.45;
}
.cjs-card__meta li strong {
  color: #1a1410;
  font-weight: 600;
  display: inline-block;
  min-width: 110px;
}

.cjs-card__excerpt {
  font-size: 0.92rem;
  color: #5a4a3e;
  line-height: 1.55;
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid #f0ece7;
}

.cjs-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #f0ece7;
  flex-wrap: wrap;
}

.cjs-card__status {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.cjs-card__status.lo-open     { background: #fde8de; color: #b8410d; }
.cjs-card__status.lo-closed   { background: #e8e3dc; color: #5a4a3e; }
.cjs-card__status.lo-pending  { background: #fff5e8; color: #8a6410; }
.cjs-card__status.outcome-terminated,
.cjs-card__status.outcome-resigned { background: #e8e3dc; color: #5a4a3e; }
.cjs-card__status.outcome-charged,
.cjs-card__status.outcome-convicted { background: #fde8de; color: #b8410d; }
.cjs-card__status.outcome-active    { background: #fff5e8; color: #8a6410; }

.cjs-card__view-link,
.cjs-card__source-link {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  color: #e85a1a;
  transition: color .15s ease;
}
.cjs-card__view-link:hover,
.cjs-card__source-link:hover {
  color: #b8410d;
}
.cjs-card__source-link {
  color: #5a4a3e;
  font-weight: 600;
}

/* --- Hearing card (horizontal layout with date block) --- */
.cjs-card--hearing {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 0;
}
.cjs-card__date {
  background: #1a1410;
  color: #fff;
  padding: 24px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.cjs-card__date .mo {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #f4a548;
  margin-bottom: 4px;
}
.cjs-card__date .day {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}
.cjs-card__date .yr {
  display: block;
  font-size: 0.72rem;
  color: #c8b9a8;
  margin-top: 4px;
}
@media (max-width: 560px) {
  .cjs-card--hearing { grid-template-columns: 1fr; }
  .cjs-card__date { padding: 14px; flex-direction: row; gap: 8px; }
  .cjs-card__date .day { font-size: 1.4rem; }
}

/* --- Member card (vertical with portrait placeholder) --- */
.cjs-card--member {
  display: flex;
  flex-direction: column;
}
.cjs-card__thumb {
  background: #1a1410;
  color: #3d2817;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.cjs-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cjs-card__thumb--placeholder {
  background: linear-gradient(135deg, #1a1410 0%, #3d2817 100%);
  color: #5a3a22;
}
.cjs-card__thumb--placeholder svg {
  opacity: 0.6;
}

/* --- Hiring card (flagged with warning color) --- */
.cjs-card--hiring {
  border-left: 4px solid #e85a1a;
}

/* --- Pagination --- */
.cjs-archive__pagination {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid #e5ddd4;
}
.cjs-archive__pagination .page-numbers {
  display: inline-block;
  padding: 10px 16px;
  margin: 0 4px;
  background: #fff;
  border: 1px solid #e5ddd4;
  border-radius: 6px;
  color: #1a1410;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all .15s ease;
}
.cjs-archive__pagination .page-numbers:hover {
  background: #fff5e8;
  border-color: #e85a1a;
  color: #e85a1a;
}
.cjs-archive__pagination .page-numbers.current {
  background: #e85a1a;
  border-color: #e85a1a;
  color: #fff;
}

/* --- Empty state --- */
.cjs-archive__empty {
  text-align: center;
  padding: 60px 20px;
  background: #fff;
  border: 1px dashed #e5ddd4;
  border-radius: 10px;
  max-width: 560px;
  margin: 40px auto;
}
.cjs-archive__empty h3 {
  font-family: 'Source Serif 4', Georgia, serif;
  color: #1a1410;
  margin: 0 0 12px;
  font-size: 1.4rem;
}
.cjs-archive__empty p {
  color: #5a4a3e;
  margin: 0 0 12px;
  line-height: 1.6;
}
.cjs-archive__submit-link {
  display: inline-block;
  margin-top: 8px;
  padding: 10px 22px;
  background: #e85a1a;
  color: #fff !important;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: background .15s ease;
}
.cjs-archive__submit-link:hover {
  background: #b8410d;
}
