/* RESET E BASE */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* Importazione font Inter da Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap');

:root {
  --accent-color: #FFF6D7;
  --white: #ffffff;
  --black: #000000;
  --third: #B0936B;
}

/* Responsive breakpoints */
:root {
  --mobile: 480px;
  --tablet: 820px;
  --desktop: 1024px;
}

html {
  scroll-behavior: smooth;
}

body,
html {
  font-family: 'Inter', sans-serif;
  color: var(--black)!important;
  height: 100%;
  overflow-x: hidden;
}

/* Disabilita lo scroll-snap su mobile per evitare problemi */
@media (min-width: 821px) {
  body, html {
    scroll-snap-type: y mandatory;
  }
}

/* SEZIONI GENERICHE */
.section {
  width: 100%;
  position: relative;
  overflow: hidden;
}

@media (min-width: 821px) {
  .section {
    scroll-snap-align: start;
  }
}

/* SEZIONE HERO (prima sezione in alto) */
.hero {
  background: url("../img/sfondo/1.png") no-repeat center center/cover;
  padding: 45px;
  height: 100dvh;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.carousel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.carousel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0) 30%);
  z-index: 2;
  pointer-events: none;
}

.carousel-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.carousel-image::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0) 30%);
  pointer-events: none;
}

.carousel-image.active {
  opacity: 1;
}

@media (max-width: 768px) {
  .hero {
    padding: 20px;
    height: auto;
    min-height: 100vh;
  }
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo-svg {
  height: 100px;
}

@media (max-width: 768px) {
  .logo-svg {
    height: 70px;
  }
}

@media (max-width: 480px) {
  .logo-svg {
    height: 50px;
  }
}

a,
a:active,
a:visited {
  color: var(--accent-color);
  text-decoration: none;
  border-bottom: 1px solid;
  padding-bottom: 3px;
}

/* Mobile menu button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--accent-color);
  cursor: pointer;
  z-index: 1000;
  padding: 15px;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
  margin: 0;
  outline: none;
  box-shadow: none;
  text-shadow: none;
  font-family: inherit;
  position: relative;
  width: 36px;
  height: 36px;
}

.menu-toggle:focus {
  outline: none;
}

.menu-toggle::-moz-focus-inner {
  border: 0;
}

/* Hamburger icon */
.menu-toggle span {
  display: block;
  position: absolute;
  height: 4px;
  width: 36px;
  background-color: var(--accent-color);
  border-radius: 4px;
  opacity: 1;
  left: 50%;
  transform: translateX(-50%) rotate(0deg);
  -webkit-transform: translateX(-50%) rotate(0deg);
  transition: .25s ease-in-out;
  -webkit-transition: .25s ease-in-out;
}

.menu-toggle span:nth-child(1) {
  top: 6px;
}

.menu-toggle span:nth-child(2) {
  top: 16px;
}

.menu-toggle span:nth-child(3) {
  top: 26px;
}

/* X icon when menu is active */
.menu-toggle.active span:nth-child(1) {
  top: 16px;
  transform: translateX(-50%) rotate(45deg);
  -webkit-transform: translateX(-50%) rotate(45deg);
}

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

.menu-toggle.active span:nth-child(3) {
  top: 16px;
  transform: translateX(-50%) rotate(-45deg);
  -webkit-transform: translateX(-50%) rotate(-45deg);
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
    position: relative;
    z-index: 1000;
  }
}

/* Navigation styles */
nav ul {
  list-style: none;
  display: flex;
  gap: 45px;
}

nav ul li {
  margin: 0;
}

nav ul li a {
  color: var(--accent-color);
  text-decoration: none;
  text-transform: uppercase;
  font-size: clamp(18px, 2vw, 30px);
  position: relative;
  border-bottom: none;
  padding-bottom: 0;
}

nav ul li a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 0;
  height: 1px;
  background-color: var(--accent-color);
  transition: width 0.3s ease;
}

nav ul li a:hover::after {
  width: 100%;
}

/* Tablet styles */
@media (max-width: 820px) {
  nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 998;
    transition: right 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  nav.active {
    right: 0;
  }

  nav ul {
    flex-direction: column;
    align-items: center;
    gap: 30px;
  }

  nav ul li a {
    font-size: clamp(24px, 4vw, 36px);
    padding: 10px;
  }
}

/* Mobile styles */
@media (max-width: 480px) {
  nav ul {
    gap: 20px;
  }

  nav ul li a {
    font-size: 20px;
  }
}

.date-container {
  display: flex;
  justify-content: space-between;
  font-size: 30px;
  color: var(--accent-color);
}

@media (max-width: 768px) {
  .date-container {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .date-container {
    font-size: 18px;
  }
}

.btn {
  position: relative;
  z-index: 2;
  padding: 15px 30px;
  border: none;
  font-size: 20px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.application-button-link {
  position: relative;
  z-index: 2;
  border: none;
}

.application-button {
  position: relative;
  z-index: 2;
  background-color: #C26730;
  color: white;
}

.regolamento-btn {
  background-color: #3B2E26;
  color: white;
}

/* SEZIONE INFO (seconda sezione: due colonne) */
.info-section,
.first-section,
.second-section,
.third-section {
  display: flex;
  width: 100%;
  min-height: 750px;
  align-items: stretch;
}

@media (min-width: 821px) {
  .info-section,
  .first-section,
  .second-section,
  .third-section {
    height: 100vh;
    scroll-snap-align: start;
  }
}

/* Definisco application-section separatamente senza scroll snap */
.application-section {
  position: relative;
  width: 100%;
  height: 80dvh;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Colonne: ognuna metà larghezza, piena altezza */
.info-column,
.info-first-column,
.info-second-column,
.info-third-column {
  width: 50%;
  display: flex;
  align-items: center;
  padding: 60px;
}

.info-block {
  width: 100%;
  display: flex;
  gap: 40px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.info-block > *:nth-child(1),
.info-block > *:nth-child(2) {
  flex: 1 1 calc(50% - 40px)!important; /* 50% width minus the gap */
  min-width: 200px; /* Minimum width to prevent too narrow columns */
}

.info-block > *:nth-child(3) {
  flex: 0 0 100%; /* Third child takes full width */
  margin-top: 40px; /* Add space above the third element */
}
.info-title {
  font-size: 24px;
  line-height: 1.4;
  flex: 0 0 280px;
  margin: 0;
}

.info-text {
  font-size: 18px;
  line-height: 1.6;
  flex: 1;
  margin: 0;
  max-width: 600px;
}

/* Medium screen styles */
@media (max-width: 1024px) {
  .info-block {
    flex-direction: column;
    gap: 20px;
  }

  .info-title {
    flex: none;
    margin-bottom: 15px;
    font-size: 22px;
    max-width: 100%;
  }

  .info-text {
    font-size: 17px;
    max-width: 100%;
  }

  .info-column,
  .info-first-column,
  .info-second-column,
  .info-third-column {
    padding: 40px;
  }
}

/* Tablet styles */
@media (max-width: 820px) {
  .info-section,
  .first-section,
  .second-section,
  .third-section {
    flex-direction: column;
    min-height: auto;
    height: auto;
  }

  .info-column,
  .info-first-column,
  .info-second-column,
  .info-third-column {
    width: 100%;
    padding: 60px 40px;
  }

  

  .first-section {
    display: flex;
    flex-direction: column;
  }

  .right-first-column {
    order: -1;
    min-height: 60vh;
  }

  .left-first-column {
    order: 2;
  }

  .info-block {
    max-width: 720px;
    margin: 0 auto;
  }
}

/* Mobile styles */
@media (max-width: 480px) {
  .left-second-column {
    min-height: 70vh;
  }

  .info-column,
  .info-first-column,
  .info-second-column,
  .info-third-column {
    padding: 40px 20px;
    height: 100dvh;
  }

  .info-block {
    flex-direction: column;
    gap: 20px;
  }

  .info-title {
    flex: none;
    margin-bottom: 20px;
    font-size: 22px;
  }

  .info-text {
    font-size: 16px;
    max-width: 100%;
  }

  .right-third-column {
    min-height: 70vh;
  }

  /* Footer mobile styles */
  .footer-content {
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 30px;
  }

  .footer-logo,
  .footer-languages,
  .footer-contact {
    flex: none;
    text-align: center;
  }

  .footer-contact h3 {
    margin-bottom: 5px;
  }
}

/* Specific column backgrounds */
.left-column {
  background-color: #f8f3e1;
  color: #333;
}

.right-column {
  background-color: #C26730;
  color: var(--white);
}

.left-first-column {
  background-color: #3B2E26;
  color: var(--accent-color);
}

.right-first-column {
  background: url("../img/sfondo/2.png") no-repeat center bottom/cover;
}

.left-second-column {
  background: url("../img/sfondo/6.jpg") no-repeat center center/cover;
}

.right-second-column {
  background-color: var(--accent-color);
  color: var(--black);
}

.left-third-column {
  background-color: var(--third);
  color: var(--accent-color);
  display: flex;
  align-items: center;
  padding: 60px;
}

.right-third-column {
  background: url("../img/sfondo/7.jpg") no-repeat center center/cover;
  display: flex;
  align-items: center;
  padding: 60px;
}
.submit-banner {
  position: absolute;
  left: 0;
  bottom: 120px;
  background: #F8F3E3;
  color: #3b2d26;
  font-size: 1.9rem;
  padding: 0.7rem 2.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  z-index: 10;
  border-radius: 0;
  box-shadow: none;
  display: inline-block;
  text-align: center;
}
@media (max-width: 900px) {
  .submit-banner {
      font-size: 1.1rem;
      padding: 0.5rem 1rem;
      left: 0;
      bottom: 100px;
  }
}
@media (max-width: 768px) {
  .application-section {
    height: 50vh;
    min-height: 400px;
  }

  .carousel,
  .carousel-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }

  .application-button {
    padding: 12px 20px;
    font-size: 16px;
  }
}

.application-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.application-button:hover {
  background-color: #e69500;
}

.footer {
  background-color: var(--black);
  color: var(--accent-color);
  padding: 10px 0;
  height:20dvh;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 45px;
  max-width: 1440px;
  margin: 0 auto;
  width: 90%;
  background: #000000;
}

.footer-logo {
  height: 50px;
  flex: 1;
}

.footer-languages {
  flex: 1;
  text-align: center;
}

.footer-contact {
  flex: 1;
  text-align: right;
}

.footer-contact h3 {
  margin-bottom: 10px;
}

@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    align-items: center;
    gap: 30px;
    padding: 40px 20px;
  }

  .footer-logo,
  .footer-languages,
  .footer-contact {
    flex: none;
    text-align: center;
  }

  .footer-contact h3 {
    margin-bottom: 5px;
  }
}

.footer-contact p {
  margin: 0;
}

/* Overlay for mobile menu */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 997;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

.section.residenti {
  background: #f8f3e1;
  padding: 50px;
}

.residenti-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2vw;
    max-width: 1800px;
    margin: 0 auto;
    padding:  2vw 2vw 3vw 2vw;
}

.residenti-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
}

.residenti-img {
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
    border-radius: 0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.residenti-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.residenti-info {
    width: 100%;
    text-align: left;
    background: none;
    color: #000;
    padding: 1.5vw 0 0 0;
}

.residenti-name {
    font-size: 1.25rem;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0;
    padding: 0;
}

@media (max-width: 1024px) {
    .residenti-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .residenti-name {
        font-size: 3vw;
    }
}
@media (max-width: 600px) {
    .residenti-grid {
        grid-template-columns: 1fr;
    }
    .residenti-name {
        font-size: 5vw;
    }
}