.hfh-catalog {
  *,
  :before,
  :after {
    box-sizing: border-box;
    border: 0 solid #e5e7eb;
  }
}

.hfh-catalog__header {
  display: flex;
  justify-content: space-between;
  column-gap: 1rem;
  align-items: start;
}

.hfh-catalog__layout {
  display: grid;
  padding-block: 2rem;
  column-gap: 1rem;
  row-gap: 1rem;
}

.hfh-catalog__before-filters,
.hfh-catalog__views {
  align-self: center;
}

@media screen and (min-width: 64rem) {
  .hfh-catalog__layout {
    grid-template-columns: 1fr auto;
  }

  .hfh-catalog__before-filters {
    grid-column: 1;
    grid-row: 1;
  }

  .hfh-catalog__views {
    grid-column: 2;
    grid-row: 1;
  }

  .hfh-catalog__main {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .hfh-catalog__layout:has(.hfh-catalog__sidebar) {
    grid-template-columns: 15rem 1fr;
  }

  .hfh-catalog__layout:has(.hfh-catalog__sidebar) .hfh-catalog__sidebar {
    grid-column: 1;
    grid-row: 2;
  }

  .hfh-catalog__layout:has(.hfh-catalog__sidebar) .hfh-catalog__main {
    grid-column: 2;
  }
}

.hfh-catalog__switcher {
  width: fit-content;
  min-width: 15rem;
  max-width: 100%;
  font-family: var(--hfh-catalog-font, inherit);
  font-size: 1.125rem;
  line-height: 1.625rem;
}

.hfh-catalog__switcher-toggle {
  display: block;
  position: relative;
  padding: 0.6875rem 3.6875rem 0.6875rem 1rem;
  border: 0.125rem solid var(--hfh-catalog-checkbox-border, #767676);
  background-color: var(--hfh-catalog-checkbox-bg, #fff);
  color: var(--hfh-catalog-text, inherit);
  list-style: none;
  cursor: pointer;
}

.hfh-catalog__switcher-toggle::-webkit-details-marker {
  display: none;
}

.hfh-catalog__switcher-toggle::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 1rem;
  width: 0.8125rem;
  height: 0.5625rem;
  background-color: var(--hfh-catalog-checkbox-border, #767676);
  mask-image: url("data:image/svg+xml,%3Csvg width='13' height='9' viewBox='0 0 13 9' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 1L6.49998 7L1 1' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E");
  mask-repeat: no-repeat;
  mask-size: 100% 100%;
  transform: translateY(-50%);
  pointer-events: none;
}

.hfh-catalog__switcher[open] > .hfh-catalog__switcher-toggle::after {
  transform: translateY(-50%) rotate(180deg);
}

@media (forced-colors: active) {
  .hfh-catalog__switcher-toggle::after {
    background-color: CanvasText;
  }
}

.hfh-catalog__switcher-nav {
  border: 0.125rem solid var(--hfh-catalog-checkbox-border, #767676);
  border-top: 0;
  background-color: var(--hfh-catalog-checkbox-bg, #fff);
}

.hfh-catalog__switcher-list {
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
}

.hfh-catalog__switcher-link {
  display: block;
  padding: 0.375rem 1rem;
  color: var(--hfh-catalog-text, inherit);
  text-decoration: none;
}

.hfh-catalog__switcher-link:hover,
.hfh-catalog__switcher-link:focus-visible {
  background-color: var(--hfh-catalog-filters-bg, #f4f4f4);
}

.hfh-catalog__switcher-link[aria-current="page"] {
  color: var(--hfh-catalog-accent, #333);
  font-weight: bold;
}

.hfh-catalog__switcher--overlay {
  position: relative;
}

.hfh-catalog__switcher--overlay .hfh-catalog__switcher-nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.15);
}

.hfh-catalog__sidebar {
  padding: 1.5rem 1.25rem 2.5rem;
  background-color: var(--hfh-catalog-filters-bg, #f4f4f4);
  height: fit-content;
}

.hfh-catalog__filters-fieldsets {
  display: flex;
  flex-wrap: wrap;
  column-gap: 4rem;
}

.hfh-catalog__filters-title,
.hfh-catalog__filter-legend {
  display: block;
  padding: 0;
  font-family: var(--hfh-catalog-font, inherit);
  font-weight: bold;
  font-size: 0.875rem;
  line-height: 1.5rem;
  color: var(--hfh-catalog-accent, #333);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.hfh-catalog__filter {
  margin: 1rem 0 0;
  padding: 0;
  border: 0;
}

.hfh-catalog__filter + .hfh-catalog__filter {
  margin-top: 0.5rem;
}

.hfh-catalog__filter-options {
  display: flex;
  flex-direction: column;
}

.hfh-catalog {
  .hfh-catalog__filter {
    width: auto;
    margin: 1rem 0 0;
    padding: 0;
    border: 0;
    float: none;
  }

  .hfh-catalog__filter-options {
    position: relative;
    z-index: auto;
    border: none;
    width: auto;
    background: transparent;
  }

  .hfh-catalog__filter-option {
    position: relative;
    z-index: auto;
    border: none;
    width: auto;
    background: transparent;
  }
}

.hfh-catalog__filter-option {
  display: grid;
  grid-template-columns: 20px 1fr;
  column-gap: 1rem;
  align-items: flex-start;
  hyphens: auto;
}

.hfh-catalog__checkbox,
.hfh-catalog__checkbox::before,
.hfh-catalog__checkbox::after {
  box-sizing: border-box;
}

.hfh-catalog__checkbox {
  appearance: none;
  position: relative;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.0625rem;
  padding: 0;
  border: 0;
}

.hfh-catalog__checkbox::before,
.hfh-catalog__checkbox::after {
  position: absolute;
  top: 0;
  left: 0;
  content: "";
  display: block;
  width: 1.25rem;
  height: 1.25rem;
}

.hfh-catalog__checkbox::before {
  border: 0.125rem solid var(--hfh-catalog-checkbox-border, #767676);
  background-color: var(--hfh-catalog-checkbox-bg, #fff);
}

.hfh-catalog__checkbox::after {
  background-color: transparent;
  mask-image: var(
    --hfh-catalog-checkmark,
    url("data:image/svg+xml,%3Csvg width='12' height='10' viewBox='0 0 12 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 4.20549L5.11724 7.32272L10.44 1' stroke='%23000' stroke-width='3'/%3E%3C/svg%3E")
  );
  mask-repeat: no-repeat;
  mask-position: center;
}

.hfh-catalog__checkbox:checked::before {
  background-color: var(--hfh-catalog-accent, #333);
  border-color: var(--hfh-catalog-accent, #333);
}

.hfh-catalog__checkbox:checked::after {
  background-color: var(--hfh-catalog-accent-contrast, #fff);
}

@media (forced-colors: active) {
  .hfh-catalog__checkbox:checked::after {
    background-color: CanvasText;
  }
}

.hfh-catalog__checkbox-label {
  font-family: var(--hfh-catalog-font, inherit);
}

.hfh-catalog__visually-hidden,
.hfh-catalog__skip-link:not(:focus-visible) {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.hfh-catalog__skip-link {
  font-size: 0.875rem;
  outline: 2px solid var(--hfh-catalog-focus-outline, #427ca4);
  outline-offset: 0.3125rem;
}

.hfh-catalog__views {
  display: flex;
  justify-content: flex-end;
  font-family: var(--hfh-catalog-font, inherit);
}

.hfh-catalog__view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0.625rem;
  border: 0.125rem solid var(--hfh-catalog-checkbox-border, #767676);
  background-color: var(--hfh-catalog-checkbox-bg, #fff);
  color: var(--hfh-catalog-text, inherit);
  text-decoration: none;
}

.hfh-catalog__view-icon {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
}

.hfh-catalog__view + .hfh-catalog__view {
  margin-left: -0.125rem;
}

.hfh-catalog__view:hover,
.hfh-catalog__view:focus-visible {
  background-color: var(--hfh-catalog-filters-bg, #f4f4f4);
  text-decoration: none;
}

.hfh-catalog__view[aria-current="true"] {
  z-index: 1;
  background-color: var(--hfh-catalog-accent, #333);
  border-color: var(--hfh-catalog-accent, #333);
  color: var(--hfh-catalog-accent-contrast, #fff);
}

.hfh-catalog__view:focus-visible {
  z-index: 2;
}

@media (forced-colors: active) {
  .hfh-catalog__view[aria-current="true"] {
    forced-color-adjust: none;
    background-color: Highlight;
    border-color: Highlight;
    color: HighlightText;
  }
}
.hfh-catalog__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
  column-gap: 1rem;
  row-gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hfh-catalog__card {
  display: block;
  position: relative;
  height: 100%;
  border: 0.125rem solid var(--hfh-catalog-card-border, #ddd);
  color: var(--hfh-catalog-text, inherit);
  font-weight: 300;
  text-decoration: none;
  hyphens: auto;
  transition:
    background-color 0.25s ease 0s,
    border-color 0.25s ease 0s,
    color 0.25s ease 0s;
}

.hfh-catalog__card:hover,
.hfh-catalog__card:focus-visible {
  background-color: var(--hfh-catalog-accent, #333);
  border-color: var(--hfh-catalog-accent, #333);
  color: var(--hfh-catalog-accent-contrast, #fff);
  text-decoration: none;

  .hfh-catalog__card-text {
    border-top-color: transparent;
  }
}

.hfh-catalog__image {
  background: var(--hfh-catalog-image-bg, #f4f4f4);
  aspect-ratio: 3/4;
}

.hfh-catalog__image img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.hfh-catalog__card-text {
  padding: 1rem 0.875rem;

  border-top: 1px solid var(--hfh-catalog-text-border, #ddd);
  transition: border-color 0.25s ease 0s;
}

.hfh-catalog__pretitle {
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5rem;
}

.hfh-catalog__title {
  margin-bottom: 0.75rem;
  font-size: 1.5rem;
  line-height: 2rem;
  word-break: break-word;
}

@media (min-width: 64rem) {
  .hfh-catalog__card-text {
    padding: 1.25rem 1.375rem;
  }

  .hfh-catalog__pretitle {
    font-size: 1.25rem;
  }

  .hfh-catalog__title {
    font-size: 2rem;
    line-height: 2.5rem;
  }

  .hfh-catalog__filters-fieldsets {
    display: block;
  }
}

.hfh-catalog__list--list {
  grid-template-columns: 1fr;
  row-gap: 0;
}

.hfh-catalog__list--list > li + li {
  margin-top: -0.125rem;
}

.hfh-catalog__list--list .hfh-catalog__image {
  display: none;
}

.hfh-catalog__list--list .hfh-catalog__card {
  padding: 0.9375rem 3.125rem 0.9375rem 0;
  border-width: 0.125rem 0;
}

.hfh-catalog__list--list .hfh-catalog__card::after {
  content: "";
  position: absolute;
  top: 1.5rem;
  right: 0;
  width: 2rem;
  height: 0.875rem;
  background-color: var(--hfh-catalog-accent, #333);
  mask-image: var(
    --hfh-catalog-arrow,
    url("data:image/svg+xml,%3Csvg width='32' height='14' viewBox='0 0 32 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 7H30M24 1L30 7L24 13' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E")
  );
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}

@media (forced-colors: active) {
  .hfh-catalog__list--list .hfh-catalog__card::after {
    background-color: CanvasText;
  }
}

.hfh-catalog__list--list .hfh-catalog__card:hover,
.hfh-catalog__list--list .hfh-catalog__card:focus-visible {
  z-index: 1;
  background-color: transparent;
  border-color: var(--hfh-catalog-accent, #333);
  color: var(--hfh-catalog-text, inherit);
}

.hfh-catalog__list--list .hfh-catalog__card-text {
  display: flex;
  flex-direction: column-reverse;
  row-gap: 0.5rem;
  padding: 0;
  border-top: 0;
}

.hfh-catalog__list--list .hfh-catalog__pretitle {
  margin-bottom: 0;
  font-size: 1rem;
  color: var(--hfh-catalog-text-muted, #595959);
  transition: color 0.25s ease 0s;
}

.hfh-catalog__list--list .hfh-catalog__title {
  margin-bottom: 0;
  font-size: 1.5rem;
  line-height: 2rem;
  transition: color 0.25s ease 0s;
}

.hfh-catalog__list--list .hfh-catalog__card:hover .hfh-catalog__title,
.hfh-catalog__list--list .hfh-catalog__card:focus-visible .hfh-catalog__title {
  color: var(--hfh-catalog-accent, #333);
}

.hfh-catalog__list--list .hfh-catalog__card:hover .hfh-catalog__pretitle,
.hfh-catalog__list--list
  .hfh-catalog__card:focus-visible
  .hfh-catalog__pretitle {
  color: var(--hfh-catalog-text, inherit);
}

.hfh-catalog__edit {
  display: block;
  width: fit-content;
  font-size: 1rem;
  font-weight: 700;
  background-color: var(--hfh-catalog-button-bg, #333);
  color: var(--hfh-catalog-button-color, #fff);
  padding: 0.875rem 1.375rem 0.875rem 1.375rem;
  margin-bottom: 2rem;
  border-width: 2px;
  border-style: solid;
  border-color: var(--hfh-catalog-button-bg, #333);
  text-decoration: none;

  &:hover {
    background-color: var(--hfh-catalog-button-bg-hover, #fff);
    color: var(--hfh-catalog-button-color-hover, #333);
    border-color: var(--hfh-catalog-button-bg-hover, #333);
  }
}
