/* ==========================================================================
   giannigaggero.it — foglio di stile
   Fondo bianco da galleria: i colori li mettono i quadri. L'unico accento è
   il blu dei geometrici, usato per link e dettagli.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-soft: #f4f4f2;
  --text: #161616;
  --muted: #6b6b6b;
  --border: #e4e4e0;
  --accent: #1d5fd6;
  --font: "Avenir Next", Avenir, "Segoe UI", "Helvetica Neue", Roboto, Arial, sans-serif;
  --maxw: 76rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--font);
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
a:hover { color: var(--accent); }
h1, h2 { font-weight: 600; letter-spacing: -.01em; line-height: 1.15; }
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); margin: 0 0 1.2rem; }
h2 { font-size: 1.5rem; margin: 0 0 1.5rem; }
main { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* --- Testata ------------------------------------------------------------- */
.testata {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.6rem var(--gutter) 1.4rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 2rem;
  flex-wrap: wrap;
}
.marchio {
  font-size: 1.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  text-decoration: none;
}
.marchio:hover { color: var(--text); }
.menu { display: flex; gap: .3rem 1.5rem; flex-wrap: wrap; }
.menu a { text-decoration: none; color: var(--muted); font-size: 1rem; }
.menu a:hover, .menu a[aria-current] { color: var(--text); }
.menu a[aria-current] { box-shadow: 0 2px 0 var(--accent); }

/* --- Home ---------------------------------------------------------------- */
.eroe {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: var(--gutter);
  align-items: end;
  margin: 1.5rem 0 4rem;
}
.eroe h1 { font-size: clamp(2.6rem, 7vw, 5.2rem); font-weight: 600; line-height: 1.02; margin: 0; }
.eroe h1 span:last-child { font-size: .42em; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.mosaico { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.mosaico img { aspect-ratio: 1; object-fit: cover; width: 100%; }

.recensione { max-width: 62rem; margin: 0 auto 4rem; }
.recensione .colonne { columns: 2 22rem; column-gap: 3rem; }
.recensione .colonne p { margin: 0 0 1rem; break-inside: avoid-column; }
.recensione .firma { text-align: right; font-style: italic; color: var(--muted); }

.sezione { margin: 0 0 4.5rem; padding-top: 2.5rem; border-top: 1px solid var(--border); }
.altri { display: flex; gap: 2rem; flex-wrap: wrap; margin-top: 2rem; }
.altri a, .intro a { color: var(--accent); text-decoration: none; }

/* --- Griglia delle opere ------------------------------------------------- */
.griglia {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr));
  gap: 2.5rem 1.6rem;
}
.opera { text-decoration: none; display: flex; flex-direction: column; text-align: center; }
.opera .cornice { background: var(--bg-soft); overflow: hidden; margin-bottom: .9rem; }
.opera img { aspect-ratio: 1; object-fit: cover; width: 100%; transition: transform .5s ease; }
.opera:hover img { transform: scale(1.03); }
.opera .titolo {
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  line-height: 1.45;
  font-weight: 500;
}
.opera:hover .titolo { color: var(--accent); }
.opera .dettagli { font-size: .88rem; color: var(--muted); margin-top: .25rem; }
.nd { display: block; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: #a33; margin-top: .2rem; }
.conta { font-size: .85rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* --- Intro delle pagine di serie ----------------------------------------- */
.intro { max-width: 46rem; margin: 1.5rem 0 3.5rem; }
.intro p { margin: 0 0 .9rem; }

.diapositive { margin: 0 0 4rem; }
.diapositive h2 { font-size: 1.15rem; }
.striscia {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: .8rem;
}
.striscia > a { flex: 0 0 min(26rem, 82%); scroll-snap-align: start; border: 1px solid var(--border); }
.striscia.foto > a { flex-basis: min(20rem, 70%); border: 0; }
.striscia.foto img { aspect-ratio: 1; object-fit: cover; width: 100%; }

/* --- Scheda di un'opera -------------------------------------------------- */
.scheda {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(16rem, 1fr);
  gap: 3rem;
  align-items: start;
  margin: 1.5rem 0 3rem;
}
.quadro { margin: 0; background: var(--bg-soft); padding: clamp(1rem, 3vw, 2.5rem); }
.quadro img { margin: 0 auto; max-height: 78vh; width: auto; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.info h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
dl { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.2rem; margin: 0 0 1.8rem; }
dt { color: var(--muted); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; padding-top: .2rem; }
dd { margin: 0; }
dd a { color: var(--accent); text-decoration: none; }
.info .testo p { margin: 0 0 1rem; }
.bottone {
  display: inline-block;
  margin-top: .8rem;
  padding: .75rem 1.4rem;
  background: var(--text);
  color: #fff;
  text-decoration: none;
  font-size: .85rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.bottone:hover { background: var(--accent); color: #fff; }
.altre img { width: 100%; }
.altre { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(16rem, 100%), 1fr)); gap: 1rem; margin-bottom: 3rem; }
.sfoglia {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--border);
  padding: 1.5rem 0 3rem;
  font-size: .95rem;
}
.sfoglia a { text-decoration: none; color: var(--muted); max-width: 48%; }
.sfoglia a:hover { color: var(--accent); }
.sfoglia a[rel="next"] { text-align: right; }

/* --- Bio, contatti, blog ------------------------------------------------- */
.bio, .contatti {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 3.5rem;
  align-items: start;
  margin: 1.5rem 0 4rem;
}
.contatti { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.bio figure, .contatti figure { margin: 0; }
.bio h2 { margin-top: 2.5rem; }
.testo p { margin: 0 0 1rem; }
.contatti dl { margin-top: 2rem; font-size: 1.15rem; }
.contatti dd a { color: var(--text); }

.articoli { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(18rem, 100%), 1fr)); gap: 2.5rem 2rem; }
.articolo-scheda { text-decoration: none; display: flex; flex-direction: column; }
.articolo-scheda .cornice { overflow: hidden; margin-bottom: 1rem; background: var(--bg-soft); }
.articolo-scheda img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.articolo-scheda time { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.articolo-scheda .titolo { font-size: 1.25rem; font-weight: 600; margin: .2rem 0 .4rem; }
.articolo-scheda .estratto { color: var(--muted); font-size: .95rem; }
.articolo-scheda:hover .titolo { color: var(--accent); }

.articolo { max-width: 44rem; margin: 1.5rem auto 4rem; }
.articolo .sopra { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.articolo .sopra a { color: var(--accent); text-decoration: none; }
.articolo figure { margin: 2rem 0 0; }
.articolo .testo { font-size: 1.12rem; }

/* --- Piè di pagina ------------------------------------------------------- */
.piede {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem var(--gutter) 2.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 1.5rem 3rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .95rem;
}
.piede strong { color: var(--text); font-weight: 600; }
.piede a { text-decoration: none; }
.piede nav { display: flex; gap: .3rem 1.2rem; flex-wrap: wrap; align-self: end; }
.copyright { flex-basis: 100%; margin: 0; font-size: .8rem; }

/* --- Ingrandimento ------------------------------------------------------- */
.zoom { cursor: zoom-in; display: block; }
.lightbox {
  border: 0;
  padding: 0;
  max-width: 100vw;
  max-height: 100vh;
  width: 100vw;
  height: 100vh;
  background: rgba(12, 12, 12, .94);
}
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 94vw; max-height: 92vh; width: auto; cursor: zoom-out; }
.lightbox .chiudi {
  position: absolute;
  top: .6rem;
  right: 1rem;
  background: none;
  border: 0;
  color: #fff;
  font-size: 2.4rem;
  line-height: 1;
  cursor: pointer;
}

/* --- Schermi piccoli ----------------------------------------------------- */
@media (max-width: 860px) {
  .eroe, .scheda, .bio, .contatti { grid-template-columns: 1fr; gap: 2rem; }
  .eroe { margin-bottom: 3rem; }
  .quadro img { max-height: none; width: 100%; }
}
@media (max-width: 560px) {
  .testata { padding-top: 1.1rem; }
  .marchio { font-size: 1.35rem; }
  .menu { gap: .2rem 1.1rem; }
  .griglia { grid-template-columns: 1fr 1fr; gap: 1.8rem .9rem; }
  .opera .titolo { font-size: .7rem; letter-spacing: .08em; }
  .opera .dettagli { font-size: .78rem; }
}
@media (prefers-reduced-motion: reduce) {
  .opera img { transition: none; }
}
