@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&family=Magra:wght@400;700&display=swap');

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scroll-behavior: smooth;
}

/* Variables */
:root {
  --grey-light: #e6e6e6;
  --white-light: #fff;
  --black-light: #222;
  --shadow-light: rgba(0, 0, 0, 0.1);
  --orange: #e06b1a;
  --remove-btn-orange: #c55a12;
  --text-grey: #888;
  --black-dark: #1a1a1a;
  --text-color-dark: #f5f5f5;
  --gris-dark: #2b2b2b;
  --shadow-dark: rgba(0, 0, 0, 0.6);
  --crimson: "Crimson Text";
  --magra: "Magra";
}

/* Thèmes */
html[data-theme="light"] {
  --bg-color: var(--grey-light);
  --text-color: var(--black-light);
  --card-bg: var(--white-light);
  --shadow-color: var(--shadow-light);
}

html[data-theme="dark"] {
  --bg-color: var(--black-dark);
  --text-color: var(--text-color-dark);
  --card-bg: var(--gris-dark);
  --shadow-color: var(--shadow-dark);
}


body {
  background-color: var(--bg-color);
  font-family: var(--magra), sans-serif;
  color: var(--text-color);
  line-height: 1.6;
}

/* Header*/
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  box-shadow: 0 2px 6px var(--shadow-color);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  background-color: var(--card-bg);
}

header nav {
  display: flex;
  gap: 2rem;
}

header nav a {
  color: var(--text-color);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.3s;
}

header nav a:hover {
  color: var(--orange);
}

#logo {
  background-color: #fff;
  border-radius: 2rem;
  width: 15rem;
}

#themeToggle {
  cursor: pointer;
  font-size: 1.8rem;
  background: none;
  border: none;
  color: var(--text-color);
}

main {
  max-width: 60rem;
  margin: 12rem auto 4rem;
  padding: 0 2rem;
  position: relative;
}


h1 {
  display: none;
}

h2, h3 {
  font-family: var(--crimson);
  color: var(--orange);
  margin-bottom: 1rem;
}

/* ==== SECTION RECETTE ==== */
.recette h2 {
  text-align: center;
  font-size: 2.2rem;
  margin-bottom: 2rem;
}

.imageEtFav {
  position: relative;
  width: 100%;
  height: 360px; 
  overflow: hidden;
  border-radius: 1rem;
  box-shadow: 0 2px 6px var(--shadow-color);
  margin-bottom: 1.5rem;
  display: flex; 
  align-items: center; 
  justify-content: center; 
}

.imageEtFav .material-symbols-outlined {
  position: absolute;
  top: 1rem;
  right: 1rem;
  cursor: pointer;
  font-size: 2rem;
  color: var(--orange);
  transition: transform 0.2s;
  z-index: 10;
}

.imageEtFav .material-symbols-outlined:hover {
  transform: scale(1.2);
}


#caroussel { 
  position: relative; 
  width: 100%; 
  height: 100%; 
}

#caroussel input[type="radio"]{
  display: none;
}

#caroussel .slides {
  display: flex; 
  width: 300%; 
  height: 100%; 
  transition: transform 0.6s ease-in-out;
  flex-wrap: nowrap;
}

#caroussel figure {
  width: 100%; 
  height: 100%;
  position: relative;
  margin: 0;
  flex-shrink: 0; 
  display: flex;
  justify-content: center;
  align-items: center;
}

#caroussel figcaption {
  display: none;
}

#caroussel img {
  width: 100%; 
  height: 500px; 
  object-fit: cover; 
  border-radius: 0; 
}

#img1:checked ~ .slides { transform: translateX(0); }       
#img2:checked ~ .slides { transform: translateX(-100%); } 
#img3:checked ~ .slides { transform: translateX(-200%); }  


#caroussel .controls {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%); 
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  z-index: 10; 
}

#caroussel .dot {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5); 
  cursor: pointer;
  transition: background-color 0.3s, transform 0.3s;
  border: 2px solid rgba(255, 255, 255, 0.8);
}

#img1:checked ~ .controls label[for="img1"],
#img2:checked ~ .controls label[for="img2"],
#img3:checked ~ .controls label[for="img3"] {
  background-color: var(--orange); 
  transform: scale(1.2); 
}
.infos {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 3rem;
  font-weight: bold;
}

#categorie, #time, #niveau {
  padding: 0.4rem 0.8rem;
  border-radius: 10%;
  color: #fff;
  font-size: 0.95rem;
  margin-right: 2rem;
}

.la-star{
  font-size: x-large;
}

#categorie { background-color: rgb(55, 140, 161); }
#time { background-color: rgb(93, 182, 93); }
#niveau { background-color: rgb(206, 130, 206); }

/* ==== INGREDIENTS ==== */
#ingredients {
  margin-bottom: 3rem;
}

#ingredients ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 1rem;
}

#ingredients li {
  display: inline-flex;       
  align-items: center;
  gap: 1rem;               
  background-color: var(--card-bg);
  padding: 0.3rem 0.5rem;    
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px var(--shadow-color);
  width: fit-content;
}

#ingredients li:hover {
  transform: translateX(8px);
  box-shadow: 0 2px 8px var(--shadow-color);
}

#ingredients img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

/* ==== ETAPES ==== */
#etape {
  margin-bottom: 3rem;
}

#etape ol {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-left: 1.5rem;
}

#etape li {
  background-color: var(--card-bg);
  padding: 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px var(--shadow-color);
  gap: 1rem;
  margin-bottom: 1rem;
}

/* ==== RECETTES SIMILAIRES ==== */
#similaires ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

#similaires li {
  background-color: var(--card-bg);
  padding: 0.8rem 1.2rem;
  border-radius: 1rem;
  box-shadow: 0 1px 3px var(--shadow-color);
  transition: transform 0.2s, color 0.2s;
  cursor: pointer;
}

#similaires li:hover {
  transform: scale(1.05);
  color: var(--orange);
}

/* Footer*/
footer {
  background-color: var(--card-bg);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 4rem;
  box-shadow: 0 -2px 6px var(--shadow-color);
}

#menuToggle {
  display: none; 
}


@media (max-width: 900px) {

  main {
    max-width: 90%;
    margin: 10rem auto 3rem;
    padding: 0 1rem;
  }

  .recette h2 {
    font-size: 1.8rem;
  }

  .imageEtFav {
    height: 300px;
  }

  .infos {
    flex-wrap: wrap;
    gap: 0.8rem;
    font-size: 0.95rem;
  }

  #ingredients img {
    width: 60px;
    height: 60px;
  }

  #ingredients ul {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.8rem;
  }

  #logo{
  width: 10rem;
}

  #etape li {
    font-size: 0.95rem;
  }

  #similaires ul {
    justify-content: center;
    gap: 1.2rem;
  }

  #similaires li {
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
  }

  header nav {
    gap: 1rem;
    flex-wrap: wrap;
  }
}


/* 📱 SMARTPHONE */
@media (max-width: 600px) {

  header {
    padding: 0.5rem 1rem;
    z-index: 105;
  }

  header nav {
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
  }

  main {
    max-width: 100%;
    margin: 8rem auto 2rem;
    padding: 0 1rem;
  }

  .recette h2 {
    font-size: 1.5rem;
  }

  .imageEtFav {
    height: 220px;
  }

  .imageEtFav .material-symbols-outlined {
    font-size: 1.6rem;
    top: 0.6rem;
    right: 0.6rem;
  }

  .infos {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
  }

  #ingredients ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }

  #ingredients li {
    width: 100%;
    justify-content: flex-start;
  }

  #ingredients img {
    width: 60px;
    height: 60px;
  }

  #etape ol {
    padding-left: 1rem;
    gap: 0.8rem;
  }

  #etape li {
    font-size: 0.9rem;
    padding: 0.8rem;
  }

  #similaires ul {
    flex-direction: column;
    align-items: center;
  }

  #similaires li {
    width: 100%;
    text-align: center;
    font-size: 0.9rem;
  }

  footer {
    flex-direction: column;
    text-align: center;
    height: auto;
    padding: 1rem;
  }

  #logo{
  width: 7rem;
}
  
  #menuToggle {
    display: block;
    font-size: 1.8rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    z-index: 110;
    padding: 0.25rem 0.5rem;
  }

   #navLinks {
    display: none;           
    position: absolute;        
    left: 0;
    right: 0;
    top: 100%;                 
    background-color: var(--card-bg);
    box-shadow: 0 6px 16px var(--shadow-color);
    padding: 1rem 1.25rem;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }

  #navLinks.active {
    display: flex;
  }


  #navLinks a {
    padding: 0.5rem 0;
    width: 100%;
    text-align: left;
    border-bottom: 1px solid rgba(0,0,0,0.06); 
  }
  #navLinks a:last-child {
    border-bottom: none;
  }
}
