/* ============================================================
   FIDELITY CARDS — CASE STUDY DETAIL PAGE STYLES
   Letta dopo blog.css (riusa tutte le variabili e classi base).
   ============================================================ */

/* ============================================================
   BREADCRUMB
   ============================================================ */
.cd-crumbs {
  padding: 18px 0 0;
  font-size: 0.82rem;
  color: var(--ink-60);
  font-weight: 600;
}
.cd-crumbs .bg-container {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.cd-crumbs a {
  color: var(--ink-60);
  text-decoration: none;
  transition: color .15s ease;
}
.cd-crumbs a:hover { color: var(--ink-100); }
.cd-crumbs__current { color: var(--ink-100); }

/* ============================================================
   HERO
   ============================================================ */
.cd-hero {
  padding: clamp(28px, 4vw, 56px) 0 16px;
}
.cd-hero__meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.cd-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  border: 2px solid var(--ink-100);
  box-shadow: 2px 2px 0 var(--ink-100);
}
.cd-badge--outline {
  background: var(--fc-white);
  color: var(--ink-100);
}
.cd-badge--ghost {
  background: transparent;
  color: var(--ink-60);
  border-color: var(--ink-20);
  box-shadow: none;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  font-size: 0.85rem;
}

.cd-hero__title {
  font-family: 'Satoshi', sans-serif;
  font-weight: 900;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--ink-100);
  margin: 0 0 18px;
  max-width: 18ch;
}
.cd-hero__subtitle {
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  line-height: 1.55;
  color: var(--ink-80);
  max-width: 60ch;
  font-style: italic;
  font-weight: 500;
}
.cd-hero__subtitle em { font-style: italic; }

.cd-kpis {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
}
.cd-kpi {
  background: var(--fc-white);
  border: 2.5px solid var(--ink-100);
  border-radius: 16px;
  box-shadow: 4px 4px 0 var(--ink-100);
  padding: 12px 20px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}
.cd-kpi__value {
  font-family: 'Satoshi', sans-serif;
  font-weight: 900;
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}
.cd-kpi__label {
  font-size: 0.82rem;
  color: var(--ink-60);
  font-weight: 600;
  line-height: 1.25;
}

/* ============================================================
   IMAGE
   ============================================================ */
.cd-image-wrap {
  padding: 0 0 clamp(20px, 3vw, 36px);
}
.cd-image {
  border: 2.5px solid var(--ink-100);
  border-radius: var(--r-card);
  box-shadow: 6px 6px 0 var(--ink-100);
  overflow: hidden;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 920px;
  margin: 0 auto;
}
.cd-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================================
   ARTICLE BODY (PROSE)
   ============================================================ */
.cd-article {
  padding: 16px 0 clamp(48px, 6vw, 80px);
}
.cd-prose {
  max-width: 720px;
  margin: 0 auto;
  font-size: clamp(1rem, 1.15vw, 1.1rem);
  line-height: 1.7;
  color: var(--ink-100);
}

.cd-prose p {
  margin: 0 0 1.2em;
  color: var(--ink-80);
}
.cd-prose p:last-child { margin-bottom: 0; }
.cd-prose strong {
  color: var(--ink-100);
  font-weight: 700;
}
.cd-prose em { font-style: italic; }

.cd-prose h2 {
  font-family: 'Satoshi', sans-serif;
  font-style: italic;
  font-weight: 700;
  font-size: clamp(1.4rem, 2.2vw, 1.85rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--ink-100);
  margin: 2.2em 0 0.8em;
}
.cd-prose h3 {
  font-family: 'Satoshi', sans-serif;
  font-style: italic;
  font-weight: 700;
  font-size: clamp(1.15rem, 1.6vw, 1.4rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ink-100);
  margin: 1.6em 0 0.6em;
}
.cd-prose h2:first-child,
.cd-prose h3:first-child { margin-top: 0; }

.cd-prose ul {
  margin: 0 0 1.2em;
  padding-left: 1.3em;
  list-style: none;
}
.cd-prose ul li {
  position: relative;
  padding-left: 14px;
  margin-bottom: 0.5em;
  color: var(--ink-80);
}
.cd-prose ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

.cd-prose blockquote {
  margin: 1.8em 0;
  padding: 22px 24px;
  background: var(--fc-paper);
  border: 2.5px solid var(--ink-100);
  border-radius: 18px;
  box-shadow: 4px 4px 0 var(--ink-100);
  position: relative;
}
.cd-prose blockquote p {
  font-style: italic;
  color: var(--ink-100);
  font-size: 1.05em;
  line-height: 1.55;
  margin: 0;
}
.cd-prose blockquote::before {
  content: '"';
  position: absolute;
  top: -8px;
  left: 18px;
  font-family: 'Satoshi', serif;
  font-size: 3rem;
  font-weight: 900;
  color: var(--accent);
  background: var(--fc-paper);
  padding: 0 8px;
  line-height: 1;
}

.cd-prose table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.6em 0;
  border: 2.5px solid var(--ink-100);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 4px 4px 0 var(--ink-100);
  font-size: 0.92em;
}
.cd-prose thead {
  background: var(--ink-100);
  color: var(--fc-white);
}
.cd-prose th, .cd-prose td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--ink-10);
}
.cd-prose thead th {
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.78em;
  border-bottom: none;
}
.cd-prose tbody tr:last-child td { border-bottom: none; }
.cd-prose tbody td { color: var(--ink-80); }
.cd-prose tbody td:first-child { font-weight: 700; color: var(--ink-100); }
@media (max-width: 580px) {
  .cd-prose th, .cd-prose td { padding: 9px 10px; font-size: 0.9em; }
}

.cd-prose details {
  margin: 0.8em 0;
  background: var(--fc-white);
  border: 1.5px solid var(--ink-20);
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  transition: border-color .15s ease;
}
.cd-prose details[open] { border-color: var(--ink-100); }
.cd-prose details summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 48px 16px 20px;
  font-weight: 700;
  color: var(--ink-100);
  position: relative;
  font-size: 1rem;
}
.cd-prose details summary::-webkit-details-marker { display: none; }
.cd-prose details summary::after {
  content: '';
  position: absolute;
  right: 22px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--ink-100);
  border-bottom: 2px solid var(--ink-100);
  transform: translateY(-70%) rotate(45deg);
  transition: transform .2s ease;
}
.cd-prose details[open] summary::after {
  transform: translateY(-30%) rotate(-135deg);
}
.cd-prose details p {
  padding: 0 20px 18px;
  margin: 0;
  color: var(--ink-80);
  font-size: 0.96em;
}
.cd-prose details p:last-child { padding-bottom: 18px; }

.cd-prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}
.cd-prose a:hover { text-decoration-thickness: 2.5px; }

/* ============================================================
   CTA BANNER (mid)
   ============================================================ */
.cd-cta-wrap {
  padding: 0 0 clamp(48px, 6vw, 80px);
}
.cd-cta {
  border: 2.5px solid var(--ink-100);
  border-radius: var(--r-card);
  box-shadow: 8px 8px 0 var(--ink-100);
  padding: clamp(36px, 6vw, 64px) clamp(28px, 5vw, 56px);
  color: var(--fc-white);
}
@media (max-width: 720px) {
  .cd-cta {
    padding: clamp(26px, 6vw, 40px) clamp(22px, 5vw, 32px);
  }
  .cd-cta__title { font-size: clamp(2rem, 6vw, 2.4rem); }
  .cd-cta__lead { margin-bottom: 22px; }
}
.cd-cta__title {
  font-family: 'Satoshi', sans-serif;
  font-weight: 900;
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  margin: 0 0 16px;
  color: inherit;
}
.cd-cta__title mark {
  background: var(--fc-yellow);
  color: var(--ink-100);
  padding: 0 10px;
  border-radius: 10px;
  border: 2.5px solid var(--ink-100);
  display: inline-block;
  transform: rotate(-1.5deg);
}
.cd-cta__lead {
  font-size: 1rem;
  line-height: 1.55;
  opacity: 0.92;
  margin: 0 0 24px;
}
.cd-cta__btns { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.cd-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--fc-white);
  color: var(--ink-100);
  font-weight: 800;
  padding: 13px 20px;
  border: 2.5px solid var(--ink-100);
  border-radius: var(--r-pill);
  box-shadow: 4px 4px 0 var(--ink-100);
  transition: transform .15s ease, box-shadow .15s ease;
}
.cd-cta__btn:hover {
  transform: translate(-2px,-2px);
  box-shadow: 6px 6px 0 var(--ink-100);
}
.cd-cta__btn--ghost {
  background: transparent;
  color: var(--fc-white);
  border-color: var(--fc-white);
}
.cd-cta__visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.cd-cta__visual img {
  width: clamp(48px, 6vw, 80px);
  height: auto;
  animation: bg-bob 6s ease-in-out infinite;
}
.cd-cta__visual img:nth-child(2) { animation-delay: 0.6s; }
.cd-cta__visual img:nth-child(3) { animation-delay: 1.2s; }

/* ============================================================
   RELATED CASES
   ============================================================ */
.cd-related {
  padding: clamp(48px, 6vw, 80px) 0;
  background: var(--fc-paper);
  border-top: 2.5px solid var(--ink-100);
  border-bottom: 2.5px solid var(--ink-100);
}
.cd-related__title {
  font-family: 'Satoshi', sans-serif;
  font-weight: 900;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin: 0 0 28px;
  text-align: center;
}
.cd-related__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(14px, 2vw, 20px);
  max-width: 1080px;
  margin: 0 auto;
}
@media (max-width: 880px) { .cd-related__grid { grid-template-columns: 1fr; } }

.cd-related__card {
  background: var(--fc-white);
  border: 2.5px solid var(--ink-100);
  border-radius: var(--r-card);
  box-shadow: 4px 4px 0 var(--ink-100);
  overflow: hidden;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-height: 140px;
  transition: transform .2s ease, box-shadow .2s ease;
  text-decoration: none;
  color: inherit;
}
.cd-related__card:hover {
  transform: translate(-2px,-2px);
  box-shadow: 6px 6px 0 var(--ink-100);
}
.cd-related__media {
  flex: 0 0 40%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-right: 2.5px solid var(--ink-100);
  aspect-ratio: auto;
}
.cd-related__media img {
  width: 78%;
  height: 78%;
  max-width: 78%;
  max-height: 78%;
  object-fit: contain;
}
.cd-related__body {
  flex: 1;
  padding: 14px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.cd-related__sector {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-60);
  line-height: 1;
}
.cd-related__name {
  font-family: 'Satoshi', sans-serif;
  font-weight: 900;
  font-size: 1.02rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink-100);
}
.cd-related__desc {
  font-size: 0.82rem;
  color: var(--ink-80);
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.cd-related__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--ink-100);
  margin-top: 2px;
}
@media (max-width: 540px) {
  .cd-related__card { min-height: 120px; }
  .cd-related__media { flex-basis: 38%; }
  .cd-related__body { padding: 12px 14px; gap: 4px; }
  .cd-related__name { font-size: 0.95rem; }
  .cd-related__desc { font-size: 0.78rem; }
}

/* ============================================================
   NOT FOUND
   ============================================================ */
.cd-notfound {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 60px 20px;
  text-align: center;
}
.cd-notfound h1 {
  font-family: 'Satoshi', sans-serif;
  font-weight: 900;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

/* ============================================================
   REVEAL ANIMATION
   ============================================================ */
.cd-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s ease, transform .6s ease;
}
.cd-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
