/* =========================================================
   Avv. Giuseppe Parisi — Studio Legale
   Foglio di stile principale
   Palette istituzionale: blu notte + oro
   ========================================================= */

/* ---------- 1. Reset & token ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body,
h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }

ul[class] { list-style: none; padding: 0; }

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

input, button, textarea, select { font: inherit; color: inherit; }

:root {
  /* Colori */
  --navy-900: #0b1a2b;
  --navy-800: #102540;
  --navy-700: #17395e;
  --navy-600: #234b76;
  --gold-600: #9a7620;
  --gold-500: #b9902f;
  --gold-400: #cfa94a;
  --gold-200: #e8d6a4;
  --ivory:    #f7f5f0;
  --ivory-2:  #efebe2;
  --paper:    #ffffff;
  --ink:      #16202b;
  --muted:    #5b6775;
  --line:     #dfd9cc;

  /* Tipografia */
  --font-serif: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  --font-sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Misure */
  --wrap: 1160px;
  --wrap-narrow: 760px;
  --radius: 2px;
  --shadow-sm: 0 1px 2px rgba(11, 26, 43, .06), 0 4px 14px rgba(11, 26, 43, .05);
  --shadow-md: 0 10px 40px rgba(11, 26, 43, .10);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- 2. Base ---------- */
body {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.01em;
  color: var(--navy-900);
}

h1 { font-size: clamp(2.4rem, 5.2vw, 3.9rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.7rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }

p + p { margin-top: 1.1em; }

a { color: var(--navy-700); text-decoration-color: var(--gold-400); text-underline-offset: 3px; }
a:hover { color: var(--gold-600); }

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

.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.section--tint { background: var(--ivory); }
.section--dark { background: var(--navy-900); color: #dde5ee; }
.section--dark h2,
.section--dark h3 { color: #fff; }

.eyebrow {
  font-family: var(--font-sans);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold-600);
  margin-bottom: .9rem;
}
.section--dark .eyebrow { color: var(--gold-400); }

.lead { font-size: 1.13rem; color: var(--muted); }
.section--dark .lead { color: #b9c6d6; }

.rule {
  width: 52px; height: 2px; background: var(--gold-500);
  margin: 1.4rem 0 1.8rem;
}
.rule--center { margin-inline: auto; }

.text-center { text-align: center; }

/* Skip link */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--navy-900); color: #fff; padding: .75rem 1.2rem;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 3px; }

/* ---------- 3. Bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .95rem 1.9rem;
  font-size: .8rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.btn:hover { transform: translateY(-1px); }

.btn--primary { background: var(--gold-500); color: #17120a; border-color: var(--gold-500); }
.btn--primary:hover { background: var(--gold-400); border-color: var(--gold-400); color: #17120a; }

.btn--outline { background: transparent; color: var(--navy-800); border-color: var(--navy-800); }
.btn--outline:hover { background: var(--navy-800); color: #fff; }

.btn--ghost-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.45); }
.btn--ghost-light:hover { background: #fff; color: var(--navy-900); border-color: #fff; }

.btn-row { display: flex; flex-wrap: wrap; gap: .9rem; }

/* ---------- 4. Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; min-height: 78px;
}

.brand { display: flex; align-items: center; gap: .85rem; text-decoration: none; }
.brand__mark {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--gold-500);
  color: var(--navy-900);
  font-family: var(--font-serif); font-size: 1.05rem; font-weight: 600;
  letter-spacing: .02em;
}
.brand__name {
  font-family: var(--font-serif); font-size: 1.22rem; font-weight: 600;
  color: var(--navy-900); line-height: 1.1; display: block;
}
.brand__sub {
  font-size: .62rem; letter-spacing: .17em; text-transform: uppercase;
  color: var(--muted); display: block; margin-top: .18rem;
}

.nav { display: flex; align-items: center; gap: 2rem; }
.nav__list { display: flex; align-items: center; gap: 1.9rem; list-style: none; margin: 0; padding: 0; }
.nav__link {
  font-size: .82rem; font-weight: 500; letter-spacing: .06em;
  text-transform: uppercase; text-decoration: none; color: var(--navy-800);
  padding: .4rem 0; position: relative;
}
.nav__link::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0;
  height: 1.5px; background: var(--gold-500);
  transition: right .3s var(--ease);
}
.nav__link:hover::after,
.nav__link[aria-current="page"]::after { right: 0; }
.nav__link[aria-current="page"] { color: var(--navy-900); }

.nav-toggle {
  display: none; width: 44px; height: 44px;
  background: none; border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer; padding: 0; place-items: center;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block; width: 20px; height: 1.5px; background: var(--navy-900);
  transition: transform .3s var(--ease), opacity .2s;
}
.nav-toggle span { position: relative; }
.nav-toggle span::before,
.nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after  { top: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after  { transform: translateY(-6px) rotate(-45deg); }

/* ---------- 5. Hero ---------- */
.hero {
  position: relative;
  background:
    radial-gradient(1100px 620px at 80% -10%, rgba(35, 75, 118, .55), transparent 60%),
    linear-gradient(160deg, var(--navy-900) 0%, #0e2237 55%, #143050 100%);
  color: #e7edf5;
  overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 74px 74px;
  mask-image: radial-gradient(circle at 70% 30%, #000, transparent 75%);
  pointer-events: none;
}
.hero__inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.15fr .85fr;
  gap: clamp(2rem, 5vw, 4.5rem); align-items: center;
  padding: clamp(3.5rem, 8vw, 6.5rem) 0;
}
.hero h1 { color: #fff; }
.hero__role {
  font-size: .78rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--gold-400); margin-bottom: 1.1rem;
}
.hero__text { color: #c3d0de; font-size: 1.1rem; margin-top: 1.6rem; max-width: 46ch; }
.hero .btn-row { margin-top: 2.4rem; }

.hero__portrait { position: relative; }
.hero__portrait figure {
  position: relative;
  border: 1px solid rgba(207, 169, 74, .45);
  padding: 12px;
  background: rgba(255,255,255,.03);
}
.hero__portrait img { width: 100%; aspect-ratio: 4/5; object-fit: cover; filter: grayscale(.15) contrast(1.02); }
.portrait-placeholder {
  width: 100%; aspect-ratio: 4/5;
  display: grid; place-items: center; text-align: center;
  background: linear-gradient(150deg, #16324f, #0c1d30);
  color: rgba(232, 214, 164, .75);
  font-family: var(--font-serif); font-size: 3.4rem; letter-spacing: .05em;
}
.portrait-placeholder small {
  display: block; font-family: var(--font-sans); font-size: .6rem;
  letter-spacing: .18em; text-transform: uppercase; margin-top: .8rem;
  color: rgba(195, 208, 222, .7);
}

/* Barra credenziali */
.credbar { border-top: 1px solid rgba(255,255,255,.12); position: relative; z-index: 1; }
.credbar__grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: rgba(255,255,255,.12);
}
.credbar__item { background: var(--navy-900); padding: 1.6rem 1.4rem; }
.credbar__num {
  font-family: var(--font-serif); font-size: 1.9rem; color: var(--gold-400); line-height: 1;
}
.credbar__label {
  font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  color: #9db0c4; margin-top: .55rem;
}

/* ---------- 6. Griglie di contenuto ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-2--bias { grid-template-columns: .9fr 1.1fr; align-items: start; }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem 1.8rem;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease), transform .25s var(--ease);
  /* Nessun height:100% qui: come figlia diretta di una griglia la card si
     allunga già da sola (align-items:stretch), mentre fuori da una griglia
     height:100% si calcolava sull'altezza dell'intera colonna e la card
     sfondava la sezione. */
}
.card:hover { border-color: var(--gold-400); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.card__icon {
  width: 44px; height: 44px; margin-bottom: 1.2rem;
  display: grid; place-items: center;
  border: 1px solid var(--gold-400); color: var(--gold-600);
}
.card__icon svg { width: 20px; height: 20px; }
.card h3 { margin-bottom: .7rem; }
.card p { color: var(--muted); font-size: .97rem; }
.card__list { margin-top: 1rem; padding: 0; list-style: none; }
.card__list li {
  font-size: .92rem; color: var(--muted);
  padding-left: 1.1rem; position: relative; margin-top: .4rem;
}
.card__list li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: 5px; height: 5px; background: var(--gold-500);
}

/* Elenco puntato oro generico */
.list-gold { list-style: none; padding: 0; margin-top: 1.4rem; }
.list-gold li { position: relative; padding-left: 1.5rem; margin-top: .6rem; }
.list-gold li::before {
  content: ""; position: absolute; left: 0; top: .68em;
  width: 7px; height: 1.5px; background: var(--gold-500);
}

/* Citazione */
.pullquote {
  border-left: 2px solid var(--gold-500);
  padding: .4rem 0 .4rem 1.8rem;
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 2.6vw, 1.75rem);
  line-height: 1.4; color: var(--navy-800);
}

/* Timeline profilo */
.timeline { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--line); }
.timeline li { position: relative; padding: 0 0 2rem 2rem; }
.timeline li::before {
  content: ""; position: absolute; left: -5px; top: .55rem;
  width: 9px; height: 9px; background: var(--gold-500); border-radius: 50%;
}
.timeline li:last-child { padding-bottom: 0; }
.timeline h3 { font-size: 1.18rem; }
.timeline p { color: var(--muted); font-size: .97rem; margin-top: .35rem; }

/* Regioni */
.regions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.6rem; }
.region-chip {
  border: 1px solid rgba(232, 214, 164, .35);
  color: var(--gold-200);
  padding: .5rem 1.05rem;
  font-size: .78rem; letter-spacing: .08em; text-transform: uppercase;
}

/* ---------- 7. Page hero (pagine interne) ---------- */
.page-hero {
  background: linear-gradient(160deg, var(--navy-900), #14304e);
  color: #e7edf5; padding: clamp(3rem, 7vw, 5rem) 0 clamp(2.6rem, 6vw, 4rem);
}
.page-hero h1 { color: #fff; }
.page-hero p { color: #b9c6d6; max-width: 62ch; margin-top: 1.1rem; }

.breadcrumb { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: #8fa3b8; margin-bottom: 1rem; }
.breadcrumb a { color: #8fa3b8; text-decoration: none; }
.breadcrumb a:hover { color: var(--gold-400); }

/* ---------- 8. Form ---------- */
.form-layout { display: grid; grid-template-columns: 1.25fr .75fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }

.form-card {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: clamp(1.6rem, 4vw, 2.8rem);
  box-shadow: var(--shadow-sm);
}

.field { margin-bottom: 1.35rem; }
.field label {
  display: block; font-size: .78rem; font-weight: 600;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--navy-800); margin-bottom: .5rem;
}
.field .req { color: var(--gold-600); }

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: .85rem 1rem;
  background: #fcfbf8;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: .98rem;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.field textarea { min-height: 160px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none; background: #fff;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(185, 144, 47, .14);
}
.field input:user-invalid,
.field textarea:user-invalid { border-color: #b3261e; }

.field__hint { font-size: .8rem; color: var(--muted); margin-top: .45rem; }
.field__error { font-size: .8rem; color: #b3261e; margin-top: .4rem; display: none; }
.field.has-error .field__error { display: block; }
.field.has-error input,
.field.has-error select,
.field.has-error textarea { border-color: #b3261e; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.35rem; }

.checkbox {
  display: flex; gap: .75rem; align-items: flex-start;
  font-size: .88rem; color: var(--muted); line-height: 1.55;
}
.checkbox input { width: 18px; height: 18px; flex: none; margin-top: .18rem; accent-color: var(--gold-600); }

/* honeypot */
.hp-field { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-status {
  display: none; padding: 1rem 1.2rem; margin-bottom: 1.5rem;
  border-left: 3px solid; font-size: .95rem;
}
.form-status.is-visible { display: block; }
.form-status--ok  { background: #eef6ee; border-color: #2e7d32; color: #1e4620; }
.form-status--err { background: #fdeeed; border-color: #b3261e; color: #7a1c16; }

/* Box contatti laterale */
.aside-box { background: var(--ivory); border: 1px solid var(--line); padding: 1.8rem 1.6rem; }
.aside-box + .aside-box { margin-top: 1.5rem; }
.aside-box h3 { font-size: 1.2rem; margin-bottom: 1rem; }

.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li { display: flex; gap: .85rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.contact-list li:last-child { border-bottom: 0; }
.contact-list svg { width: 17px; height: 17px; color: var(--gold-600); flex: none; margin-top: .28rem; }
.contact-list strong { display: block; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.contact-list span, .contact-list a { font-size: .98rem; color: var(--ink); text-decoration: none; }
.contact-list a:hover { color: var(--gold-600); }

/* placeholder dati da compilare */
.ph {
  background: rgba(185, 144, 47, .14);
  border-bottom: 1px dashed var(--gold-500);
  padding: 0 .25rem;
}

/* ---------- 9. FAQ ---------- */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none;
  padding: 1.3rem 2.5rem 1.3rem 0; position: relative;
  font-family: var(--font-serif); font-size: 1.2rem; color: var(--navy-900);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: .4rem; top: 50%;
  transform: translateY(-50%); color: var(--gold-600); font-size: 1.5rem;
  font-family: var(--font-sans); transition: transform .25s var(--ease);
}
.faq details[open] summary::after { content: "–"; }
.faq details p { padding-bottom: 1.4rem; color: var(--muted); max-width: 72ch; }

/* ---------- 10. CTA ---------- */
.cta-band {
  background: linear-gradient(140deg, var(--navy-800), #0d2138);
  color: #fff; text-align: center;
  padding: clamp(3rem, 7vw, 5rem) 0;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: #b9c6d6; max-width: 56ch; margin: 1rem auto 2rem; }
.cta-band .btn-row { justify-content: center; }

/* ---------- 11. Footer ---------- */
.site-footer { background: var(--navy-900); color: #9db0c4; padding: clamp(3rem, 6vw, 4.5rem) 0 2rem; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 2.5rem; }
.site-footer h4 {
  font-family: var(--font-sans); font-size: .72rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--gold-400);
  margin-bottom: 1.1rem;
}
.site-footer .brand__name { color: #fff; }
.site-footer .brand__sub { color: #7e93a9; }
.site-footer .brand__mark { border-color: rgba(207,169,74,.6); color: var(--gold-200); }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: .6rem; }
.footer-links a { color: #9db0c4; text-decoration: none; }
.footer-links a:hover { color: var(--gold-400); }
.footer-about { max-width: 38ch; margin-top: 1.2rem; }
.footer-bottom {
  margin-top: 3rem; padding-top: 1.6rem;
  border-top: 1px solid rgba(255,255,255,.12);
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between;
  font-size: .82rem; color: #7e93a9;
}
.footer-legal { max-width: 90ch; font-size: .78rem; color: #6c8098; margin-top: 1.2rem; line-height: 1.6; }

/* ---------- 12. Animazioni d'ingresso ---------- */
/* L'effetto si attiva solo se JavaScript è disponibile: senza JS
   i contenuti restano visibili (nessuna pagina bianca). */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- 13. Responsive ---------- */
@media (max-width: 980px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__portrait { max-width: 380px; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .form-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .credbar__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .nav-toggle { display: grid; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    display: none; padding: 1rem 1.25rem 1.6rem;
    box-shadow: var(--shadow-md);
  }
  .nav.is-open { display: block; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__list li { border-bottom: 1px solid var(--line); }
  .nav__link { display: block; padding: .95rem 0; font-size: .9rem; }
  .nav__link::after { display: none; }
  .nav .btn { margin-top: 1.2rem; width: 100%; justify-content: center; }
  .site-header { position: relative; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .grid-2, .grid-2--bias, .grid-3, .field-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .btn { width: 100%; justify-content: center; }
  .btn-row { flex-direction: column; }
}

/* ---------- 14. Stampa ---------- */
@media print {
  .site-header, .nav, .cta-band, .site-footer, .btn { display: none !important; }
  body { font-size: 11pt; color: #000; }
  .hero, .page-hero { background: none !important; color: #000; }
  .hero h1, .page-hero h1 { color: #000; }
}
