/**
 * Recipes List Block Styles
 *
 * @package YaloFSE
 */

.recipes_list {
  padding: clamp(2rem, 4vw, 4rem) 0;
}

.recipes_list .recipes-list-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

@media (min-width: 992px) {
  .recipes_list .recipes-list-layout {
    grid-template-columns: minmax(220px, 24%) minmax(0, 1fr);
    align-items: start;
    gap: 42px;
    padding-top: 48px;
  }
}

.recipes-filters {
  min-width: 0;
  border-bottom: 1px solid #d7d9df;
  padding-bottom: 20px;
}

@media (min-width: 992px) {
  .recipes-filters {
    position: sticky;
    top: 180px;
    border-bottom: 0;
    padding-bottom: 0;
    /* Keep filters in view: cap column height and scroll the checkbox area */
    max-height: calc(100vh - 180px - 2rem);
    max-height: calc(100dvh - 180px - 2rem);
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .recipes-filter-accordion {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: 0;
  }

  .recipes-filter-accordion__panel {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding-right: 6px;
    scrollbar-width: thin;
  }
}

.recipes-filters__title {
  margin: 0 0 18px;
  color: var(--kb-brand-blue);
}

@media (min-width: 992px) {
  .recipes-filters__title {
    margin-bottom: 20px;
  }
}

.recipes-filters__search {
  margin-bottom: 20px;
}

.recipes-filter-search {
  width: 100%;
  min-height: 42px;
  border: 1px solid #6d77a3;
  background: #fff;
  color: #27355f;
  padding: 0 38px 0 12px;
  font-family: var(--font-secondary);
  font-size: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7' stroke='%23001489' stroke-width='2'/%3E%3Cpath stroke='%23001489' stroke-width='2' stroke-linecap='round' d='M20 20l-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 16px 16px;
  background-position: right 12px center;
}

.recipes-filter-search:focus {
  outline: none;
  border-color: var(--kb-brand-blue);
}

.recipes-filter-accordion {
  border-top: 0;
  padding: 20px 0 0;
}

.recipes-filter-accordion__toggle {
  width: 100%;
  height: auto;
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  padding: 0 0 12px;
  background: transparent;
  color: var(--kb-brand-blue);
  font-family: var(--font-primary);
  font-size: clamp(20px, 2vw, 24px);
  text-align: left;
}

.recipes-filter-accordion__toggle:hover,
.recipes-filter-accordion__toggle:focus,
.recipes-filter-accordion__toggle:active {
  background: transparent !important;
  background-color: transparent !important;
  border: 0 !important;
  box-shadow: none;
}

.recipes-filter-accordion__icon {
  position: relative;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-block;
}

.recipes-filter-accordion__icon::before,
.recipes-filter-accordion__icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 2px;
  background: #001489;
  border-radius: 1px;
  transform: translate(-50%, -50%);
}

.recipes-filter-accordion__icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.recipes-filter-accordion__toggle[aria-expanded="true"] .recipes-filter-accordion__icon::after {
  opacity: 0;
}

.recipes-filter-accordion__panel {
  display: grid;
  gap: 8px;
  padding-bottom: 14px;
}

.recipes-filter-accordion.is-collapsed .recipes-filter-accordion__panel {
  display: none;
}

.recipes-filter-group {
  display: grid;
  gap: 8px;
}

.recipes-filter-group + .recipes-filter-group {
  margin-top: 22px;
}

.recipes-filter-parent {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #001489;
  font-family: var(--font-secondary);
  font-size: 16px;
  line-height: 1.2;
}

.recipes-filter-group__title {
  margin: 0;
  color: var(--kb-brand-blue);
  font-family: var(--font-primary);
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.2;
}

.recipes-filter-parent .recipes-filter-group__title {
  color: #001489;
  font-family: var(--font-secondary);
  font-size: 16px;
  line-height: 1.2;
}

.recipes-filter-parent input,
.recipes-filter-checkbox input {
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1px solid #001489;
  border-radius: 2px;
  -webkit-appearance: none;
  appearance: none;
  background: #fff;
  position: relative;
}

.recipes-filter-parent input:checked,
.recipes-filter-checkbox input:checked {
  background-color: #001489;
}

.recipes-filter-parent input:checked::after,
.recipes-filter-checkbox input:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.recipes-filter-parent input:indeterminate::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 7px;
  width: 10px;
  height: 2px;
  background: #fff;
}

.recipes-filter-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  color: #001489;
  font-family: var(--font-secondary);
  cursor: pointer;
  line-height: 1.2;
  margin-left: 2px;
  padding-left: 28px;
}

.recipes-results {
  min-width: 0;
}

.recipes-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1rem, 2vw, 2rem);
}

@media (min-width: 680px) {
  .recipes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .recipes-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.recipe-card {
  min-width: 0;
  display: flex;
}

.recipe-card.is-hidden {
  display: none;
}

.recipe-card__link {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--kb-brand-blue);
  min-height: 100%;
  width: 100%;
}

.recipe-card__thumb {
  margin: 0;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.recipe-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recipe-card__times {
  display: grid;
  gap: 0.15rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #484848;
  font-size: 11px;
  line-height: 1.2;
}

.recipe-card__times p {
  margin: 0;
}

.recipe-card__title {
  margin: 0;
  color: var(--kb-brand-blue);
  font-size: 24px;
  line-height: 1.15;
}

.recipe-card__read-more {
  margin-top: auto;
  width: fit-content;
  min-width: 128px;
  padding: 10px 16px;
  text-align: center;
  font-family: var(--font-secondary);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  background: var(--kb-brand-blue);
  color: var(--color-white);
  line-height: 1;
  text-transform: uppercase;
  border: 2px solid transparent;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.recipe-card__link:hover .recipe-card__read-more,
.recipe-card__link:focus .recipe-card__read-more {
  background: var(--color-white);
  color: var(--kb-brand-blue);
  border-color: var(--kb-brand-blue);
}

.no-recipe-results {
  display: none;
  margin: 2rem 0 0;
  color: var(--kb-brand-blue);
}

.no-recipe-results.is-visible {
  display: block;
}
