/* Colors base càlids */
:root {
  --color-fons: #f8f9fa;
  --color-blanc-suau: rgba(255, 255, 255, 0.85);
  --color-ombra: rgba(0, 0, 0, 0.1);
  --color-text: #333; 
}
/*Aquest estil fa que el salt cap a la secció sigui suau*/
html {
  scroll-behavior: smooth;
}


/* Estil base del body */
body {
      font-family: 'Segoe UI', sans-serif;
      line-height: 1.6;
      background-color: var(--color-fons);
      /*color: #333;*/
      padding: 2rem;
      background-image: url('img/estovallesgris.jpg');
      background-size: 300px 300px;
      background-repeat: repeat;
      background-position: center;
      /* Fons subtil amb superposició blanca translúcida */
      position: relative;
}
/*Això fa que el patró d’estovalles quedi visible però discret, 
amb el text molt més llegible. I amb position: relative al <body>, 
la capa queda just darrere del contingut.*/
body::before {
  content: '';
  position: absolute;
  inset: 0;
 /* background-color: rgba(255, 255, 255, 0.7); /* blanc translúcid */
  background-color: rgba(255, 255, 255, 0.4); /* més suau */
  z-index: -1;
}

/* Estil integrat per tots els blocs principals */
nav, section, .recepta-container, .intro-historia, .ingredients, .preparacio, .consell, footer {
  /*background-color: var(--color-blanc-suau);*/
  border-radius: 12px;
  box-shadow: 0 2px 6px var(--color-ombra);
  padding: 1rem;
  backdrop-filter: blur(3px);
  margin-bottom: 1.5rem;
}
 
header {
  background: #cc9966;
  border-radius: 12px;
  color: white;
  text-align: center;
  padding: 2rem;
}

.logo {
  width: 100%;
  max-width: 600px; /* o la mida màxima que vulguis */
  height: auto;
  border-radius: 10px;
}
@media (max-width: 600px) {
  .logo {
    max-width: 300px; /* o la mida que prefereixis per mòbil */
  }
}


nav.categories ul {
  border-radius: 12px;  
  display: flex;
  justify-content: center;
  background: #cc9966;
  padding: 1rem;
  list-style: none;
}

nav.categories a {
  margin: 0 1rem;
  text-decoration: none;
  color: #333;
  font-weight: bold;
}

.etiquetes {
  /*background: #bbb5af;*/
  text-align: center;
  margin: 2rem;
}

.tag-filter button {
  margin: 0.5rem;
  padding: 0.5rem 1rem;
  background: #cc9966;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  
}

.receptes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  padding: 2rem;
}

.recepta {
  background: white;
  padding: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
}

.recepta img {
width: 100%;  /*  Mida completa */
/*width:"400";*/
  border-radius: 4px;
}

.recepta .etiquetes span {
  background: #35990e;
  color: white;
  padding: 0.3rem 0.6rem;
  margin-right: 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

.menu-toggle {
  display: none;
  font-size: 2rem;
  padding: 1rem;
  text-align: right;
  cursor: pointer;
  background: #eee;
}

/* Estil base per seccions */
.categoria {
  position: relative;
  margin: 3rem 0;
  padding-top: 1px; /* Evita col·lapse de marges */
}
.categoria h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 2rem 0;
  padding-bottom: 12px;
  text-align: center;
  color: #5a4a3a; /* Color terra */
  background-color: white;
  font-size: 2.2rem;
  justify-content: center;
  border-radius: 12px;
  
  /* Línia decorativa 
  &::after {
    content: "";
    flex: 1;
    height: 3px;
    background: linear-gradient(90deg, #d4a017, transparent);
    margin-left: 10px;
}*/
/* Icona */
  .fa-seedling {
    color: #8fd19e; /* Verd suau */
    font-size: 1.2em;
  }
}
.categoria i {
  color: #cc9966;
  font-size: 2rem;
}
/* Versió fosca per contrast */
body.dark .categoria > h2 {
  color: #f9f4e8;
  &::after {
    background: linear-gradient(90deg, #c45a1a, transparent);
  }
}

/* Versió mòbil amb menú hamburguesa */
@media (max-width: 600px) {
  .menu-toggle {
    display: block;
  }

  nav.categories {
    display: none;
    flex-direction: column;
    align-items: center;
  }

  nav.categories.visible {
    display: flex;
  }

  nav.categories ul {
    flex-direction: column;
    padding: 0;
  }

  nav.categories li {
    margin: 0.5rem 0;
  }
}
/* botons de descàrrega-impresió */ 
.download-btn {
      display: inline-block;
      background-color: #a7d9a5;
      color: #fff;
      padding: 0.75rem 1.5rem;
      border-radius: 5px;
      font-weight: bold;
      text-decoration: none;
      transition: background-color 0.3s ease;
      margin-top: 1rem;
    }

    .download-btn:hover {
      background-color: #88c286;
    }
