/*
 * Quintaliani — foglio di stile principale.
 * Stessa identita' visiva del progetto originale: sfondo chiaro,
 * tipografia condensata per i titoli, cornici leggermente sghembe
 * ("grandangolo") per le opere.
 */

:root{
  --bg: #F0ECE3;
  --bg-alt: #E7E1D2;
  --ink: #1C1A16;
  --ink-soft: #5C574C;
  --line: #D3CBB8;
  --cobalt: #274870;
  --terracotta: #B4502C;
  --ochre: #C4922E;
  --green: #3C5340;
  --wine: #7A2E2A;
  --font-display: 'Big Shoulders Display', sans-serif;
  --font-voice: 'Newsreader', serif;
  --font-body: 'Inter', sans-serif;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin:0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg{ display:block; max-width:100%; }
a{ color: inherit; text-decoration: none; }

::selection{ background: var(--cobalt); color: var(--bg); }

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

.wrap{
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 64px);
}

.eyebrow{
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- NAV ---------- */
header.site-nav{
  position: fixed;
  top:0; left:0; right:0;
  z-index: 50;
  padding: 22px clamp(20px, 5vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  mix-blend-mode: difference;
}
header.site-nav .logo{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #F0ECE3;
}
header.site-nav .logo img{ max-height: 44px; width: auto; }
header.site-nav nav{
  display:flex;
  gap: clamp(16px, 3vw, 36px);
  flex-wrap: wrap;
}
header.site-nav nav a{
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #F0ECE3;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}
header.site-nav nav a:hover{ border-color: currentColor; }

/* ---------- HERO ---------- */
.hero{
  position: relative;
  padding-top: 128px;
  padding-bottom: 30px;
}
.hero-top{
  margin-bottom: clamp(28px, 5vw, 48px);
}
.hero-title{
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 0.86;
  letter-spacing: -0.01em;
  font-size: clamp(48px, 9vw, 140px);
  text-transform: uppercase;
  margin: 0 0 20px;
}
.hero-title .line2{ color: var(--terracotta); }
.hero-sub{
  font-family: var(--font-voice);
  font-style: italic;
  font-size: clamp(18px, 1.9vw, 24px);
  color: var(--ink-soft);
  max-width: 44ch;
  margin: 0;
  line-height: 1.5;
}
.hero-place{
  display:flex;
  align-items:center;
  gap: 12px;
  margin-bottom: 22px;
}
.hero-place .dot{
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--cobalt);
}

.hero-visual-full .opera-frame{ clip-path: none; }
.hero-visual-full .opera-caption{ margin-top: 16px; }

.scroll-cue{
  display:flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 40px auto 0;
}
.scroll-cue span{
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.scroll-cue .stem{
  width: 1px; height: 34px;
  background: linear-gradient(var(--ink-soft), transparent);
  animation: stem-pulse 2.2s ease-in-out infinite;
  margin: 0 auto;
}
@keyframes stem-pulse{
  0%,100%{ opacity: 0.35; }
  50%{ opacity: 1; }
}

/* ---------- OPERA FRAME (elemento distintivo) ---------- */
.opera-frame{
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--bg-alt);
  clip-path: polygon(0 2.4%, 100% 0, 100% 97.6%, 0 100%);
}
.opera-frame.skew-r{
  clip-path: polygon(0 0, 100% 2.4%, 100% 100%, 0 97.6%);
}
.opera-media{
  width: 100%;
  height: 100%;
  display:block;
  position: relative;
}

/* Blocco che ruota fisicamente (0°/180°: coincide con la cornice;
   90°/270°: dimensionato in modo che, DOPO la rotazione, combaci
   esattamente con la cornice — nessun margine, nessun taglio). */
.opera-rotator{
  position: absolute;
  inset: 0;
}
.opera-rotator img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Rotazione immagine (impostabile dal pannello, per opera).
   --nr e' il rapporto larghezza/altezza NATURALE dell'immagine
   (calcolato in PHP), usato solo per i casi 90/270. */
.opera-frame[data-rot="180"] .opera-rotator img{
  transform: rotate(180deg);
}
.opera-frame[data-rot="90"] .opera-rotator,
.opera-frame[data-rot="270"] .opera-rotator{
  inset: auto;
  top: 50%;
  left: 50%;
  width: calc(var(--nr, 1) * 100%);
  height: calc(100% / var(--nr, 1));
}
.opera-frame[data-rot="90"] .opera-rotator{
  transform: translate(-50%, -50%) rotate(90deg);
}
.opera-frame[data-rot="270"] .opera-rotator{
  transform: translate(-50%, -50%) rotate(270deg);
}

.opera-caption{
  margin-top: 18px;
  display:flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.opera-caption .t{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(20px, 2.4vw, 30px);
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.opera-caption .y{
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* ---------- FRASE (statement) ---------- */
.statement{
  padding: clamp(90px, 14vw, 170px) 0;
  text-align: center;
}
.statement blockquote{
  margin: 0 auto;
  max-width: 22ch;
  font-family: var(--font-voice);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(28px, 4.4vw, 52px);
  line-height: 1.28;
  color: var(--ink);
}
.statement blockquote em{
  color: var(--terracotta);
  font-style: italic;
}

/* ---------- GALLERIE ---------- */
.gallery{ padding: 40px 0 clamp(80px, 10vw, 140px); }
.gallery-alt{
  background: var(--bg-alt);
  padding-top: clamp(70px, 9vw, 130px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.gallery-head{
  display:flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: clamp(40px, 6vw, 76px);
  gap: 20px;
  flex-wrap: wrap;
}
.gallery-head h2{
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(40px, 7vw, 90px);
  line-height: 0.9;
  margin: 6px 0 0;
}
.gallery-head p{
  font-family: var(--font-voice);
  font-style: italic;
  color: var(--ink-soft);
  max-width: 36ch;
  margin: 0;
  font-size: clamp(15px, 1.4vw, 18px);
}
.gallery-empty{
  font-family: var(--font-voice);
  font-style: italic;
  color: var(--ink-soft);
}

.opera{
  margin: 0 0 clamp(70px, 9vw, 128px);
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.opera.is-visible{ opacity: 1; transform: none; }
.opera.size-xl{ width: 100%; }
.opera.size-lg{ width: min(84%, 980px); }
.opera.size-lg.align-right{ margin-left: auto; }
.opera.size-md{ width: min(62%, 680px); }
.opera.size-md.align-right{ margin-left: auto; }
.opera.size-sm{ width: min(46%, 460px); }
.opera.size-sm.align-right{ margin-left: auto; }

.dipinti-sub{
  padding-top: 28px;
  padding-bottom: clamp(30px, 4vw, 44px);
  margin-top: -10px;
  border-top: 1px solid var(--line);
}

/* ---------- BEFORE / AFTER ---------- */
.ba-section{
  padding: clamp(70px, 9vw, 130px) 0;
  border-top: 1px solid var(--line);
}
.ba-head{
  text-align: center;
  max-width: 640px;
  margin: 0 auto clamp(36px, 5vw, 60px);
}
.ba-head h2{
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(34px, 5.5vw, 64px);
  margin: 8px 0 12px;
  line-height: 0.95;
}
.ba-head p{
  font-family: var(--font-voice);
  font-style: italic;
  color: var(--ink-soft);
  font-size: clamp(15px, 1.4vw, 18px);
  margin: 0;
}
.ba-slider-2{ margin-top: clamp(50px, 7vw, 90px); }

.ba-slider{
  position: relative;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  aspect-ratio: 1.694;
  overflow: hidden;
  background: var(--bg-alt);
  cursor: ew-resize;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}
.ba-media{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.ba-media img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
}
.ba-before{
  clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0);
}
.ba-tag{
  position: absolute;
  top: 16px;
  z-index: 3;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #F0ECE3;
  background: rgba(28,26,22,0.55);
  padding: 6px 12px;
  pointer-events: none;
}
.ba-tag-before{ left: 16px; }
.ba-tag-after{ right: 16px; }

.ba-handle{
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos, 50%);
  width: 0;
  z-index: 4;
  pointer-events: none;
}
.ba-handle::before{
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: -1px;
  width: 2px;
  background: #F0ECE3;
  box-shadow: 0 0 0 1px rgba(28,26,22,0.25);
}
.ba-grip{
  position: absolute;
  top: 50%; left: 0;
  width: 46px; height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  background: #F0ECE3;
  box-shadow: 0 8px 22px rgba(28,26,22,0.3);
  pointer-events: auto;
  cursor: ew-resize;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ba-grip svg{ width: 20px; height: 20px; }
.ba-grip:focus-visible{ outline: 2px solid var(--terracotta); outline-offset: 3px; }

.ba-hint{
  text-align: center;
  margin-top: 16px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- BIOGRAFIA ---------- */
.about{
  padding: clamp(70px, 9vw, 130px) 0;
  border-top: 1px solid var(--line);
}
.about-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 90px);
  align-items: start;
}
.about-copy h2{
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(34px, 5vw, 58px);
  margin: 8px 0 22px;
  line-height: 0.95;
}
.about-copy p{
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 0 16px;
}
.about-copy p strong{ color: var(--ink); font-weight: 600; }

.exhib-list{
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.exhib-list li{
  display:flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.exhib-list li .place{ font-weight: 500; }
.exhib-list li .kind{
  color: var(--ink-soft);
  font-size: 13px;
  text-align: right;
  white-space: nowrap;
}

/* ---------- CONTATTI / FOOTER ---------- */
.contact{
  padding: clamp(70px, 10vw, 140px) 0 40px;
  border-top: 1px solid var(--line);
}
.contact-inner{ text-align: center; }
.contact h2{
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(44px, 8vw, 110px);
  line-height: 0.9;
  margin: 0 0 28px;
}
.contact-links{
  display:flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 28px;
  margin-bottom: clamp(60px, 8vw, 100px);
}
.contact-links a{
  font-size: 15px;
  font-weight: 500;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.contact-links a:hover{ border-color: var(--terracotta); color: var(--terracotta); }

footer.site-foot{
  display:flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 860px){
  header.site-nav nav{ gap: 14px; }
  header.site-nav nav a{ font-size: 10.5px; letter-spacing: 0.1em; }
  .about-grid{ grid-template-columns: 1fr; }
  .opera.size-lg, .opera.size-md, .opera.size-sm{ width: 100%; }
  .opera-caption .t{ font-size: 20px; }
}
