/* badge contatore progetti nel menu */
.cd-menu-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--cd-blu-light);
  color: var(--cd-blu);
  border-radius: 10px;
  font-size: .68rem;
  font-weight: 700;
  padding: 0 .45em;
  min-width: 18px;
  height: 16px;
  line-height: 1;
  vertical-align: middle;
  margin-left: .2rem;
}
.cd-menu-item.active .cd-menu-count {
  background: var(--cd-blu);
  color: #fff;
}

/* ---------- Menu image preview panel ---------- */
.cd-menu-preview {
  position: fixed;
  z-index: 1019;
  width: 220px;
  background: var(--cd-white);
  border-radius: var(--cd-radius);
  box-shadow: 0 8px 32px rgba(0,55,117,.18);
  border: 1px solid var(--cd-border);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease;
}
.cd-menu-preview.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.cd-menu-preview img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
}
.cd-menu-preview-label {
  padding: .5rem .75rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--cd-blu-scuro);
  font-family: 'Montserrat', sans-serif;
  background: var(--cd-blu-light);
}

@media (max-width: 768px) {
  .cd-menu-preview { display: none !important; }
}

/* ---------- Timeline (chi-sono) ---------- */
.cd-timeline-item {
  display: flex;
  gap: 1rem;
  padding-bottom: 1rem;
  position: relative;
}
.cd-timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 18px;
  bottom: 0;
  width: 2px;
  background: var(--cd-blu-light);
}
.cd-timeline-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--cd-blu);
  border: 3px solid var(--cd-blu-light);
  flex-shrink: 0;
  margin-top: 3px;
  position: relative;
  z-index: 1;
}
.cd-timeline-content { flex: 1; }
.cd-timeline-year {
  font-size: .75rem;
  font-weight: 700;
  color: var(--cd-blu);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .2rem;
}
.cd-timeline-title {
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  margin-bottom: .4rem;
  font-size: .95rem;
}
.cd-timeline-content p {
  font-size: .855rem;
  color: var(--cd-muted);
  line-height: 1.6;
  margin: 0;
}

/* ---------- Home Hero ---------- */
.cd-hero {
  background: linear-gradient(135deg, var(--cd-blu-scuro) 0%, var(--cd-blu) 100%);
  border-radius: var(--cd-radius);
  overflow: hidden;
  box-shadow: var(--cd-shadow);
}
.cd-hero-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 1.5rem;
  flex-wrap: wrap;
}
.cd-hero-text { flex: 1; min-width: 220px; }

.cd-hero-eyebrow {
  font-size: .74rem;
  font-weight: 600;
  color: rgba(255,255,255,.7);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: .5rem;
}
.cd-hero-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  margin-bottom: .4rem;
}
.cd-hero-sub {
  font-size: .82rem;
  color: rgba(255,255,255,.8);
  line-height: 1.45;
  margin-bottom: .7rem;
}
.cd-hero-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}
.cd-hero-actions .btn-cd-primary {
  background: var(--cd-accent);
  color: #fff;
}
.cd-hero-actions .btn-cd-primary:hover { background: #d4920a; }
.cd-hero-actions .btn-cd-outline {
  border-color: rgba(255,255,255,.5);
  color: #fff;
}
.cd-hero-actions .btn-cd-outline:hover {
  background: rgba(255,255,255,.15);
  color: #fff;
}

.cd-hero-avatar {
  flex-shrink: 0;
}
.cd-hero-avatar img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  border: 3px solid var(--cd-accent);   /* bordo distintivo (gold) sull'avatar hero home/chi-sono */
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
  display: block;
}

/* HERO COMPACT: 140px alto, layout orizzontale (avatar | testo | cta) */
.cd-hero-compact { height: 140px; }
.cd-hero-compact .cd-hero-content {
  height: 100%;
  padding: 0 1.5rem;
  gap: 1.25rem;
  flex-wrap: nowrap;
  align-items: center;
}
.cd-hero-compact .cd-hero-avatar img {
  width: 90px;
  height: 90px;
  border-width: 2.5px;
}
.cd-hero-compact .cd-hero-text {
  flex: 1;
  min-width: 0;
}
.cd-hero-compact .cd-hero-eyebrow {
  font-size: .68rem;
  margin-bottom: .15rem;
  letter-spacing: .1em;
}
.cd-hero-compact .cd-hero-title {
  font-size: 1.3rem;
  margin-bottom: .15rem;
  line-height: 1.15;
}
.cd-hero-compact .cd-hero-sub {
  font-size: .75rem;
  line-height: 1.35;
  margin-bottom: 0;
  color: rgba(255,255,255,.75);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cd-hero-compact .cd-hero-actions {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  flex-shrink: 0;
}
.cd-hero-compact .cd-hero-actions a {
  width: 130px;
  text-align: center;
}

@media (max-width: 768px) {
  .cd-hero-compact { height: auto; min-height: 140px; }
  .cd-hero-compact .cd-hero-content { flex-wrap: wrap; padding: 1rem; }
  .cd-hero-compact .cd-hero-sub { white-space: normal; }
  .cd-hero-compact .cd-hero-actions { flex-direction: row; width: 100%; }
}

@media (max-width: 576px) {
  .cd-hero-title { font-size: 1.35rem; }
  .cd-hero-avatar img { width: 90px; height: 90px; }
  .cd-hero-content { padding: 1.25rem 1rem; gap: 1rem; }
}

/* ---------- Home area cards ---------- */
.cd-area-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--cd-radius);
  overflow: hidden;
  border: 1px solid var(--cd-border);
  text-decoration: none;
  color: var(--cd-text);
  transition: box-shadow .2s, transform .2s;
  height: 100%;
}
.cd-area-card:hover {
  box-shadow: 0 6px 24px rgba(0,103,199,.18);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--cd-text);
}
.cd-area-img {
  height: 100px;
  background-size: cover;
  background-position: center;
  background-color: var(--cd-blu-light);
  flex-shrink: 0;
}
.cd-area-body {
  display: flex;
  flex-direction: column;      /* icona+categoria sopra, descrizione sotto */
  gap: .1rem;
  padding: .4rem .7rem;        /* parte bianca compatta (-~5px altezza card) */
  background: var(--cd-white);
  flex: 1; /* riempie l'altezza rimanente */
}
.cd-area-head {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-width: 0;
}
.cd-area-head i {
  font-size: 1.2rem;
  color: var(--cd-blu);
  flex-shrink: 0;
}
.cd-area-head strong {
  font-size: .9rem;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cd-area-body span {
  display: block;
  white-space: nowrap;         /* descrizione sempre su 1 riga */
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: .78rem;
  color: var(--cd-muted);
  line-height: 1.4;
}

/* Header card con gradient navbar (per Cosa faccio e Ultimi progetti) */
.cd-card-header-gradient {
  background: linear-gradient(90deg, var(--cd-blu-scuro) 0%, var(--cd-blu) 100%) !important;
  color: #fff !important;
  border-bottom: 0 !important;
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 600;
  padding: .65rem .85rem !important;
  min-height: 47px;        /* altezza uniforme: con o senza frecce (frecce = 26px) gli header combaciano */
  box-sizing: border-box;
}
.cd-card-header-gradient i { color: rgba(255,255,255,.95); }
.cd-card-header-gradient a { color: rgba(255,255,255,.9); text-decoration: none; }
.cd-card-header-gradient a:hover { color: #fff; text-decoration: underline; }

/* Frecce slider Cosa faccio */
.cd-areas-nav {
  margin-left: auto;
  display: flex;
  gap: .25rem;
}
.cd-areas-nav button {
  background: transparent;                  /* attivo: sfondo trasparente, icona bianca */
  border: 1px solid rgba(255,255,255,.45);
  color: #fff;
  border-radius: 6px;
  width: 28px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  padding: 0;
  font-size: .85rem;
}
.cd-areas-nav button:hover:not(:disabled) {
  background: rgba(255,255,255,.18);
}
.cd-areas-nav button:disabled {
  color: rgba(255,255,255,.4);              /* disattivo: grigio/sbiadito su trasparente */
  border-color: rgba(255,255,255,.2);
  background: transparent;
  opacity: 1;
  cursor: default;
}

/* Viewport + track slider */
.cd-areas-viewport {
  overflow: hidden;
  padding: .6rem !important;
}
.cd-areas-track {
  display: flex;
  gap: 1rem;
  transition: transform .4s cubic-bezier(.25,.8,.25,1);
}
.cd-areas-track > .cd-area-card {
  flex: 0 0 calc((100% - 2rem) / 3);  /* 3 visibili - 2 gap da 1rem */
  min-width: 0;
}
@media (max-width: 768px) {
  .cd-areas-track > .cd-area-card {
    flex: 0 0 100%;
  }
}

/* ---------- Apri Ticket card (col-3 home) — card BLU piena, testi bianchi ---------- */
.cd-ticket-card {
  background: linear-gradient(160deg, var(--cd-blu-scuro) 0%, var(--cd-blu) 100%);
  border-color: var(--cd-blu-scuro);
  display: flex;             /* card flex-column: il corpo riempie l'altezza... */
  flex-direction: column;
}
.cd-ticket-card .cd-card-header-gradient {
  background: transparent !important;   /* lascia trasparire il blu della card */
}
.cd-ticket-card .cd-ticket-body {
  display: flex;
  flex-direction: column;
  flex: 1;                  /* ...cosi' margin-top:auto della CTA la spinge in fondo */
  gap: .3rem;
  padding: 0 .7rem .6rem;   /* bottom .6rem = stesso inset delle card-area (viewport) */
}
.cd-ticket-intro {
  font-size: .78rem;
  color: rgba(255,255,255,.9);
  line-height: 1.35;
  margin: 0;
}
.cd-ticket-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.cd-ticket-steps li {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .76rem;
  color: #fff;
}
.cd-ticket-step-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  background: #fff;
  color: var(--cd-blu);
  border-radius: 50%;
  font-size: .68rem;
  font-weight: 800;
  flex-shrink: 0;
}
.cd-ticket-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  background: #fff;
  color: var(--cd-blu) !important;   /* bianco con testo blu: coerente sul fondo blu */
  font-size: .82rem;
  font-weight: 700;
  padding: .4rem .8rem;
  border-radius: 6px;
  text-decoration: none !important;
  margin-top: auto;   /* CTA spinta in fondo: l'extra va qui, non sotto l'header */
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  transition: box-shadow .2s, transform .2s;
}
.cd-ticket-cta:hover {
  background: #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,.28);
  transform: translateY(-1px);
}

/* ---------- Ultimi 6 progetti (stile card statistiche) ---------- */
.cd-last-card {
  display: block;
  background: var(--cd-white);
  border: 1px solid var(--cd-border);
  border-radius: var(--cd-radius);
  overflow: hidden;
  text-decoration: none !important;
  color: var(--cd-text) !important;
  transition: box-shadow .2s, transform .2s;
  height: 100%;
}
.cd-last-card:hover {
  box-shadow: 0 4px 14px rgba(0,103,199,.18);
  transform: translateY(-2px);
}
.cd-last-img {
  height: 80px;
  background-size: cover;
  background-position: center;
  background-color: var(--cd-blu-light);
}
.cd-last-body {
  padding: .5rem .6rem .55rem;
}
.cd-last-title {
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--cd-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.4em;
  margin-bottom: .15rem;
}
.cd-last-meta {
  font-size: .68rem;
  color: var(--cd-muted);
  line-height: 1.2;
}

/* Vetrina lavori: padding uniforme a "Cosa posso fare per te" (.6rem) */
.cd-vetrina .cd-card-body { padding: .6rem; }

/* Ultimi 6 progetti in home: 6 colonne (override .cd-grid che e' 4) */
.cd-grid.cd-grid-6 {
  grid-template-columns: repeat(6, 1fr);
  gap: .75rem;
}
@media (max-width: 1199px) {
  .cd-grid.cd-grid-6 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 575px) {
  .cd-grid.cd-grid-6 { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   BANNER ILLUSTRATO: illustrazione Mirko a destra (sfumata nel
   gradient) + icona/titolo/sottotitolo HTML a sinistra.
   Testo vero -> SEO + responsive. Usa <div class="cd-illu-img">
   con background-image inline.
   ============================================================ */
.cd-illu-banner {
  position: relative;
  height: 140px;
  border-radius: var(--cd-radius);
  overflow: hidden;
  background: linear-gradient(135deg, var(--cd-blu-scuro) 0%, var(--cd-blu) 100%);
  box-shadow: var(--cd-shadow);
}
.cd-illu-banner .cd-illu-img {
  position: absolute;
  top: 0; right: 0; bottom: 0;     /* illustrazione a DESTRA */
  width: 170px;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 42%);
          mask-image: linear-gradient(90deg, transparent 0%, #000 42%);
}
.cd-illu-banner .cd-illu-text {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .2rem;
  padding: 0 1.5rem;
  max-width: calc(100% - 160px);
}
.cd-illu-eyebrow {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: rgba(255,255,255,.78);
  margin: 0;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.cd-illu-eyebrow i { color: var(--cd-accent); font-size: .95rem; }
.cd-illu-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  color: #fff;
  margin: 0;
  line-height: 1.15;
}
.cd-illu-title span { color: var(--cd-accent); }
.cd-illu-sub {
  font-size: .82rem;
  color: rgba(255,255,255,.82);
  margin: 0;
  line-height: 1.4;
}
.cd-illu-actions { display: flex; gap: .5rem; margin-top: .4rem; flex-wrap: wrap; }
.cd-illu-actions a { font-size: .82rem; padding: .4rem .9rem; white-space: nowrap; }
.cd-illu-actions .btn-cd-primary { background: var(--cd-accent); color: #fff; border: 0; }
.cd-illu-actions .btn-cd-primary:hover { background: #d4920a; color: #fff; }
@media (max-width: 575px) {
  .cd-illu-banner .cd-illu-img { width: 120px; }
  .cd-illu-banner .cd-illu-text { max-width: calc(100% - 105px); padding: 0 1rem; }
  .cd-illu-title { font-size: 1.18rem; }
  .cd-illu-sub { font-size: .74rem; }
}
