/* Francesco "Franz" Munari — foglio di stile unico */

@font-face { font-family: "Cormorant Garamond"; src: url("../fonts/cormorant-garamond-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("../fonts/cormorant-garamond-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("../fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  /* grigi neutri: lo sfondo è una sfumatura da quasi bianco a grigio perla, come un fondale da studio */
  --paper: #ececeb;
  --paper-2: #dededc;
  --bg-top: #f7f7f6;
  --bg-mid: #e8e8e6;
  --bg-edge: #cfcfcc;
  --ink: #1a1a19;
  --ink-soft: #57575a;
  --line: #c9c9c6;
  --accent: #a2482b;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1320px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  isolation: isolate;
  color: var(--ink);
  font: 400 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
/* Sfondo grigio sfumato, fermo mentre la pagina scorre (pseudo-elemento fisso: funziona anche su iOS,
   dove background-attachment: fixed è ignorato) */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 0%, var(--bg-top) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 45%, var(--bg-edge) 100%);
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* --- Header --- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 68px; }
.brand { text-decoration: none; display: flex; align-items: center; gap: 14px; }
.brand-sign { height: 40px; width: auto; }
.brand-name { font: 600 22px/1 var(--serif); letter-spacing: .01em; }
.header-right { display: flex; align-items: center; gap: 28px; }
.nav { display: flex; gap: 26px; font-size: 14px; }
.lang { display: flex; font-size: 12px; letter-spacing: .08em; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang a { text-decoration: none; padding: 6px 11px; }
.lang a[aria-current="true"] { background: var(--ink); color: var(--paper); }
.footer-sign { width: 240px; margin-bottom: 14px; }
.bio-sign { width: min(420px, 100%); margin: 22px 0 28px; }
.nav a { text-decoration: none; padding: 6px 0; border-bottom: 1px solid transparent; }
.nav a[aria-current="page"] { border-bottom-color: var(--ink); }
.nav-toggle { display: none; background: none; border: 0; font: 500 14px var(--sans); color: var(--ink); padding: 10px 0; cursor: pointer; }

@media (max-width: 760px) {
  .brand-name { display: none; }
  .brand-sign { height: 34px; }
  .header-right { gap: 16px; }
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; gap: 0; background: var(--paper); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 16px; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 0; border-bottom: 1px solid var(--line); }
}

/* --- Tipografia --- */
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.08; margin: 0; overflow-wrap: break-word; }
h1 { font-size: clamp(38px, 7vw, 96px); letter-spacing: -.01em; }
h2 { font-size: clamp(30px, 4vw, 52px); }
h3 { font-size: 26px; }
.eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 18px; }
.lead { font: 400 clamp(20px, 2.2vw, 26px)/1.45 var(--serif); max-width: 34em; }
.prose { max-width: 40em; }
.prose p { margin: 0 0 1.1em; }

/* --- Hero home: opera a tutta larghezza, nome gigante sovrapposto (stile galleria) --- */
.hero { padding: 0 0 clamp(48px, 7vw, 100px); }
.hero-stage {
  position: relative; overflow: hidden;
  /* fascia più bassa: lascia intravedere il nome sotto già alla prima schermata */
  /* due opere orizzontali (~1,6:1 ciascuna) affiancate: l'altezza segue la larghezza, senza vuoti sopra */
  height: clamp(340px, min(64svh, calc(26vw + 64px)), 720px); margin-top: clamp(16px, 3vw, 40px);
}
/* ogni slide: due opere della stessa serie affiancate (su mobile solo la prima),
   intere e allineate in basso, ciascuna con la sua didascalia sotto */
.hero-slide {
  position: absolute; inset: 0; opacity: 0; transition: opacity 1.6s ease;
  display: flex; justify-content: center; gap: clamp(20px, 3vw, 48px); padding: 0 clamp(64px, 7vw, 120px);
}
.hero-slide.is-active { opacity: 1; z-index: 1; }
.hero-work { margin: 0; flex: var(--r) 1 0; min-width: 0; display: flex; flex-direction: column; }
.hero-work a { display: block; flex: 1; min-height: 0; }
.hero-work img {
  width: 100%; height: 100%; object-fit: contain; object-position: center bottom;
  transform: scale(1.03); transform-origin: center bottom; transition: transform 9s linear;
}
.hero-slide.is-active img { transform: scale(1); }
.hero-work figcaption {
  margin-top: 12px; font-size: 13px; line-height: 1.45; color: var(--ink-soft);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.hero-work figcaption strong { font: 400 19px/1.2 var(--serif); color: var(--ink); margin-right: 6px; }
/* frecce laterali trasparenti */
.hero-arrow {
  position: absolute; z-index: 3; top: calc(50% - 40px); transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  color: var(--ink); transition: background .2s, transform .2s;
}
.hero-prev { left: clamp(8px, 2vw, 32px); }
.hero-next { right: clamp(8px, 2vw, 32px); }
.hero-name {
  font-size: clamp(46px, 6.4vw, 92px); line-height: .9; letter-spacing: -.025em;
  margin: 0 0 22px;
}
.hero-name em { font-style: italic; color: var(--accent); }
.hero-intro {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.75fr); gap: clamp(20px, 5vw, 72px);
  align-items: end; margin-top: clamp(32px, 5vw, 72px);
}
.hero-intro .eyebrow { margin: 0; }
.hero-intro .lead { margin: 0 0 28px; }
@media (max-width: 760px) {
  .hero-stage { height: calc(100vw * .62 + 66px); min-height: 0; }
  .hero-slide { padding: 0; }
  .hero-work + .hero-work { display: none; }
  .hero-work figcaption { padding: 0 var(--gutter); font-size: 12.5px; }
  .hero-work figcaption strong { font-size: 17px; }
  .hero-arrow { width: 40px; height: 40px; top: calc(50% - 33px); }
  .hero-name { font-size: clamp(44px, 13vw, 80px); }
  .hero-intro { grid-template-columns: 1fr; gap: 24px; margin-top: 28px; }
}
@media (prefers-reduced-motion: reduce) { .hero-slide img { transform: none !important; } }

.btn { display: inline-block; text-decoration: none; border: 1px solid var(--ink); padding: 13px 22px; font-size: 14px; letter-spacing: .04em; }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { cursor: pointer; background: none; color: var(--ink); font-family: var(--sans); transition: background .2s, color .2s; min-height: 44px; }
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.btn[disabled] { opacity: .5; cursor: progress; }

/* --- Sezioni --- */
.section { padding: clamp(48px, 7vw, 100px) 0; border-top: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 40px; flex-wrap: wrap; }

/* Categorie */
.cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.cat { text-decoration: none; display: block; }
.cat-img { aspect-ratio: 4 / 3; overflow: hidden; background: var(--paper-2); }
.cat-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.cat:hover .cat-img img { transform: scale(1.04); }
.cat h3 { margin-top: 14px; }
.cat p { margin: 4px 0 0; font-size: 14px; color: var(--ink-soft); }
@media (max-width: 860px) { .cats { grid-template-columns: repeat(2, 1fr); gap: 20px; } }
@media (max-width: 520px) { .cats { grid-template-columns: 1fr; } }

/* Galleria a righe giustificate: ogni riga riempie la larghezza, niente vuoti.
   Senza JS bastano i flex-grow proporzionali; js/main.js calcola righe bilanciate. */
.gallery { display: flex; flex-wrap: wrap; gap: 28px 20px; }
.gallery .item { flex: var(--r) 1 calc(var(--r) * 240px); margin: 0; min-width: 0; }
.gallery.is-justified .item { flex: 0 0 auto; }
.gallery.is-justified .item.row-end { flex-grow: 1; }
.gallery a { display: block; text-decoration: none; overflow: hidden; background: var(--paper-2); }
.gallery img { width: 100%; height: auto; aspect-ratio: var(--r); object-fit: cover; transition: transform .6s cubic-bezier(.16, 1, .3, 1), opacity .3s; }
.gallery a:hover img { transform: scale(1.03); }
.gallery figcaption { font: 400 19px/1.3 var(--serif); margin-top: 10px; }
/* didascalia descrittiva: due righe in galleria, intera nella pagina dell'opera */
.gallery .cap {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  font: 400 12.5px/1.45 var(--sans); color: var(--ink-soft); margin-top: 4px;
}
.work-cap { font-size: 14px; line-height: 1.55; color: var(--ink-soft); margin-top: 14px; max-width: 46em; }
@media (max-width: 520px) { .gallery { gap: 22px 12px; } .gallery figcaption { font-size: 16px; } }

/* Vista "Tutte": gruppi per serie */
.cat-group { padding-top: clamp(32px, 5vw, 64px); margin-top: clamp(16px, 3vw, 32px); border-top: 1px solid var(--ink); scroll-margin-top: 80px; }
.cat-group:first-of-type { border-top: 0; padding-top: 8px; margin-top: 0; }
.cat-group-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.cat-group-head h2 { font-size: clamp(34px, 4.5vw, 56px); }
.cat-group-head a { margin-left: auto; font-size: 14px; text-decoration: none; }
.cat-group-head a:hover { text-decoration: underline; }
.cat-group-more { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 8px 0 0; }
.cat-group-intro { color: var(--ink-soft); max-width: 44em; margin: 10px 0 28px; }

/* Filtri categoria */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 36px; padding: 0; list-style: none; }
.filters a { display: block; text-decoration: none; font-size: 13px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; }
.filters a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.count { color: var(--ink-soft); font-size: 12px; margin-left: 4px; }

/* Pagina opera */
.work { padding: clamp(32px, 5vw, 64px) 0; }
.work-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.work figure { margin: 0; }
.work figure img { width: 100%; max-height: 82vh; object-fit: contain; object-position: left top; }
.work dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; font-size: 14px; margin: 28px 0; }
.work dt { color: var(--ink-soft); }
.work dd { margin: 0; }
.crumbs { font-size: 13px; color: var(--ink-soft); margin-bottom: 18px; }
.crumbs a { text-decoration: none; }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; font-size: 14px; }
@media (max-width: 860px) { .work-grid { grid-template-columns: 1fr; } }

.facts { list-style: none; padding: 0; margin: 24px 0; border-top: 1px solid var(--line); }
.facts li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.facts span:first-child { color: var(--ink-soft); }

/* Pagina opera: altre opere della serie */
.related { margin-top: clamp(56px, 8vw, 110px); padding-top: clamp(32px, 4vw, 48px); border-top: 1px solid var(--ink); }
.related h2 { font-size: clamp(28px, 3.5vw, 44px); }

/* Biografia */
.bio-hero { padding: clamp(32px, 6vw, 88px) 0 clamp(32px, 5vw, 64px); }
.bio-hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(28px, 6vw, 96px); align-items: end; }
.bio-hero h1 { font-size: clamp(48px, 8.5vw, 124px); line-height: .98; }
.bio-hero h1 em { font-style: italic; color: var(--accent); }
.bio-sign { width: min(440px, 80%); margin: 28px 0 24px; }
.bio-portrait { margin: 0; }
.bio-portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.bio-portrait figcaption, .studio figcaption { font-size: 13px; color: var(--ink-soft); margin-top: 10px; }
@media (max-width: 860px) { .bio-hero-grid { grid-template-columns: minmax(0, 1fr); } .bio-portrait img { aspect-ratio: 4 / 3; } }

.section-tight { padding: 0 0 clamp(40px, 6vw, 80px); }
.cifre { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); }
.cifre li { padding: 24px 24px 8px 0; border-right: 1px solid var(--line); }
.cifre li + li { padding-left: 24px; }
.cifre li:last-child { border-right: 0; }
.cifre strong { display: block; font: 400 clamp(44px, 5vw, 72px)/1 var(--serif); }
.cifre span { display: block; margin-top: 10px; font-size: 14px; color: var(--ink-soft); max-width: 18em; }
@media (max-width: 760px) {
  .cifre { grid-template-columns: 1fr 1fr; }
  .cifre li, .cifre li + li { padding: 20px 12px 16px 0; border-right: 0; border-bottom: 1px solid var(--line); }
}

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: clamp(28px, 6vw, 96px); }
.split-head { position: sticky; top: 100px; align-self: start; }
@media (max-width: 860px) { .split { grid-template-columns: minmax(0, 1fr); } .split-head { position: static; } }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 24px; padding: 26px 0; border-top: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 1px solid var(--line); }
.tl-year { font: 400 34px/1 var(--serif); color: var(--accent); }
.timeline h3 { font-size: 28px; margin-bottom: 8px; }
.timeline p { margin: 0; color: var(--ink-soft); max-width: 40em; }
@media (max-width: 520px) { .timeline li { grid-template-columns: 1fr; gap: 8px; } }

.segno { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 32px; }
.segno-item { text-decoration: none; }
.segno-item img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: opacity .2s; }
.segno-item:hover img { opacity: .85; }
.segno-item span { display: block; font: 400 17px/1.3 var(--serif); margin-top: 8px; }
@media (max-width: 520px) { .segno { grid-template-columns: 1fr 1fr; } }

.studio { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 20px; align-items: start; }
.studio figure { margin: 0; }
.studio img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.studio figure:first-child img { aspect-ratio: 4 / 3; }
@media (max-width: 760px) { .studio { grid-template-columns: 1fr 1fr; } .studio figure:first-child { grid-column: 1 / -1; } }

.cta-band { background: var(--ink); color: var(--paper); padding: clamp(48px, 7vw, 96px) 0; }
.cta-band .wrap { display: flex; justify-content: space-between; align-items: center; gap: 28px; flex-wrap: wrap; }
.cta-band h2 { max-width: 14em; }
.cta-band .btn { border-color: var(--paper); color: var(--paper); }
.cta-band .btn-solid { background: var(--paper); color: var(--ink); }
.cta-band .btn:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); }

/* Contatti (schede come sito miche) */
.contact-head { max-width: 46em; margin-bottom: 40px; }
.contact-head h1 { font-size: clamp(48px, 7vw, 104px); }
.contact-head .lead { margin-top: 20px; }
.contact-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 16px; max-width: 980px; }
.contact-btn {
  display: flex; align-items: center; gap: 18px; padding: 22px 24px; min-height: 88px;
  border: 1px solid var(--ink); background: var(--bg-top); text-decoration: none; color: var(--ink);
  transition: background .2s, color .2s;
}
.contact-btn:hover { background: var(--ink); color: var(--paper); }
.contact-btn__icon { flex: none; width: 52px; height: 52px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; }
.contact-btn__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.contact-btn__label { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; opacity: .7; }
.contact-btn__value { font: 400 clamp(20px, 2.2vw, 26px)/1.2 var(--serif); overflow-wrap: anywhere; }
.contact-btn__arrow { flex: none; transition: transform .2s; }
.contact-btn:hover .contact-btn__arrow { transform: translateX(4px); }
.contact-alt { font-size: 14px; color: var(--ink-soft); margin: 14px 0 0; }

.contact-work-banner { display: flex; align-items: center; gap: 16px; padding: 12px 14px; margin-bottom: 20px; max-width: 980px; background: var(--paper-2); border-left: 2px solid var(--accent); }
.contact-work-banner[hidden] { display: none; }
.contact-work-banner img { width: 96px; height: 72px; object-fit: cover; flex: none; }
.contact-work-banner span { flex: 1; }
.contact-work-banner strong { font: 400 22px/1.2 var(--serif); display: block; }
.contact-work-clear { text-decoration: none; font-size: 26px; line-height: 1; padding: 8px 12px; min-width: 44px; text-align: center; }

.contact-tips { margin-top: clamp(40px, 6vw, 72px); max-width: 640px; }
.h-small { font: 500 13px/1.4 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 12px; }
.tips { margin: 0; padding: 0; list-style: none; }
.tips li { padding: 12px 0 12px 24px; border-bottom: 1px solid var(--line); position: relative; }
.tips li::before { content: ""; position: absolute; left: 0; top: 24px; width: 12px; height: 1px; background: var(--accent); }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq summary { cursor: pointer; font: 400 22px/1.3 var(--serif); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--sans); color: var(--ink-soft); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 12px 0 0; max-width: 46em; color: var(--ink-soft); }

.note { font-size: 14px; color: var(--ink-soft); border-left: 2px solid var(--accent); padding: 4px 0 4px 16px; max-width: 46em; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 40px; font-size: 14px; color: var(--ink-soft); }
.site-footer .wrap { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.site-footer strong { color: var(--ink); font: 600 22px var(--serif); display: block; margin-bottom: 6px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 4px 0; }
.site-footer a { text-decoration: none; }
.legal-line { grid-column: 1 / -1; font-size: 12px; border-top: 1px solid var(--line); padding-top: 20px; }
@media (max-width: 760px) { .site-footer .wrap { grid-template-columns: 1fr; } }

/* Lightbox */
.lb { position: fixed; inset: 0; z-index: 50; background: rgba(20, 18, 15, .96); display: none; align-items: center; justify-content: center; }
.lb.open { display: flex; }
.lb img { max-width: 92vw; max-height: calc(100vh - 190px); max-height: calc(100dvh - 190px); object-fit: contain; margin-bottom: 110px; }
.lb-cap { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: #e6e6e4; font: 400 20px var(--serif); padding: 0 60px; margin: 0; }
.lb-cap strong { font-weight: 400; display: block; }
.lb-cap span { display: block; max-width: 62ch; margin: 6px auto 0; font: 400 14px/1.5 var(--sans); color: #bdbdba; }
.lb button { position: absolute; background: none; border: 0; color: #e6e6e4; font: 400 34px/1 var(--sans); cursor: pointer; padding: 16px; }
.lb-close { top: 8px; right: 8px; }
.lb-prev { left: 4px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 4px; top: 50%; transform: translateY(-50%); }
.lb button:hover { color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* Pulsante "torna su" */
.to-top {
  position: fixed; z-index: 30;
  /* alzato: in basso a destra c'è il badge "Powered by Netlify" sulle pagine .netlify.app */
  right: max(20px, env(safe-area-inset-right)); bottom: calc(84px + env(safe-area-inset-bottom));
  width: 48px; height: 48px; padding: 0; aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--ink); text-decoration: none;
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .25s, transform .25s cubic-bezier(.16, 1, .3, 1), background .2s, border-color .2s;
}
.to-top[hidden] { display: grid; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
/* Vetro stile Apple (liquid glass) per i controlli che galleggiano sopra le opere:
   frecce della hero e "torna su" */
.hero-arrow, .to-top {
  background: rgba(255, 255, 255, .26);
  -webkit-backdrop-filter: blur(14px) saturate(180%); backdrop-filter: blur(14px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75), inset 0 -1px 1px rgba(255, 255, 255, .2),
              0 8px 24px -10px rgba(0, 0, 0, .28);
}
.hero-arrow:hover, .to-top:hover { background: rgba(255, 255, 255, .45); color: var(--ink); }
.hero-arrow:active { transform: translateY(-50%) scale(.94); }
.to-top:active { transform: scale(.94); }
body.lb-open .to-top { display: none; }

/* ---------- Adattamenti mobile / tablet ---------- */

/* Telefoni stretti: card contatti e banner opera più compatti */
@media (max-width: 400px) {
  .contact-btn { padding: 16px; gap: 14px; }
  .contact-btn__icon { width: 40px; height: 40px; }
  .contact-btn__icon svg { width: 22px; height: 22px; }
  .contact-btn__arrow { display: none; }
  .contact-btn__value { font-size: 19px; overflow-wrap: normal; }
  .contact-work-banner { gap: 12px; padding: 10px; }
  .contact-work-banner img { width: 64px; height: 48px; }
  .contact-work-banner strong { font-size: 19px; }
}

/* Telefono in orizzontale: hero su due colonne, header più basso, lightbox con didascalia piccola */
@media (orientation: landscape) and (max-height: 500px) {
  .site-header .wrap { min-height: 54px; }
  .brand-sign { height: 30px; }
  .hero-stage { height: calc(100vh - 54px); height: calc(100dvh - 54px); aspect-ratio: auto; }
  .hero-name { font-size: 40px; }
  .hero-intro { grid-template-columns: 1fr 2fr; }
  .hero .lead { font-size: 17px; margin: 0 0 18px; }
  .bio-hero-grid, .contact-head { gap: 24px; }
  .lb img { max-height: calc(100vh - 70px); max-height: calc(100dvh - 70px); margin-bottom: 26px; }
  .lb-cap { font-size: 16px; bottom: 8px; }
}

/* Schermi touch: aree di tocco di almeno 44px */
@media (pointer: coarse) {
  .lang a { padding: 12px 14px; }
  .nav-toggle { min-height: 44px; padding: 12px 4px; }
  .filters a { padding: 12px 16px; }
  .site-footer li a, .pager a, .crumbs a, .cat-group-head a, .section-head > a {
    display: inline-block; padding-block: 12px;
  }
  .site-footer li { margin: 0; }
  .faq summary { padding: 6px 0; }
}

#main:focus { outline: none; }

/* Biografia: mostre e stampa */
.shows { list-style: none; margin: 0; padding: 0; }
.mostra { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 48px); padding: 28px 0 36px; border-top: 1px solid var(--line); }
.mostra:last-child { border-bottom: 1px solid var(--line); }
.show-date { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 0 0 8px; }
.mostra h3 { font-size: clamp(28px, 3vw, 38px); margin-bottom: 6px; }
.show-place { font-size: 14px; color: var(--ink-soft); margin: 0 0 14px; }
.show-text p:last-child { margin-bottom: 0; }
.show-docs { display: flex; gap: 14px; align-items: flex-start; }
.show-docs figure { margin: 0; flex: 1 1 0; min-width: 0; }
.show-docs a { display: block; background: var(--paper-2); box-shadow: 0 18px 36px -24px rgba(20, 20, 20, .45); }
.show-docs img { width: 100%; max-height: 420px; object-fit: contain; }
.show-docs figcaption { font-size: 12.5px; line-height: 1.45; color: var(--ink-soft); margin-top: 8px; }
@media (max-width: 760px) { .mostra { grid-template-columns: 1fr; } }

/* Hero: puntini per scegliere la coppia di opere, in una riga sotto la fascia */
.hero-dots { display: flex; justify-content: center; gap: 2px; margin-top: 6px; }
.hero-dot {
  width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer;
  display: grid; place-items: center;
}
.hero-dot::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%;
  border: 1px solid var(--ink); background: transparent; transition: background .2s, transform .2s;
}
.hero-dot:hover::before { transform: scale(1.25); }
.hero-dot[aria-current="true"]::before { background: var(--ink); }


/* Home: striscia delle mostre */
.shows-strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.shows-strip a { display: block; text-decoration: none; }
.shows-strip img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; background: var(--paper-2); filter: grayscale(.2); transition: filter .3s; }
.shows-strip a:hover img { filter: none; }
.shows-strip .show-date { display: block; margin: 14px 0 4px; }
.shows-strip strong { display: block; font: 400 26px/1.15 var(--serif); }
.shows-strip span:last-child { display: block; font-size: 14px; color: var(--ink-soft); margin-top: 4px; }
@media (max-width: 760px) { .shows-strip { grid-template-columns: 1fr; } }
.shows-more { font-size: 15px; color: var(--ink-soft); margin: 22px 0 0; }

/* Didascalie tagliate a due righe: "Leggi tutto" le apre per intero (anche cliccando il testo) */
.gallery .cap.is-open, .hero-work figcaption.is-open { display: block; -webkit-line-clamp: unset; overflow: visible; }
.gallery .cap.is-cut, .hero-work figcaption.is-cut { cursor: pointer; }
.cap-toggle {
  display: inline-block; margin-top: 2px; padding: 4px 0; border: 0; background: none; cursor: pointer;
  font: 500 12px/1.4 var(--sans); color: var(--ink); text-decoration: underline; text-underline-offset: 3px;
}
.cap-toggle[hidden] { display: none; }
.cap-toggle:hover { color: var(--accent); }
.hero-work .cap-toggle { align-self: flex-start; }
@media (max-width: 760px) { .hero-work .cap-toggle { margin-left: var(--gutter); } }
@media (pointer: coarse) { .cap-toggle { padding: 12px 0; } }
