@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=DM+Serif+Display:ital@0;1&display=swap");
:root {
  --font-family: "DM Sans", sans-serif;
  --font-title: "DM Serif Display", serif;
  --panna: #f3f3f3;
  --marrone: #472a29;
  --grigio: #4b4643;
  --font-color: black;
  --giallo: #e0d8be;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

a {
  text-decoration: none !important;
}

body {
  font-family: var(--font-family);
  color: var(--grigio);
}

main {
  overflow: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-title);
  color: var(--font-color);
}

h1 {
  font-size: 4rem !important;
  line-height: 3rem !important;
}

h2 {
  font-size: 3.5rem !important;
  line-height: 3rem !important;
}

@media (max-width: 520px) {
  h1 {
    font-size: 3rem !important;
    line-height: 3rem !important;
  }

  h2 {
    font-size: 2.8rem !important;
    line-height: 2.8rem !important;
  }
}

@media (max-width: 390px) {
  h1 {
    font-size: 2.8rem !important;
    line-height: 3rem !important;
  }

  h2 {
    font-size: 2.5rem !important;
    line-height: 2.5rem !important;
  }
}

.scrollup {
  position: fixed;
  background-color: transparent;
  left: 1rem;
  bottom: 50px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 100;
  transition: bottom 0.3s ease;
}

.img-cta {
  width: 3rem;
  height: 3rem;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  box-shadow: rgba(0, 0, 0, 0.16) 0px 3px 6px, rgba(0, 0, 0, 0.23) 0px 3px 6px;
  border-radius: 0.7rem;
}

.img-cta img {
  border: 1px solid var(--grigio);
  padding: 0.3rem;
  border-radius: 0.7rem;
  background-color: white;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.show-scroll {
  bottom: 3rem;
}

.scrollup {
  animation: pulse 3s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/*BARRA*/
.barra {
  height: 3rem;
  position: sticky;
  top: 0;
  left: 0;
  background-color: var(--giallo);
  z-index: 2;
  padding: 0.6rem 0;
}

@media (max-width: 520px) {
  .barra {
    padding: 0.8rem 0;
  }
}

header {
  position: fixed;
  top: 3rem;
  left: 0;
  width: 100%;
  z-index: 999;
  background-color: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

@media (max-width: 350px) {
  header {
    top: 4.5rem;
  }

  .barra {
    height: 4.5rem;
  }
}

.link-barra {
  color: var(--grigio);
}

.navbar-toggler {
  border: none;
}

.navbar-toggler:focus {
  box-shadow: none !important;
}

.nav-link {
  color: black !important;
  font-weight: 400 !important;
}

/* ------ Stile dei link del menu (desktop) ------ */
.navbar-nav .nav-item {
  margin-left: 1rem;
  margin-right: 1rem;
}

.navbar-nav .nav-link {
  position: relative;
  color: var(--grigio);

  padding-bottom: 5px;
  transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
  color: black;
}

.navbar-nav .nav-link::after {
  content: "";
  position: absolute;
  width: 0%;
  height: 1px;
  bottom: 0;
  left: 0;
  background-color: black;
  transition: width 0.3s ease;
}

.navbar-nav .nav-link:hover::after {
  width: 100%;
}

/* ------ Responsive: max 1023px ------ */
@media (max-width: 1023px) {
  .barra .col-auto:not(:nth-child(3)):not(:last-child) {
    display: none;
  }

  .barra .col-auto:nth-child(3),
  .barra .col-auto:last-child {
    display: block;
  }

  .navbar-nav {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
  }

  .navbar-nav .nav-item {
    width: 100%;
    margin-bottom: 10px;
    margin-left: 0;
    margin-right: 0;
    text-align: center;
  }

  .navbar-nav .nav-link {
    display: inline-block; /* Perché la linea si adatti al testo */
    position: relative; /* Per posizionare il ::after */
    padding: 10px 0;
    color: var(--grigio);
    transition: color 0.3s ease;
  }

  .navbar-nav .nav-link::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: black;
    transition: width 0.4s ease-in-out;
  }

  .navbar-nav .nav-link:hover {
    color: black;
  }

  .navbar-nav .nav-link:hover::after {
    width: 100%; /* Solo quanto il testo */
  }
}

/*HERO*/
.marrone {
  color: var(--marrone) !important;
}

.box-text-hero {
  margin: 0 auto;
  max-width: 820px;
}

.box-cta {
  margin: 0 auto !important;
  max-width: 480px;
}

.button-cta {
  background-color: var(--giallo);
  border: none;
  border-radius: 4rem !important;
  padding: 1rem 1.5rem;
  width: 100%;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
}

.button-sezione-3 {
  display: inline !important;
  width: auto;
}

.button-cta a {
  color: var(--grigio);
  font-weight: 500;
  text-decoration: none;
}

/*SEZIONE 2*/
.panna {
  background-color: var(--panna);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.box-card {
  margin: 0 auto !important;
  max-width: 1024px;
}

.card-servizi {
  background-color: white;
}

.shadow-custom {
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
}

/*FOOTER*/
footer {
  background-color: var(--giallo);
}

small {
  color: black;
}
small a {
  color: black;
  text-decoration: underline !important;
}

li a {
  color: black;
}

/*SALA DEL COMMIATO*/
.hero-funerale {
  position: relative;
  width: 100%;
  overflow: hidden;
  z-index: -1;
}

.hero-funerale picture,
.hero-funerale img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(90%);
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 2rem;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
}

@media (min-width: 781px) {
  .hero-overlay {
    align-items: flex-start;
    text-align: left;
    padding-left: 4rem;
  }
}

@media (max-width: 780px) {
  .hero-overlay {
    align-items: center;
    text-align: center;
    padding: 0 1rem;
  }
}

@media (min-width: 992px) {
  .modal-main-img {
    max-height: 65vh;
    object-fit: contain;
  }
}

.image-wrapper {
  position: relative;
  filter: brightness(0.8);
  height: 350px; /* Altezza fissa */
  overflow: hidden;
  z-index: 1;
}

.image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 767.98px) {
  .image-wrapper {
    height: 250px;
  }
}

.button-cta {
  color: black;
}

/*SERVIZI FUNEBRI*/
.service-icon {
  width: 50%;
  height: auto;
}

@media (max-width: 768px) {
  .service-icon {
    width: 25%;
  }
}

/*NECROLOGI*/
.container-necrologi {
  max-width: 540px;
  margin: 0 auto;
}

.button-necrologi {
  display: inline-block !important;
  width: auto;
}
