/* Make the exposed filter occupy the full width of the Bootstrap row */
.views-exposed-form.bef-exposed-form {
  flex: 0 0 100%;
  width: 100%;
  max-width: 100%;
  order: -1;
  margin-bottom: 2rem;
  padding: 0;
}

/* Remove default fieldset styling */
.views-exposed-form.bef-exposed-form fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

/* Hide the "Category" legend */
.views-exposed-form.bef-exposed-form legend {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Arrange category options in one horizontal row */
.views-exposed-form.bef-exposed-form .form-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  width: 100%;
}

/* Each radio option */
.views-exposed-form.bef-exposed-form .js-form-type-radio {
  margin: 0;
  padding: 0;
}

/* Hide the native radio button */
.views-exposed-form.bef-exposed-form input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Make labels look like filter buttons */
.views-exposed-form.bef-exposed-form input[type="radio"] + label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 146px;
  min-height: 46px;
  padding: 0.75rem 1.25rem;
  border: 1px solid #adb5bd;
  border-radius: 0.375rem;
  background-color: #fff;
  color: #111;
  font-size: 0.875rem;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

/* Hover state */
.views-exposed-form.bef-exposed-form input[type="radio"] + label:hover {
  border-color: #411491;
  color: #411491;
  background-color: #fff;
}

/* Selected state */
.views-exposed-form.bef-exposed-form
  input[type="radio"]:checked
  + label {
  border-color: #411491;
  background-color: #411491;
  color: #fff;
}

/* Keyboard focus state */
.views-exposed-form.bef-exposed-form
  input[type="radio"]:focus-visible
  + label {
  outline: 3px solid rgba(65, 20, 145, 0.35);
  outline-offset: 2px;
}

@media (max-width: 767.98px) {
  .views-exposed-form.bef-exposed-form {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .views-exposed-form.bef-exposed-form .fieldset-wrapper {
    width: 100%;
    overflow: hidden;
  }

  .views-exposed-form.bef-exposed-form .form-radios {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.625rem;
    width: 100%;
    padding: 0.25rem 0.25rem 0.75rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .views-exposed-form.bef-exposed-form .js-form-type-radio {
    flex: 0 0 auto;
    margin: 0;
  }

  .views-exposed-form.bef-exposed-form
    input[type="radio"] + label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 140px;
    min-height: 46px;
    white-space: nowrap;
  }

  /* Optional: hide the scrollbar in WebKit browsers */
  .views-exposed-form.bef-exposed-form .form-radios::-webkit-scrollbar {
    height: 6px;
  }

  .views-exposed-form.bef-exposed-form .form-radios::-webkit-scrollbar-thumb {
    background-color: #adb5bd;
    border-radius: 999px;
  }

  .views-exposed-form.bef-exposed-form .form-radios::-webkit-scrollbar-track {
    background-color: #f1f1f1;
  }
}

/* Hide the Apply button */
.views-exposed-form.bef-exposed-form .form-actions {
  display: none;
}

/* Card grid */
.views-card-grid {
  --card-gap: 1.5rem;
}

/* Individual card column */
.views-card-grid > .col {
  display: flex;
}

/* Card */
.views-card-grid .card {
  width: 100%;
  min-height: 100%;
  overflow: hidden;
  border: 0;
  border-radius: 0 0 1rem 1rem;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Card image */
.views-card-grid .card > a:first-child,
.views-card-grid .card > .contextual-region {
  display: block;
  width: 100%;
}

/*
 * Image field wrapper.
 * This also handles Drupal's nested image markup.
 */
.views-card-grid .card > .contextual-region,
.views-card-grid .card .field_media_image,
.views-card-grid .card .field_media_image > div {
  width: 100%;
  margin: 0;
  padding: 0;
}

.views-card-grid .card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: cover;
}

/* Card content */
.views-card-grid .card-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 260px;
  padding: 2rem 1.5rem 2.25rem;
}

/* Category button */
.views-card-grid .card-body .mb-4 {
  margin-bottom: 1.5rem !important;
}

.views-card-grid .card-body .btn-outline-secondary {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0.45rem 0.65rem;
  border: 1px solid #411491;
  border-radius: 0.25rem;
  background: #fff;
  color: #411491;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.2;
  text-transform: none !important;
}

/* Category button hover state */
.views-card-grid .card-body .btn-outline-secondary:hover,
.views-card-grid .card-body .btn-outline-secondary:focus {
  border-color: #411491;
  background: #411491;
  color: #fff;
}

/* Card title */
.views-card-grid .card-title {
  margin: 0 0 1.75rem;
  color: #111;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* Title link */
.views-card-grid .card-title a {
  color: inherit;
  text-decoration: none;
}

.views-card-grid .card-title a:hover,
.views-card-grid .card-title a:focus {
  color: inherit;
  text-decoration: underline;
}

/* Card body/content */
.views-card-grid .card-text {
  margin: 0;
  color: #222;
  line-height: 1.5;
}

/* Remove unwanted spacing from Drupal body output */
.views-card-grid .card-text p,
.views-card-grid .card-text section,
.views-card-grid .card-text ul {
  margin-top: 0;
}

.views-card-grid .card-text p:last-child {
  margin-bottom: 0;
}

/* Optional metadata area */
.views-card-grid .card-meta {
  margin-top: auto;
  color: #111;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.views-card-grid .card-meta time,
.views-card-grid .card-meta span {
  white-space: nowrap;
}

/* Responsive desktop layout */
@media (min-width: 992px) {
  .views-card-grid {
    row-gap: 1.5rem;
  }

}

/* Tablet */
@media (min-width: 768px) and (max-width: 991.98px) {

  .views-card-grid .card-body {
    padding: 1.5rem 1.25rem 1.75rem;
  }

  .views-card-grid .card-title {
    font-size: 1rem;
  }
}

/* Mobile */
@media (max-width: 767.98px) {

  .views-card-grid .card-body {
    min-height: 230px;
    padding: 1.5rem 1.25rem 1.75rem;
  }

  .views-card-grid .card-title {
    font-size: 1rem;
  }
}