/* =========================================================
   FZ — Consulenza Contabile e Amministrativa
   Design tokens
   ========================================================= */

:root{
  --navy: #156082;
  --azure: #0F9ED5;
  --gray: #A6A6A6;
  --ink: #142229;
  --ink-soft: #4B5B63;
  --paper: #FFFFFF;
  --paper-soft: #F4F7F8;
  --line: #D9E1E4;

  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", "Helvetica Neue", Arial, sans-serif;

  --max: 1180px;
  --gutter: clamp(1.5rem, 5vw, 4rem);
}

*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }

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

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

a{ color: inherit; text-decoration: none; }

h1, h2, h3{
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.08;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

p{ margin: 0 0 1em; color: var(--ink-soft); max-width: 62ch; }

.wrap{
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* -------------------- Header -------------------- */

.site-header{
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(6px);
  z-index: 20;
}

.site-header .wrap{
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
}

.brand{
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--serif);
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
}

/* Regole responsive per il brand nell'header (Mobile vs Desktop) */
.brand-mobile {
  display: inline-block !important;
}
.brand-desktop {
  display: none !important;
}

@media (min-width: 901px) {
  .brand-mobile {
    display: none !important;
  }
  .brand-desktop {
    display: inline-block !important;
  }
}

nav.main-nav ul{
  list-style: none;
  display: flex;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  margin: 0;
  padding: 0;
}

nav.main-nav a{
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  padding: 0.3rem 0;
  border-bottom: 1.5px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

nav.main-nav a:hover,
nav.main-nav a[aria-current="page"]{
  color: var(--navy);
  border-bottom-color: var(--azure);
}

.nav-toggle{
  display: none;
  background: none;
  border: 1px solid var(--line);
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after{
  content: "";
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--ink);
  position: relative;
}
.nav-toggle span::before{ position: absolute; top: -6px; }
.nav-toggle span::after{ position: absolute; top: 6px; }

/* -------------------- Buttons -------------------- */

.btn{
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1.5px solid var(--navy);
  color: var(--navy);
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color .15s ease;
}
.btn:hover{ background: var(--navy); color: var(--paper); }

.btn-solid{
  background: var(--navy);
  color: var(--paper);
}
.btn-solid:hover{ background: var(--azure); border-color: var(--azure); }

/* -------------------- Section scaffolding -------------------- */

section{ padding: clamp(3.5rem, 8vw, 6.5rem) 0; }

.section-label{
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--azure);
  margin-bottom: 0.9rem;
  display: block;
}

.section-head{
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.5rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.section-head h2{ font-size: clamp(1.7rem, 3vw, 2.3rem); margin: 0; }

/* -------------------- Ledger rule motif -------------------- */

.ledger-row{
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 1.25rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
}
.ledger-row:last-child{ border-bottom: 1px solid var(--line); }

.ledger-index{
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--gray);
  padding-top: 0.15rem;
}

.ledger-row h3{ font-size: 1.15rem; margin-bottom: 0.35rem; color: var(--ink); }
.ledger-row p{ margin: 0; }

/* -------------------- Elenchi servizi -------------------- */

.service-list{
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem 2rem;
}
.service-list li{
  position: relative;
  padding-left: 1.3rem;
  color: var(--ink-soft);
  font-size: 0.97rem;
}
.service-list li::before{
  content: "–";
  position: absolute;
  left: 0;
  color: var(--azure);
  font-weight: 600;
}

@media (max-width: 600px){
  .service-list{ grid-template-columns: 1fr; }
}

/* -------------------- Palette signature -------------------- */

.swatches{
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.swatch{
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.swatch.navy{ background: var(--navy); }
.swatch.azure{ background: var(--azure); }
.swatch.gray{ background: var(--gray); }

/* -------------------- Layout grids (responsive) -------------------- */

/* Hero a due colonne (index): testo + immagine */
.hero-grid{
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 6vw, 4rem);
  align-items: center;
}
.hero-media{
  padding: 0.6rem;
}

/* Azioni hero (bottoni) */
.hero-actions{
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

/* Griglia "chi sono" (Desktop: 2 colonne -> Immagine | Testo, con Formazione dentro il testo) */
.about-grid{
  display: grid;
  grid-template-columns: 0.8fr 1.6fr;
  grid-template-areas: "media content";
  gap: clamp(2rem, 3.5vw, 3rem);
  align-items: start;
}
.about-media{
  grid-area: media;
  border: 1px solid var(--line);
  padding: 0.6rem;
  position: sticky;
  top: 110px;
}
.about-media img{
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
.about-content{
  grid-area: content;
  min-width: 0;
}

/* -------------------- Titoli di studio (Formazione) -------------------- */

.about-education{
  background: var(--paper-soft);
  border: 1px solid var(--line);
  padding: clamp(1.2rem, 2vw, 1.8rem);
  margin: 2.5rem 0;
  overflow: hidden;
}

.edu-heading{
  font-size: 1.1rem;
  margin: 0 0 1.25rem;
}

.edu-list{
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.edu-item{
  display:flex;
  align-items:flex-start;
  gap:0.9rem;
  opacity:1;
  transform:none;
}

.page-chisono.edu-scroll-enabled .edu-item{
  opacity:0;
  transform:translate3d(100%,0,0);
  will-change:transform, opacity;
}

.edu-item:not(:last-child){
  padding-bottom: 1.35rem;
  border-bottom: 1px solid var(--line);
}

.edu-icon{
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--azure);
}
.edu-icon svg{ width: 18px; height: 18px; }

.edu-year{
  display: block;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--azure);
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.edu-title{
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  margin: 0 0 0.15rem;
}

.edu-institution{
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin: 0;
  max-width: none;
}

.edu-badge{
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--azure);
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 0.1rem 0.5rem;
  margin-left: 0.5rem;
  vertical-align: middle;
}

@media (prefers-reduced-motion: reduce){
  .edu-item{
    opacity:1 !important;
    transform:none !important;
    will-change:auto;
  }
}
.page-chisono .edu-list {
  overflow: visible;
}

.page-chisono .edu-item {
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

/* Griglia contatti: info + form */
.contact-grid{
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}

/* Griglia "punti di forza" a 3 colonne */
.feature-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}

/* Riquadro CTA */
.cta-box{
  border: 1px solid var(--line);
  padding: clamp(2rem, 5vw, 3.5rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

/* -------------------- Footer -------------------- */

.site-footer{
  background: var(--navy);
  color: #E7EFF2;
  padding: 3rem 0 2rem;
}
.site-footer a{ color: #E7EFF2; }
.site-footer .wrap{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}
.footer-cols{ display: flex; gap: clamp(2rem, 6vw, 5rem); flex-wrap: wrap; }
.footer-col h4{
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #AFCBD8;
  margin: 0 0 0.9rem;
}
.footer-col p, .footer-col a{ font-size: 0.92rem; margin: 0 0 0.5rem; color: #E7EFF2; }
.footer-bottom{
  border-top: 1px solid rgba(255,255,255,0.18);
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  font-size: 0.8rem;
  color: #AFCBD8;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* -------------------- Responsive -------------------- */

@media (max-width: 900px){
  nav.main-nav{
    position: absolute;
    top: 84px;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    display: none;
    max-height: calc(100vh - 84px);
    overflow-y: auto;
  }
  nav.main-nav.open{ display: block; }
  nav.main-nav ul{
    flex-direction: column;
    padding: 1.5rem var(--gutter) 2rem;
    gap: 1.1rem;
  }
  nav.main-nav a{
    display: block;
    font-size: 1.05rem;
    padding: 0.4rem 0;
  }
  .nav-toggle{ display: flex; }

  body.menu-open .hero-media,
  body.menu-open .about-media,
  body.menu-open .about-education{
    display: none;
  }

  .hero-grid,
  .contact-grid{
    grid-template-columns: 1fr;
  }

  /* "Chi sono" in versione mobile: foto sopra, testo (con Formazione inclusa) sotto */
  .about-grid{
    grid-template-columns: 1fr;
    grid-template-areas:
      "media"
      "content";
  }

  .about-media{
    position: static;
    margin-bottom: 1.5rem;
  }
  .edu-item {
        width: 100%;
  }
  .about-media img{
    max-height: 70vh;
  }

  .feature-grid{
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px){
  section{ padding: clamp(2.5rem, 10vw, 3.5rem) 0; }

  .feature-grid{
    grid-template-columns: 1fr;
  }

  .hero-actions .btn,
  .cta-box .btn{
    width: 100%;
    justify-content: center;
  }

  .cta-box{
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-cols{
    gap: 2rem 2.5rem;
  }

  .site-footer .wrap{
    flex-direction: column;
  }

  .footer-bottom{
    flex-direction: column;
    gap: 0.4rem;
  }
}