/* ======================================
   Recipe Index Layout
====================================== */

.recipe-filter-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 45px;
  align-items: start;
  margin: 0;
}

/* ======================================
   Recipe Title
====================================== */

.recipe-title {
  font-size: 24px;
  line-height: 1;
  font-weight: 600;
  margin: 0 0 30px;
  color: #111;
  font-family: "Roxborough";
}

/* ======================================
   Search
====================================== */

.recipe-search {
  margin-bottom: 30px;
}

/*
 * Search field wrapper
 * Used to position the search icon
 * inside the input.
 */

.recipe-search-field {
  position: relative;
  width: 100%;
}

/*
 * Search input
 */

#recipe-search {
  width: 100%;
  height: 46px;

  /*
     * Extra right padding so the
     * search icon doesn't overlap text.
     */
  padding: 0 50px 0 15px;
  border: 1px solid #d6d6d6;
  outline: none;
  background: #fff;
  font-size: 14px;
  transition: 0.3s;
  font-family: "Work Sans";
  box-sizing: border-box;
  border-radius: 4px;
  color: #000;
}

#recipe-search::placeholder {
    color: #000;
}

/*
 * Search input focus
 */

#recipe-search:focus {
  border-color: #222;
}

/*
 * Search icon
 */

.recipe-search-icon {
  position: absolute;
  right: 15px;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/*
 * Search icon SVG
 */

.recipe-search-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: #111;
  stroke-width: 2;
  stroke-linecap: round;
}

/* ======================================
   Category Title
====================================== */

.recipe-category-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  font-family: "Roxborough";
}

/* ======================================
   Category Toggle
====================================== */

.recipe-category-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* Category Arrow */

.recipe-category-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}

.recipe-category-arrow svg {
  width: 18px;
  height: 18px;
  display: block;
  transition: transform 0.3s ease;
}

/* ======================================
   Categories
====================================== */

.recipe-categories {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.recipe-categories label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #111;
  font-family: "Work Sans";
}

.recipe-categories input {
  width: 15px;
  height: 15px;
  accent-color: #111;
}

/* ======================================
   Clear Filters
====================================== */

#recipe-clear-filters {
  display: inline-block;
  margin-top: 32px;
  padding: 0;
  border: none;
  background: transparent;
  color: #111;
  font-family: "Work Sans";
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

#recipe-clear-filters:hover {
  opacity: 0.6;
}

/* ======================================
   Recipe Grid
====================================== */

#recipe-results {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 35px 25px;
  align-items: start;
  transition: opacity 0.2s ease;
}

#recipe-results.is-loading {
  opacity: 0.55;
  pointer-events: none;
}

/* ======================================
   Recipe Card
====================================== */

.recipe-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.recipe-image {
  display: block;
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 20px;
  margin-bottom: 18px;
  background: #f5f5f5;
  position: relative;
}

.recipe-image img {
  width: 100%;
  height: 100% !important;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: 20px;
}

/* ======================================
   Recipe Image Hover Overlay
====================================== */

/* Hover overlay */
.recipe-image::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #f2f3f2;
  opacity: 0;
  z-index: 10;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Show overlay on card hover */
.recipe-card:hover .recipe-image::before {
  opacity: 0.5;
}

.recipe-category-name {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: #111;
  line-height: 1;
  font-family: "Work Sans";
}

.recipe-category-name a {
  color: #6e7072;
}

.recipe-title-card {
  margin: 0;
  padding: 0;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 600;
  font-family: "Roxborough";
}

.recipe-title-card a {
  color: #111;
  text-decoration: none;
}

.recipe-title-card a:hover {
  color: #111;
}

/* ======================================
   Recipe Content
====================================== */

.recipe-content {
  display: flex;
  flex-direction: column;
}

/* ======================================
   Pagination
====================================== */

#recipe-pagination {
  display: flex;
  justify-content: center;
  margin-top: 60px;
}

/* ======================================
   Load More
====================================== */

#recipe-load-more {
  background: #111;
  color: #fff;
  border: none;
  padding: 12px 24px;
  cursor: pointer;
  font-size: 14px;
  letter-spacing: 0.7px;
  font-weight: 700;
  text-transform: uppercase;
  transition: 0.3s;
  border-radius: 4px;
  font-family: "Work Sans";
}

#recipe-load-more:hover {
  background: #6e7072;
}

/* ======================================
   Loader
====================================== */

.recipe-loader {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 70px 0;
}

.recipe-loader span {
  width: 45px;
  height: 45px;
  border: 4px solid #e5e5e5;
  border-top: 4px solid #111;
  border-radius: 50%;
  animation: recipeSpinner 0.8s linear infinite;
}

@keyframes recipeSpinner {
  100% {
    transform: rotate(360deg);
  }
}

/* ======================================
   Responsive
====================================== */
@media (max-width: 767px) {
  .recipe-title {
    font-size: 36px;
  }
}

/* ======================================
   Mobile & Tablet Category Accordion
====================================== */

@media (max-width: 1024px) {
  .recipe-filter-container {
    grid-template-columns: 1fr;
  }

  .recipe-sidebar {
    position: relative;
    top: 0;
  }

  #recipe-results {
    grid-template-columns: repeat(2, 1fr);
  }

  .recipe-category-title {
    margin: 0;
    padding: 0;
    font-size: 16px;
  }

  .recipe-category-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 60px;
    padding: 0 16px;
    cursor: pointer;
    border: 1px solid #d6d6d6;
    border-radius: 4px;
    background: #fff;
    box-sizing: border-box;
  }

  .recipe-category-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
  }

  .recipe-category-arrow svg {
    width: 18px;
    height: 18px;
    display: block;
    transition: transform 0.3s ease;
  }

  /* CLOSED */
  .recipe-category-toggle + .recipe-categories {
    display: none;
    margin-top: 0;
    padding: 18px 16px;
    border: 1px solid #d6d6d6;
    border-top: 0;
    border-radius: 0 0 4px 4px;
    box-sizing: border-box;
  }

  /* OPEN */
  .recipe-category-toggle.is-open + .recipe-categories {
    display: flex;
  }

  /* Rotate arrow */
  .recipe-category-toggle.is-open .recipe-category-arrow svg {
    transform: rotate(180deg);
  }
}
/* Desktop Categories */
@media (min-width: 1025px) {
  .recipe-category-arrow {
    display: none;
  }

  .recipe-category-title {
    margin-bottom: 20px;
  }
}

/* ======================================
   Tablet Categories - 2 Columns
====================================== */

@media (min-width: 768px) and (max-width: 1024px) {
  .recipe-category-toggle + .recipe-categories {
    display: none;
    grid-template-columns: repeat(2, 1fr);
    column-gap: 30px;
    row-gap: 14px;
  }

  .recipe-category-toggle.is-open + .recipe-categories {
    display: grid;
  }
}
