
#pageContainer {
	background-color: transparent;
	margin: 75px auto 0px auto;
	padding: 0;
	font-family: Roboto;
	width: 70%;
	min-width: 300px;
	text-align: center;
}

h1 {
  margin: 0 0 1rem 0;
  font-size: 2.5rem;
}

h2.section-title {
  font-size: 1.8rem;
  color: #2d6a4f;
  margin: 2rem 0 1rem;
  text-align: left;
}

/******************************************************/

.toggle-search-btn {
  display: block;
  background: white;
  color: #2d6a4f;
  border: none;
  font-weight: bold;
  padding: 0.7rem 1.2rem;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  margin: 1rem auto 0 auto;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: background 0.3s ease;
}

.toggle-search-btn:hover {
  background: #e9f5ef;
}

.search-bar-wrapper {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
}

.search-bar-wrapper.active {
  max-height: 1000px;
  transition: max-height 0.5s ease;
}


.search-bar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #ffffff;
  padding: 1rem;
  border-radius: 10px;
  max-width: 1000px;
  margin: 1rem auto;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.search-q {
  padding: 0.6rem 1rem;
  border-radius: 5px;
  border: 1px solid #ccc;
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
}

.search-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.search-row select,
.search-row input {
  padding: 0.6rem 1rem;
  border-radius: 5px;
  border: 1px solid #ccc;
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
}

.search-field {
  display: flex;
  flex-direction: column;
}

.search-field label {
  font-weight: 500;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
  color: #333;
  
  text-align: left;
  padding-left: 4px;
}

@media (max-width: 768px) {
  .search-row {
    grid-template-columns: 1fr;
  }
}

/******************************************************/

.search-alerts {
  max-width: 1000px;
  margin: 1rem auto;
  padding: 0.8rem 1rem;
  background-color: #fff3cd;
  border: 1px solid #ffeeba;
  border-radius: 8px;
  color: #856404;
  font-size: 0.95rem;
}
.alert-message + .alert-message {
  margin-top: 0.4rem;
}

/******************************************************/

main {
  padding: 2rem;
  max-width: 1200px;
  margin: auto;
}

.featured {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 3rem;
}

.featured-left {
  flex: 1;
  min-width: 280px;
}

.featured-left img {
  width: 100%;
  border-radius: 10px;
  object-fit: cover;
  max-height: 400px;
}

.featured-right {
  flex: 1;
  min-width: 280px;
  max-height: 400px;
  overflow-y: auto;
  background: white;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.recipe-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.recipe-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
}

.recipes-grid {
  margin-top: 2rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.recipe-card {
  background: white;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: transform 0.2s;
  cursor: pointer;
}

.recipe-card:hover {
  transform: translateY(-5px);
}

.recipe-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  margin-bottom: 0.5rem;
}

.recipe-card h3 {
  margin: 0.5rem 0;
  font-size: 1.2rem;
}

.recipe-card p {
  margin: 0.2rem 0;
  font-size: 0.9rem;
  color: #555;
}

/******************************************************/

.recipe-card {
  position: relative;
}

.like-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: box-shadow 0.3s ease, border 0.3s ease;
}

.like-icon:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  border-color: #ccc;
}

.like-icon .fa {
  font-size: 1.2rem;
  color: #999;
  transition: color 0.3s ease;
}

.like-icon .fa-heart {
  color: #e63946;
}

.recipe-card p i {
  margin-right: 0.3rem;
  color: #2d6a4f;
  font-size: 1.1rem;
  vertical-align: middle;
}

/******************************************************/

.tag-filter-wrapper {
  grid-column: 1 / -1;
  margin-top: 1rem;
}

#tag-select {
  padding: 0.5rem;
  font-size: 1rem;
  border-radius: 5px;
  width: 100%;
  margin-bottom: 0.5rem;
}

.selected-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.selected-tags .tag-badge {
  background: white;
  border: 1px solid #ccc;
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: background 0.2s;
}

.selected-tags .tag-badge:hover {
  background: #f1f1f1;
}

/******************************************************/

.tag-badge {
  display: inline-flex;
  align-items: center;
  background-color: #f2f2f2;
  color: #333;
  padding: 6px 10px 6px 12px;
  margin: 4px;
  border-radius: 20px;
  font-size: 14px;
  cursor: default;
  border: 1px solid #ccc;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  transition: background-color 0.2s ease;
  position: relative;
}

.tag-badge:hover {
  background-color: #e6e6e6;
  transform: scale(1.05);
}

.tag-badge .remove-tag {
  font-weight: bold;
  color: #888;
  margin-left: 8px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.tag-badge .remove-tag:hover {
  color: #c0392b;
}

/******************************************************/

.ingredient-filter-wrapper {
  grid-column: 1 / -1;
  margin-top: 1rem;
}

#ingredient-select {
  padding: 0.5rem;
  font-size: 1rem;
  border-radius: 5px;
  width: 100%;
  margin-bottom: 0.5rem;
}

.selected-ingredients {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.selected-ingredients .ingredient-badge {
  background: white;
  border: 1px solid #ccc;
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: background 0.2s;
}

.selected-ingredients .ingredient-badge:hover {
  background: #f1f1f1;
}

.ingredient-badge {
  display: inline-flex;
  align-items: center;
  background-color: #f2f2f2;
  color: #333;
  padding: 6px 10px 6px 12px;
  margin: 4px;
  border-radius: 20px;
  font-size: 14px;
  cursor: default;
  border: 1px solid #ccc;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  transition: background-color 0.2s ease;
  position: relative;
}

.ingredient-badge:hover {
  background-color: #e6e6e6;
  transform: scale(1.05);
}

.ingredient-badge .remove-ingredient {
  font-weight: bold;
  color: #888;
  margin-left: 8px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.ingredient-badge .remove-ingredient:hover {
  color: #c0392b;
}

/******************************************************/

/* --- Media Gallery (carrousel léger) --- */
.media-gallery {
  position: relative;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.media-gallery img {
  width: 100%;
  height: 160px;            /* même hauteur que .recipe-card img */
  object-fit: cover;
  display: block;
}

.featured-left .media-gallery img {
  max-height: 400px;        /* remplace le max-height de l'ancien img */
  height: auto;
}

.mg-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.9);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  cursor: pointer;
  font-size: 20px;
  line-height: 36px;
  text-align: center;
  padding: 0;
}

.mg-prev { left: 10px; }
.mg-next { right: 10px; }

.media-gallery .mg-dots {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.85);
}

.media-gallery .mg-dots::before,
.media-gallery .mg-dots::after { content: ""; }

.media-gallery .mg-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #bbb;
}

.media-gallery .mg-dot.is-active {
  background: #2d6a4f;
}

.media-gallery--card img {
  height: 160px;  /* garantit l'homogénéité avec .recipe-card img */
}

.mg-prev.hidden, 
.mg-next.hidden {
	display: none;
	visibility: hidden;
}

/******************************************************/

#pageContainer.hide-likes .like-icon {
	display: none !important;
}

