/* ──────────────────────────────────────────────────────────────────
   Case by Party Search
   JCC design tokens: blue #005ea2, heading #1b2b85, border #dfe1e2,
   muted text #565c65, required red #d63e04
   ────────────────────────────────────────────────────────────────── */

/* ── Form container ──────────────────────────────────────────────── */
/* Layout handled by jcc-body structure */

/* ── Hero section background ─────────────────────────────────────── */
.node--type-page .jcc-hero {
  background-color: #f3f3f3;
}

/* ── Disclaimer ──────────────────────────────────────────────────── */
.jcc-cs-disclaimer {
  color: #565c65;
}

.jcc-cs-separator {
  border: 0;
  border-top: 1px solid #dfe1e2;
  margin: 1.5rem 0;
}

/* ── Form rows ───────────────────────────────────────────────────── */
.jcc-cs-row {
  margin-bottom: 1.5rem;
}

.jcc-cs-field {
  width: 100%;
}

/* ── Fieldset for year range ─────────────────────────────────────── */
.jcc-cs-fieldset {
  border: none;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.jcc-cs-legend {
  display: block;
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: #1b2b85;
  padding: 0;
}

/* ── Labels ──────────────────────────────────────────────────────── */
.jcc-body__main-text label {
  display: block;
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: #1b2b85;
}

.jcc-cs-required {
  color: #d63e04;
  margin-left: 0.125rem;
}

/* ── Checkbox row ────────────────────────────────────────────────── */
.jcc-cs-checkbox-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.jcc-cs-checkbox-row input[type="checkbox"] {
  width: auto;
  margin-right: 0.5rem;
  margin-bottom: 0;
}

.jcc-cs-checkbox-row label {
  margin-bottom: 0;
  font-weight: normal;
  cursor: pointer;
}

/* ── Inputs ──────────────────────────────────────────────────────── */
.jcc-body__main-text input[type="text"],
.jcc-body__main-text input[type="number"],
.jcc-body__main-text select {
  display: block;
  width: 100%;
  padding: 0.625rem 1rem;
  border: 1px solid #dfe1e2;
  background: #fff;
  box-sizing: border-box;
}

.jcc-body__main-text input[type="text"]:focus,
.jcc-body__main-text input[type="number"]:focus,
.jcc-body__main-text select:focus {
  outline: 2px solid #005ea2;
  outline-offset: 2px;
  border-color: #005ea2;
}

/* ── Year range ──────────────────────────────────────────────────── */
.jcc-cs-year-range {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.jcc-cs-year-field {
  flex: 1;
}

.jcc-cs-year-field label {
  font-weight: normal;
  margin-bottom: 0.25rem;
}

/* ── reCAPTCHA ───────────────────────────────────────────────────── */
#cs-recaptcha {
  margin: 0;
}

/* ── Button ──────────────────────────────────────────────────────── */
.jcc-cs-btn {
  display: inline-block;
  padding: 0.625rem 1.5rem;
  font-weight: bold;
  border: 2px solid transparent;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.jcc-cs-btn:focus {
  outline: 2px solid #005ea2;
  outline-offset: 2px;
}

.jcc-cs-btn--primary {
  background-color: #005ea2;
  color: #fff;
  border-color: #005ea2;
}

.jcc-cs-btn--primary:hover:not(:disabled) {
  background-color: #1b2b85;
  border-color: #1b2b85;
}

.jcc-cs-btn--primary:disabled {
  background-color: #aab5c3;
  border-color: #aab5c3;
  color: #fff;
  cursor: not-allowed;
}

/* ── Status messages ─────────────────────────────────────────────── */
.jcc-cs-status {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  display: none;
}

.jcc-cs-status--success {
  display: block;
  background-color: #e8f5e9;
  color: #1b5e20;
  border: 1px solid #a5d6a7;
}

.jcc-cs-status--error {
  display: block;
  background-color: #fff0f0;
  color: #d63e04;
  border: 1px solid #d63e04;
}

/* ── Results table ───────────────────────────────────────────────── */
.jcc-cs-results {
  margin-top: 2rem;
}

.jcc-cs-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  border: 1px solid #dfe1e2;
}

/* ── Table caption (visually hidden but accessible) ──────────────── */
.jcc-cs-table-caption {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.jcc-cs-table th {
  background-color: #1b2b85;
  color: #fff;
  font-weight: bold;
  text-align: left;
  padding: 0.75rem 1rem;
  border: 1px solid #dfe1e2;
}

.jcc-cs-table td {
  padding: 0.75rem 1rem;
  border: 1px solid #dfe1e2;
}

.jcc-cs-table tbody tr:nth-child(odd) {
  background-color: #f9f9f9;
}

.jcc-cs-table tbody tr:hover {
  background-color: #f0f0f0;
}

/* ── Empty results message ───────────────────────────────────────── */
.jcc-cs-empty-results {
  text-align: center;
  padding: 2rem 1rem !important;
  color: #565c65;
  font-style: italic;
}

/* ── Pagination ──────────────────────────────────────────────────── */
.jcc-cs-pagination {
  text-align: center;
  padding: 1rem 0;
}

.jcc-cs-page-numbers {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
}

.jcc-cs-page-btn {
  display: inline-block;
  min-width: 44px;
  height: 44px;
  padding: 0.5rem;
  background-color: #fff;
  border: 1px solid #dfe1e2;
  color: #005ea2;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.15s, border-color 0.15s;
}

.jcc-cs-page-btn:hover:not(.jcc-cs-page-btn--active):not([aria-disabled="true"]) {
  background-color: #f0f0f0;
  border-color: #005ea2;
}

.jcc-cs-page-btn:focus {
  outline: 2px solid #005ea2;
  outline-offset: 2px;
}

.jcc-cs-page-btn--active {
  background-color: #005ea2;
  color: #fff;
  border-color: #005ea2;
  cursor: default;
}

.jcc-cs-page-ellipsis {
  padding: 0 0.5rem;
  color: #565c65;
}

/* ── Screen reader only ──────────────────────────────────────────── */
.jcc-cs-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;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media screen and (max-width: 640px) {

  .jcc-cs-year-range {
    flex-direction: column;
    gap: 0;
  }

  .jcc-cs-year-field {
    margin-bottom: 1rem;
  }

  .jcc-cs-btn--primary {
    width: 100%;
  }

  .jcc-cs-table th,
  .jcc-cs-table td {
    padding: 0.5rem;
  }

  /* Ensure pagination buttons meet touch target size on mobile */
  .jcc-cs-page-btn {
    min-width: 44px;
    min-height: 44px;
  }
}

/* ── High-contrast mode ──────────────────────────────────────────── */
@media (prefers-contrast: high) {
  .jcc-body__main-text input[type="text"],
  .jcc-body__main-text input[type="number"],
  .jcc-body__main-text select {
    border-width: 2px;
  }

  .jcc-cs-page-btn {
    border-width: 2px;
  }

  .jcc-cs-table th,
  .jcc-cs-table td {
    border-width: 2px;
  }
}

/* ── Reduced motion ──────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .jcc-cs-btn,
  .jcc-cs-page-btn {
    transition: none;
  }

  /* Disable smooth scrolling for users who prefer reduced motion */
  * {
    scroll-behavior: auto !important;
  }
}

/* ── Print styles ────────────────────────────────────────────────── */
@media print {
  .jcc-cs-form,
  .jcc-cs-pagination {
    display: none;
  }

  .jcc-cs-results {
    display: block !important;
  }

  .jcc-cs-table {
    border: 1px solid #000;
  }

  .jcc-cs-table th,
  .jcc-cs-table td {
    border: 1px solid #000;
  }
}
