html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: sans-serif;
  font-size: 13px;
  color: black;
  background-color: white;
}

/* =====================
   HEADER & NAVIGATION
===================== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px 0px;
  background: transparent;
  z-index: 100;
  transition: color 0.3s ease, background-color 0.3s ease;
}

header a {
  text-decoration: none;
  color: black;
  margin: 0 15px;
  font-weight: 500;
  text-transform: uppercase;
  font-size: 14px;
}

header .logo {
  transition: filter 0.3s ease;
  position: relative;
  z-index: 200;
}

.logo {
  position: relative;
  transform: none;
  top: auto;
  left: auto;
  height: 48px;
  margin: 0 auto;
  z-index: 200;
}

.logo img {
  height: 48px;
  /* fissiamo dimensione del logo */
  filter: invert(1);
  /* Logo nero di default */
}

/* Quando header è scuro (sfondo scuro) o siamo in mobile-active, logo e hamburger diventano bianchi */
header.dark .logo img,
header.mobile-active .logo img {
  filter: invert(0);
  /* Logo bianco su header scuro/mobile-active */
}

header.dark a {
  color: white;
}

header.light a {
  color: black;
}

header.dark a {
  color: white;
}

header.mobile-active .logo img {
  filter: invert(1);
}

/* MENU GROUPS FOR HEADER */
.menu-group {
  display: flex;
  gap: 0px;
  align-items: center;
}

.left-menu,
.right-menu {
  display: flex;
  gap: 30px;
  align-items: center;
}

.left-menu {
  justify-content: flex-start;
}

.right-menu {
  justify-content: flex-end;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  padding: 0 2%;
}

.hamburger {
  display: none;
}

header.dark .hamburger span {
  background-color: #fff;
}

header.light .hamburger span {
  background-color: #000;
}

body.menu-open .close-menu {
  display: block;
}

.mobile-menu {
  display: none;
}

/* =====================
   HERO SECTION
===================== */
.hero {
  height: 100vh;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.hero::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-img {
  background-size: cover;
  background-position: center;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.spacer {
  height: 80px;
}


.hero-text-desktop {
  position: relative;
  z-index: 2;
  max-width: 1000px;
  padding: 2em;
  color: white;
  margin-top: -100px;
  line-height: 1.9em;
  display: block;
}

#hero-text-mobile {
  display: none;
  position: relative;
  z-index: 2;
  padding: 1.5em;
  color: white;
  line-height: 1.6em;
  height: calc(100vh - 80px);
  margin-top: 80px;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
}

#hero-text-mobile .hero-slide {
  position: relative;
  height: calc(100vh - 80px);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  padding: 0 1.5rem 2rem;
  color: white;
}

#hero-text-mobile .hero-slide-body {
  margin-top: 20vh;
  text-align: center;
  line-height: 1.6;
}


/* =====================
   CONTACT PANEL & OVERLAY
===================== */
.contact-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(4px);
  z-index: 998;
}

.contact-panel {
  position: fixed;
  top: 0;
  right: -100%;
  width: 40%;
  height: 100vh;
  background-color: white;
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
  z-index: 999;
  transition: right 0.4s ease;
}

.contact-panel.active {
  right: 0;
}

.contact-overlay.active {
  display: block;
}

.contact-content {
  padding: 40px;
  height: 100%;
  overflow-y: auto;
  position: relative;
  margin-bottom: 20px;
}

.contact-content h2 {
  font-size: 12px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.contact-content .row {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.contact-content input,
.contact-content select,
.contact-content textarea {
  width: 100%;
  padding: 10px 0;
  margin-bottom: 15px;
  font-size: 13px;
  border: none;
  border-bottom: 1px solid #ccc;
  background: transparent;
  outline: none;
}

.contact-content form textarea {
  height: auto;
  resize: none;
}

.contact-content button {
  font-size: 12px;
  padding: 12px 20px;
  text-transform: uppercase;
  border: 1px solid black;
  color: #000;
  background: none;
  cursor: pointer;
  width: 100%;
}

.contact-content .close-contact {
  background: none;
  border: none;
  font-size: 13px;
  text-transform: uppercase;
  cursor: pointer;
  position: absolute;
  top: 0;
  right: 0;
  text-align: end;
}

/* =====================
   GRID SECTION
===================== */
.background {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  box-sizing: border-box;
}

.background-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(155, 155, 155, 0.04);
  pointer-events: none;
  z-index: 1;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
  /* padding: 2vmin; */
  box-sizing: border-box;
  border-collapse: collapse;
  background-color: white;
}

.grid-cell {
  position: relative;
  width: 100%;
  padding-top: 133.33%;
  /* 3:4 ratio (4/3 = 1.3333) */
  overflow: hidden;
}

.grid-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* =====================
   MEDIA QUERIES
===================== */
@media (max-width: 768px) {
  .nav-container {
    justify-content: center;
    align-items: center;
    position: relative;
  }

  .hamburger {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 300;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    color: black;
  }

  body.menu-open .hamburger span:nth-child(1) {
    transform: rotate(45deg);
    position: absolute;
    background: black;
  }

  body.menu-open .hamburger span:nth-child(2) {
    opacity: 0;
    background: black;
  }

  body.menu-open .hamburger span:nth-child(3) {
    transform: rotate(-45deg);
    position: absolute;
    background: black;
  }

  header.dark .hamburger span {
    background: white;
  }

  .hamburger span {
    height: 3px;
    width: 24px;
    background: black;
    /* default nero */
    margin: 5px 0;
    transition: all 0.3s ease;
    transform-origin: center;
    display: block;
  }

  .logo {
    margin: 0 auto;
    position: relative;
    z-index: 200;
  }

  .contact-panel.active {
    width: 100%;
  }

  .left-menu,
  .right-menu {
    display: none;
  }

  header {
    padding-top: 20px;
  }

  .nav-container {
    position: relative;
    justify-content: center;
    align-items: center;
  }

  .hamburger {
    display: flex;
    color: black;
    z-index: 300;
  }

  body.menu-open .mobile-menu {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: fixed;
    inset: 0;
    background-color: white;
    z-index: 150;
    margin-top: -150px;
  }

  body.menu-open .mobile-menu a {
    font-size: 24px;
    text-transform: uppercase;
    color: black;
    margin: 20px 0;
    text-decoration: none;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  #contact-panel {
    display: flex;
    flex-direction: column;
  }

  #contact-panel .contact-content {
    flex: 1;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
  }

  .hero-text-desktop {
    display: none !important;
  }

  #hero-text-mobile {
    display: block;
  }

  .hero-slide {
    height: calc(100vh - 80px);
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    padding: 1.7rem 1.2rem;
    color: white;
  }

}

@media (max-width: 480px) {
  .grid {
    grid-template-columns: 1fr;
  }
}


section {
  padding: 100px 40px;
  max-width: 1000px;
  margin: 0 auto;
}

.contact-image {
  width: 100%;
  height: 180px;
  background-image: url("./images/facciata-bellissima.jpg");
  /* percorso immagine */
  background-size: cover;
  background-position: center;
  margin: 30px 0;
}

.scroll-indicator {
  position: absolute;
  bottom: 15%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  gap: 8px;
  justify-content: center;
  font-size: 13px;
  color: white;
  opacity: 0.85;
  pointer-events: none;
  animation: bounce 1.4s ease-in-out 0s 2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.scroll-indicator .arrow {
  font-size: 18px;
  line-height: 1;
}

.scroll-indicator.direction-up .arrow:first-child {
  animation-name: bounce-up;
}

.scroll-indicator.direction-down .arrow:last-child {
  animation-name: bounce;
}

.scroll-indicator.direction-both .arrow:first-child {
  animation-name: bounce-up;
}

.scroll-indicator.direction-both .arrow:last-child {
  animation-name: bounce;
}

@keyframes bounce {

  0%,
  100% {
    transform: translate(-50%, 0);
  }

  50% {
    transform: translate(-50%, 5px);
  }
}

@keyframes bounce-up {

  0%,
  100% {
    transform: translate(-50%, 0);
  }

  50% {
    transform: translate(-50%, -5px);
  }
}