body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url('img/title2.jpeg');
  background-size: 50%;
  background-repeat: repeat;
  background-position: center;
  background-color: #d3bee8;
  z-index: -1;
}

header {
    background-color:  #ebcbdc;
    box-shadow: 10px 10px 9px #cde8ec;
}

nav a {
  color: #bd2586;
  background-color:  #cde8ec;
  font-size: 16px;
  line-height: 1;/* force uniform height */
  box-sizing: border-box;
  font-family: 'BPnoScript', sans-serif;
}


nav a:hover{
  background-color: #bd2586;
  color:#cde8ec;
}

.dropdown-content li a:hover {
  background-color: #bd2586;
}



.builderimg img {
  width: auto;
  height: 150px; 
  object-fit: contain;
  flex:1;
  flex: 0 0 calc(100% / 6);
}


.painttin {
  height: 100px !important; 
  align-self: center;
}

.box {
  padding: 15px;
  margin: 15px;
  border-radius: 10px;
  text-align: center;
}

.titleimg {
  max-width: 100%;
  height: auto;        /* key line */
  display: block;
  margin: 10px auto 0;
}

.sylvie {
  max-width: 50%;
}

.foresty {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.forest {
  background-color: #cde8ec;
  box-shadow: 10px 10px 9px #eccde9;
}

.builder {
  background-color: #ebcbdc;
  box-shadow: 10px 10px 9px #cde8ec;
}
 .twoimg {
  display: flex;
  gap: 20px;
  align-items: center;
}

.imgandcaption {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.miscimg {
    flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.miscimg img {
  height: 200px;
}
.forestbox1 {
  flex: 0 0 200px; /* fixed width for packet */
}

.forestbox1 {
  flex: 0 1 250px; /* allow shrink */
}

.forestbox1 img {
  width: 100%;
  height: auto;
}

.miscimg img.twins {
  height: 170px;
}


.imgandcaption1 {
  display: flex;
  align-items: center;
  align-content: center;
  align-self: center;
    
}

.imgandcaption1 img {
  height: 300px;
  margin-right: 10px;
}


.builderimg {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

h1 {
  text-decoration: wavy underline;
}

@media (max-width: 768px) {

  /* Stack all flex layouts vertically */
  .twoimg,
  .miscimg,
  .builderimg,
  .imgandcaption1 {
    flex-direction: column;
    align-items: center;
  }

  /* Make images responsive */
  img {
    max-width: 100%;
    height: auto;
  }

  /* Builder images: one per row */
  .builderimg img {
    flex: 0 0 100%;
    height: auto;
  }

  /* Forest boxes full width */
  .forestbox1 {
    flex: 0 0 100%;
  }

  /* Remove fixed heights that break mobile */
  .painttin,
  .miscimg img,
  .miscimg img.twins,
  .imgandcaption1 img {
    height: auto !important;
  }

  /* Center and widen content */
  .box {
    margin: 10px;
    padding: 12px;
  }

  .sylvie {
    max-width: 90%;
  }

  nav a {
    font-size: 18px; /* easier to tap */
    line-height: 1.2;
  }
}

@media (max-width: 768px) {

  /* Keep flex rows, allow wrapping */
  .miscimg,
  .builderimg {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  /* Two images per row */
  .miscimg img,
  .builderimg img {
    flex: 0 0 48%;   /* ~2 per row with gap */
    max-width: 48%;
    height: auto;
  }

  /* Stack text/image combos vertically */
  .twoimg,
  .imgandcaption1 {
    flex-direction: column;
    align-items: center;
  }

  /* Remove fixed heights */
  .painttin,
  .miscimg img.twins,
  .imgandcaption1 img {
    height: auto !important;
  }

  .box {
    margin: 20px 0;
    padding: 12px;
  }

  .sylvie {
    max-width: 90%;
  }

  nav a {
    font-size: 18px;
    line-height: 1.2;
  }
}
