/* BODY */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  line-height: 1.6;
}

/* LOGO */
.logo img {
  width: 180px;
  height: auto;
}

/* HEADER */
header {
  background: rgba(255, 68, 0, 0.831);
  color: white;
  padding: 1rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* MENÚ */
header ul {
  list-style: none;
  display: none; /* mobile first: menú ocult */
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  text-align: center;
}

header a {
  color: white;
  text-decoration: none;
}

/* BOTÓ HAMBURGUESA */
.menu-toggle {
  background: none;
  border: none;
  font-size: 3rem;
  color: white;
  cursor: pointer;
  display: block;
}

/* Oculta overlay por defecto */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.menu-cuadro {
  background: white;
  padding: 2rem;
  border-radius: 10px;
  width: 80%;
  max-width: 300px;
  text-align: center;
  position: relative;
}

.menu-cuadro ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0 0;
}

.menu-cuadro li {
  margin: 1rem 0;
}

.menu-cuadro a {
  text-decoration: none;
  color: #ff4400;
  font-weight: bold;
  font-size: 1.3rem;
}

.menu-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 3rem;
  background: none;
  border: none;
  cursor: pointer;
  color: #333;
}

/* HERO */
.hero {
  background: url("../img/arribada.jpg") no-repeat center center/cover;
  color: white;
  text-align: center;
  padding: 1rem;
  min-height: 65vh;
  display: flex;
  flex-direction: column;
  justify-content: end;
  font-size: 1.2rem;
}

/* SECCIONS */
section {
  padding: 1.5rem 1rem;
}

/* QUI SOM */
#qui-som {
  background: #e0f2f1;
  padding: 2rem 1rem;
  text-align: justify;
}

#qui-som .container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
}

.text-escriptori {
  display: none;
}

.text-mobil {
  display: block;
}

/* COL·LABORA */

#colabora h2 {
  text-align: center;
  margin-bottom: 1rem;
  color: rgba(255, 68, 0, 0.831);
}

#colabora p {
  color: #444;
  text-align: justify;
  width: 90%;
  margin: 0 auto;
}

/* GRID PROJECTES / TARGETES */
.grid,
.cards {
  display: grid;
  grid-template-columns: 1fr; /* una columna per defecte */
  gap: 1.5rem;
  margin: 1rem auto;
  max-width: 1200px; /* limita l’ample màxim per a escriptori */
  width: 100%; /* ocupa tot l’ample possible */
  justify-items: center; /* centra les cards dins el grid */
}

/* CARDS */
.card,
.blog-card {
  background: #f9f9f9;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 10px rgba(0, 0, 0, 0.5);
  text-align: center;
  padding: 1rem;
  transition: transform 0.3s ease;
  width: 350px; /* fixar un ample raonable per a centrar */
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card img,
.blog-card img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 8px 8px 0 0;
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block; /* perquè tota la targeta sigui clicable */
}

.card-link:hover .card {
  transform: translateY(-5px); /* manté l'efecte hover */
}

.card h3,
.blog-card h3 {
  margin: 1rem 0 0.5rem;
  color: rgba(255, 68, 0, 0.831);
}

.card p,
.blog-card p {
  font-size: 0.95rem;
  color: #444;
}

.btn {
  display: inline-block;
  background: #00695c;
  color: white;
  padding: 0.7rem 1.2rem;
  border-radius: 5px;
  text-decoration: none;
  transition: background 0.3s ease;
  width: 100%;
}

/* FORMULARI centrat */
#contacte h2 {
  text-align: center;
  margin-bottom: 1rem;
}

#contacte {
  background: #e0f2f1;
}

.container-contacte {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  justify-content: center;
}

.contact-info {
  width: 100%;
}

form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

form input,
form textarea,
form button {
  padding: 0.7rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  box-sizing: border-box;
  width: 100%;
  font-size: 1rem;
}

form button {
  background: rgba(255, 68, 0, 0.831);
  color: white;
  cursor: pointer;
  border: none;
  margin-top: 1rem;
}

/* FOOTER */
footer {
  background: #004d40;
  color: white;
  text-align: center;
  padding: 1rem;
}

footer p {
  color: white !important;
  text-align: center !important;
  margin-bottom: 1rem !important;
}

.social a {
  color: white;
}

/* ------------------------------
   MEDIA QUERIES
--------------------------------*/

/* Tablets (≥600px) */
@media (min-width: 600px) {
  header {
    flex-direction: row;
    justify-content: space-between;
  }

  header nav ul {
    display: flex !important; /* menú visible en tablet */
    flex-direction: row;
    gap: 1rem;
  }

  .menu-toggle {
    display: none; /* ocultem hamburguesa */
  }

  .grid,
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .container-contacte {
    flex-direction: row;
    gap: 2rem;
  }

  .contact-info {
    flex: 1;
  }

  form {
    flex: 2;
    max-width: none;
  }
}

/* Escriptori (≥900px) */
@media (min-width: 900px) {
  header {
    flex-direction: row;
    justify-content: space-between;
    padding: 1rem 5rem;
    position: relative; /* afegir */
    z-index: 1000; /* afegir */
  }

  header nav ul {
    display: flex !important; /* menú visible en escriptori */
    flex-direction: row;
    gap: 1.5rem;
    font-size: 1.2rem;
  }

  .menu-toggle {
    display: none;
  }

  .logo img {
    width: 220px;
  }

  /* Per defecte, només mostra escriptori */
  .text-mobil {
    display: none;
  }

  .text-escriptori {
    display: block;
  }

  .container-contacte {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    justify-content: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
  }

  .menu-toggle {
    display: none; /* ocultem hamburguesa */
  }

  .contact-info {
    flex: 1;
    min-width: 200px;
  }

  #colabora p {
    text-align: center;
    margin-bottom: 3rem;
  }

  form {
    flex: 2;
    min-width: 500px;
    width: auto;
    margin: 0;
  }

  form input,
  form textarea,
  form button {
    width: 100%;
  }

  .grid,
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}
