/* CSS Reset e base */
body, h1, ul, li, p {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
    color: #333;
}

p {
    line-height: 1.7;
    font-size: 15px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

main > section,
main > .row,
main > .container > section {
  margin-bottom: 3rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee; /* opzionale per separare visivamente */
}

.container {
  padding: 1rem 2rem;
}

/* Container comune */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* HEADER */
.site-header {
  position: sticky;
  top: 0;
  width: 100%;
  background-color: #f8f8f8;
  z-index: 1000;
  border-bottom: 1px solid #ddd;
  transition: padding 0.3s ease, background-color 0.3s ease;
  /*padding: 0;*/
  height: 80px;
  transition: height 0.3s ease;
}

.site-header .logo img {
  max-height: 60px;
  transition: max-height 0.3s ease;
}

.site-header.shrink {
  padding: 5px 0;
}

.site-header.shrink .logo img {
  max-height: 40px;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  transition: padding 0.3s ease;
}

.site-header.shrink .header-content {
  padding: 5px 15px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #005a87;
}

.logo {
    display: inline-block;
    line-height: 0;
    max-height: 80px;
    padding-right: 10px;
}

.logo img {
    max-height: 60px;
    height: auto;
    width: auto;
}

nav ul {
    list-style: none;
    display: flex;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    text-decoration: none;
    color: #333;
    transition: color 0.3s;
}

nav ul li a:hover {
    color: #005a87;
}

/* Nascondi toggle su desktop */
.menu-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
}

/* Stile menu per mobile */
@media (max-width: 991px) {
    nav {
        position: relative;
    }

    .menu-toggle {
        display: block;
    }

    #nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        background-color: #f8f8f8;
        width: 200px;
        border: 1px solid #ddd;
        border-radius: 4px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        padding: 10px 0;
    }

    #nav-menu.open {
        display: block;
    }

    #nav-menu li {
        margin: 10px 0;
        text-align: left;
        padding: 0 20px;
    }
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 30px;
  height: 30px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1100;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: #005a87;
  border-radius: 2px;
  transition: all 0.3s ease;
  margin: 6px 0; /* spazio verticale tra le linee */
}

/* Effetto X quando attivo */
.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translateY(13px); /* prima era 6px */
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translateY(-12px); /* prima era -6px */
}

/* NAV responsive */
.main-nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
  padding: 0;
  margin: 0;
}

.main-nav a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
}

@media (max-width: 992px) {
  .menu-toggle {
    display: block;
  }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #f8f8f8;
    display: none;
    flex-direction: column;
    text-align: center;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
  }

  .main-nav.active {
    display: flex;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 15px;
  }
}

/* HERO SECTION */
.hero {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    color: #fff;
    padding: 0;
    text-align: center;
    margin-top: 0;
}

.hero-content h1 {
    font-size: 42px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.btn {
    display: inline-block;
    background-color: #005a87;
    color: #fff;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #003e5f;
}

.hero .breadcrumb {
  position: absolute;
  top: 15px;
  left: 20px;
  font-size: 14px;
  color: #fff;
  background-color: rgba(0, 90, 135, 0.5);
  padding: 5px 10px;
  border-radius: 4px;
  z-index: 10;
}

.hero .breadcrumb a {
  color: #fff;
  text-decoration: underline;
}

.hero .breadcrumb span {
  color: #eee;
}

/* MAIN CONTENT */
.features {
    display: flex;
    gap: 20px;
    margin: 40px auto;
    text-align: center;
}

.feature-item {
    flex: 1;
    background-color: #f1f1f1;
    padding: 40px 20px;
    border-radius: 5px;
    transition: box-shadow 0.3s;
}

.feature-item:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Intro Home */
.intro {
    margin: 40px auto;
    text-align: center;
}

.intro h2 {
    font-size: 28px;
    color: #005a87;
    margin-bottom: 15px;
}

.intro p {
    font-size: 16px;
    line-height: 1.6;
    color: #444;
}

/* Ultime strutture */
.latest-structures {
    margin: 60px auto;
}

.latest-structures h2 {
    font-size: 24px;
    margin-bottom: 30px;
    color: #005a87;
    text-align: center;
}

.structure-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.structure-card {
    background: #f9f9f9;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.structure-card:hover {
    transform: translateY(-4px);
}

.structure-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.structure-card h3 {
    font-size: 18px;
    margin: 15px;
    color: #333;
}

.structure-card .location,
.structure-card .categories {
    font-size: 14px;
    margin: 0 15px 10px;
    color: #666;
}

.regioni {
    margin: 60px auto;
    text-align: center;
}

.regioni h2 {
    font-size: 24px;
    margin-bottom: 30px;
    color: #005a87;
}

.region-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    justify-content: center;
    padding: 0 10px;
}

.region-buttons a {
    display: block;
    padding: 12px 15px;
    background-color: #e0f0f7;
    color: #005a87;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.region-buttons a:hover {
    background-color: #005a87;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}


/* FOOTER */
.main-footer {
    background-color: #f8f8f8;
    color: #333;
    padding: 40px 0 20px;
    font-size: 14px;
    border-top: 1px solid #ddd;
}

.footer-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: space-between;
}

.footer-col {
    flex: 1 1 220px;
    min-width: 220px;
}

.footer-col h4 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #005a87;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li {
    margin-bottom: 6px;
}

.footer-col ul li a {
    text-decoration: none;
    color: #333;
    transition: color 0.3s;
}

.footer-col ul li a:hover {
    color: #005a87;
}

.footer-logo {
    max-width: 100px;
    margin: 10px 0;
}

.footer-menu {
    background-color: #eaeaea;
    padding: 15px 0;
    margin-top: 40px;
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
}

.footer-menu ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    list-style: none;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.footer-menu ul li a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-menu ul li a:hover {
    color: #005a87;
}

.footer-bottom {
    text-align: center;
    padding: 15px 0 0;
    color: #777;
    font-size: 13px;
}

/* Responsive footer */
@media (max-width: 768px) {
    .footer-columns {
        flex-direction: column;
    }
}


.hero {
    position: relative;
    width: 100%;
    height: 500px; /* puoi cambiare l'altezza a tuo piacimento */
    overflow: hidden;
}

/* Adatta automaticamente altezza su smartphone/tablet */
@media (max-width: 768px) {
    .hero {
        height: 400px;
    }
}

@media (max-width: 375px) {
    .hero {
        height: 300px;
    }
}

/* Immagine responsive con taglio laterale */
.hero picture,
.hero img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* questo fa tutto il lavoro */
    object-position: center; /* centratura immagine */
    display: block;
}

/* contenuto testuale centrato sull'immagine */
.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #fff;
    width: 90%;
    padding: 10px;
    background: rgba(0,0,0,0.4);
    border-radius: 5px;
}

.hero-content h1 {
    margin-bottom: 15px;
    font-size: 2rem;
}

.btn {
    display: inline-block;
    background-color: #005a87;
    color: #fff;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #003e5f;
}
