/* === Home Page === */
#home-page-video {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

#home-page-layer {
  position: absolute;
  z-index: 2;
  width: 100%;
  left: 0;
  top: 30%;
  text-align: center;
  background-color: rgba(255, 255, 255, 0.6);
  font-family: "Montserrat";
}

#home-page-layer:before,
#home-page-layer:after {
  content: '';
  position: absolute;
  width: 100%;
  height: 0.375rem;
  display: block;
}

#home-page-layer:before {
  top: -0.375rem;
  background-image: linear-gradient(to top, rgba(255, 255, 255, 0.6), transparent);
}

#home-page-layer:after {
  bottom: -0.375rem;
  background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.6), transparent);
}

#main-title,
#sub-title {
  max-width: 100%;
  padding: 0 5%;
  opacity: 0;
  animation: fadeIn 1s ease-out forwards;
  animation-delay: 0.4s;
}

#main-title {
  font-size: 2.75rem;
  margin-top: 1.3rem;
}

#sub-title {
  font-size: 1.75rem;
}

/* === Card Section === */
.container {
  max-width: 75rem;
  margin: 0 auto;
  padding: 0 1.875rem;
}

.section-title {
  font-size: 2.2rem;
  color: #333;
  margin: 0;
  text-align: center;
}

.card-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  padding: 1.25rem 1.25rem 0;
}

.card {
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 1rem;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-0.3125rem);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-image {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background-color: transparent;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: none;
  outline: none;
}

.card-content {
  padding: 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-title {
  font-size: 1.5rem;
  color: #333;
  margin: 0;
}

.card-description {
  font-size: 1rem;
  color: #555;
  text-align: justify;
  margin-bottom: 0;
}

.find-out-more {
  margin-top: auto;
}

/* === Animazioni === */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* === Media Queries === */
@media (max-width: 1023px) {

  /* Layout */
  .section:first-of-type {
    position: relative;
    width: 100%;
    height: 95vh;
    overflow: hidden;
  }

  /* Home Page */
  #home-page-layer {
    background-color: rgba(255, 255, 255, 0.8);
  }

  #main-title,
  #sub-title {
    padding: 0 2%;
    text-align: center;
  }

  #main-title {
    font-size: 1.8rem;
  }

  #sub-title {
    font-size: 1.2rem;
  }

  /* Card Section */
  .section-title {
    margin: 2rem 0 0;
    font-size: 2rem;
  }

  .card-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
  }

  .card {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 25rem;
    margin: 0 auto;
  }

  .card-title {
    font-size: 1.4rem;
  }

  /* Form Section */
  #message {
    min-height: 12.5rem;
  }
}

@media (max-width: 440px) {

  /* Home Page */
  #home-page-layer {
    top: 25%;
  }

  #main-title {
    font-size: 1.6rem;
    margin-top: 0.65rem;
  }

  #sub-title {
    font-size: 1rem;
  }

  /* Card Section */
  .container {
    padding: 0 !important;
  }

  .section-title {
    padding: 0 0.625rem;
    font-size: 1.8rem;
  }

  .card-description {
    font-size: 0.9rem;
  }
}

@media (max-width: 380px) {
  .container {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  .card-container {
    padding-left: 6px !important;
    padding-right: 6px !important;
  }
}