/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Merriweather&display=swap');

/* ====== BASE STYLES ====== */
body {
  margin: 0;
  font-family: 'Merriweather', Georgia, serif;
  background: url('img/la-faula-sfondo-trasparente.avif') no-repeat center center fixed;
  background-size: cover;
  color: #3a2c1a;
  line-height: 1.8;
  font-size: 16px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.img-center {
  margin-left: auto;
  margin-right: auto;
}

.img-shadow:hover {
  transform: scale(1.02);
  filter: sepia(0.3) contrast(1.1);
}

.hero img {
  width: 80%;
  object-fit: contain;
  margin: 0 auto;
}

/* ====== NAVBAR ====== */
nav.navbar {
  background-color: transparent;
  width: 90%;
  margin: 0 auto;
  padding: 20px 0;
  display: flex;
  justify-content: center;
}

.hamburger {
  display: none;
  font-size: 28px;
  padding: 10px 20px;
  cursor: pointer;
}

.menu {
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
}

.menu li a {
  text-decoration: none;
  color: #3a2c1a;
  font-weight: 700;
  font-size: 22px;
  padding: 10px 14px;
  transition: background-color 0.3s, color 0.3s;
  border-radius: 6px;
}

.menu li a:hover,
.menu li a.active {
  background-color: #3a2c1a;
  color: #f3ebd9;
}

.navbar li {
  position: relative;
}


.submenu {
  display: none;
  position: absolute;
  background-color: #3a2c1a;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  list-style: none;
  padding: 0;
  margin: 0;
  top: 100%;
  left: 0;
  z-index: 1000;
  min-width: 200px;
  word-break: break-word;
}

.submenu li a {
  display: block;
  padding: 10px 14px;
  white-space: nowrap;
  font-size: 18px;
  color: #f3ebd9;
}

.navbar li.open .submenu {
  display: block;
}
/* ====== MENU DESKTOP & MOBILE RESPONSIVE ====== */
@media (min-width: 769px) {
  .navbar li:hover > .submenu {
    display: block;
  }
  .navbar li.open > .submenu {
    display: block;
  }
}

@media screen and (max-width: 768px) {
  .navbar li.open > .submenu {
    display: block;
  }
  .submenu {
    position: static !important;
    background-color: #3a2c1a;
    box-shadow: none;
    width: 100%;
    min-width: unset;
  }
}

/* ====== MAIN ====== */
main {
  width: 80%;
  max-width: 1000px;
  margin: 40px auto;
  padding: 0 20px;
  background-color: transparent;
  border-radius: 10px;
  font-size: 18px;
}

.intro h1 {
  font-size: 2.8em;
  margin-bottom: 16px;
  letter-spacing: 0.5px;
  font-weight: 700;
  text-align: center;
}

/* ====== WHITE BOX ====== */
.white-box {
  background-color: #fff;
  padding: 2.5rem;
  margin: 40px auto;
  border-radius: 12px;
  max-width: 960px;
  width: 92%;
  color: #3a2c1a;
  font-size: 1.05rem;
  line-height: 1.8;
  overflow-wrap: break-word;
}

.white-box h2 {
  font-size: 1.8em;
  margin-bottom: 1rem;
}

.white-box p {
  margin-bottom: 1rem;
}

small {
  font-size: smaller;
}

/* ====== FOOTER ====== */
footer.footer-custom {
  background-color: transparent !important;
  color: #fff;
  padding: 30px;
  font-size: 18px;
  margin-top: 60px;
  text-align: center;
  width: 100%;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

footer.footer-custom .container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

footer.footer-custom img {
  display: block;
  margin: 0 auto 1rem;
  max-width: 200px;
  width: 100%;
  height: auto;
}

footer.footer-custom ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

footer.footer-custom ul li {
  margin-bottom: 1rem;
}

footer.footer-custom ul li a {
  color: #3a2c1a;
  text-decoration: none;
}

footer.footer-custom p {
  font-size: 0.9rem;
  color: #3a2c1a;
  margin-top: 1rem;
}

/* ====== IMAGE LAYOUTS ====== */
.gallery,
.three-image-gallery,
.home-two-images,
.center-image-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 40px;
}

.gallery img,
.home-two-images img,
.three-image-gallery img,
.center-image-wrapper img {
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s ease;
  display: block;
  margin: 0 auto;
}

.gallery img {
  width: 220px;
  height: 150px;
  object-fit: cover;
}

.home-two-images img,
.three-image-gallery img {
  max-width: 400px;
  width: 100%;
  height: auto;
}

.three-image-gallery figure,
.home-two-images figure {
  flex: 1 1 30%;
  max-width: 30%;
  text-align: center;
}

.three-image-gallery figcaption,
.home-two-images figcaption {
  margin-top: 8px;
  font-style: italic;
  color: #3a2c1a;
  font-size: 1rem;
}

.center-image-wrapper>div:first-child,
.center-image-wrapper>div:last-child {
  flex: 0 0 20%;
  min-width: 0;
}

.center-image-wrapper .center-image-container {
  flex: 0 0 60%;
  text-align: center;
}

.center-image-wrapper img {
  max-width: 700px;
}

.gallery img:hover,
.home-two-images img:hover,
.three-image-gallery img:hover,
.center-image-wrapper img:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  filter: brightness(1.05);
}

/* ====== RESPONSIVE MEDIA QUERIES ====== */
@media screen and (max-width: 992px) {
  .gallery img {
    width: 45%;
  }
}

@media screen and (max-width: 768px) {
  .hamburger {
    display: block;
  }
  .menu {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  .menu.show {
    display: flex;
  }
  .menu li a {
    font-size: 18px;
  }
  .submenu {
    position: static !important;
    background-color: #3a2c1a;
    box-shadow: none;
    width: 100%;
    min-width: unset;
  }
  .submenu li a {
    font-size: 16px;
    padding: 12px;
    white-space: normal !important;
    word-break: break-word;
    text-align: center;
  }
  .white-box {
    padding: 1.5rem;
    font-size: 1rem;
  }
  .white-box h2 {
    font-size: 1.5em;
  }
  .three-image-gallery figure {
    flex: 1 1 45%;
    max-width: 45%;
  }
}

@media screen and (max-width: 600px) {
  .gallery img,
  .three-image-gallery figure,
  .home-two-images figure,
  .center-image-wrapper img {
    width: 100%;
  }
  .center-image-wrapper>div:first-child,
  .center-image-wrapper>div:last-child {
    display: none;
  }
  .center-image-wrapper .center-image-container {
    flex: 1 1 100%;
  }
  .submenu {
    position: static;
    box-shadow: none;
    width: 100%;
    min-width: unset;
    background-color: #3a2c1a;
  }
  .submenu li a {
    font-size: 16px;
    padding: 12px;
    white-space: normal;
    word-break: break-word;
  }
  footer.footer-custom img {
    max-width: 120px;
  }
}

@media (min-width: 769px) and (max-width: 1662px) {
  .menu {
    gap: 5px;
  }
  .menu li a {
    font-size: 14px;
    padding: 6px 10px;
    white-space: nowrap;
    font-weight: 500;
  }
  .submenu {
    min-width: 160px;
  }
  .submenu li a {
    font-size: 13px;
    padding: 6px 10px;
    white-space: nowrap;
  }
  .intro h1 {
    font-size: 1.5em;
    font-weight: 400;
  }
}
/* ====== RESPONSIVE ====== */
@media (min-width: 769px) and (max-width: 1662px) {
  h1 {
    font-size: 1em !important;
  }

  h2 {
    font-size: 1em !important;
  }

  h3 {
    font-size: 1em !important;
  }

  .intro h1 {
    font-size: 1em !important;
  }
}

@media screen and (max-width: 769px) {
  h1 {
    font-size: 1em !important;
  }

  h2 {
    font-size: 1em !important;
  }

  h3 {
    font-size: 1em !important;
  }

  .intro h1 {
    font-size: 1em !important;
  }
}

@media screen and (max-width: 600px) {
  .three-image-gallery {
    flex-direction: column;
    align-items: center;
  }

  .three-image-gallery figure {
    flex: 1 1 100%;
    max-width: 100%;
    margin-bottom: 20px;
  }

  .three-image-gallery img {
    width: 100%;
    height: auto;
  }
}
@media screen and (max-width: 600px) {
  .home-two-images {
    flex-direction: column;
    align-items: center;
  }

  .home-two-images figure {
    flex: 1 1 100%;
    max-width: 100%;
    margin-bottom: 20px;
  }

  .home-two-images img {
    width: 100%;
    height: auto;
  }
}

html, body {
  overflow-x: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}
@media screen and (max-width: 768px) {
  .gallery img:hover,
  .img-shadow:hover {
    transform: none;
    filter: none;
    box-shadow: none;
  }
}
@media (hover: none) and (pointer: coarse) {
  a:hover,
  .img-shadow:hover,
  .gallery img:hover,
  .menu li a:hover {
    transform: none !important;
    filter: none !important;
    background: none !important;
    color: inherit !important;
    box-shadow: none !important;
  }
}

