:root {
  --bg: #0d0d0d;
  --text: #f5f2ee;
  --accent: #c8a96e;
  --font1: 'Cormorant Garamond', serif;
  --font2: 'Jost', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font2);
  overflow-x: hidden;
}

/* =========================
   HEADER
========================= */
.site-header {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 25px 5vw;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;

  transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

.site-header .logo {
  font-family: var(--font1);
  font-size: 24px;
  color: var(--text);
  text-decoration: none;
}

.site-header .logo span {
  color: var(--accent);
}

.site-header.scrolled {
  background: rgba(13, 13, 13, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

nav a {
  color: rgba(255,255,255,0.8);
  margin-left: 24px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  font-family: var(--font2);
  transition: color 0.3s ease, transform 0.3s ease;
  position: relative;
}

nav a:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

nav a::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0%;
  height: 1px;
  background: var(--accent);
  transition: width 0.3s ease;
}

nav a:hover::after {
  width: 100%;
}

/* =========================
   HERO SLIDER
========================= */
.hero-slider {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  z-index: 1;
}

/* 🔥 FIX IMPORTANTE: NON BLOCCA I CLICK */
.hero-slider::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.15);
  z-index: 2;
  pointer-events: none; /* ✅ FIX */
}

.slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 1.2s ease;
  z-index: 1;
}

.slide.active {
  opacity: 1;
}

/* =========================
   PORTFOLIO
========================= */
.portfolio {
  padding: 120px 40px 40px; /* spazio per header fisso */
  position: relative;
  z-index: 5; /* ✅ sopra eventuali overlay */
}

.portfolio h1 {
  text-align: center;
  margin-bottom: 40px;
}

.portfolio-section {
  margin-bottom: 60px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  grid-auto-rows: 200px;
  gap: 15px;

  position: relative;
  z-index: 10; /* ✅ click sempre attivi */
}

/* immagini */
.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  border-radius: 10px;
  transition: transform 0.3s ease, filter 0.3s ease;

  position: relative;
  z-index: 15; /* ✅ sopra tutto */
}

.gallery img.landscape {
  grid-row: span 1;
}

.gallery img.portrait {
  grid-row: span 2;
}

.gallery img:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}

/* =========================
   LIGHTBOX
========================= */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);

  display: flex;
  justify-content: center;
  align-items: center;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;

  z-index: 9999; /* ✅ sopra header */
}

.lightbox.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox-img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;

  transform: scale(0.9);
  transition: transform 0.4s ease;
}

.lightbox.active .lightbox-img {
  transform: scale(1);
}

/* BOTTONI */
.close {
  position: absolute;
  top: 25px;
  right: 40px;
  font-size: 40px;
  color: white;
  cursor: pointer;
}

.prev, .next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 50px;
  color: white;
  cursor: pointer;
  padding: 10px;
  user-select: none;
  transition: opacity 0.3s ease;
}

.prev { left: 30px; }
.next { right: 30px; }

.prev:hover, .next:hover {
  opacity: 0.6;
}


/* =========================
   SCRITTURA
========================= */


.scrittura-container{
    width:95%;
    max-width:1400px;
    margin:auto;
    padding:40px 20px;
}

.scrittura-hero{
    text-align:center;
    margin-bottom:50px;
}

.scrittura-hero h1{
    font-size:3rem;
    margin-bottom:15px;
}

.scrittura-hero p{
    max-width:900px;
    margin:auto;
    line-height:1.8;
}

.scrittura-menu{
    display:flex;
    justify-content:center;
    flex-wrap:wrap;
    gap:15px;
    margin-bottom:60px;
}

.scrittura-menu a{
    padding:12px 20px;
    border-radius:25px;
    text-decoration:none;
    transition:.3s;
}

.scrittura-section{
    margin-bottom:80px;
}

.scrittura-section h2{
    margin-bottom:30px;
}

.card-grid{
    display:grid;
    grid-template-columns:
    repeat(auto-fit,minmax(280px,1fr));
    gap:25px;
}

.card{
    padding:25px;
    border-radius:15px;
    background:#fff;
    box-shadow:0 4px 15px rgba(0,0,0,.08);
    transition:.3s;
}

.card:hover{
    transform:translateY(-5px);
}

.portfolio-grid{
    display:grid;
    grid-template-columns:
    repeat(auto-fit,minmax(280px,1fr));
    gap:25px;
}

.portfolio-box{
    padding:25px;
    border-radius:15px;
    background:#fff;
    box-shadow:0 4px 15px rgba(0,0,0,.08);
}

.portfolio-box ul{
    margin-top:15px;
}

.portfolio-box li{
    margin-bottom:10px;
}

.formazione-box{
    padding:30px;
    border-radius:15px;
    background:#fff;
    box-shadow:0 4px 15px rgba(0,0,0,.08);
}

.btn-scrittura{
    display:inline-block;
    margin-top:25px;
    padding:12px 25px;
    border-radius:25px;
    text-decoration:none;
}

.scrittura-section{
    display:none;
    animation:fadeScrittura .35s ease;
}

.scrittura-section.active{
    display:block;
}

@keyframes fadeScrittura{
    from{
        opacity:0;
        transform:translateY(10px);
    }

    to{
        opacity:1;
        transform:translateY(0);
    }
}


.scrittura-page {
    padding: 40px 20px;
}

.scrittura-hero {
    max-width: 900px;
    margin: 0 auto 40px auto;
    text-align: center;
}

.scrittura-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
}

.scr-nav-btn {
    padding: 10px 16px;
    border: 1px solid #999;
    background: #f5f5f5;
    color: #222;
    cursor: pointer;
    transition: .25s;
    border-radius: 6px;
    font-weight: 600;
}

.scr-nav-btn:hover {
    background: #e5e5e5;
}

.scr-nav-btn.active {
    background: #222;
    color: #fff;
    border-color: #222;
}

.scr-section {
    display: none;
    max-width: 1100px;
    margin: 0 auto;
}

.scr-section.active {
    display: block;
}

.scr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.scr-card {
    padding: 20px;
    border: 1px solid #ddd;
    background: #fafafa;
}

.scr-contact-box {
    padding: 20px;
    border: 1px solid #ddd;
    max-width: 600px;
}



/* =========================
  FOTOGRAFI
========================= */


.fotografi {
  padding: 120px 5vw 60px;
}

.fotografi h1 {
  text-align: center;
  margin-bottom: 60px;
  font-family: var(--font1);
}

.fotografo-card {
  margin-bottom: 80px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 60px;
}

/* parte alta: foto + testo */
.fotografo-top {
  display: flex;
  gap: 30px;
  align-items: center;
  margin-bottom: 30px;
}

.fotografo-top img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 12px;
  flex-shrink: 0;
}

.fotografo-info h2 {
  margin-bottom: 10px;
  font-family: var(--font1);
  font-size: 28px;
}

.fotografo-info p {
  opacity: 0.8;
  line-height: 1.6;
  max-width: 700px;
}

/* galleria opere */
.fotografo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
}

.fotografo-gallery img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
  transition: transform 0.3s ease;
}

.fotografo-gallery img:hover {
  transform: scale(1.05);
}





/* =========================
   MINI GALLERY 8 FOTO
========================= */

.fotografo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.fotografo-gallery img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.fotografo-gallery img:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}

/* =========================
   LIGHTBOX (RIUTILIZZABILE)
========================= */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 9999;
}

.lightbox.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}



/* =========================================
   LIGHTBOX PER AUDIOVISIVO & FOTOGRAFI (MODAL)
   ========================================= */

/* Galleria Audiovisivo */
.av-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.av-gallery img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.av-gallery img:hover {
  opacity: 1;
  transform: scale(1.04);
}

/* Modal Lightbox Isolato (Evita conflitti con .lightbox) */
.lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.94);
  display: none; /* Gestito via JS con display: flex */
  justify-content: center;
  align-items: center;
  z-index: 10000;
  backdrop-filter: blur(5px);
}

.lightbox-content {
  position: relative;
  max-width: 85vw;
  max-height: 85vh;
  text-align: center;
}

#lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

#lightbox-caption {
  margin-top: 15px;
  color: var(--text);
  font-family: var(--font2);
  font-size: 14px;
  letter-spacing: 1px;
  opacity: 0.8;
}

/* Controlli Modal */
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 35px;
  font-size: 38px;
  color: #fff;
  cursor: pointer;
  z-index: 10001;
  transition: color 0.2s ease;
}

.lightbox-close:hover {
  color: var(--accent);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 40px;
  color: #fff;
  cursor: pointer;
  padding: 15px;
  z-index: 10001;
  user-select: none;
  transition: color 0.2s ease, opacity 0.2s ease;
  opacity: 0.7;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 1;
  color: var(--accent);
}

/* Responsiveness Lightbox Modal (Schermi piccoli) */
@media (max-width: 768px) {
  .lightbox-prev, 
  .lightbox-next {
    padding: 8px 12px;
    font-size: 24px;
  }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-close {
    top: 12px;
    right: 18px;
    font-size: 30px;
  }
}





/* --- ACCORDION TECNICO & DIETRO LE QUINTE --- */
.av-tech-section {
    margin-top: 25px;
    border: 1px solid #333333;
    border-radius: 6px;
    background-color: #161616;
    overflow: hidden;
}

.av-tech-toggle {
    width: 100%;
    padding: 14px 18px;
    background: #1f1f1f;
    border: none;
    color: #f0f0f0;
    font-size: 1rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease, color 0.2s ease;
}

.av-tech-toggle:hover {
    background: #2a2a2a;
    color: #ffffff;
}

.av-tech-icon {
    font-size: 1.2rem;
    color: #888888;
}

.av-tech-content {
    padding: 15px 20px 25px 20px;
    border-top: 1px solid #2a2a2a;
}






/* =========================
   AUDIOVISIVO (STABLE VERSION)
========================= */

.audiovisivo {
  padding: 120px 5vw;
}

.audiovisivo h1 {
  text-align: center;
  margin-bottom: 40px;
  font-family: var(--font1);
}

/* =========================
   MENU CATEGORIE
========================= */

.av-menu {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.av-menu button {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 10px 20px;
  cursor: pointer;
  transition: 0.3s ease;
}

.av-menu button.active {
  background: var(--accent);
  color: #000;
}

/* =========================
   SEARCH + FILTRI
========================= */

.catalogo-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
  margin: 25px 0;
}

.catalogo-bar input,
.catalogo-bar select {
  padding: 10px 14px;
  border-radius: 10px;
  min-width: 180px;
}

/* =========================
   INFO RISULTATI
========================= */

.catalogo-info {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  opacity: 0.8;
  margin: 10px 0 20px;
}

/* =========================
   CONTENITORE SEZIONI
========================= */

.av-container {
  margin-top: 30px;
}

/* =========================
   SEZIONI (IMPORTANTISSIMO)
   ➜ FLEX STABILE (NO GRID)
========================= */

.av-section {
  display: none;
}

.av-section.active {
  display: flex;
  flex-wrap: wrap;
  gap: 25px;
  justify-content: center;
  align-items: flex-start;
  align-content: flex-start;
}

/* =========================
   CARD BASE
========================= */

.av-card {
  width: 200px;
  flex: 0 0 200px;
  transition: all 0.25s ease;
}

/* 🔥 FIX IMPORTANTE: hidden NON deve rompere layout */
.av-card.hidden {
  opacity: 0;
  transform: scale(0.96);
  pointer-events: none;
  position: absolute;
  visibility: hidden;
}

/* =========================
   CARD EXPANDED (IMPORTANTE)
========================= */

.av-card.active {
  width: 100%;
  flex: 1 1 100%;
  background: rgba(255,255,255,0.03);
  padding: 20px;
  border-radius: 12px;
}

/* =========================
   POSTER STYLE
========================= */

.av-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.av-header::before {
  content: "";
  width: 180px;
  height: 260px;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  background-image: var(--poster);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.av-header h2 {
  margin-top: 10px;
  font-size: 16px;
  text-align: center;
}

/* =========================
   CONTENUTO CARD
========================= */

.av-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
  margin-top: 10px;
  padding: 0 10px;
}

.av-card.active .av-content {
  max-height: 2000px;
  margin-top: 15px;
}

/* =========================
   DESCRIZIONE
========================= */

.av-desc {
  margin-bottom: 15px;
  line-height: 1.6;
}

.av-credits {
  font-size: 14px;
  opacity: 0.8;
  margin-bottom: 15px;
}

/* =========================
   GALLERY
========================= */

.av-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.av-gallery img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  transition: transform 0.3s ease;
}

.av-gallery img:hover {
  transform: scale(1.05);
}

/* =========================
   MESTIERI HEADER
========================= */

.av-group-title {
  width: 100%;
  font-size: 1.4rem;
  margin: 40px 0 20px;
  padding-left: 10px;
  border-left: 3px solid #aaa;
  opacity: 0.9;
}






/* =========================
   CONTATTI
========================= */

.contatti-page {
  padding: 120px 5vw 80px;
}


/* ===== TITOLO ===== */

.contact-page-title{
    text-align:center;
    margin:40px 0 60px;
}

.contact-page-title h1{
    font-size:3rem;
    letter-spacing:2px;
}

/* ===== WRAPPER SCHEDE ===== */

.contact-wrapper{
    display:flex;
    justify-content:center;
    align-items:flex-start;
    gap:50px;

    flex-wrap:wrap;

    margin-bottom:70px;
}

/* ===== SINGOLA SCHEDA ===== */

.contact-hero{
    flex:1 1 450px;
    max-width:600px;
}



/* HERO */
.contact-hero {
  display: flex;
  gap: 50px;
  align-items: center;
  margin-bottom: 100px;
  flex-wrap: wrap;
}

.contact-image img {
  width: 320px;
  height: 420px;
  object-fit: cover;
  border-radius: 14px;
}

.contact-intro {
  flex: 1;
  min-width: 280px;
}

.contact-intro h1 {
  font-family: var(--font1);
  font-size: 56px;
  margin-bottom: 25px;
}

.contact-intro p {
  font-size: 18px;
  line-height: 1.8;
  opacity: 0.85;
  max-width: 650px;
  margin-bottom: 30px;
}

.contact-direct {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.contact-direct a {
  color: var(--accent);
  text-decoration: none;
  font-size: 18px;
  transition: opacity 0.3s ease;
}

.contact-direct a:hover {
  opacity: 0.7;
}

/* SEZIONI */
.contact-section {
  margin-bottom: 90px;
}

.contact-section h2 {
  font-family: var(--font1);
  font-size: 38px;
  margin-bottom: 30px;
}

.contact-section p {
  line-height: 1.8;
  opacity: 0.82;
  max-width: 900px;
}

/* CARD SERVIZI */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 25px;
  margin-top: 35px;
}

.service-card {
  background: rgba(255,255,255,0.03);
  border-radius: 14px;
  padding: 30px;
  transition: transform 0.3s ease,
              background 0.3s ease;
}

.service-card:hover {
  transform: translateY(-5px);
  background: rgba(255,255,255,0.05);
}

.service-card h3 {
  font-family: var(--font1);
  margin-bottom: 15px;
  font-size: 24px;
}

.service-card p {
  font-size: 15px;
  line-height: 1.7;
  opacity: 0.8;
}

/* CHIUSURA */
.contact-footer-text {
  text-align: center;
  margin-top: 80px;
}

.contact-footer-text p {
  font-family: var(--font1);
  font-size: 28px;
  opacity: 0.85;
}

/* RESPONSIVE */
@media (max-width: 768px) {

  .contact-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .contact-image img {
    width: 100%;
    max-width: 400px;
    height: auto;
  }

  .contact-intro h1 {
    font-size: 42px;
  }

}


.contact-row{
    display:flex;
    gap:50px;
    justify-content:center;
    align-items:flex-start;
    flex-wrap:wrap;
}

.contact-row .contact-hero{
    flex:1 1 450px;
    max-width:600px;
}





/* =========================
   FOOTER
========================= */
.site-footer {
  background: #0d0d0d;
  padding: 40px 5vw;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  letter-spacing: 1px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.site-footer a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  margin: 0 10px;
  transition: color 0.3s ease;
}

.site-footer a:hover {
  color: var(--accent);
}


.footer-right img {
  width: 20px;
  height: 20px;
  opacity: 0.7;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.footer-right a img {
  width: 34px;
  height: 34px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.footer-right a:hover img {
  transform: scale(1.15);
  opacity: 0.8;
}

.footer-right img:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.footer-right a {
  display: inline-block;
  margin-left: 12px;
}