* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "EB Garamond";
  font-size: 18px;
  line-height: 1.6;
  color: #333;
  background: whitesmoke;
  min-height: 100vh;
}

/* Navbar fissa */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #822433;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  padding: 1.1rem 0;
  transition: all 0.3s ease;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-container img {
  height: 80px;
}

.logo {
  font-size: 2.3rem;
  font-weight: bold;
  color: whitesmoke;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-item {
  position: relative;
}

.nav-link {
  text-decoration: none;
  background: #822433;
  color: whitesmoke;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 25px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.nav-link:hover,
.nav-link.active {
  color: #822433;
  background: whitesmoke;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px whitesmoke;
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 4px;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: whitesmoke;
  border-radius: 3px;
  transition: all 0.3s ease;
}

/* Contenuto principale */
.main-content {
  margin-top: 80px;
  margin-bottom: 80px;
  min-height: calc(100vh - 160px);
  /* padding: 2rem; */
}

.page {
  display: none;
  max-width: 1500px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 3rem 5rem 5rem 5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  animation: fadeIn 0.5s ease-in-out;

  background-image: url(img/sfondo.jpg);
  background-position: center;
  background-repeat: repeat;
}

.page.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#home p,
#contact .section {
  background-color: #ffffd0;
  opacity: 0.65;
  color: black;
  font-size: 1.35rem;
  padding: 20px;
  border-radius: 15px;
}

#home p:last-child {
  margin-top: 30px;
}

#contact {
  text-align: center;
}

#contact a {
  text-decoration: none;
  color: inherit;
}

.sector {
  text-align: center;
}

.sector h1 {
  font-size: 3.5rem;
  margin-bottom: 1.2rem;
  color: #822433;
  font-weight: bold;
}

.sector h2 {
  font-size: 2.8rem;
  color: #822433;
  margin-bottom: 1rem;
  font-weight: bold;
}

.sector h3 {
  font-size: 1.7rem;
  border-radius: 15px;
  background-color: #822433;
  color: whitesmoke;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 0.4rem auto;
  grid-template-columns: 1fr 1fr 1fr;
  margin-bottom: 20px;
}

.feature-card {
  display: block;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  background: #ffffd0;
  border-radius: 15px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(102, 126, 234, 0.1);
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(117, 21, 30);
}

.feature-card h4,
.content-item h4,
.collapsible h4 {
  color: #822433;
  margin-top: 1rem;
  margin-bottom: 1rem;
  font-size: 1.3rem;
  text-align: center;
}

.feature-card p {
  margin: 1.2rem;
  text-align: center;
}

a {
  text-decoration: none;
}

/* Footer fisso */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #822433;
  z-index: 1000;
  max-height: 70px;
  display: flex;
  justify-content: flex-start;
}

.footer-content {
  max-width: 1200px;
  text-align: center;
  padding: 0 2rem;
  display: flex;
  align-items: center;
}

.footer p {
  color: whitesmoke;
  font-size: 1.5rem;
  justify-content: flex-end;
}

footer img {
  max-height: 50px;
  margin-left: 120px;
}

/* Responsive */
@media (max-width: 768px) {
  .logo {
    font-size: 1.9rem;
  }

  .hamburger {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 122px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 80px);
    background: whitesmoke;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 12rem;
    transition: left 0.3s ease;
    backdrop-filter: blur(10px);
  }

  .nav-menu.active {
    left: 0;
    padding-top: 10rem;
  }

  .nav-container {
    padding: 0 1rem;
  }

  .sector h1 {
    font-size: 3rem;
  }

  .sector h2 {
    font-size: 2.5rem;
  }

  .page {
    padding: 2rem 1rem;
    margin: 1rem;
  }

  /* .main-content {
    padding: 1rem;
  } */

  .feature-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }

  .footer {
    display: flex;
    justify-content: center;
  }

  .footer p {
    font-size: 0.6rem;
    justify-content: flex-end;
    max-height: fit-content;
  }

  footer img {
    margin-left: 0px;
  }
}

@media (max-width: 480px) {
  .sector h2 {
    font-size: 2rem;
  }

  .feature-card {
    padding: 1.5rem;
  }

  .footer {
    display: flex;
    justify-content: center;
  }

  .footer p {
    font-size: 0.6rem;
    justify-content: flex-end;
    max-height: fit-content;
  }
}

/*stile accordion*/
.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Default Desktop/Tablet Styles */
.hero .sector {
  color: white;
  border-radius: 8px;
}

.feature-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.trigger img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.collapsible p {
  color: #555;
  text-align: justify;
}

/* Hide accordion elements on desktop */
.chevron {
  display: none;
}

.collapsible-content {
  display: contents;
}

/* Mobile Styles - Accordion Active */
@media (max-width: 768px) {
  body {
    padding-top: 10px;
  }

  /* Hero becomes clickable on mobile */
  .hero {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
  }

  .hero h2:hover {
    background-color: white;
    color: #822433;
  }

  .hero .sector h2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 2rem;
  }

  .hero.active h2 {
    background-color: white;
    color: #822433;
    border-radius: 8px 8px 0 0;
    margin-bottom: 0;
  }

  /* Show chevron on mobile */
  .chevron {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 1.2rem;
  }

  .hero.active .chevron {
    transform: rotate(180deg);
  }

  /* Grid becomes accordion container on mobile */
  .feature-grid {
    display: block;
    grid-template-columns: none;
    gap: 0;
    background: white;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.8s ease;
  }

  .feature-grid.show {
    max-height: 2000px;
    /* padding: 20px; */
  }

  /* Trigger becomes clickable */
  .trigger {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
  }

  .feature-card img {
    height: 100%;
    width: 100%;
  }

  .feature-card img:hover {
    transform: none;
  }

  /* Collapsible content setup */
  .collapsible-content {
    display: block;
    max-height: 0;
    overflow: hidden;
    transition: all 0.8s ease;
  }

  .collapsible-content.show {
    max-height: 1000px;
    margin-top: 15px;
  }

  /* Individual collapsible cards */
  .collapsible {
    margin-bottom: 15px;
    transform: translateY(10px);
    opacity: 0;
    transition: all 0.6s ease;
  }

  .collapsible:hover {
    border-color: #822433;
  }

  .collapsible.show {
    transform: translateY(0);
    opacity: 1;
  }

  .collapsible h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
  }

  .collapsible p {
    font-size: 0.8rem;
  }
}

/* Extra small mobile */
@media (max-width: 480px) {
  .hero h2 {
    font-size: 1.2rem;
  }

  .feature-grid.show {
    padding: 15px;
  }

  .trigger {
    padding: 15px;
  }

  .trigger img {
    height: 100%;
  }

  .collapsible {
    padding: 15px;
  }

  .collapsible h3 {
    font-size: 1.1rem;
  }

  .collapsible p {
    font-size: 0.7rem;
  }
}

/*accordion video*/
.section {
  margin-bottom: 15px;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.content {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.content-item {
  flex: 1;
  min-width: 300px;
  min-height: 350px;
  padding: 20px;
  background: white;
  position: relative;
  margin-top: 1.5rem;
  border-radius: 15px;
}

.content-item:first-child {
  margin-right: 10px;
}

.content-item:last-child {
  margin-left: 10px;
}

.content-item p {
  color: #666;
  line-height: 1.6;
  font-size: 1rem;
  text-align: center;
  margin-top: 100px;
}

/* Desktop: tutti i contenuti visibili */
@media (min-width: 769px) {
  .content {
    display: flex !important;
  }
}

/* Mobile: accordion behavior */
@media (max-width: 768px) {
  .content {
    display: none;
    flex-direction: column;
    animation: slideDown 0.3s ease-out;
  }

  .content.active {
    display: flex;
  }

  .content.active .trigger::after {
    transform: translateY(-50%) rotate(45deg);
  }

  iframe {
    height: 100%;
    width: 100%;
  }
}