/* ============================================================
   PretLegno — proposte grafiche
   base.css : reset, token, componenti comuni a tutte le versioni
   Tutto lo stile passa da variabili CSS: le palette e i font
   stanno in temi.css, i layout in v-a.css / v-b.css / v-c.css
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

:root {
  /* scala tipografica e spaziature (modulate dal pannello) */
  --fs: 17px;
  --sp: 1;
  --r: 14px;
  --r-sm: 8px;
  --wrap: 1240px;
  --wrap-narrow: 760px;
  --sec-y: calc(5.5rem * var(--sp));
  --gap: calc(1.6rem * var(--sp));
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* dimensione testo */
html[data-size="s"] { --fs: 15.5px; }
html[data-size="m"] { --fs: 17px; }
html[data-size="l"] { --fs: 19px; }

/* respiro */
html[data-space="c"] { --sp: .74; }
html[data-space="n"] { --sp: 1; }
html[data-space="a"] { --sp: 1.32; }

/* angoli */
html[data-corner="sq"] { --r: 0px; --r-sm: 0px; }
html[data-corner="mo"] { --r: 14px; --r-sm: 8px; }

html {
  font-size: var(--fs);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1rem;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3, h4, .brand-n, blockquote {
  font-family: var(--display);
  font-weight: var(--display-w, 500);
  line-height: 1.12;
  letter-spacing: var(--display-ls, -0.01em);
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(2.3rem, 5.6vw, 4.1rem); }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.7rem); }
h3 { font-size: 1.22rem; line-height: 1.24; }
p  { margin: 0 0 1.05em; }
p:last-child { margin-bottom: 0; }

strong, b { font-weight: 600; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--on-accent);
  padding: .7rem 1.1rem; z-index: 999;
}
.skip:focus { left: .6rem; top: .6rem; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(1.1rem, 4vw, 2.4rem); }
.wrap-narrow { width: 100%; max-width: var(--wrap-narrow); margin: 0 auto; padding: 0 clamp(1.1rem, 4vw, 2.4rem); }
.center { text-align: center; }

/* ---------- occhiello, lead, didascalie ---------- */
.eyebrow {
  display: block;
  font-family: var(--text);
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .18em;
  color: var(--accent-ink);
  margin: 0 0 .85rem;
}
html[data-caps="1"] .eyebrow { text-transform: uppercase; }
html[data-caps="0"] .eyebrow { text-transform: none; letter-spacing: .06em; }

.lead { font-size: 1.12rem; color: var(--ink-soft); }
.caption { font-size: .82rem; color: var(--ink-soft); }
.claim {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(1.3rem, 2.6vw, 1.75rem);
  line-height: 1.35;
}

/* ---------- bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem;
  font-family: var(--text);
  font-size: .86rem; font-weight: 600; letter-spacing: .06em;
  text-decoration: none;
  padding: .95rem 1.7rem;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
html[data-caps="1"] .btn { text-transform: uppercase; }
.btn:hover { transform: translateY(-2px); }

.btn-solid { background: var(--accent); color: var(--on-accent); }
.btn-solid:hover { background: var(--accent-ink); }
.btn-dark { background: var(--ink); color: var(--bg); }
.btn-dark:hover { background: var(--accent); color: var(--on-accent); }
html[data-btn="contorno"] .btn-dark { background: transparent; color: var(--ink); border-color: var(--ink); }
html[data-btn="contorno"] .btn-dark:hover { background: var(--ink); color: var(--bg); }

.btn-ghost { border-color: currentColor; color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: var(--bg); }
/* il contorno bianco vale solo dove il testo dell'hero sta sopra la
   fotografia (versione A): in B e C il blocco e' su fondo pagina */
html:is([data-v="a"],[data-v="b"],[data-v="c"]) .hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,.75); }
html:is([data-v="a"],[data-v="b"],[data-v="c"]) .hero .btn-ghost:hover { background: #fff; color: #1b1712; }

html[data-btn="contorno"] .btn-solid {
  background: transparent; color: var(--accent-ink); border-color: var(--accent);
}
html[data-btn="contorno"] .btn-solid:hover { background: var(--accent); color: var(--on-accent); }
html:is([data-v="a"],[data-v="b"],[data-v="c"])[data-btn="contorno"] .hero .btn-solid { color: #fff; border-color: #fff; }
html:is([data-v="a"],[data-v="b"],[data-v="c"])[data-btn="contorno"] .hero .btn-solid:hover { background: #fff; color: #1b1712; }

.actions { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.9rem 0 0; }

/* ---------- header ---------- */
.head {
  position: sticky; top: 0; z-index: 60;
  transition: background .3s var(--ease), box-shadow .3s var(--ease), padding .3s var(--ease);
}
.head-in { display: flex; align-items: center; gap: 1.4rem; }

.brand { text-decoration: none; display: block; line-height: 1.05; }
.brand-k {
  display: block;
  font-family: var(--text);
  font-size: .62rem; font-weight: 600;
  letter-spacing: .34em; text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: .32rem;
}
.brand-n { display: block; font-size: 1.42rem; letter-spacing: .02em; text-transform: uppercase; }

.nav { display: flex; align-items: center; gap: 1.5rem; }
.nav a {
  font-size: .82rem; font-weight: 500; letter-spacing: .04em;
  text-decoration: none; color: inherit;
  padding: .3rem 0;
  border-bottom: 1px solid transparent;
  white-space: nowrap;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.nav a:hover { color: var(--accent-ink); }
.nav a.on { border-bottom-color: var(--accent); color: var(--accent-ink); }
.nav-cta {
  border: 1px solid currentColor !important;
  border-radius: var(--r-sm);
  padding: .5rem 1.05rem !important;
}

.navt, .burger { display: none; }

/* ---------- sezioni ---------- */
.flow { display: flex; flex-direction: column; }
section { padding: var(--sec-y) 0; }
.s-hero { padding: 0; }
.sec-head { max-width: 720px; margin-bottom: calc(2.6rem * var(--sp)); }

/* ---------- hero ---------- */
.hero { position: relative; display: grid; }
.hero-media { position: relative; overflow: hidden; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-body { position: relative; }
.hero .sub { font-size: 1.12rem; max-width: 46ch; }

/* ---------- storia ---------- */
.duo { display: grid; gap: calc(3rem * var(--sp)); align-items: center; }
.duo-media img { width: 100%; border-radius: var(--r); }
.motto {
  font-family: var(--display); font-style: italic;
  font-size: 1.2rem; color: var(--accent-ink);
}

/* ---------- lavorazioni (card / lista / griglia) ---------- */
.works { display: grid; gap: var(--gap); counter-reset: w; }
.work {
  counter-increment: w;
  text-decoration: none; color: inherit;
  position: relative; display: block;
  overflow: hidden;
  border-radius: var(--r);
}
.work-media { display: block; overflow: hidden; border-radius: inherit; }
.work-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .8s var(--ease);
}
.work:hover .work-media img { transform: scale(1.05); }
.work-body { display: block; }
.work-body small { display: block; font-size: .85rem; color: var(--ink-soft); margin-top: .3rem; }

/* ---------- citazione ---------- */
.s-quote { position: relative; }
.quote-media { position: absolute; inset: 0; overflow: hidden; }
.quote-media img { width: 100%; height: 100%; object-fit: cover; }
blockquote { margin: 0; font-size: clamp(1.4rem, 3vw, 2.2rem); font-style: italic; line-height: 1.32; }
.who { font-family: var(--text); font-size: .8rem; letter-spacing: .16em; margin-top: 1.2rem; }
html[data-caps="1"] .who { text-transform: uppercase; }

/* ---------- referenza ---------- */
.ref-pic img { width: 100%; border-radius: var(--r); }
.strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); margin-top: var(--gap); }
.strip img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--r); }

/* ---------- video / cta ---------- */
.s-video .wrap { max-width: var(--wrap-narrow); text-align: center; }
.s-video h2 { margin-bottom: 1rem; }
.s-video p { margin-bottom: 1.6rem; }
.s-video p.cta { margin-bottom: 0; }

/* ---------- galleria pagine interne ---------- */
.gallery { display: grid; gap: var(--gap); }
.gallery figure { margin: 0; }
.gallery a { display: block; overflow: hidden; border-radius: var(--r); }
.gallery img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .8s var(--ease), filter .4s var(--ease);
}
.gallery a:hover img { transform: scale(1.04); }
.gallery figcaption { display: none; font-size: .84rem; color: var(--ink-soft); padding-top: .55rem; }

/* ---------- correlate ---------- */
.related { display: flex; flex-wrap: wrap; gap: .7rem; justify-content: center; }
.related a {
  text-decoration: none; font-size: .85rem;
  padding: .6rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
html[data-corner="sq"] .related a { border-radius: 0; }
.related a:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* ---------- contatti ---------- */
.contact-grid { display: grid; gap: calc(2.6rem * var(--sp)); }
.contact-list { list-style: none; margin: 1.4rem 0 0; padding: 0; }
.contact-list li { padding: .85rem 0; border-top: 1px solid var(--line); display: grid; gap: .15rem; }
.contact-list b { font-size: .74rem; letter-spacing: .16em; color: var(--accent-ink); font-weight: 600; }
html[data-caps="1"] .contact-list b { text-transform: uppercase; }
.contact-list a { text-decoration: none; }
.contact-list a:hover { color: var(--accent-ink); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: calc(1.7rem * var(--sp));
}
.form-note {
  font-size: .82rem; color: var(--ink-soft);
  background: var(--bg-alt); border-radius: var(--r-sm);
  padding: .7rem .9rem; margin: .8rem 0 1.2rem;
}
.f-field { margin-bottom: .9rem; }
.f-field label { display: block; font-size: .78rem; letter-spacing: .08em; color: var(--ink-soft); margin-bottom: .35rem; }
html[data-caps="1"] .f-field label { text-transform: uppercase; }
.f-field input, .f-field textarea {
  width: 100%; font: inherit; font-size: .95rem;
  color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: .7rem .85rem;
}
.f-field input:focus, .f-field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.map-frame { width: 100%; height: 100%; min-height: 420px; border: 0; border-radius: var(--r); }

/* ---------- footer ---------- */
.foot { background: var(--foot-bg); color: var(--foot-ink); padding: calc(4rem * var(--sp)) 0 1.6rem; }
.foot-cols { display: grid; gap: calc(2.2rem * var(--sp)); }
.foot h4 { font-family: var(--text); font-size: .76rem; letter-spacing: .16em; margin-bottom: .9rem; opacity: .75; }
html[data-caps="1"] .foot h4 { text-transform: uppercase; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; font-size: .92rem; }
.foot a { text-decoration: none; opacity: .85; }
.foot a:hover { opacity: 1; color: var(--accent-soft); }
.foot .brand-k { color: var(--accent-soft); }
.foot p { font-size: .92rem; opacity: .8; }
.legal {
  display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; justify-content: space-between;
  font-size: .78rem; opacity: .65;
  margin-top: calc(2.6rem * var(--sp)); padding-top: 1.3rem;
  border-top: 1px solid rgba(255,255,255,.14);
}

/* ---------- lightbox ---------- */
.lb {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(16,12,9,.94);
  display: none; align-items: center; justify-content: center;
  padding: 2.2rem 1.2rem 3.4rem;
}
.lb.on { display: flex; }
.lb img { max-width: 100%; max-height: 84vh; width: auto; border-radius: var(--r-sm); }
.lb-cap {
  position: absolute; bottom: 1.2rem; left: 0; right: 0;
  text-align: center; color: #f4ece1; font-size: .88rem; padding: 0 1.2rem;
}
.lb-x {
  position: absolute; top: 1rem; right: 1.2rem;
  width: 2.6rem; height: 2.6rem; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.14); color: #fff; font-size: 1.3rem; cursor: pointer;
}
.lb-x:hover { background: rgba(255,255,255,.28); }

/* ---------- badge anteprima ---------- */
.mock-badge {
  position: fixed; left: .9rem; bottom: .9rem; z-index: 90;
  background: rgba(24,18,13,.86); color: #f6efe4;
  font-family: var(--text); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  padding: .5rem .8rem; border-radius: 999px;
  pointer-events: none;
}

/* ---------- responsive comune ---------- */
@media (min-width: 720px) {
  .duo { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1.05fr .95fr; }
  .foot-cols { grid-template-columns: 1.6fr 1fr 1fr; }
}

@media (max-width: 900px) {
  /* menu a tendina laterale: mai spostato fuori dal viewport
     (creerebbe scorrimento orizzontale), si apre in dissolvenza */
  .nav {
    position: fixed; top: 0; right: 0; bottom: 0; left: auto;
    width: min(80vw, 320px);
    background: var(--surface); color: var(--ink);
    flex-direction: column; flex-wrap: nowrap;
    align-items: flex-start; justify-content: center;
    gap: 1.1rem; padding: 2.4rem;
    overflow-y: auto;
    opacity: 0; visibility: hidden; transform: translateY(-10px);
    transition: opacity .3s var(--ease), transform .3s var(--ease), visibility .3s;
    box-shadow: -18px 0 50px -30px rgba(0,0,0,.6);
    z-index: 70;
  }
  .nav a { font-size: 1.05rem; }
  .navt:checked ~ .nav { opacity: 1; visibility: visible; transform: translateY(0); }
  .burger {
    display: block; width: 2.4rem; height: 2.4rem; margin-left: auto;
    position: relative; cursor: pointer; z-index: 80;
  }
  .burger span {
    position: absolute; left: .35rem; right: .35rem; height: 2px;
    background: currentColor; transition: transform .3s var(--ease), opacity .3s var(--ease);
  }
  .burger span:nth-child(1) { top: .72rem; }
  .burger span:nth-child(2) { top: 1.15rem; }
  .burger span:nth-child(3) { top: 1.58rem; }
  .navt:checked ~ .burger span:nth-child(1) { transform: translateY(.43rem) rotate(45deg); }
  .navt:checked ~ .burger span:nth-child(2) { opacity: 0; }
  .navt:checked ~ .burger span:nth-child(3) { transform: translateY(-.43rem) rotate(-45deg); }
  .map-frame { min-height: 320px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
