/*General Index pages*/
p {
  margin: 0.1rem;
}

#index-top-container {
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  padding-top: 8rem;
  margin-bottom: 3.15rem;
  position: relative;
  height: 18rem;
}

#search-bar-mover {
  position: absolute; 
  bottom: -3.15rem; 
  width: 100%;
}

.index-title {
  color: white;
  text-shadow: 0px 0px 10px black;
  /* Hero title now carries the search term — keep large queries from breaking the hero */
  max-width: 90%;
  margin-left: auto;
  margin-right: auto;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Search-bar clear (X) button — shown in place of the search icon when a search is active */
.searchbar-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  cursor: pointer;
  color: var(--col-green-1); /* same green as the searchbar border */
}

.searchbar-clear:hover {
  color: var(--col-green-2);
}

/* #index-container {
  padding-top: 4rem;
  padding-left: 1rem;
  padding-right: 1rem;
} */

.badge-dark {
  white-space: inherit;
}

#index-item-container {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

/* Search row: input field + circular filter button (app-style) */
.searchbar-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.searchbar-field {
  position: relative;
  flex: 1 1 auto;
  min-width: 0; /* allow the input to shrink so the button always fits */
}

/* Hero search field is narrower (circular button beside it), so pull the icon to the edge.
   Scoped here so the global .searchbar-submit-btn (navbar, shop, articles, videos) is unchanged. */
.searchbar-field .searchbar-submit-btn {
  top: 0.55rem;
  right: 0.8rem;
}

/* Circular filter button to the right of the search bar (replaces the old text button) */
#advanced-filter-link.filter-btn-circle {
  flex: 0 0 auto;
  width: 2.9rem; /* fixed equal dimensions -> guaranteed circle */
  height: 2.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  background-color: var(--col-green-1);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

#advanced-filter-link.filter-btn-circle:hover {
  background-color: var(--col-green-2);
}

#advanced-filter-link.filter-btn-circle:active {
  transform: scale(0.94);
}

.flex-container {
  display: flex;
  flex-flow: row wrap;
  justify-content: space-around;
  padding: 0;
  margin: 0;
  list-style: none;
  row-gap: 1rem;
}

.flex-item {
  padding: 20px 15px 0 15px;
  flex-basis: 15%;
  flex-grow: 0;
  text-align: left;
}

@media only screen and (max-width: 2000px) {
  .flex-item {
    flex-basis: 25%;
  }
}

@media only screen and (max-width: 1600px) {
  .flex-item {
    flex-basis: 33.33%;
  }
}

@media only screen and (max-width: 768px) {
  .flex-item {
    flex-basis: 50%;
  }
}

@media only screen and (max-width: 450px) {
  .flex-item-video,
  .flex-item-article {
    flex-basis: 100%;
  }
}

.flex-item-article .card-img {
  object-fit: cover;
  aspect-ratio: 3/2;
}

.flex-item h3.title {
  padding-top: 1rem;
}

/* App-style recipe cards (recipe index + navbar search results) */
.recipe-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(234, 237, 232, 0.9) 0%, rgba(234, 237, 232, 0.5) 100%); /* --col-green-5 #EAEDE8 */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.recipe-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.recipe-card__link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.recipe-card__media {
  position: relative;
  line-height: 0;
  overflow: hidden;
}

.recipe-card__img {
  width: 100%;
  display: block;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: 16px 16px 0 0; /* round top to match card; square bottom (title body sits below) */
  transition: transform 0.35s ease;
}

.recipe-card:hover .recipe-card__img {
  transform: scale(1.04);
}

.recipe-card__overlay {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.recipe-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.4;
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.recipe-card__badge--time {
  background-color: var(--col-green-1);
}

.recipe-card__badge--premium {
  background-color: var(--col-yellow-1);
}

.recipe-card__body {
  padding: 0.55rem 0.7rem 0.75rem;
}

.recipe-card__title {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recipe-card__yt {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.recipe-card__yt-icon {
  height: 20px;
  width: auto;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

@media only screen and (max-width: 576px) {
  .recipe-card__title {
    font-size: 1.15rem;
  }
}

/* Small section labels that distinguish the "Browse by Category" and "Latest recipes" areas */
.section-heading {
  text-align: center;
  /* font-size: 2.2rem; */
  margin: 0 0 1rem;
}

/* Recipe-type quick-link cards (clean-landing entry point) */
.type-cards {
  padding: 0.5rem 0 1.5rem;
}

.type-card-grid {
  display: grid;
  gap: clamp(0.55rem, 1.4vw, 1rem);
}

/* Browse by Category: one square-track grid. The first 4 cards are featured by
   spanning two tracks; the remaining cards stay aligned to the same grid. */
.type-card-grid--browse {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  margin-bottom: 1.5rem;
  align-items: start;
}

.type-card-grid--browse > .type-card {
  grid-column: span 1;
  min-width: 0;
}

.type-card-grid--browse > .type-card:nth-child(-n + 4) {
  grid-column: span 2;
}

.type-card-grid--browse > .type-card:nth-child(-n + 4) .type-card__label {
  font-size: 1.2rem;
}

@media only screen and (max-width: 992px) {
  .type-card-grid--browse {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media only screen and (max-width: 576px) {
  .type-card-grid--browse {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .type-card-grid--browse > .type-card:nth-child(-n + 4) {
    grid-column: span 1;
  }

  .type-card-grid--browse > .type-card:nth-child(-n + 4) .type-card__label {
    font-size: 0.95rem;
  }
}

.type-card {
  display: block;
  text-align: center;
  text-decoration: none;
  color: inherit;
}

.type-card__media {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  aspect-ratio: 1 / 1;
}

.type-card__img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 14px; /* override global img radius */
  transition: transform 0.35s ease;
}

.type-card:hover .type-card__img {
  transform: scale(1.05);
}

.type-card__label {
  display: block;
  margin-top: 0.5rem;
  font-family: var(--font-0); /* Cotoris Bold, matching the recipe-card titles */
  font-size: 1.05rem;
  line-height: 1.2;
}

@media only screen and (max-width: 576px) {
  .type-card__label {
    font-size: 0.95rem;
  }
}

/* Clean-landing: collapse the full filters behind the filter button on all viewports */
#advanced-filter.collapsed {
  display: none;
}

/* Filter dropdowns: equal-width, aligned grid that wraps responsively (no max-width cap).
   Bootstrap's flex .col-sm grew each wrapped row independently, so rows misaligned. */
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  align-items: start;
  column-gap: 1rem;
  margin: 0; /* neutralize Bootstrap .row negative gutters */
}

.filter-grid > .col-sm {
  max-width: none; /* fill the grid track instead of flex-basing */
  padding-left: 0;
  padding-right: 0;
}

.dropdown-menu {
  width: 100%;
  transition: all 0.3s ease-in-out;
}

.dropdown-menu {
  background-color: rgb(255, 255, 255, 0);
}

.dropdown-menu[role="combobox"] {
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  background-color: rgb(255, 255, 255, 0.7);
}

.dropdown-menu:hover {
  border-radius: 20px;
}

.btn.dropdown-toggle {
  padding: 0.3rem 0.8rem 0.3rem 0.5rem;
}

.dropdown.bootstrap-select {
  width: 210px;
}

.filter-column {
  min-width: 250px;
  min-height: 33px;
}

.dropdown button {
  background-color: var(--col-green-5);
  color: var(--col-green-1) !important;
  font-weight: 300;
}

.dropdown button:hover,
.dropdown button:active {
  background-color: var(--col-green-5);
  color: var(--col-green-1) !important;
  font-weight: 300;
}

.pagination {
  display: inline-block;
  margin: 0 auto;
}

.pagination-form {
  display: inline;
}

.pagination-form-input {
  width: initial;
  display: inline;
  padding: 0.2rem;
  text-align: center;
  width: 2.5rem;
}

.page-arrow {
  font-size: 1.9rem;
  padding: 0 0.5rem 0 0.5rem;
  opacity: 0.4;
}

.page-text {
  font-size: 1.2rem;
}

.page-arrow:hover {
  opacity: 1;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type="number"] {
  -moz-appearance: textfield;
}

/*Allergen*/
.badge.badge-circle {
  border-radius: 50%;
  width: 1.7rem;
  height: 1.7rem;
  box-shadow: 1px 1px 3px grey;
}

.badge-icon-container {
  position: relative;
  margin-top: 1rem;
}

#index-yt-icon {
  vertical-align: middle;
}

#index-yt-link:hover {
  transform: scale(1.05);
}

/*Tablet*/
@media only screen and (max-width: 992px) {
  /* #advanced-filter-link {
    font-size: 0.9rem;
    padding: 0.2rem 0.4rem 0.2rem 0.4rem;
  } */

  #advanced-filter {
    display: none;
  }
}

/*Mobile*/
@media only screen and (max-width: 576px) {
  #index-container {
    padding-top: 1rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  #index-container .col-sm-6 {
    padding: 0;
  }

  #index-container h1 {
    font-size: 1.6rem;
  }

  #index-container h5 {
    font-size: 1.1rem;
  }

  #index-container .btn {
    font-size: 0.9rem;
    padding: 0.2rem 0.4rem 0.2rem 0.4rem;
  }

  #index-item-container {
    padding: 0.2rem;
  }

  /*Index*/
  .flex-item {
    padding: 10px 2px 0 2px;
    text-align: left;
    /* line-height: 1; */
    position: relative;
  }

  .flex-item h3 {
    margin-bottom: 0.2rem;
  }

  .flex-item h3.subtitle {
    margin-bottom: 0.2rem;
  }
}
