/* =========================================================
   Art by Stefano Mastria — foglio di stile
   Palette ricavata dal logo: crema, inchiostro, ocra, blu tenue
   ========================================================= */

:root {
  --cream:      #FBF8F3;
  --cream-warm: #F4EEE4;
  --ink:        #2E2B28;
  --ink-soft:   #6B645C;
  --ochre:      #B5714F;
  --blue:       #8FA5BC;
  --line:       #E2DACD;

  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans:  "Jost", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --wrap: 1240px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a   { color: inherit; }

.wrap { width: min(100% - 3rem, var(--wrap)); margin-inline: auto; }

/* ---------- tipografia ---------- */

h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; line-height: 1.15; }
h2 { font-size: clamp(2rem, 4vw, 3.1rem); }
h3 { font-size: 1.45rem; }

.eyebrow {
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 1rem;
}

.lede { font-size: 1.12rem; color: var(--ink-soft); max-width: 60ch; }

/* ---------- intestazione ---------- */

.site-header {
  padding: 2rem 0 1.25rem;
  text-align: center;
  border-bottom: 1px solid var(--line);
  background: var(--cream);
}

.brand { text-decoration: none; display: inline-block; }
.brand .brand-top {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ochre);
  display: block;
  line-height: 1;
}
.brand .brand-name {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 4.4vw, 2.7rem);
  letter-spacing: .02em;
  display: block;
  margin-top: .15rem;
}

/* variante testata con il logo tondo */
.brand-logo { display: inline-block; line-height: 0; }
.brand-logo img {
  width: clamp(112px, 13vw, 156px);
  height: auto;
  margin-inline: auto;
}

.nav {
  margin-top: 1.4rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem;
  font-size: .82rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.nav a { text-decoration: none; padding-bottom: 3px; border-bottom: 1px solid transparent; }
.nav a:hover { border-bottom-color: var(--ochre); }

/* ---------- hero ---------- */

.hero { position: relative; }
.hero img { width: 100%; height: clamp(380px, 62vh, 660px); object-fit: cover; }
/* testo in basso a sinistra: il dipinto al centro resta visibile */
.hero-inner {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: flex-start; justify-content: flex-end;
  text-align: left;
  padding: clamp(2rem, 5vw, 4.5rem);
  background: linear-gradient(180deg, rgba(20,18,16,0) 42%, rgba(20,18,16,.55) 100%);
  color: #fff;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  max-width: 16ch;
  text-shadow: 0 2px 22px rgba(0,0,0,.45);
}
.hero p {
  margin: .8rem 0 1.6rem;
  font-size: clamp(.95rem, 1.5vw, 1.12rem);
  text-shadow: 0 2px 14px rgba(0,0,0,.45);
}

.btn {
  display: inline-block;
  padding: .85rem 2.3rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  text-decoration: none;
  font-size: .78rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  transition: background .25s, color .25s;
}
.btn-light { color: #fff; }
.btn-light:hover { background: #fff; color: var(--ink); }
.btn-dark:hover { background: var(--ink); color: var(--cream); }

/* ---------- sezioni ---------- */

section { padding: clamp(3.5rem, 7vw, 6rem) 0; }
.section-head { text-align: center; margin-bottom: 3rem; }

/* collezioni per anno */
.years { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2rem; }
.year-card {
  position: relative; overflow: hidden; border-radius: 3px;
  text-decoration: none; color: #fff; display: block;
}
.year-card img { height: 420px; width: 100%; object-fit: cover; transition: transform .8s ease; }
.year-card:hover img { transform: scale(1.04); }
.year-card .overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  /* centrare i blocchi non centra il testo dentro di loro: su schermo stretto la
     didascalia va a capo e le righe si allineerebbero a sinistra, appoggiate ai
     bordi. Il margine laterale le tiene staccate dal bordo dell'immagine. */
  text-align: center;
  padding: 1.6rem 1.5rem;
  /* un velo uniforme non basta: su un acquerello chiaro il testo bianco sparisce.
     Qui il velo si scurisce verso il centro, dove stanno anno e didascalia. */
  background:
    radial-gradient(ellipse at center, rgba(20,17,14,.52) 0%, rgba(20,17,14,.22) 72%),
    rgba(24,21,18,.16);
  transition: background .35s;
  text-shadow: 0 1px 10px rgba(0,0,0,.45);
}
.year-card:hover .overlay {
  background:
    radial-gradient(ellipse at center, rgba(20,17,14,.60) 0%, rgba(20,17,14,.32) 72%),
    rgba(24,21,18,.20);
}
.year-card .yr { font-family: var(--serif); font-size: 3.4rem; line-height: 1; }
.year-card .sub {
  font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; margin-top: .6rem;
  /* senza un limite la riga arriva da bordo a bordo e lascia una parola sola
     sotto; così le due righe vengono di lunghezza simile */
  max-width: 34ch;
  text-wrap: balance;
}

/* ---------- griglia opere ----------
   I riquadri seguono la forma reale dell'opera e crescono col formato:
   A5, A4 e A3 hanno la stessa proporzione (1:√2), quindi la differenza di
   misura si può leggere solo dalla dimensione del riquadro. Le opere
   orizzontali occupano più larghezza, le verticali più altezza. */

.works {
  --gap-x: 1.8rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;        /* i riquadri partono tutti dalla stessa linea */
  gap: 2.4rem var(--gap-x);
}

/* L'altezza del riquadro dipende solo dal formato, non dall'orientamento: un A5
   girato resta un A5. Da qui discende anche la larghezza — e un'orizzontale
   viene a occupare esattamente il doppio di una verticale. */
.work {
  text-decoration: none;
  display: block;
  --alt: 297px;                   /* altezza del riquadro per un A5 */
  --prop: 1.414;                  /* lato lungo diviso lato corto */
}
.work.fmt-a4 { --alt: 342px; }    /* +15% */
.work.fmt-a3 { --alt: 393px; }    /* +32% */
/* i piccoli 10×15 non sono della serie A: più bassi e un filo più slanciati */
.work.fmt-small { --alt: 258px; --prop: 1.5; }

/* la selezione in apertura d'annata: poche opere, centrate sulla pagina */
.works.is-centred { justify-content: center; }
.featured { padding-bottom: 0; }
.featured + .wrap .chips { margin-top: 2.5rem; }

.work.is-portrait  { width: min(100%, calc(var(--alt) / var(--prop))); }
.work.is-landscape { width: min(100%, calc(var(--alt) * var(--prop))); }

.work-img {
  height: var(--alt);
  background: var(--cream-warm);
  padding: 1.1rem;
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
}
.work-img img {
  max-height: 100%; width: auto; object-fit: contain;
  box-shadow: 0 6px 22px rgba(46,43,40,.13);
  transition: transform .5s ease;
}
.work:hover .work-img img { transform: translateY(-5px); }
.work h3 { margin-top: 1rem; font-size: 1.12rem; }
.work .meta { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }

/* ---------- schede del negozio ----------
   Stessa griglia della galleria, ma la scheda non è tutta un collegamento:
   sotto il titolo ci sono prezzo e bottone d'acquisto, e un collegamento
   dentro un altro collegamento non sarebbe valido. */
.shop-item { display: block; }
.shop-item .shop-link { text-decoration: none; display: block; color: inherit; }
.shop-item:hover .work-img img { transform: translateY(-5px); }
.shop-price {
  font-family: var(--serif);
  font-size: 1.35rem;
  margin: .5rem 0 .8rem;
}
.btn-small { padding: .6rem 1.5rem; font-size: .7rem; }

/* opera venduta: resta nel negozio, ma senza invito all'acquisto */
.shop-item.is-sold .work-img { background: var(--cream); }
.shop-item.is-sold .shop-price { color: var(--ink-soft); text-decoration: line-through; }
.shop-sold {
  display: inline-block; text-decoration: none;
  padding: .55rem 1.4rem; border-radius: 999px;
  background: var(--ochre); color: var(--cream);
  font-size: .7rem; letter-spacing: .18em; text-transform: uppercase;
}
.shop-sold .dove {
  display: block; letter-spacing: .08em;
  font-size: .62rem; opacity: .8; text-transform: none;
}
.shop-sold:hover { background: var(--ink); }

/* about */
.about { background: var(--cream-warm); }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.about-grid img { border-radius: 3px; }

/* fascia acquisto */
.buy { text-align: center; }
.buy .note { font-size: .9rem; color: var(--ink-soft); margin-top: 1.2rem; }

/* footer */
.site-footer {
  background: var(--ink); color: var(--cream);
  padding: 3.5rem 0 2rem; text-align: center;
}
.site-footer .social { display: flex; justify-content: center; gap: 1.8rem; margin-bottom: 1.6rem; flex-wrap: wrap; }
.site-footer a { text-decoration: none; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; opacity: .85; }
.site-footer a:hover { opacity: 1; }
.site-footer .copy { font-size: .74rem; letter-spacing: .1em; opacity: .55; }

/* ---------- mobile ---------- */

@media (max-width: 720px) {
  .about-grid { grid-template-columns: 1fr; }
  .nav { gap: 1.1rem; font-size: .74rem; }
  .year-card img { height: 300px; }
  .works { --gap-x: 1rem; gap: 1.8rem var(--gap-x); }
  .work { --alt: 212px; }
  .work.fmt-a4 { --alt: 244px; }
  .work.fmt-a3 { --alt: 280px; }
  .work.fmt-small { --alt: 184px; }
}

/* =========================================================
   Pagina singola opera: slideshow + scheda tecnica
   ========================================================= */

.work-detail { padding-top: clamp(2.5rem, 5vw, 4rem); }

.work-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

/* --- slideshow --- */
.gallery { position: relative; }

.stage {
  position: relative;
  background: var(--cream-warm);
  border: 1px solid var(--line);
  aspect-ratio: 4 / 3;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.slide { margin: 0; display: none; width: 100%; height: 100%; }
.slide.is-active { display: flex; align-items: center; justify-content: center; }
.slide img {
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;
  padding: 1.6rem;
}
/* il dipinto da solo riceve un'ombra; i mockup sono già fotografie d'ambiente */
.slide[data-slide="0"] img { box-shadow: 0 8px 30px rgba(46,43,40,.16); padding: 2.2rem; }

.nav-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 2;
  width: 42px; height: 42px;
  border: 1px solid var(--line);
  background: rgba(251,248,243,.86);
  color: var(--ink);
  border-radius: 50%;
  font-size: 1.5rem; line-height: 1;
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.nav-arrow:hover { background: #fff; }
.nav-arrow.prev { left: 12px; }
.nav-arrow.next { right: 12px; }

.thumbs { display: flex; gap: .7rem; margin-top: .9rem; flex-wrap: wrap; }
.thumb {
  width: 78px; height: 78px;
  padding: 0; cursor: pointer;
  border: 1px solid var(--line);
  background: var(--cream-warm);
  overflow: hidden;
  opacity: .62;
  transition: opacity .2s, border-color .2s;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb:hover { opacity: .9; }
.thumb.is-active { opacity: 1; border-color: var(--ochre); }

/* --- scheda tecnica --- */
.work-info h1 {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 3.4vw, 2.8rem);
  margin: .2rem 0 1rem;
}
.work-info .lede { margin-bottom: 2rem; }

.specs {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .55rem 1.6rem;
  margin: 0 0 2.2rem;
  padding: 1.6rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: .95rem;
}
.specs dt {
  font-size: .72rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-soft); align-self: center;
}
.specs dd { margin: 0; }

.price .amount {
  font-family: var(--serif);
  font-size: 2rem;
  display: block;
  margin-bottom: 1rem;
}
.price .not-for-sale {
  display: inline-block;
  font-size: .78rem; letter-spacing: .18em; text-transform: uppercase;
  padding: .55rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--cream-warm);
}
.price .sold {
  display: inline-block;
  font-size: .78rem; letter-spacing: .18em; text-transform: uppercase;
  padding: .55rem 1.3rem;
  border-radius: 999px;
  color: var(--cream);
  background: var(--ochre);
}
.price .note { font-size: .88rem; color: var(--ink-soft); margin-top: 1rem; }

@media (max-width: 860px) {
  .work-layout { grid-template-columns: 1fr; }
  .stage { aspect-ratio: 1 / 1; }
  .thumb { width: 64px; height: 64px; }
}

/* =========================================================
   Galleria di un anno
   ========================================================= */

.year-intro { padding: clamp(2.5rem, 5vw, 4rem) 0 1rem; }
.year-title {
  font-family: var(--serif);
  font-size: clamp(3.4rem, 9vw, 6.5rem);
  line-height: .95;
  margin: 0;
}

.chips {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: .6rem; margin-top: 2.2rem;
}
.chip {
  font-family: var(--sans);
  font-size: .74rem; letter-spacing: .14em; text-transform: uppercase;
  padding: .55rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.chip:hover { border-color: var(--ochre); color: var(--ink); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--cream); }

.coll-group { margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.coll-group[hidden] { display: none; }
.coll-title {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  padding-bottom: .8rem;
  margin-bottom: 1.8rem;
  border-bottom: 1px solid var(--line);
}

/* anteprime degli anni: slideshow in dissolvenza */
.year-slides { position: absolute; inset: 0; }
.year-slides img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.1s ease;
}
.year-slides img.is-active { opacity: 1; }
.year-card { display: block; height: 420px; }
.year-card .overlay { z-index: 1; }
.year-card .count {
  font-size: .7rem; letter-spacing: .16em; text-transform: uppercase;
  margin-top: .9rem; opacity: .85;
}
@media (max-width: 720px) { .year-card { height: 300px; } }

/* apertura con il marchio: nessun testo sovrapposto, perché coprirebbe il
   badge e il bianco non si leggerebbe su una foto così chiara */
.hero-logo img {
  width: 100%;
  height: clamp(300px, 52vh, 620px);
  object-fit: cover;
  object-position: center 45%;
}

/* Su schermi larghi il ritaglio a tutta larghezza taglierebbe il tondo sopra e
   sotto. L'immagine viene quindi mostrata intera e centrata; ai lati, invece di
   due bande vuote, la stessa foto ingrandita e sfocata prosegue la scena. */
@media (min-width: 900px) {
  .hero-logo {
    position: relative;
    overflow: hidden;
    isolation: isolate;
  }
  .hero-logo::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("../images/hero-logo.jpg") center / cover no-repeat;
    filter: blur(34px) saturate(1.08) brightness(1.02);
    transform: scale(1.18);      /* evita i bordi chiari lasciati dalla sfocatura */
    z-index: -1;
  }
  .hero-logo img {
    height: auto;
    max-height: 74vh;
    object-fit: contain;
    margin-inline: auto;
    position: relative;
    box-shadow: 0 0 60px rgba(60, 50, 40, .16);
  }
}
.hero-caption {
  padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(1rem, 2vw, 2rem);
  text-align: center;
}
.hero-caption h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.8rem, 3.6vw, 3rem);
  max-width: 22ch;
  margin: 0 auto;
  line-height: 1.15;
}
.hero-caption p {
  color: var(--ink-soft);
  margin: 1rem auto 2rem;
  font-size: clamp(.98rem, 1.5vw, 1.12rem);
}

/* elenco premi e notizie nella sezione dedicata all'artista */
.news-title {
  font-size: 1.15rem;
  margin-top: 2.4rem;
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--line);
}
.news { list-style: none; padding: 0; margin: 1.2rem 0 0; }
.news li {
  display: grid;
  grid-template-columns: 4.2rem 1fr;
  gap: .8rem;
  padding: .6rem 0;
  font-size: .98rem;
  color: var(--ink-soft);
  border-bottom: 1px solid rgba(226,218,205,.55);
}
.news li:last-child { border-bottom: 0; }
.news .yr {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--ochre);
}
