/* =====================================================================
   BJH Taxonomy Archive — Additions
   ---------------------------------------------------------------------
   APPEND THIS TO THE END OF bjh-search.css (or load it AFTER bjh-search.css).
   The archive shortcode reuses .bjh-search styles for ~98% of the layout;
   the rules below only add the small archive-specific bits.
   v1.0.0
   ===================================================================== */

/* The archive shares ALL .bjh-search styles. The .bjh-archive class is a
   hook for any future archive-only tweaks — currently used only to mark
   the locked-taxonomy chip. */

/* Locked "current archive" chip — sits at the front of .bjh-active-filters.
   Visually distinct: filled accent background, no remove (×), not clickable. */
.bjh-active-chip--locked {
  background: var(--bjh-text);          /* #1F2729 */
  color: var(--bjh-white);
  border-color: var(--bjh-text);
  font-weight: 600;
  cursor: default;
  letter-spacing: 0.01em;
}
.bjh-active-chip--locked:hover {
  /* No state change on hover — it's not interactive */
  background: var(--bjh-text);
  color: var(--bjh-white);
}

/* On archive pages the searchbar is removed, so give the hero a touch
   more breathing room before the layout. */
.bjh-archive .bjh-hero {
  margin-bottom: 24px;
}

/* The locked chip can read a little long ("Resource Type: Sentencing Toolkits");
   allow it to wrap nicely on small screens without breaking pill shape. */
@media (max-width: 600px) {
  .bjh-active-chip--locked {
    max-width: 100%;
    white-space: normal;
    text-align: left;
    line-height: 1.3;
  }
}

:root {
  --bjh-primary:   #D49C2C;
  --bjh-secondary: #247B7C;
  --bjh-purple:    #27132E;
  --bjh-text:      #1F2729;
  --bjh-accent:    #9F2226;
  --bjh-bg:        #FAF8F4;
  --bjh-white:     #FFFFFF;
  --bjh-muted:     #6B7280;
  --bjh-border:    #E5E7EB;
  --bjh-chip-green-bg:   #C1FAEE;
  --bjh-chip-green-text: #005643;
  --bjh-chip-pink-bg:    #FAC1C1;
  --bjh-chip-pink-text:  #790000;
  --bjh-card-shadow:       0 1px 10px rgba(45, 27, 61, 0.08);
  --bjh-card-shadow-hover: 0 8px 24px rgba(45, 27, 61, 0.16);
  --bjh-radius-input:  999px;
  --bjh-radius-btn:    25px;
  --bjh-radius-badge:  4px;
  --bjh-radius-chip:   999px;
}

/* ---------------------------------------------------------------------
   Wrapper
   --------------------------------------------------------------------- */
.bjh-search {
  color: var(--bjh-text);
}

.bjh-search *,
.bjh-search *::before,
.bjh-search *::after {
  box-sizing: border-box;
}

/* ---------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------- */
.bjh-hero {
  max-width: 1400px;
  margin: 0 auto;
  background: var(--bjh-primary);
  color: var(--bjh-white);
  padding: 100px;
  border-start-end-radius: 150px;
  border-end-start-radius: 150px;
}

.bjh-hero__inner {
  max-width: 1100px;
}

.bjh-hero__eyebrow {
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--bjh-white);
  margin: 0;
  opacity: 1;
}

.bjh-hero__title {
  font-size: 48px;
  line-height: 1.1;
  font-weight: 700;
  color: var(--bjh-white);
  margin: 0 0 16px;
}

.bjh-hero__lede {
  font-size: 17px;
  line-height: 1.5;
  color: var(--bjh-white);
  margin: 0;
  opacity: 1;
}

/* ---------------------------------------------------------------------
   Search bar
   --------------------------------------------------------------------- */
.bjh-searchbar {
    max-width: 70%;
    margin: 4em auto 0;
    padding: 0 20px;
}

.bjh-searchbar__form {
  background: var(--bjh-white);
  border: 1px solid var(--bjh-secondary);
  border-radius: var(--bjh-radius-input);
  display: flex;
  align-items: center;
  padding: 4px 4px 4px 24px;
  gap: 8px;
}

.bjh-searchbar__input {
    flex: 1 1 auto;
    border: 0;
    outline: none;
    font-size: 16px;
    line-height: 1.4;
    padding: 14px 0;
    width: 100%;
    color: var(--e-global-color-text);
    background-color: #FFFFFF;
    border-style: solid !important;
    border-color: var(--e-global-color-secondary) !important;
    border-radius: 999px 999px 999px 999px !important;
    padding: 12px 12px 12px 12px !important;
}

.bjh-searchbar__input::placeholder { color: var(--bjh-muted); }

.bjh-searchbar__submit {
  flex: 0 0 auto;
  background: var(--bjh-primary);
  color: var(--bjh-white);
  border: 0;
  border-radius: var(--bjh-radius-input);
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.bjh-searchbar__submit:hover,
.bjh-searchbar__submit:focus,
.bjh-searchbar__submit:focus-visible {
  background: var(--bjh-secondary);
  color: var(--bjh-white);
  outline: 0;
  box-shadow: 0 4px 14px rgba(36, 123, 124, 0.28);
}

.bjh-searchbar__submit:active {
  background: #1B5F60;
}

/* ---------------------------------------------------------------------
   Layout: sidebar 25% / main 75%
   --------------------------------------------------------------------- */
.bjh-layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 20px 80px;
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.bjh-sidebar {
  flex: 0 0 25%;
  max-width: 25%;
  position: sticky;
  top: 24px;
}

.bjh-main {
  flex: 1 1 75%;
  min-width: 0;
}

/* ---------------------------------------------------------------------
   Sidebar
   --------------------------------------------------------------------- */
.bjh-filter-group {
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0 0 28px;
}

.bjh-filter-group__legend {
  font-size: 16px;
  font-weight: 500;
  color: var(--bjh-secondary);
  letter-spacing: 0;
  text-transform: none;
  margin: 0 0 12px;
  padding: 0;
  display: block;
}

.bjh-filter-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.bjh-filter-list .bjh-filter-list {
  margin-left: 16px;
  margin-top: 2px;
}

.bjh-filter-row {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 0;
  font-size: 15px;
  line-height: 1.3;
  color: var(--bjh-text);
  cursor: pointer;
  font-weight: 400;
}

/* ---------- Checkbox / Radio: unselected #ccc, selected #1F2729 ---------- */
.bjh-filter-input {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin: 0;
  cursor: pointer;
  /* Force consistent look across browsers */
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  background-color: #FFFFFF;
  border: 1.5px solid #cccccc;       /* UNSELECTED */
  transition: border-color 0.15s ease, background-color 0.15s ease;
  position: relative;
}

/* Checkbox: square with small radius */
.bjh-filter-input[type="checkbox"] {
  border-radius: 3px;
}

/* Radio: circle */
.bjh-filter-input[type="radio"] {
  border-radius: 50%;
}

/* Hover affordance */
.bjh-filter-input:hover {
  border-color: #9aa0a6;
}

/* SELECTED state — border #1F2729, fill #1F2729, white glyph */
.bjh-filter-input:checked {
  border-color: #1F2729;
  background-color: #1F2729;
}

/* Checkbox checkmark (white tick) */
.bjh-filter-input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 0px;
  width: 5px;
  height: 10px;
  border: solid #FFFFFF;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Radio dot (white center) */
.bjh-filter-input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #FFFFFF;
  transform: translate(-50%, -50%);
}

/* Focus ring for keyboard users */
.bjh-filter-input:focus-visible {
  outline: 2px solid #1F2729;
  outline-offset: 2px;
}

.bjh-filter-text { flex: 1 1 auto; }

.bjh-filter-toggle {
  display: none;
}

/* ---------------------------------------------------------------------
   Results header
   --------------------------------------------------------------------- */
.bjh-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 20px;
}

.bjh-results-count {
  font-size: 15px;
  color: var(--bjh-text);
}

.bjh-results-count strong { color: var(--bjh-text); font-weight: 700; }

.bjh-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.bjh-sort__label{
  width: 48%;
}

.bjh-sort__select {
  border: 1px solid var(--bjh-border);
  background: var(--bjh-white);
  color: var(--bjh-text);
  border-radius: 8px;
  padding: 8px 28px 8px 12px;
  font-size: 14px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%231F2729' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px 6px;
}

.bjh-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
  align-items: center;
}

.bjh-active-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bjh-white);
  border: 1px solid var(--bjh-border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--bjh-text);
}

.bjh-active-chip__x {
  border: 0; background: transparent; cursor: pointer;
  color: var(--bjh-muted); padding: 0; font-size: 16px; line-height: 1;
}
.bjh-active-chip__x:hover { color: var(--bjh-accent); }

.bjh-clear-all {
  border: 0; background: transparent;
  color: var(--bjh-accent); font-weight: 600;
  font-size: 13px; cursor: pointer; text-decoration: underline;
}

/* ---------------------------------------------------------------------
   Grid
   --------------------------------------------------------------------- */
.bjh-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

/* ---------------------------------------------------------------------
   Card
   --------------------------------------------------------------------- */
.bjh-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 525px;
  padding: 20px;
  background: var(--bjh-white);
  border-radius: 16px 16px 12px 12px;
  box-shadow: var(--bjh-card-shadow);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bjh-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--bjh-card-shadow-hover);
}

.bjh-card__media {
  width: 100%;
  height: 208px;
  overflow: hidden;
  background: #27132E;
  flex: 0 0 208px;
  border-radius: 12px;
}

.bjh-card__media img,
.bjh-card__media svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  border-radius: 12px;
}

.bjh-card__body {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  gap: 12px;
  padding: 0;
  flex: 1 1 auto;
  min-height: 0;
}

.bjh-card__year {
  position: absolute;
  top: 30px;
  left: 30px;
  z-index: 2;
  display: inline-block;
  background: #D49C32;
  color: var(--bjh-white);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  border-radius: var(--bjh-radius-badge);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.bjh-card__citation {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12px;
  line-height: 14px;
  letter-spacing: 0.08em;
  color: var(--bjh-primary);
  margin: 0;
  font-weight: 500;
}

.bjh-card__title,
.bjh-search .bjh-card__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 20px;
  line-height: 26px;
  font-weight: 700;
  color: #1F2729;
  font-family: "Lexend Deca", sans-serif;
  margin: 0;
  height: 54px;
}

.bjh-card__title a {
  color: #1F2729;
  text-decoration: none;
}

.bjh-card__title a:hover { color: var(--bjh-secondary); }

.bjh-card--case .bjh-card__title {
  -webkit-line-clamp: 1;
}

.bjh-search .bjh-card__excerpt,
.bjh-card__excerpt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.5em;
  color: #1F2729;
  font-family: "Lexend Deca", sans-serif;
  margin: 0;
}

.bjh-card--case .bjh-card__excerpt {
  -webkit-line-clamp: 3;
}

.bjh-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 100%;
  margin: 6px 0;
  padding: 0;
  justify-content: flex-start;
}

.bjh-search .bjh-chip,
.bjh-chip {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  line-height: 14px;
  padding: 4px 10px;
  border-radius: var(--bjh-radius-chip);
  border: 1px solid transparent;
  white-space: nowrap;
  font-family: "Lexend Deca", sans-serif;
  text-decoration: none;
  min-height: 32px;
}

.bjh-search .bjh-chip--green,
.bjh-chip--green {
  background: var(--bjh-chip-green-bg);
  border-color: var(--bjh-chip-green-bg);
  color: var(--bjh-chip-green-text);
}

.bjh-search .bjh-chip--pink,
.bjh-chip--pink {
  background: var(--bjh-chip-pink-bg);
  border-color: var(--bjh-chip-pink-bg);
  color: var(--bjh-chip-pink-text);
}

.bjh-chip:hover { color: inherit; text-decoration: none; }

.bjh-search .bjh-card__meta,
.bjh-card__meta {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 0;
  padding: 0;
  font-size: 14px;
  color: #1F2729;
}

.bjh-card__meta span { line-height: 1.3; }

.bjh-card__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}

.bjh-search .bjh-card__btn,
.bjh-card__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: var(--bjh-primary);
  color: var(--bjh-white) !important;
  border: 0;
  border-radius: var(--bjh-radius-btn);
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  font-family: "Lexend Deca", sans-serif;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.bjh-card__btn:hover,
.bjh-card__btn:focus,
.bjh-card__btn:focus-visible {
  background: var(--bjh-secondary);
  color: var(--bjh-white);
  text-decoration: none;
  outline: 0;
  box-shadow: 0 4px 14px rgba(36, 123, 124, 0.28);
}

.bjh-card__btn:active {
  background: #1B5F60;
  transform: translateY(1px);
}

.bjh-search .bjh-card__download,
.bjh-card__download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  align-self: center;
  background: transparent;
  color: #1F2729;
  border: 0;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.2;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  cursor: pointer;
  font-family: "Lexend Deca", sans-serif;
  transition: color 0.2s ease, text-decoration-thickness 0.2s ease;
}

.bjh-card__download:hover,
.bjh-card__download:focus,
.bjh-card__download:focus-visible {
  color: var(--bjh-secondary);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  outline: 0;
}

.bjh-card__download:active { color: #1B5F60; }

/* ---------------------------------------------------------------------
   Pagination
   --------------------------------------------------------------------- */
.bjh-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 40px 0 0;
  flex-wrap: wrap;
}

.bjh-pagination a,
.bjh-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--bjh-border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--bjh-text);
  text-decoration: none;
  background: var(--bjh-white);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.bjh-pagination a:hover {
  border-color: var(--bjh-primary);
  color: var(--bjh-primary);
}

.bjh-pagination .current,
.bjh-pagination span.current {
  background: var(--bjh-primary);
  border-color: var(--bjh-primary);
  color: var(--bjh-white);
}

/* ---------------------------------------------------------------------
   Empty state
   --------------------------------------------------------------------- */
.bjh-empty {
  background: var(--bjh-white);
  border: 1px dashed var(--bjh-border);
  border-radius: 16px;
  padding: 48px 24px;
  text-align: center;
  color: var(--bjh-text);
}

.bjh-empty h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--bjh-text);
}

.bjh-empty p {
  font-size: 16px;
  line-height: 1.5;
  color: var(--bjh-muted);
  margin: 0 auto 16px;
}
.bjh-empty__text a {
    color: var(--e-global-color-primary);
}
.bjh-empty__text a:hover{
  color: #247B7C;
  text-decoration: underline;
}

.bjh-empty .bjh-clear-all { font-size: 14px; }

/* ---------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .bjh-hero {
    padding: 60px;
  }
  .bjh-hero__title { font-size: 36px; }
  .bjh-hero__lede { font-size: 16px; }

  .bjh-layout {
    flex-direction: column;
    gap: 24px;
    padding: 32px 20px 64px;
  }

  .bjh-sidebar {
    flex: 1 1 100%;
    max-width: 100%;
    width: 100%;
    position: static;
  }

  /* Show the toggle on tablet/mobile */
  .bjh-filter-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 18px;
    background: var(--bjh-white);
    border: 1px solid var(--bjh-border);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--bjh-text);
    cursor: pointer;
    margin: 0 0 12px;
    gap: 10px;
  }

  .bjh-filter-toggle svg { flex: 0 0 18px; }
  .bjh-filter-toggle > span:not(.bjh-filter-toggle__count) { flex: 1 1 auto; text-align: left; }

  .bjh-filter-toggle::after {
    content: "▾";
    color: #fff;
    font-size: 14px;
    transition: transform 0.2s ease;
  }
  .bjh-searchbar {
    max-width: 100%;
  }   

  .bjh-filter-toggle__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--bjh-primary);
    color: var(--bjh-white);
    font-size: 12px;
    font-weight: 700;
  }

  /* Default (collapsed) — hide filter form on tablet/mobile */
  .bjh-sidebar .bjh-filters-form { display: none; }

  /* JS toggles .is-open on the sidebar (matches PHP shortcode JS) */
  .bjh-sidebar.is-open .bjh-filters-form { display: block; }
  .bjh-sidebar.is-open ~ * .bjh-filter-toggle::after,
  .bjh-filter-toggle[aria-expanded="true"]::after { transform: rotate(180deg); }

  .bjh-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }
}

@media (max-width: 768px) {
 
  .bjh-hero__title { font-size: 28px; }
  .bjh-hero__lede { font-size: 16px; }

  .bjh-searchbar { padding: 0 16px; margin-top: 24px; max-width: 100%; }
  .bjh-searchbar__form { padding: 4px 4px 4px 16px; gap: 8px; }
  .bjh-searchbar__input { font-size: 15px; padding: 12px 0; }
  .bjh-searchbar__submit { padding: 10px 16px; font-size: 14px; }

  .bjh-layout { padding: 24px 16px 56px; gap: 20px; }

  .bjh-results-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .bjh-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .bjh-card { min-height: 0; }
  .bjh-card__media { height: 180px; flex-basis: 180px; }
  .bjh-card__title { font-size: 18px; }
}

@media print {
  .bjh-sidebar, .bjh-searchbar, .bjh-pagination, .bjh-results-header { display: none; }
  .bjh-grid { grid-template-columns: 1fr; gap: 12px; }
  .bjh-card { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
}