@import url('https://fonts.googleapis.com/css2?family=Marcellus&family=Cormorant+Garamond:ital,wght@0,300;0,400;1,300&display=swap');

/* =====================
   VARIABILI
   ===================== */
:root {
  --bg: #111111;
  --bg-surface: #181818;
  --text: #f0ede8;
  --text-muted: #777;
  --text-dark: #111;
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.22);
  --white: #fff;
  --radius: 4px;
  --radius-lg: 10px;
  --transition: 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* =====================
   RESET & BASE
   ===================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  min-height: 100vh;
  color: var(--text);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* =====================
   NAVBAR
   ===================== */
.navbar {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 0 52px;
  height: 72px;
  background: transparent;
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 100;
}

.logo {
  font-family: 'Marcellus', serif;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 400;
  font-size: 1rem;
  color: var(--white);
  white-space: nowrap;
  flex-shrink: 0;
  z-index: 200;
  position: relative;
  line-height: 1;
}

.navbar > .nav-links {
  list-style: none;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 36px;
  align-items: center;
  justify-content: flex-end;
  margin: 0;
  padding: 0;
}

.navbar > .nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-family: 'Marcellus', serif;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 4px 0;
  position: relative;
  transition: color var(--transition);
  white-space: nowrap;
  line-height: 1;
}

.navbar > .nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1px;
  background: var(--white);
  transition: width var(--transition);
}

.navbar > .nav-links a:hover { color: var(--white); }
.navbar > .nav-links a:hover::after { width: 100%; }

/* =====================
   HAMBURGER
   ===================== */
.hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  cursor: pointer;
  background: transparent;
  border: none;
  z-index: 200;
  position: relative;
  flex-shrink: 0;
  padding: 0;
}

/* SVG tavolozza */
.hamburger .icon-palette {
  width: 28px;
  height: 28px;
  transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  transform-origin: center;
}

.hamburger.open .icon-palette {
  transform: rotate(160deg);
}

/* Icona X non usata */
.hamburger .icon-close {
  display: none;
}


/* =====================
   MENU MOBILE — box centrato
   ===================== */

/* Backdrop semitrasparente */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.nav-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* Box centrale */
.nav-overlay-box {
  position: relative;
  background: linear-gradient(145deg, #202020 0%, #141414 55%, #1c1318 100%);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 50px 52px 40px;
  min-width: 270px;
  max-width: 88vw;
  text-align: center;
  transform: scale(0.9) translateY(16px);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.23, 1, 0.32, 1),
              opacity 0.4s ease;
  box-shadow: 0 28px 70px rgba(0,0,0,0.65),
              inset 0 0 0 1px rgba(255,255,255,0.04);
}

.nav-overlay.open .nav-overlay-box {
  transform: scale(1) translateY(0);
  opacity: 1;
  transition-delay: 0.06s;
}

/* X dentro il box */
.overlay-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.4;
  transition: opacity 0.2s ease;
}

.overlay-close:hover { opacity: 1; }

.overlay-close::before,
.overlay-close::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
}

.overlay-close::before { transform: rotate(45deg); }
.overlay-close::after  { transform: rotate(-45deg); }

/* Voci nel box */
.nav-overlay .nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: stretch;
  padding: 0; margin: 0;
}

.nav-overlay .nav-links li {
  overflow: hidden;
}

.nav-overlay .nav-links li a {
  display: block;
  font-family: "Marcellus", serif;
  font-size: 1.4rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  padding: 12px 0;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transform: translateY(18px);
  opacity: 0;
  transition: color 0.25s ease,
              transform 0.45s cubic-bezier(0.23, 1, 0.32, 1),
              opacity 0.4s ease;
}

.nav-overlay .nav-links li:last-child a { border-bottom: none; }
.nav-overlay .nav-links a::after { display: none; }

.nav-overlay.open .nav-links li a { transform: translateY(0); opacity: 1; }
.nav-overlay.open .nav-links li:nth-child(1) a { transition-delay: 0.10s; }
.nav-overlay.open .nav-links li:nth-child(2) a { transition-delay: 0.15s; }
.nav-overlay.open .nav-links li:nth-child(3) a { transition-delay: 0.20s; }
.nav-overlay.open .nav-links li:nth-child(4) a { transition-delay: 0.25s; }
.nav-overlay.open .nav-links li:nth-child(5) a { transition-delay: 0.30s; }
.nav-overlay.open .nav-links li:nth-child(6) a { transition-delay: 0.35s; }

.nav-overlay .nav-links a:hover { color: var(--white); }



/* =====================
   HERO
   ===================== */
.hero {
  text-align: center;
  padding: 110px 20px 90px;
}

.hero h2 {
  font-family: 'Marcellus', serif;
  font-weight: 400;
  font-size: 3.4rem;
  letter-spacing: 0.04em;
  margin-bottom: 18px;
  line-height: 1.15;
}

.hero p {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 1.3rem;
  color: var(--text-muted);
}

/* Linea decorativa sotto hero */
.hero::after {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: var(--border-strong);
  margin: 40px auto 0;
}

/* =====================
   TITOLI PAGINA
   ===================== */
.page-title {
  text-align: center;
  padding: 70px 20px 50px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.page-title h2 {
  font-family: 'Marcellus', serif;
  font-weight: 400;
  font-size: 2.8rem;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.page-title p {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 1.2rem;
  color: var(--text-muted);
}

/* =====================
   GALLERIA — griglia originale
   ===================== */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  padding: 40px;
  grid-auto-flow: dense;
  align-items: start;
}

.card {
  text-align: center;
  display: flex;
  flex-direction: column;
  background: transparent;
  overflow: hidden;
  transition: transform 0.4s var(--transition);
}

.card img {
  width: 100%;
  height: auto;
  max-height: 600px;
  object-fit: contain;
  display: block;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card h3 {
  font-family: 'Marcellus', serif;
  font-weight: 400;
  color: var(--text);
  font-size: 1.1rem;
  margin-top: 14px;
  letter-spacing: 0.05em;
}

.card p {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 300;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 5px;
}

.card.wide { grid-column: span 2; }

.card:hover { transform: translateY(-4px); }

/* =====================
   GALLERY HOME — 3 colonne
   ===================== */
.gallery-home {
  grid-template-columns: repeat(3, 1fr);
}

/* Gallery home: sempre 3 colonne su tutti gli schermi */
.gallery-home {
  grid-template-columns: repeat(3, 1fr) !important;
}

/* =====================
   CONTATTI
   ===================== */
.contact {
  padding: 90px 20px;
  text-align: center;
}

.contact h2 {
  font-family: 'Marcellus', serif;
  font-weight: 400;
  font-size: 2.8rem;
  letter-spacing: 0.06em;
}

.contact-subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 1.1rem;
  margin-top: 12px;
  color: var(--text-muted);
}

.contact-box {
  background: var(--white);
  color: var(--text-dark);
  padding: 36px 40px;
  max-width: 420px;
  margin: 40px auto;
  border-radius: var(--radius-lg);
}

/* =====================
   FORM CONTATTI
   ===================== */
.contact-form {
  max-width: 560px;
  margin: 0 auto 40px;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  text-align: left;
}

.contact-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact-form .form-group label {
  font-family: 'Marcellus', serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.contact-form .form-group input,
.contact-form .form-group textarea {
  padding: 0.9rem 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 1rem;
  font-family: 'Cormorant Garamond', serif;
  transition: border-color var(--transition);
  resize: vertical;
  border-radius: 0;
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: rgba(255,255,255,0.18); }

.contact-form .form-group input:focus,
.contact-form .form-group textarea:focus {
  outline: none;
  border-bottom-color: var(--white);
}

.btn-submit {
  align-self: flex-start;
  padding: 13px 40px;
  background: transparent;
  color: var(--white);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-family: 'Marcellus', serif;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.btn-submit:hover { background: var(--white); color: var(--text-dark); border-color: var(--white); }
.btn-submit:disabled { opacity: 0.4; cursor: not-allowed; background: transparent; color: var(--white); }

.form-feedback {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1rem;
  min-height: 1.4rem;
}

.feedback-success { color: #7ddb8e; }
.feedback-error   { color: #e87070; }

/* =====================
   BIOGRAFIA
   ===================== */
.biografia {
  padding: 40px 52px 90px;
  text-align: center;
}

.biografia h2 {
  font-family: 'Marcellus', serif;
  font-weight: 400;
  font-size: 2.8rem;
  letter-spacing: 0.06em;
  margin-bottom: 32px;
}

.bio-box {
  background: var(--white);
  color: var(--text-dark);
  padding: 44px 52px;
  max-width: 780px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
}

.bio-testo {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: 1.15rem;
  line-height: 2;
  text-align: left;
}

/* =====================
   FOOTER
   ===================== */
.footer {
  background: transparent;
  color: var(--text-muted);
  text-align: center;
  padding: 52px 20px;
  margin-top: 90px;
  border-top: 1px solid var(--border);
}

.footer p {
  margin-bottom: 18px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  font-family: 'Marcellus', serif;
}

.social-links {
  display: flex;
  gap: 32px;
  justify-content: center;
}

.social-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-family: 'Marcellus', serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 0;
  position: relative;
  transition: color var(--transition);
}

.social-links a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1px;
  background: var(--white);
  transition: width var(--transition);
}

.social-links a:hover { color: var(--white); }
.social-links a:hover::after { width: 100%; }

/* =====================
   OVERLAY ANTEPRIME SEZIONI
   ===================== */
.card-link {
  position: relative;
  display: block;
  text-decoration: none;
  overflow: hidden;
}

.card-link .card { margin: 0; }
.card-link.wide { grid-column: span 2; }

.card-link .img-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.card-link .img-wrapper img {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: fill;
  transition: transform 0.65s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card-link:hover .img-wrapper img { transform: scale(1.04); }

.img-wrapper .card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.58);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.card-link:hover .card-overlay { opacity: 1; }

.overlay-text {
  font-family: 'Marcellus', serif;
  font-weight: 400;
  color: var(--white);
  font-size: 2.2rem;
  text-align: center;
  padding: 20px;
  letter-spacing: 0.1em;
}

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 1024px) {
  .navbar { padding: 0 28px; }
  .navbar > .nav-links { gap: 24px; }
}

@media (max-width: 768px) {
  .hamburger { display: flex; }
  .navbar > .nav-links { display: none; }
  .navbar { padding: 0 20px; height: 62px; }

  .gallery {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    padding: 20px;
    gap: 20px;
  }

  .biografia { padding: 24px 20px 56px; }
  .bio-box { padding: 28px 24px; }

  .hero { padding: 75px 20px 65px; }
  .hero h2, .page-title h2 { font-size: 2.2rem; }
  .page-title { padding: 50px 20px 36px; }

  .card img, .card-link .card img { max-height: 400px; }
  .overlay-text { font-size: 1.8rem; }
  .card.wide { grid-column: span 2; }
  .contact-form { padding: 0 10px; }

}

@media (max-width: 480px) {
  .navbar { padding: 0 16px; height: 56px; }
  .logo { font-size: 0.88rem; }

  .gallery {
    grid-template-columns: repeat(2, 1fr);
    padding: 12px;
    gap: 10px;
  }

  /* Foto wide occupano entrambe le colonne anche su mobile */
  .card.wide,
  .card-link.wide {
    grid-column: span 2;
  }

  .hero h2, .page-title h2 { font-size: 1.9rem; }
  .card img, .card-link .card img { max-height: 350px; }
  .overlay-text { font-size: 1.4rem; }
  .card.wide { grid-column: span 1; }

  .btn-submit { align-self: stretch; text-align: center; }

  .biografia { padding: 20px 12px 44px; }
  .bio-box { padding: 24px 18px; }

}

@media (max-width: 375px) {
  .logo { font-size: 0.8rem; }
  .card img { max-height: 300px; }
}

/* =====================
   LIGHTBOX
   ===================== */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.lightbox-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.lightbox-box {
  position: relative;
  background: #141414;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 12px;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.9) translateY(16px);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.23, 1, 0.32, 1),
              opacity 0.4s ease;
  box-shadow: 0 32px 80px rgba(0,0,0,0.7),
              inset 0 0 0 1px rgba(255,255,255,0.04);
}

.lightbox-backdrop.open .lightbox-box {
  transform: scale(1) translateY(0);
  opacity: 1;
  transition-delay: 0.05s;
}

.lightbox-img {
  display: block;
  max-width: 80vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  object-fit: contain;
  cursor: default;
}

/* X dentro il box */
.lightbox-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.4;
  transition: opacity 0.2s ease;
  z-index: 1;
}

.lightbox-close:hover { opacity: 1; }

.lightbox-close::before,
.lightbox-close::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
}

.lightbox-close::before { transform: rotate(45deg); }
.lightbox-close::after  { transform: rotate(-45deg); }

/* =====================
   HOVER IMMAGINI (pre-lightbox)
   ===================== */
.card img {
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              filter 0.45s ease,
              box-shadow 0.45s ease;
  will-change: transform;
}

.card:hover img {
  transform: scale(1.04) translateY(-4px);
  filter: brightness(1.08) contrast(1.03);
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}