/* Palazzo Coppola - Custom styles */

html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  position: relative;
}

/* Su mobile riduce il tracking estremo per evitare overflow del testo */
@media (max-width: 640px) {
  .tracking-widest2 { letter-spacing: 0.2em; }
  .tracking-wider2  { letter-spacing: 0.14em; }
}

/* Smooth fade */
.fade-in { animation: fadeIn 1.2s ease-out both; }
@keyframes fadeIn { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:none} }

/* Hero parallax-ish */
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
  filter: brightness(0.55);
}
.hero-bg::after {
  content:""; position:absolute; inset:0;
  background: linear-gradient(180deg, rgba(45,45,45,0.4) 0%, rgba(45,45,45,0.7) 100%);
}

/* Hero slideshow crossfade */
.hero-slide {
  position:absolute; inset:0;
  background-size: cover; background-position: center;
  opacity: 0;
  transition: opacity 2s ease-in-out;
  z-index: 0;
}
.hero-slide.active { opacity: 1; }
.hero-overlay {
  position:absolute; inset:0;
  background: linear-gradient(180deg, rgba(45,45,45,0.35) 0%, rgba(45,45,45,0.65) 100%);
  z-index:1;
}

/* Subtle underline animation for nav */
.nav-link { position: relative; }
.nav-link::after {
  content:""; position:absolute; left:0; bottom:-4px;
  width:0; height:1px; background: currentColor;
  transition: width .3s ease;
}
.nav-link:hover::after, .nav-link.active::after { width:100%; }

/* Ornamental divider */
.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: #B89150;
  flex-wrap: wrap; /* Su mobile va a capo invece di overflow */
  max-width: 100%;
}
.ornament > * {
  min-width: 0;
  flex-shrink: 1;
  text-align: center;
  word-break: break-word;
}
.ornament::before, .ornament::after {
  content: "";
  height: 1px;
  width: 40px;
  flex: 0 0 40px;
  background: currentColor;
  opacity: .5;
}
@media (min-width: 640px) {
  .ornament::before, .ornament::after {
    width: 60px;
    flex-basis: 60px;
  }
}

/* Card hover */
.room-card { transition: transform .5s ease, box-shadow .5s ease; }
.room-card:hover { transform: translateY(-6px); }
.room-card img { transition: transform 1.2s ease; }
.room-card:hover img { transform: scale(1.07); }

/* Image link hover */
.gallery-item { transition: transform .4s ease; cursor: pointer; }
.gallery-item:hover { transform: scale(1.02); }
.gallery-item img { transition: filter .4s ease, transform .8s ease; }
.gallery-item:hover img { filter: brightness(1.05); }

/* Mobile menu */
/* Mobile menu: completamente fuori dal layout quando chiuso (no overflow).
   Quando .open viene aggiunto, diventa visibile e scorre da destra. */
.mobile-menu {
  transform: translateX(100%);
  transition: transform .4s ease;
  visibility: hidden;
  pointer-events: none;
}
.mobile-menu.open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

/* Header sticky bg transition */
header.scrolled { background: rgba(45,45,45,0.96); backdrop-filter: blur(10px); }
header.scrolled .logo-text-light { color: #fff; }

/* Form */
.form-input {
  width:100%;
  background: transparent;
  border: 0; border-bottom: 1px solid #d0c8b8;
  padding: .75rem .25rem;
  color: #2d2d2d;
  font-family: 'Montserrat', sans-serif; font-size: .92rem;
  transition: border-color .3s ease;
}
.form-input:focus {
  outline: none;
  border-bottom-color: #B89150;
}
.form-input::placeholder { color: #9a8e76; }

/* Buttons */
.btn-primary {
  display:inline-flex; align-items:center; justify-content:center;
  padding: 1rem 2.4rem;
  background: #B89150; color: #fff;
  font-family: 'Montserrat', sans-serif; font-weight: 500;
  letter-spacing: .15em; text-transform: uppercase; font-size: .78rem;
  transition: background .3s ease, transform .3s ease;
  border: 1px solid #B89150;
}
.btn-primary:hover { background: #9A773C; border-color: #9A773C; transform: translateY(-2px); }

.btn-outline {
  display:inline-flex; align-items:center; justify-content:center;
  padding: 1rem 2.4rem;
  background: transparent; color: #fff;
  font-family: 'Montserrat', sans-serif; font-weight: 500;
  letter-spacing: .15em; text-transform: uppercase; font-size: .78rem;
  border: 1px solid rgba(255,255,255,.6);
  transition: all .3s ease;
}
.btn-outline:hover { background: rgba(255,255,255,.1); border-color: #fff; }

.btn-dark-outline {
  display:inline-flex; align-items:center; justify-content:center;
  padding: 1rem 2.4rem;
  background: transparent; color: #2d2d2d;
  font-family: 'Montserrat', sans-serif; font-weight: 500;
  letter-spacing: .15em; text-transform: uppercase; font-size: .78rem;
  border: 1px solid #2d2d2d;
  transition: all .3s ease;
}
.btn-dark-outline:hover { background: #2d2d2d; color: #fff; }

/* WhatsApp floating */
.whatsapp-float {
  position: fixed; right: 1.25rem; bottom: 1.25rem;
  width: 56px; height: 56px;
  background: #C9A961; color: #fff;
  display:flex; align-items:center; justify-content:center;
  border-radius: 9999px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  z-index: 50;
  font-size: 1.6rem;
  transition: transform .3s ease, background-color .3s ease;
}
.whatsapp-float:hover { transform: scale(1.08); background: #B89150; }

/* Lightbox tweak */
.glightbox-clean .gslide-description { font-family: 'Montserrat', sans-serif; }

/* Swiper customization */
.swiper-button-next, .swiper-button-prev { color: #fff !important; }
.swiper-pagination-bullet-active { background: #B89150 !important; }

/* Masonry-like gallery */
.gallery-grid {
  display:grid; gap: .75rem;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 640px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .gallery-grid { grid-template-columns: repeat(4, 1fr); } }

.gallery-grid img {
  width:100%; height: 200px; object-fit: cover; display:block;
  border-radius: 2px;
}
@media (min-width: 1024px) {
  .gallery-grid img { height: 230px; }
}

/* Section padding utility */
section { scroll-margin-top: 5rem; }
[id^="room-"] { scroll-margin-top: 6rem; }

/* Heading display */
.display-serif {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  line-height: 1.1;
}

/* Selection */
::selection { background: #B89150; color: #fff; }

/* Loader */
#site-loader {
  position: fixed; inset: 0;
  background: #2d2d2d;
  display:flex; align-items:center; justify-content:center;
  z-index: 9999;
  transition: opacity .8s ease, visibility .8s ease;
}
#site-loader.hidden { opacity: 0; visibility: hidden; }
#site-loader svg { width: 80px; color: #fff; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:.4} 50%{opacity:1} }

/* Map container */
.map-wrap iframe { width: 100%; height: 100%; border: 0; filter: grayscale(0.3); }
