/* Recipes Page Styles - Matched to Theme Blog Layout */
.template-recipes {
  width: 100%;
  position: relative;
  box-sizing: border-box;
  padding-top: var(--padding-section-top-mobile, 20px);
  padding-bottom: var(--padding-section-bottom-mobile, 40px);
  padding-left: 20px;
  padding-right: 20px;
}

@media screen and (min-width: 768px) {
  .template-recipes {
    padding-top: var(--padding-section-top-desktop, 30px);
    padding-bottom: var(--padding-section-bottom-desktop, 60px);
    padding-left: 60px;
    padding-right: 60px;
  }
}

/* Width Layout System - Matched to Theme Blog Content Width */
.template-recipes .width--content {
  width: 100%;
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

/* Page Heading */
.template-recipes__header {
  margin-bottom: 24px;
  text-align: center;
}

.template-recipes__title {
  color: var(--color-primary-button-background, #C41C2B);
  font-size: var(--recipes-title-font-size-mobile, 32px);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.2;
}

@media screen and (min-width: 768px) {
  .template-recipes__title {
    font-size: var(--recipes-title-font-size-desktop, 44px);
  }
}

.template-recipes__description {
  max-width: 750px;
  margin: 10px auto 0;
  font-size: 15px;
  color: #555555;
  line-height: 1.5;
}

/* Filter by Category Section */
.template-recipes__filter-section {
  margin-bottom: 30px;
  text-align: left;
}

.template-recipes__filter-label {
  font-size: var(--recipes-filter-label-font-size, 13px);
  font-weight: 500;
  color: #555555;
  margin: 0 0 10px 0;
  letter-spacing: 0.01em;
}

.template-recipes__filter-group {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 24px;
}

@media screen and (max-width: 767px) {
  .template-recipes__filter-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

.template-recipes__checkbox-item {
  display: inline-flex;
  align-items: center;
  position: relative;
}

.template-recipes__checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: var(--recipes-filter-font-size-mobile, 13px);
  font-weight: 500;
  color: #222222;
  user-select: none;
  line-height: 1.2;
}

@media screen and (min-width: 768px) {
  .template-recipes__checkbox-label {
    font-size: var(--recipes-filter-font-size-desktop, 13px);
  }
}

.template-recipes__checkbox-input {
  appearance: none;
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border: 1.5px solid #444444;
  border-radius: 2px;
  background-color: #ffffff;
  cursor: pointer;
  position: relative;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  outline: none;
  transition: all 0.15s ease-in-out;
}

.template-recipes__checkbox-input:hover {
  border-color: var(--color-primary-button-background, #C41C2B);
}

.template-recipes__checkbox-input:focus-visible {
  outline: 2px solid var(--color-primary-button-background, #C41C2B);
  outline-offset: 2px;
}

.template-recipes__checkbox-input:checked {
  background-color: var(--color-primary-button-background, #C41C2B);
  border-color: var(--color-primary-button-background, #C41C2B);
}

.template-recipes__checkbox-input:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #ffffff;
  border-width: 0 1.8px 1.8px 0;
  transform: rotate(45deg);
}

/* Recipe Gallery Grid */
.template-recipes__grid {
  display: grid;
  grid-template-columns: repeat(var(--recipes-columns-desktop, 3), 1fr);
  column-gap: var(--grid-spacing-loose, 30px);
  row-gap: 2em;
  width: 100%;
  box-sizing: border-box;
}

@media screen and (max-width: 1023px) and (min-width: 768px) {
  .template-recipes__grid {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 24px;
    row-gap: 2em;
  }
}

@media screen and (max-width: 767px) {
  .template-recipes__grid {
    grid-template-columns: repeat(var(--recipes-columns-mobile, 1), 1fr);
    column-gap: 16px;
    row-gap: 24px;
  }
}

@media screen and (max-width: 480px) {
  .template-recipes__grid {
    column-gap: 12px;
    row-gap: 20px;
  }
}

/* Recipe Card Item */
.recipe-card-item {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  transition: opacity 0.25s ease, transform 0.25s ease;
  opacity: 1;
  transform: scale(1);
}

.recipe-card-item.is-hidden {
  display: none !important;
  opacity: 0;
  transform: scale(0.96);
}

.recipe-card-item .blog-post-card {
  height: 100%;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

/* Mobile 2-column card adjustments */
@media screen and (max-width: 767px) {
  .template-recipes[style*="--recipes-columns-mobile: 2"] .recipe-card-item .blog-post-card__title,
  .template-recipes[style*="--recipes-columns-mobile:2"] .recipe-card-item .blog-post-card__title {
    font-size: clamp(13px, 3.8vw, 16px) !important;
    line-height: 1.3;
    margin: 4px 0 6px;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .template-recipes[style*="--recipes-columns-mobile: 2"] .recipe-card-item .blog-post-card__meta,
  .template-recipes[style*="--recipes-columns-mobile:2"] .recipe-card-item .blog-post-card__meta {
    font-size: 11px;
    gap: 4px;
    flex-wrap: wrap;
  }

  .template-recipes[style*="--recipes-columns-mobile: 2"] .recipe-card-item .blog-post-card__excerpt,
  .template-recipes[style*="--recipes-columns-mobile:2"] .recipe-card-item .blog-post-card__excerpt {
    font-size: 12px;
    line-height: 1.4;
  }

  .template-recipes[style*="--recipes-columns-mobile: 2"] .recipe-card-item .blog-post-card__tag,
  .template-recipes[style*="--recipes-columns-mobile:2"] .recipe-card-item .blog-post-card__tag {
    font-size: 10px;
    padding: 2px 6px;
  }
}

/* Empty State */
.template-recipes__empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 50px 20px;
  background-color: #f9f9f9;
  border-radius: 8px;
  border: 1px dashed #dcdcdc;
  margin: 15px 0;
}

.template-recipes__empty-icon {
  margin-bottom: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(196, 28, 43, 0.08);
  color: var(--color-primary-button-background, #C41C2B);
}

.template-recipes__empty-icon svg {
  width: 24px;
  height: 24px;
}

.template-recipes__empty-title {
  margin-bottom: 6px;
  font-size: 18px;
  font-weight: 600;
  color: #222222;
}

.template-recipes__empty-text {
  font-size: 14px;
  color: #666666;
  max-width: 400px;
  margin: 0 auto 16px;
}

.template-recipes__empty-reset-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 4px;
  background-color: var(--color-primary-button-background, #C41C2B);
  color: #ffffff;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.template-recipes__empty-reset-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}
