/* ckanext-peh-dataset: search filters and dataset page */

/* --- check box / radio facets ------------------------------------------ */
.peh-facet .peh-facet-items {
  margin: 0;
}

.peh-facet .peh-facet-items .nav-item {
  padding: 0;
}

.peh-facet .peh-facet-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  margin: 0;
  padding: 0.35rem 1.25rem 0.35rem 0.9rem;
  font-weight: normal;
  cursor: pointer;
  line-height: 1.3;
}

.peh-facet .peh-facet-option:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

.peh-facet .nav-item.active .peh-facet-option {
  font-weight: 600;
}

.peh-facet .peh-facet-option input {
  flex: 0 0 auto;
  margin: 0;
  cursor: pointer;
}

.peh-facet .peh-facet-option .item-label {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.peh-facet .peh-facet-option .item-count {
  flex: 0 0 auto;
}

/* --- range slider ------------------------------------------------------ */
.peh-facet-range .peh-range {
  padding: 0.75rem 1rem 1rem;
}

.peh-range-values {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.peh-range-slider {
  position: relative;
  height: 1.5rem;
  margin: 0 0.2rem;
}

.peh-range-track,
.peh-range-fill {
  position: absolute;
  top: 50%;
  height: 0.3rem;
  margin-top: -0.15rem;
  border-radius: 0.15rem;
}

.peh-range-track {
  left: 0;
  right: 0;
  background: #d9d9d9;
}

.peh-range-fill {
  left: 0;
  right: 0;
  background: var(--bs-primary, #206b82);
}

.peh-range-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1.5rem;
  margin: 0;
  padding: 0;
  background: none;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}

.peh-range-input:focus {
  outline: none;
}

.peh-range-input::-webkit-slider-runnable-track {
  background: transparent;
  height: 1.5rem;
}

.peh-range-input::-moz-range-track {
  background: transparent;
  height: 1.5rem;
}

.peh-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  pointer-events: auto;
  width: 1rem;
  height: 1rem;
  margin-top: 0.25rem;
  border: 2px solid var(--bs-primary, #206b82);
  border-radius: 50%;
  background: #fff;
  cursor: grab;
}

.peh-range-input::-moz-range-thumb {
  pointer-events: auto;
  width: 0.8rem;
  height: 0.8rem;
  border: 2px solid var(--bs-primary, #206b82);
  border-radius: 50%;
  background: #fff;
  cursor: grab;
}

.peh-range-input:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px rgba(32, 107, 130, 0.35);
}

.peh-range-input:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 3px rgba(32, 107, 130, 0.35);
}

.peh-range-bounds {
  display: flex;
  justify-content: space-between;
  font-size: 0.8em;
  color: #6c757d;
  margin-top: 0.1rem;
}

.peh-range-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

/* --- dataset page ------------------------------------------------------ */
.additional-info .peh-attribute-value {
  white-space: nowrap;
}

/* Dataset page: project(s) of a study above the tabs. */
.peh-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.5rem;
  margin: 0 0 1.5rem;
}
.peh-summary dt::after {
  content: ":";
}
.peh-summary dd {
  margin: 0;
}

/* Dataset page: attribute tabs. */
.peh-info-tabs > .nav-tabs {
  margin-bottom: 0;
}
/* CKAN's main.css hides `.js .tab-content` (legacy module markup); keep ours visible. */
.js .peh-info-tabs > .tab-content,
.peh-info-tabs > .tab-content {
  display: block;
  padding-top: 1rem;
}
.peh-info-tabs .empty {
  color: #6c757d;
  font-style: italic;
}
