/* Davide Cobelli — foglio di stile unico.
   Riferimenti: architettura editoriale jamesclear.com, hero a ruoli affiancate adhamdannaway.com,
   fascia credenziali e processo numerato oci.madebybuzzworthy.com. */

:root {
  --ink: #17120e;
  --ink-soft: #4a423a;
  --muted: #7d7367;
  --paper: #fbf9f6;
  --paper-2: #f3eee7;
  --line: #e3dad0;
  --accent: #a2542a;
  --accent-soft: #f0e2d7;
  --max: 1180px;
  --gut: clamp(1.25rem, 4vw, 3rem);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

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

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

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.12; letter-spacing: -.015em; margin: 0; }

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gut); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 100; background: var(--ink); color: var(--paper); padding: .6rem 1rem; border-radius: 4px; }

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px;
}

/* ---------- header ---------- */

.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 249, 246, .92);
  backdrop-filter: saturate(1.6) blur(8px);
  border-bottom: 1px solid var(--line);
}
.head-in { display: flex; align-items: center; gap: 1.5rem; min-height: 68px; }
.brand { font-family: var(--serif); font-size: 1.125rem; font-weight: 600; text-decoration: none; letter-spacing: -.01em; white-space: nowrap; }
.brand span { color: var(--accent); }

.nav { margin-left: auto; display: flex; align-items: center; gap: clamp(.75rem, 2vw, 1.6rem); }
.nav a { text-decoration: none; font-size: .875rem; color: var(--ink-soft); padding: .35rem 0; border-bottom: 1px solid transparent; }
.nav a:hover { color: var(--ink); border-bottom-color: var(--accent); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.nav .lang { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-left: 1px solid var(--line); padding-left: clamp(.75rem, 2vw, 1.6rem); border-bottom: 0; }
.nav .btn-sm { background: var(--ink); color: var(--paper); padding: .5rem .95rem; border-radius: 999px; border-bottom: 0; font-size: .8125rem; }
.nav .btn-sm:hover { background: var(--accent); border-bottom-color: transparent; }

.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 6px; padding: .45rem .7rem; font: inherit; font-size: .8125rem; cursor: pointer; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; inset: 68px 0 auto; margin: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: .5rem var(--gut) 1.25rem;
  }
  .nav[hidden] { display: none; }
  .nav a { padding: .7rem 0; border-bottom: 1px solid var(--line); font-size: 1rem; }
  .nav .lang { border-left: 0; padding-left: 0; }
  .nav .btn-sm { margin-top: .75rem; text-align: center; border-radius: 999px; }
}

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

.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4rem); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.kicker { font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 0 0 1.5rem; }
.kicker::before { content: ""; display: inline-block; width: 26px; height: 1px; background: var(--accent); vertical-align: middle; margin-right: .6rem; }

.roles { list-style: none; margin: 0; padding: 0; }
.roles li { padding: 1.15rem 0; border-top: 1px solid var(--line); }
.roles li:first-child { border-top: 0; padding-top: 0; }
.roles b {
  display: block; font-family: var(--serif); font-weight: 600;
  font-size: clamp(2.4rem, 6.5vw, 3.9rem); line-height: 1; letter-spacing: -.03em;
}
.roles li:nth-child(2) b { color: var(--accent); }
.roles p { margin: .5rem 0 0; color: var(--ink-soft); max-width: 46ch; font-size: 1rem; }

.portrait { position: relative; }
.portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px; filter: grayscale(1) contrast(1.05); }
.portrait figcaption {
  position: absolute; left: -1rem; bottom: 1.75rem;
  background: var(--ink); color: var(--paper);
  font-family: var(--serif); font-size: .9375rem; font-style: italic;
  padding: .7rem 1.1rem; border-radius: 3px; max-width: 17rem; line-height: 1.35;
}

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
  .portrait { order: -1; max-width: 380px; }
  .portrait figcaption { left: auto; right: -.5rem; }
}

/* ---------- fascia credenziali ---------- */

.creds { background: var(--ink); color: var(--paper); }
.creds ul { list-style: none; margin: 0; padding: clamp(2rem, 4vw, 2.75rem) 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.5rem; }
.creds li { border-left: 1px solid rgba(251, 249, 246, .18); padding-left: 1.1rem; }
.creds b { display: block; font-weight: 500; font-size: .9375rem; line-height: 1.45; }
.creds span { display: block; margin-top: .45rem; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: #c8a68d; }
@media (max-width: 900px) { .creds ul { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .creds ul { grid-template-columns: 1fr; } }

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

section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.sec-head { max-width: 60ch; margin-bottom: clamp(2rem, 4vw, 3rem); }
.sec-head h2 { font-size: clamp(1.9rem, 4.2vw, 2.8rem); }
.sec-head p { color: var(--ink-soft); margin: .9rem 0 0; }
.num { font-family: var(--sans); font-size: .75rem; letter-spacing: .16em; color: var(--accent); text-transform: uppercase; display: block; margin-bottom: .75rem; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
  padding: clamp(1.5rem, 3vw, 2.1rem); display: flex; flex-direction: column;
  text-decoration: none; transition: border-color .18s, transform .18s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card h3 { font-size: 1.4rem; margin-bottom: .6rem; }
.card p { color: var(--ink-soft); font-size: .9375rem; margin: 0 0 1.4rem; }
.card .go { margin-top: auto; font-size: .875rem; color: var(--accent); font-weight: 500; }
.card .go::after { content: " →"; }
@media (max-width: 820px) { .cards { grid-template-columns: 1fr; } }

/* ---------- elenco articoli ---------- */

.posts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.posts li { border-bottom: 1px solid var(--line); }
.posts a { display: grid; grid-template-columns: 8rem 1fr auto; gap: 1.5rem; align-items: baseline; padding: 1.5rem 0; text-decoration: none; }
.posts a:hover h3 { color: var(--accent); }
.posts time { font-size: .8125rem; color: var(--muted); letter-spacing: .04em; }
.posts h3 { font-size: 1.25rem; }
.posts p { margin: .4rem 0 0; color: var(--ink-soft); font-size: .9375rem; max-width: 62ch; }
.posts .meta { font-size: .75rem; color: var(--muted); white-space: nowrap; }
@media (max-width: 720px) {
  .posts a { grid-template-columns: 1fr; gap: .4rem; }
  .posts .meta { display: none; }
}

/* ---------- rassegna stampa ---------- */

.press { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; list-style: none; margin: 0; padding: 0; }
.press li { background: var(--paper-2); border-radius: 6px; padding: 1.75rem; }
.press blockquote { margin: 0; font-family: var(--serif); font-size: 1.1rem; line-height: 1.4; }
.press cite { display: block; margin-top: 1rem; font-style: normal; font-size: .8125rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 820px) { .press { grid-template-columns: 1fr; } }

/* ---------- processo numerato ---------- */

.steps { counter-reset: s; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.steps li { counter-increment: s; border-top: 2px solid var(--ink); padding-top: 1rem; }
.steps li::before { content: "0" counter(s); display: block; font-size: .8125rem; letter-spacing: .16em; color: var(--accent); margin-bottom: .6rem; }
.steps h3 { font-size: 1.15rem; margin-bottom: .4rem; }
.steps p { margin: 0; color: var(--ink-soft); font-size: .9375rem; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .steps { grid-template-columns: 1fr; } }

/* ---------- pagine di testo e articoli ---------- */

.page-head { padding: clamp(3rem, 7vw, 5rem) 0 clamp(1.5rem, 3vw, 2.5rem); border-bottom: 1px solid var(--line); }
.page-head .sub { font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin: 0 0 .9rem; }
.page-head h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); }
.page-head .lede { margin: 1.1rem 0 0; font-size: 1.15rem; color: var(--ink-soft); max-width: 60ch; }

.prose { max-width: 68ch; padding-block: clamp(2.5rem, 5vw, 3.5rem); }
.prose > * + * { margin-top: 1.15rem; }
.prose h2 { font-size: 1.75rem; margin-top: 2.75rem; }
.prose h3 { font-size: 1.3rem; margin-top: 2rem; }
.prose p { margin-block: 0; }
.prose a { color: var(--accent); text-underline-offset: 3px; }
.prose img { border-radius: 4px; margin-block: 1.75rem; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li + li { margin-top: .4rem; }
.prose blockquote {
  margin: 2rem 0; padding: .25rem 0 .25rem 1.5rem; border-left: 3px solid var(--accent);
  font-family: var(--serif); font-size: 1.2rem; font-style: italic; color: var(--ink-soft);
}
.prose table { width: 100%; border-collapse: collapse; font-size: .9375rem; display: block; overflow-x: auto; }
.prose td, .prose th { border: 1px solid var(--line); padding: .5rem .75rem; text-align: left; }

.claim {
  font-family: var(--serif); font-size: clamp(1.5rem, 3.6vw, 2.2rem); line-height: 1.25;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: clamp(2rem, 4vw, 2.75rem) 0; margin: 0; text-align: center;
}

.quote-band { background: var(--paper-2); }
.quote-band p { font-family: var(--serif); font-style: italic; font-size: clamp(1.5rem, 4vw, 2.4rem); line-height: 1.25; text-align: center; margin: 0; }
.quote-band cite { display: block; margin-top: 1.25rem; text-align: center; font-style: normal; font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

.btn {
  display: inline-block; background: var(--ink); color: var(--paper); text-decoration: none;
  padding: .85rem 1.6rem; border-radius: 999px; font-size: .9375rem; font-weight: 500;
  border: 0; font-family: inherit; cursor: pointer;
}
.btn:hover { background: var(--accent); }
.btn-ghost { background: none; color: var(--ink); border: 1px solid var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

.post-meta { font-size: .8125rem; color: var(--muted); letter-spacing: .04em; margin: 1.25rem 0 0; }
.post-nav { display: flex; justify-content: space-between; gap: 1.5rem; border-top: 1px solid var(--line); padding-top: 1.75rem; margin-bottom: 3rem; font-size: .9375rem; }
.post-nav a { color: var(--accent); text-decoration: none; max-width: 22ch; }
.post-nav a:hover { text-decoration: underline; }

.note { background: var(--accent-soft); border-radius: 6px; padding: 1rem 1.25rem; font-size: .9375rem; color: var(--ink-soft); }

/* ---------- galleria ---------- */

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; list-style: none; margin: 0; padding: 0; }
.gallery img { aspect-ratio: 3 / 4; object-fit: cover; border-radius: 4px; }

/* ---------- form ---------- */

.contact-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }

.field { margin-bottom: 1.25rem; }
.field label { display: block; font-size: .8125rem; letter-spacing: .04em; color: var(--ink-soft); margin-bottom: .4rem; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 5px; padding: .7rem .85rem;
}
.field textarea { min-height: 8rem; resize: vertical; }
.field-check { display: flex; gap: .65rem; align-items: flex-start; font-size: .875rem; color: var(--ink-soft); margin-bottom: 1.5rem; }
.field-check input { margin-top: .28rem; flex: none; }
.form-msg { margin-top: 1rem; font-size: .9375rem; }
.form-msg[data-state="ok"] { color: #256b3c; }
.form-msg[data-state="ko"] { color: #a12727; }

.dl { margin: 0; font-size: .9375rem; }
.dl dt { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 1.4rem; }
.dl dt:first-child { margin-top: 0; }
.dl dd { margin: .3rem 0 0; }
.dl a { color: var(--accent); }

/* ---------- footer ---------- */

.site-foot { background: var(--ink); color: #cfc6bb; padding: clamp(3rem, 6vw, 4.5rem) 0 2rem; font-size: .9375rem; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2rem; }
.site-foot h2 { font-size: 1.5rem; color: var(--paper); }
.site-foot p { margin: .75rem 0 0; max-width: 32ch; }
.site-foot h3 { font-family: var(--sans); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: #8d8378; font-weight: 600; margin-bottom: .9rem; }
.site-foot ul { list-style: none; margin: 0; padding: 0; }
.site-foot li + li { margin-top: .5rem; }
.site-foot a { color: #cfc6bb; text-decoration: none; }
.site-foot a:hover { color: var(--paper); text-decoration: underline; }
.foot-bottom { border-top: 1px solid rgba(251, 249, 246, .13); margin-top: 2.75rem; padding-top: 1.5rem; display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; font-size: .8125rem; color: #8d8378; }
@media (max-width: 820px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .foot-grid { grid-template-columns: 1fr; } }

/* ---------- banner consenso (compare solo se GA4 e' configurato) ---------- */

.cc {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 90;
  max-width: 34rem; margin-inline: auto;
  background: var(--ink); color: #e6ded4;
  border-radius: 8px; padding: 1.25rem 1.4rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .28);
  font-size: .875rem; line-height: 1.55;
}
.cc[hidden] { display: none; }
.cc p { margin: 0 0 1rem; }
.cc a { color: #d9a179; }
.cc-btn { display: flex; gap: .6rem; justify-content: flex-end; }
.cc-btn .btn { padding: .55rem 1.2rem; font-size: .875rem; background: var(--paper); color: var(--ink); }
.cc-btn .btn:hover { background: var(--accent); color: var(--paper); }
.cc-btn .btn-ghost { background: none; color: #e6ded4; border: 1px solid rgba(230, 222, 212, .45); }
.cc-btn .btn-ghost:hover { background: rgba(230, 222, 212, .12); color: #fff; }

.note-archivio { border-left: 3px solid var(--accent); background: var(--paper-2); }
.note-archivio a { color: var(--accent); }

/* ---------- payoff sotto il nome ---------- */

.payoff {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  line-height: 1.25;
  margin: 0 0 2rem;
  max-width: 22ch;
}
.payoff mark {
  background: none;
  color: var(--accent);
  box-shadow: inset 0 -.32em 0 var(--accent-soft);
}
