/* Pagina Nuova — design system "La Biblioteca" */
:root {
  --avorio: #f5f2eb;
  --inchiostro: #191611;
  --grigio: #756e60;
  --linea: #ddd7c9;
  --oro: #b07a24;
  --oro-soft: #f2e7d2;
  --display: "Clash Display", sans-serif;
  --body: "Switzer", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--avorio); color: var(--inchiostro);
  font-family: var(--body); font-size: 1.05rem; line-height: 1.62; overflow-x: clip; }
img { max-width: 100%; display: block; }
::selection { background: var(--oro); color: #fff; }

/* transizioni di pagina native (MPA View Transitions) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: via .3s ease both; }
::view-transition-new(root) { animation: arriva .45s ease both; }
@keyframes via { to { opacity: 0; transform: translateY(-14px); } }
@keyframes arriva { from { opacity: 0; transform: translateY(14px); } }

/* ——— header ——— */
header.testata { position: fixed; inset: 0 0 auto 0; z-index: 900; display: flex;
  justify-content: space-between; align-items: center; padding: 1.1rem 4vw;
  color: var(--inchiostro); background: rgba(245,242,235,.9);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--linea);
  transition: background .35s, color .35s, box-shadow .35s; }
header.testata.chiara { color: #f5f2eb; text-shadow: 0 1px 10px rgba(25,22,17,.6);
  background: linear-gradient(180deg, rgba(25,22,17,.62), rgba(25,22,17,0));
  -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
header.testata.scura-fissa { color: var(--inchiostro); }
.logo { font-family: var(--display); font-weight: 600; font-size: 1.3rem; letter-spacing: -.01em;
  color: inherit; text-decoration: none; }
.logo b { font-weight: 600; opacity: .55; }
nav.menu a { font-size: .88rem; font-weight: 600; color: inherit; text-decoration: none;
  margin-left: 1.6rem; opacity: .95; transition: opacity .3s; }
nav.menu a:hover, nav.menu a[aria-current="page"] { opacity: 1; }
nav.menu a[aria-current="page"] { text-decoration: underline; text-underline-offset: 5px; text-decoration-color: var(--oro); }
@media (max-width: 760px) { nav.menu a { margin-left: 1rem; } nav.menu a.solo-desktop { display: none; } }

/* ——— hero home ——— */
.hero { position: relative; min-height: 100svh; display: flex; align-items: flex-end;
  overflow: clip; color: #f5f2eb; }
.hero .foto { position: absolute; inset: 0; }
.hero .foto img { width: 100%; height: 100%; object-fit: cover;
  animation: kenburns 22s ease-in-out infinite alternate; }
.hero .foto video { width: 100%; height: 100%; object-fit: cover; }
@keyframes kenburns { from { transform: scale(1) translateY(0) } to { transform: scale(1.08) translateY(-2%) } }
.hero::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(25,22,17,.35), rgba(25,22,17,.15) 35%, rgba(25,22,17,.55) 62%, rgba(25,22,17,.84) 100%); }
.hero .dentro { position: relative; z-index: 2; padding: 0 4vw 9vh; max-width: 1400px; margin-inline: auto; width: 100%; }
.occhiello { font-size: .8rem; letter-spacing: .26em; text-transform: uppercase; margin: 0 0 1.2rem; }
.hero .occhiello { color: #f5e9c9; font-weight: 600; text-shadow: 0 1px 12px rgba(25,22,17,.75); }
.hero h1 { font-family: var(--display); font-weight: 600; letter-spacing: -.02em;
  font-size: clamp(2.9rem, 7.8vw, 7rem); line-height: .98; margin: 0; max-width: 14ch; text-wrap: balance;
  text-shadow: 0 2px 26px rgba(25,22,17,.5); }
.hero .lede { max-width: 36rem; font-size: 1.14rem; color: #efe9da; margin: 1.4rem 0 0;
  text-shadow: 0 1px 10px rgba(25,22,17,.6); }

/* ——— hero pagine interne: banda fotografica ——— */
.pagina-hero { position: relative; min-height: 62svh; display: flex; align-items: flex-end;
  overflow: clip; color: #f5f2eb; }
.pagina-hero .foto { position: absolute; inset: 0; }
.pagina-hero .foto img { width: 100%; height: 100%; object-fit: cover;
  animation: kenburns 22s ease-in-out infinite alternate; }
.pagina-hero::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(25,22,17,.38), rgba(25,22,17,.18) 35%, rgba(25,22,17,.58) 62%, rgba(25,22,17,.84) 100%); }
.pagina-hero .dentro { position: relative; z-index: 2; padding: 8rem 4vw 6vh; max-width: 1400px; margin-inline: auto; width: 100%; }
.briciole { font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; color: #f5e9c9;
  font-weight: 600; text-shadow: 0 1px 12px rgba(25,22,17,.75); margin: 0 0 1rem; }
.briciole a { color: inherit; text-decoration: none; }
.briciole a:hover { text-decoration: underline; }
.pagina-hero h1 { font-family: var(--display); font-weight: 600; letter-spacing: -.02em;
  font-size: clamp(2.4rem, 6vw, 5rem); line-height: 1; margin: 0; max-width: 18ch; text-wrap: balance;
  text-shadow: 0 2px 26px rgba(25,22,17,.5); }
.pagina-hero .lede { max-width: 38rem; font-size: 1.12rem; color: #efe9da; margin: 1.2rem 0 0;
  text-shadow: 0 1px 10px rgba(25,22,17,.6); }

/* ——— bottoni ——— */
.cta { font-family: var(--body); display: inline-block; margin: 1.8rem .4rem 0 0;
  background: var(--inchiostro); color: var(--avorio); font-weight: 600; font-size: .95rem;
  padding: 1rem 1.8rem; border-radius: 99px; text-decoration: none;
  transition: background .3s, color .3s, transform .3s; }
.cta:hover { background: var(--oro); color: #fff; transform: translateY(-2px); }
.cta.invertita { background: #f5f2eb; color: var(--inchiostro); }
.cta.invertita:hover { background: var(--oro); color: #fff; }
.cta.ghost { background: transparent; color: inherit; border: 1.5px solid var(--linea); }
.cta.ghost:hover { border-color: var(--oro); color: var(--oro); background: transparent; }
.hero .cta.ghost, .pagina-hero .cta.ghost { border-color: rgba(245,242,235,.5); color: #f5f2eb; }
.hero .cta.ghost:hover, .pagina-hero .cta.ghost:hover { border-color: var(--oro); color: #f2d9a8; }

/* ——— layout ——— */
main { max-width: 1400px; margin: 0 auto; padding: 0 4vw; }
section { padding: 6.5rem 0 1.5rem; }
.kicker { font-size: .78rem; letter-spacing: .24em; text-transform: uppercase; color: var(--oro); font-weight: 600; }
h2 { font-family: var(--display); font-weight: 600; letter-spacing: -.02em;
  font-size: clamp(1.9rem, 4.4vw, 3.4rem); line-height: 1.04; margin: .5rem 0 2.2rem; max-width: 26ch; }
h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.015em; font-size: 1.3rem; margin: 0 0 .5rem; }
.prosa { max-width: 46rem; color: var(--grigio); }
.prosa strong { color: var(--inchiostro); }

/* ——— card servizi (home) ——— */
.griglia { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.4rem; }
.card { background: #fdfbf6; border: 1px solid var(--linea); border-radius: 18px; overflow: clip;
  text-decoration: none; color: inherit; display: flex; flex-direction: column;
  transition: transform .45s cubic-bezier(.3,0,.2,1), box-shadow .45s; }
.card:hover { transform: translateY(-8px); box-shadow: 0 34px 70px rgba(25,22,17,.14); }
.card figure { margin: 0; height: 220px; flex: none; overflow: clip; }
.card figure img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s cubic-bezier(.2,0,.2,1); }
.card:hover figure img { transform: scale(1.06); }
.card .testo { padding: 1.5rem 1.6rem 1.7rem; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
.card p { margin: 0; color: var(--grigio); font-size: .96rem;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .apri { margin-top: auto; padding-top: .9rem; font-weight: 600; font-size: .9rem; color: var(--oro); }
.card:hover .apri { text-decoration: underline; text-underline-offset: 4px; }

/* ——— banda fotografica con parallax ——— */
.banda { position: relative; height: 52vh; min-height: 340px; border-radius: 22px; overflow: clip;
  margin: 5rem 0 0; display: grid; place-items: center; color: #f5f2eb; text-align: center; }
.banda img { position: absolute; inset: -18% 0; width: 100%; height: 136%; object-fit: cover; }
.banda::after { content: ""; position: absolute; inset: 0; background: rgba(25,22,17,.52); }
.banda blockquote { position: relative; z-index: 2; font-family: var(--display); font-weight: 500;
  font-size: clamp(1.4rem, 3.2vw, 2.4rem); line-height: 1.3; max-width: 34ch; margin: 0; padding: 0 4vw; }
.banda blockquote b { color: #f2d9a8; }

/* ——— strip "in breve" (pagine servizio) ——— */
.inbreve { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1px;
  background: var(--linea); border: 1px solid var(--linea); border-radius: 16px; overflow: clip;
  margin-top: -3.2rem; position: relative; z-index: 5; }
.inbreve div { background: #fdfbf6; padding: 1.3rem 1.5rem; }
.inbreve b { font-family: var(--display); font-weight: 600; font-size: 1.4rem; display: block; }
.inbreve span { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--grigio); }

/* ——— cosa ricevi ——— */
.ricevi { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.2rem; }
.ricevi .voce-r { background: #fdfbf6; border: 1px solid var(--linea); border-radius: 14px; padding: 1.4rem 1.5rem; }
.ricevi .voce-r b { display: block; margin-bottom: .3rem; font-weight: 600; }
.ricevi .voce-r p { margin: 0; color: var(--grigio); font-size: .95rem; }

/* ——— passi ——— */
.passi { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.6rem; counter-reset: passo; }
.passo { border-top: 2px solid var(--inchiostro); padding-top: 1.1rem; counter-increment: passo; }
.passo::before { content: "0" counter(passo); font-family: var(--display); font-weight: 600;
  color: var(--oro); font-size: 1rem; letter-spacing: .08em; }
.passo h3 { font-size: 1.15rem; margin: .4rem 0 .35rem; }
.passo p { margin: 0; color: var(--grigio); font-size: .95rem; }

/* ——— trasparenza ——— */
.trasparenza { background: var(--oro-soft); border-radius: 18px; padding: clamp(1.6rem, 4vw, 2.6rem);
  border-left: 5px solid var(--oro); }
.trasparenza h3 { margin-top: 0; }
.trasparenza ul { margin: .6rem 0 0; padding-left: 1.2rem; color: #6d5a37; display: grid; gap: .4rem; }

/* ——— faq ——— */
.faq details { border-top: 1px solid var(--linea); padding: 1.1rem 0; }
.faq details:last-child { border-bottom: 1px solid var(--linea); }
.faq summary { font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::after { content: "+"; font-family: var(--display); color: var(--oro); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--grigio); max-width: 52rem; margin: .7rem 0 0; }

/* ——— listino ——— */
.listino { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.3rem; }
.voce { border-radius: 18px; padding: 2rem 1.8rem; background: #fdfbf6; border: 1px solid var(--linea);
  display: flex; flex-direction: column; gap: .7rem;
  transition: transform .4s, box-shadow .4s, border-color .4s; }
.voce:hover { transform: translateY(-7px); border-color: var(--oro); box-shadow: 0 30px 60px rgba(176,122,36,.13); }
.voce.forte { background: var(--inchiostro); color: var(--avorio); border-color: var(--inchiostro); }
.voce h3 { margin: 0; font-size: 1.15rem; }
.voce .prezzo { font-family: var(--display); font-weight: 600; font-size: 2.7rem; letter-spacing: -.02em; }
.voce .prezzo small { font-size: 1rem; color: var(--grigio); font-family: var(--body); }
.voce.forte .prezzo small { color: #b3ac9b; }
.voce ul { margin: 0; padding-left: 1.1rem; color: var(--grigio); font-size: .95rem; display: grid; gap: .4rem; }
.voce.forte ul { color: #d5cfc0; }
.voce .cta { margin-top: auto; text-align: center; margin-right: 0; }
.voce.forte .cta { background: var(--avorio); color: var(--inchiostro); }
.voce.forte .cta:hover { background: var(--oro); color: #fff; }
.etichetta { font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--oro); font-weight: 600; }

/* ——— CTA finale ——— */
.finale { text-align: center; padding-bottom: 5rem; }
.finale h2 { margin-inline: auto; }

/* ——— footer ——— */
footer.piede { border-top: 1px solid var(--linea); margin-top: 4rem; padding: 3rem 4vw;
  color: var(--grigio); font-size: .9rem; }
footer.piede .colonne { max-width: 1400px; margin: 0 auto; display: grid;
  grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
footer.piede h4 { font-family: var(--display); font-weight: 600; color: var(--inchiostro);
  font-size: .95rem; margin: 0 0 .7rem; }
footer.piede a { color: inherit; text-decoration: none; display: block; padding: .18rem 0; }
footer.piede a:hover { color: var(--oro); }
footer.piede .fondo { max-width: 1400px; margin: 2.5rem auto 0; padding-top: 1.4rem;
  border-top: 1px solid var(--linea); display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; font-size: .84rem; }
@media (max-width: 760px) { footer.piede .colonne { grid-template-columns: 1fr; } }

@media (max-width: 640px) {
  section { padding: 3.6rem 0 1rem; }
  h2 { margin-bottom: 1.6rem; }
  .banda { height: 42vh; min-height: 280px; margin-top: 3rem; }
  .inbreve { margin-top: -2rem; }
  .inbreve div { padding: 1rem 1.2rem; }
  .hero .dentro { padding-bottom: 7vh; }
  .finale { padding-bottom: 3.5rem; }
  footer.piede { padding: 2.2rem 4vw; }
}

.reveal { opacity: 0; transform: translateY(30px); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; }
  .hero .foto img, .pagina-hero .foto img { animation: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
