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

html {
  scroll-behavior: smooth;
}

body {
  font-family: Inter, sans-serif;
  background: #f5efe6;
  color: #3b3128;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

/* HEADER */

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 70px;
  background: #efe6da;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.logo img {
  height: 64px !important;
  width: 64px !important;
  object-fit: cover !important;
  border-radius: 50% !important;
  border: 1px solid #000 !important; /* Thinner border */
  background: #fff !important;
  flex-shrink: 0 !important;
}

.titolo {
  font-family: "Playfair Display", serif;
  font-size: 22px;
  line-height: 1.1;
}

.titolo span {
  font-size: 14px;
  display: block;
  margin-top: 2px;
}

nav {
  flex: 1;
}

nav ul {
  display: flex;
  justify-content: flex-end;
  gap: 35px;
  list-style: none;
  padding-left: 0;
  flex-wrap: wrap;
}

nav a {
  text-decoration: none;
  color: #3b3128;
  font-size: 16px;
  transition: opacity 0.2s ease;
}

nav a:hover {
  opacity: 0.7;
}

/* HERO */

.hero-wrapper {
  background: #f5efe6;
  padding: 36px 58px 0 58px;
}

.hero {
  position: relative;
  max-width: 1450px;
  margin: 0 auto;
  height: 76vh;
  min-height: 520px;
  overflow: hidden;
  border-radius: 4px;
}

.hero-slider {
  position: absolute;
  inset: 0;
}

.hero-slider img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease;
  filter: brightness(1.15) saturate(1.2) contrast(1.05);
}

.hero-slider img.active {
  opacity: 1;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
      rgba(0, 0, 0, 0.28) 0%,
      rgba(0, 0, 0, 0.16) 32%,
      rgba(0, 0, 0, 0.08) 58%,
      rgba(0, 0, 0, 0.10) 100%);
  pointer-events: none;
  z-index: 1;
}

.hero-text {
  position: absolute;
  top: 50%;
  left: 7%;
  right: auto;
  transform: translateY(-50%);
  max-width: 560px;
  color: white;
  text-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
  z-index: 2;
}

.hero h1 {
  font-family: "Playfair Display", serif;
  font-size: 64px;
  line-height: 1.08;
  margin-bottom: 18px;
  color: white;
  font-weight: 700;
}

.hero p {
  font-size: 20px;
  line-height: 1.65;
  color: white;
  max-width: 460px;
}

/* FRECCE */

.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  user-select: none;
  z-index: 3;
  transition: all 0.25s ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.arrow:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-50%) scale(1.05);
}

.arrow.left {
  left: 12px;
}

.arrow.right {
  right: 12px;
}

/* SECTIONS */

section {
  padding: 90px 90px;
}

/* TORRE */

.torre {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.torre h2 {
  font-family: "Playfair Display", serif;
  font-size: 42px;
  margin-bottom: 25px;
}

.torre p {
  font-size: 18px;
  line-height: 1.8;
}

.torre img {
  width: 100%;
  border-radius: 8px;
  filter: brightness(1.15) saturate(1.2) contrast(1.05);
}

/* GALLERY */

.gallery-title {
  font-family: "Playfair Display", serif;
  font-size: 40px;
  margin-bottom: 35px;
}

.gallery {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-behavior: smooth;
}

.gallery img {
  height: 180px;
  width: auto;
  border-radius: 8px;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.3s ease;
  filter: brightness(1.15) saturate(1.2) contrast(1.05);
}

.gallery img:hover {
  transform: scale(1.05);
}

.gallery::-webkit-scrollbar {
  height: 8px;
}

.gallery::-webkit-scrollbar-thumb {
  background: #c5b8a5;
  border-radius: 10px;
}

/* VISITE */

.visite {
  background: #efe6da;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
}

.visite h2 {
  font-family: "Playfair Display", serif;
  font-size: 40px;
  margin-bottom: 20px;
}

.visite p {
  font-size: 18px;
  line-height: 1.8;
}

.phone {
  font-size: 24px;
  font-weight: 600;
  margin-top: 15px;
  word-break: break-word;
}

/* FOOTER */

footer {
  text-align: center;
  padding: 40px 20px;
  background: #e6ded4;
  font-size: 15px;
}

/* RESPONSIVE */

@media (max-width: 1200px) {
  header {
    padding: 18px 40px;
  }

  .hero-wrapper {
    padding: 28px 32px 0 32px;
  }

  .hero {
    height: 70vh;
    min-height: 500px;
  }

  .hero-text {
    left: 7%;
    max-width: 520px;
  }

  .hero h1 {
    font-size: 54px;
  }

  .hero p {
    font-size: 18px;
    max-width: 430px;
  }

  section {
    padding: 75px 40px;
  }
}

@media (max-width: 900px) {
  header {
    padding: 18px 24px;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .logo {
    gap: 12px;
  }

  .logo img {
    height: 48px !important;
    width: 48px !important;
    border: 1px solid #000 !important;
    border-radius: 50% !important;
    object-fit: cover !important;
  }

  .titolo {
    font-size: 20px;
  }

  .titolo span {
    font-size: 13px;
  }

  nav {
    width: 100%;
  }

  nav ul {
    justify-content: flex-start;
    width: 100%;
    gap: 14px 22px;
  }

  nav a {
    font-size: 15px;
  }

  .hero-wrapper {
    padding: 18px 18px 0 18px;
  }

  .hero {
    height: 60vh;
    min-height: 430px;
  }

  .hero-text {
    top: 50%;
    left: 7%;
    right: 7%;
    transform: translateY(-50%);
    max-width: none;
  }

  .hero h1 {
    font-size: 42px;
    line-height: 1.1;
    margin-bottom: 14px;
  }

  .hero p {
    font-size: 17px;
    line-height: 1.6;
    max-width: 100%;
  }

  .arrow {
    width: 40px;
    height: 40px;
    font-size: 22px;
  }

  .arrow.left {
    left: 10px;
  }

  .arrow.right {
    right: 10px;
  }

  .torre {
    display: block;
    /* Removed flex-direction to avoid conflicts once image is hidden */
  }

  .torre img {
    display: none;
    /* Hide the tower image completely on mobile screens */
  }

  .visite {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  section {
    padding: 60px 24px;
  }

  .torre h2,
  .visite h2,
  .gallery-title {
    font-size: 34px;
  }

  .torre p,
  .visite p {
    font-size: 17px;
    line-height: 1.75;
  }

  .gallery {
    gap: 14px;
  }

  .gallery img {
    height: 160px;
  }

  .phone {
    font-size: 22px;
  }
}

@media (max-width: 600px) {
  header {
    padding: 16px 18px;
  }

  nav ul {
    gap: 10px 16px;
  }

  nav a {
    font-size: 14px;
  }

  .hero-wrapper {
    padding: 14px 14px 0 14px;
  }

  .hero {
    height: 72vw;
    min-height: 360px;
    max-height: 500px;
  }

  .hero-text {
    left: 8%;
    right: 8%;
  }

  .hero h1 {
    font-size: 34px;
    margin-bottom: 12px;
  }

  .hero p {
    font-size: 15px;
    line-height: 1.55;
  }

  .arrow {
    width: 34px;
    height: 34px;
    font-size: 18px;
  }

  .arrow.left {
    left: 8px;
  }

  .arrow.right {
    right: 8px;
  }

  section {
    padding: 48px 18px;
  }

  .torre h2,
  .visite h2,
  .gallery-title {
    font-size: 28px;
    margin-bottom: 18px;
  }

  .torre p,
  .visite p {
    font-size: 16px;
    line-height: 1.7;
  }

  .gallery {
    gap: 12px;
  }

  .gallery img {
    height: 130px;
    border-radius: 6px;
  }

  .phone {
    font-size: 20px;
  }

  footer {
    padding: 28px 18px;
    font-size: 14px;
  }
}



/* SEZIONE STORIA */
.storia-container {
  background: #efe6da;
  padding: 90px 70px;
}

.storia-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px;
  margin-top: 40px;
}

.storia-item {
  background: #fdfaf6;
  padding: 20px;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2d7c7;
  transition: transform 0.3s ease;
}

.storia-item:hover {
  transform: translateY(-5px);
}

.storia-item img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 2px;
  margin-bottom: 15px;
  filter: sepia(0.2) contrast(1.1);
}

.storia-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 50px auto;
}

.storia-header h2 {
  font-family: "Playfair Display", serif;
  font-size: 42px;
  margin-bottom: 20px;
}

/* MODAL STORIA SPECIFICO */
.storia-modal-content {
  max-width: 800px;
  text-align: left;
  line-height: 1.8;
}

.storia-modal-content h2 {
  margin-top: 20px;
  margin-bottom: 15px;
}

.storia-modal-image {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  border-radius: 4px;
  background: #fdfaf6;
}

.storia-modal-text {
  font-size: 17px;
  color: #3b3128;
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 15px;
}

.storia-modal-text p {
  margin-bottom: 20px;
}

.btn-archivio {
  display: inline-block;
  margin-top: 30px;
  padding: 12px 30px;
  background: #3b3128;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-family: "Outfit", sans-serif;
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn-archivio:hover {
  background: #5d4e40;
  transform: translateY(-2px);
}

@media (max-width: 900px) {
  .storia-container {
    padding: 60px 24px;
  }

  .storia-header h2 {
    font-size: 34px;
  }
}

/* PNRR SECTION STYLES */
.pnrr-container {
  background: #fff;
  padding: 80px 40px;
  text-align: center;
}

.pnrr-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 40px;
  margin-bottom: 40px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.pnrr-logo-item {
  flex: 1 1 180px;
  max-width: 250px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.pnrr-logo-item img {
  max-height: 140px;
  width: auto;
  object-fit: contain;
  filter: grayscale(0.5);
  transition: filter 0.3s ease;
}

.pnrr-logo-item img:hover {
  filter: grayscale(0);
}

.pnrr-text {
  font-size: 14px;
  color: #777;
  max-width: 900px;
  margin: 0 auto;
  line-height: 1.6;
}

.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
  z-index: 2000;
  backdrop-filter: blur(5px);
}

.popup-overlay.show {
  opacity: 1;
  visibility: visible;
}

.popup-content {
  background: #fdfaf6;
  padding: 40px;
  border-radius: 8px;
  position: relative;
  max-width: 90%;
  max-height: 90%;
  overflow: auto;
}

.popup-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 30px;
  cursor: pointer;
  color: #3b3128;
}

/* HOME PAGE REFINEMENTS */
.home-section-title {
  text-align: center;
  margin-bottom: 50px;
}

.home-section-title h2 {
  font-family: "Playfair Display", serif;
  font-size: 56px;
  color: #3b3128;
}

.torre-description-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  max-width: 1200px;
  margin: 60px auto 0 auto;
}

.torre-text-content p {
  text-align: justify;
  font-size: 18px;
  line-height: 1.8;
  color: #4a3f35;
}

.torre-image-container {
  position: relative;
}

.torre-image-container img {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* RESPONSIVE ADDITIONS FOR HOME SECTION */
@media (max-width: 1250px) {
  .torre-description-grid {
    gap: 40px;
    padding: 0 40px;
  }

  .home-section-title h2 {
    font-size: 48px;
  }
}

@media (max-width: 1024px) {
  .torre-description-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }

  .torre-text-content p {
    text-align: center !important;
  }

  .torre-image-container {
    max-width: 600px;
    margin: 0 auto;
  }
}

@media (max-width: 600px) {
  .home-section-title h2 {
    font-size: 36px;
    margin-bottom: 30px;
  }

  .torre-description-grid {
    margin-top: 30px;
    padding: 0 10px;
    gap: 30px;
  }

  .torre-text-content p {
    font-size: 16px;
    line-height: 1.7;
  }

  .home-section-title {
    margin-bottom: 20px;
  }
}

/* REFINED VISITE SECTION */
.visite-hero {
  background: linear-gradient(rgba(59, 49, 40, 0.7), rgba(59, 49, 40, 0.7)), url('immagini/esterni/1.jpg');
  background-size: cover;
  background-position: center;
  padding: 120px 20px;
  text-align: center;
  color: #fff;
}

.visite-hero h1 {
  font-family: "Playfair Display", serif;
  font-size: 52px;
  margin-bottom: 20px;
}

.visite-content {
  max-width: 1100px;
  margin: -60px auto 90px auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  padding: 0 20px;
  position: relative;
  z-index: 10;
}

.visite-card {
  background: #fff;
  padding: 45px;
  border-radius: 8px;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.08);
  border: 1px solid #eee;
}

.visite-card h3 {
  font-family: "Playfair Display", serif;
  font-size: 28px;
  margin-bottom: 20px;
  color: #3b3128;
  border-bottom: 2px solid #efe6da;
  padding-bottom: 15px;
}

.visite-card p,
.visite-card ul {
  font-size: 17px;
  line-height: 1.8;
  color: #555;
}

.visite-card ul {
  list-style: none;
  padding: 0;
}

.visite-card ul li {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.visite-card ul li::before {
  content: "•";
  color: #c5b8a5;
  font-size: 20px;
}

.whatsapp-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #25d366;
  color: #fff;
  padding: 14px 28px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  margin-top: 25px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.whatsapp-btn:hover {
  background: #128c7e;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
  color: #fff;
}

@media (max-width: 850px) {
  .visite-content {
    grid-template-columns: 1fr;
    margin-top: -30px;
  }

  .visite-hero h1 {
    font-size: 40px;
  }
}