/* ===========================================================
   Casi studio: modello unico per le pagine caso-studio-*.html.
   Intestazione, sintesi con risultati, sfida, cosa ho fatto,
   prove visive, altri casi, fascia preventivo e footer.
   =========================================================== */

:root {
    --trust: #3E4A73;   
    --trust-2: #2E3860;
    --sunburst: #B8CCE0;
    --accent: #6E5B93;   
    --accent-hover: #574876;
    --accent-soft: #EFEAF6;
    --plum: #574876;
    --plum-soft: #EFEAF6;
    --bg: #FBF9F6;
    --sand: #F1EAE0;
    --ink: #35303D;
    --ink-soft: #5B5563;
    --caption: #7A7480;
    --white: #ffffff;
    --border: rgba(62,74,115,0.10);
    --divider: rgba(62,74,115,0.14);
    --wrap: 1080px;
    --gap-lg: clamp(56px, 8vw, 96px);
    --gap-md: clamp(32px, 5vw, 56px);
    --radius-md: 12px;
    --shadow-soft: 0 10px 24px rgba(62,74,115,0.08);
    --shadow-strong: 0 22px 46px rgba(62,74,115,0.18);
    --header-h-shrunk: 68px;
  }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h-shrunk) + 16px); }

html, body { margin: 0; padding: 0; background: var(--bg); }

body {
    font-family: 'DM Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    color: var(--ink); line-height: 1.6;
    -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  }

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

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }

a:hover { color: var(--accent-hover); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(20px, 5vw, 40px); }

.crocus-mark { display: block; }

.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255,255,255,0.92);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  }

.site-header.is-shrunk { border-bottom-color: var(--divider); box-shadow: 0 4px 16px rgba(62,74,115,0.06); }

.back-btn {
    position: absolute; top: 50%; left: clamp(16px, 3vw, 32px);
    transform: translateY(-50%);
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255,255,255,0.95); border: 1px solid var(--divider);
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--trust); text-decoration: none;
    box-shadow: 0 2px 8px rgba(62,74,115,0.08);
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 51;
  }

.back-btn:hover { background: var(--sand); transform: translateY(-50%) translateX(-3px); box-shadow: 0 4px 12px rgba(62,74,115,0.15); }

.back-btn svg { width: 18px; height: 18px; }

.site-header-inner {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: clamp(24px, 3.5vw, 40px) 0 18px; gap: 18px;
    transition: padding 0.35s ease, gap 0.35s ease;
  }

.header-eyebrow {
    display: inline-flex; align-items: center; gap: 10px;
    font-size: 12px; letter-spacing: 2.5px; text-transform: uppercase;
    color: var(--plum); font-weight: 600; margin: 0;
    opacity: 1; max-height: 40px; overflow: hidden;
    transition: opacity 0.25s ease, max-height 0.35s ease, margin 0.35s ease;
  }

.header-eyebrow::before, .header-eyebrow::after {
    content: ""; display: block; width: 24px; height: 1.5px; background: var(--plum); opacity: 0.7;
  }

.header-title {
    font-family: 'Playfair Display', Georgia, serif; font-weight: 400;
    font-size: clamp(28px, 4.6vw, 52px); line-height: 1.1; letter-spacing: -0.5px;
    margin: 0; color: var(--trust); max-width: 880px;
    opacity: 1; max-height: 220px; overflow: hidden;
    transition: opacity 0.25s ease, max-height 0.35s ease, font-size 0.35s ease, margin 0.35s ease;
  }

.site-header.is-shrunk .header-eyebrow { opacity: 0; max-height: 0; margin: 0; }

.site-header.is-shrunk .header-title {
    font-size: clamp(16px, 2vw, 20px);
    max-height: 30px;
    letter-spacing: -0.2px;
  }

.fab-top {
    position: fixed; right: clamp(16px, 3vw, 28px); bottom: clamp(16px, 3vw, 28px);
    width: 52px; height: 52px; border-radius: 50%;
    background: var(--trust); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; cursor: pointer;
    box-shadow: 0 12px 28px rgba(62,74,115,0.28);
    opacity: 0; pointer-events: none; transform: translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease, background 0.18s ease;
    z-index: 100; padding: 0;
  }

.fab-top.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }

.fab-top:hover { background: var(--trust-2); }

.fab-top svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Intestazione su mobile: freccia in alto a sinistra, titolo libero ---------- */

@media (max-width: 640px) {
  .site-header .back-btn { top: 14px; transform: none; width: 36px; height: 36px; }
  .site-header .back-btn:hover { transform: translateX(-3px); }
  .site-header .site-header-inner { padding-top: 22px; }
  .site-header .header-title { font-size: clamp(22px, 6.4vw, 30px); padding: 0 8px; }
  .site-header.is-shrunk .back-btn { top: 50%; transform: translateY(-50%); }
  .site-header.is-shrunk .header-title { font-size: 16px; padding: 0 44px; }
}

/* ---------- Fascia preventivo a fine caso studio ---------- */

.cs-cta { padding: 0 0 var(--gap-md); }

.cs-cta-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 28px;
  background: var(--accent-soft); color: var(--ink);
  border-radius: 28px; padding: clamp(28px, 4vw, 48px);
}

.cs-cta-eyebrow { margin: 0 0 8px; font-size: 12px; letter-spacing: 2.2px; text-transform: uppercase; font-weight: 700; color: var(--plum); }

.cs-cta-title { font-family: 'Playfair Display', Georgia, serif; font-weight: 700; font-size: clamp(26px, 3.2vw, 36px); line-height: 1.15; margin: 0 0 10px; color: var(--trust); }

.cs-cta-text { margin: 0; color: var(--ink-soft); font-size: 17px; }

.cs-cta-btn {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  background: var(--trust); color: #fff; text-decoration: none;
  font-weight: 700; font-size: 16px; padding: 16px 30px; border-radius: 999px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cs-cta-btn:hover { color: #fff; background: var(--trust-2); transform: translateY(-2px); box-shadow: 0 12px 26px rgba(62,74,115,0.28); }

/* ---------- Footer, come in home ---------- */

.cs-footer { background: var(--white); border-top: 1px solid var(--divider); padding: 36px 0 26px; font-size: 14.5px; }

.cs-footer a { color: var(--ink); text-decoration: none; }

.cs-footer a:hover { color: var(--accent); }

.cs-footer-top { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }

.cs-logo { display: inline-flex; align-items: center; gap: 10px; font-family: 'Playfair Display', Georgia, serif; font-weight: 700; font-size: 20px; }

.cs-mark-ring { fill: none; stroke: var(--accent); stroke-width: 5; }

.cs-mark-w { fill: none; stroke: var(--accent); stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }

.cs-mark-k { fill: none; stroke: var(--accent-hover); stroke-width: 9; stroke-linecap: round; }

.cs-footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; font-weight: 600; }

.cs-social { display: flex; gap: 10px; }

.cs-social a {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--divider);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}

.cs-footer-bottom {
  display: flex; justify-content: space-between; gap: 10px 24px; flex-wrap: wrap;
  margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--divider);
  color: var(--caption); font-size: 13px;
}

.cs-footer-bottom a { color: var(--caption); text-decoration: underline; text-underline-offset: 3px; }

.cs-legal { display: flex; gap: 16px; }

@media (max-width: 720px) {
  .cs-cta-inner { flex-direction: column; align-items: flex-start; }
  .cs-cta-btn { align-self: stretch; justify-content: center; }
  .cs-footer-top { flex-direction: column; align-items: flex-start; }
}

/* ---------- Titoli in Playfair come nel resto del sito ---------- */
.header-title { font-weight: 700; }

/* ---------- Sintesi: il risultato prima di tutto ---------- */
.cs-hero { padding-block: clamp(40px, 6vw, 72px) clamp(32px, 4vw, 48px); text-align: center; }
.cs-kicker {
  margin: 0 0 16px; font-size: 12.5px; letter-spacing: 2px; text-transform: uppercase;
  font-weight: 700; color: var(--plum);
}
.cs-headline {
  font-family: 'Playfair Display', Georgia, serif; font-weight: 700;
  font-size: clamp(30px, 4.2vw, 50px); line-height: 1.12; letter-spacing: -0.4px;
  color: var(--ink); max-width: 860px; margin: 0 auto 20px; text-wrap: balance;
}
.cs-intro { max-width: 640px; margin: 0 auto; font-size: 18px; line-height: 1.6; color: var(--ink-soft); }
.cs-kpis {
  list-style: none; padding: 0; margin: clamp(32px, 4vw, 44px) auto 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; max-width: 920px;
}
.cs-kpis li {
  background: var(--white); border: 1px solid var(--divider); border-radius: 20px;
  padding: 24px 20px; display: flex; flex-direction: column; gap: 6px; align-items: center;
}
.cs-kpis strong {
  font-family: 'Playfair Display', Georgia, serif; font-weight: 700;
  font-size: clamp(30px, 3.6vw, 42px); line-height: 1.05; color: var(--trust);
  font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1;
}
.cs-kpis strong.is-text { font-size: clamp(22px, 2.4vw, 27px); }
.cs-kpis span { font-size: 14.5px; line-height: 1.4; color: var(--ink-soft); max-width: 230px; }
.cs-meta {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 28px;
  margin: 24px auto 0; font-size: 14px; color: var(--caption);
}
.cs-meta div { display: flex; gap: 6px; }
.cs-meta dt { font-weight: 700; color: var(--plum); }
.cs-meta dd { margin: 0; }

/* ---------- Blocchi di contenuto ---------- */
.cs-block { padding-block: clamp(36px, 5vw, 56px); border-top: 1px solid var(--divider); }
.cs-label {
  display: flex; align-items: center; gap: 10px; margin: 0 0 20px;
  font-family: 'Playfair Display', Georgia, serif; font-weight: 700;
  font-size: clamp(24px, 2.6vw, 30px); color: var(--trust);
}
.cs-label .crocus-mark { width: 34px; height: 34px; flex: none; }
.cs-challenge {
  margin: 0; max-width: 760px; font-size: clamp(19px, 2vw, 22px); line-height: 1.55; color: var(--ink);
  padding-left: 20px; border-left: 3px solid var(--accent);
}

.cs-steps {
  list-style: none; padding: 0; margin: 0; counter-reset: step;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
}
.cs-steps li {
  counter-increment: step; background: var(--white); border: 1px solid var(--divider);
  border-radius: 20px; padding: 24px 24px 22px;
}
.cs-steps li::before {
  content: counter(step, decimal-leading-zero); display: block; margin-bottom: 8px;
  font-family: 'Playfair Display', Georgia, serif; font-size: 22px; color: var(--accent);
}
.cs-steps h3 { margin: 0 0 6px; font-family: 'Playfair Display', Georgia, serif; font-weight: 700; font-size: 20px; line-height: 1.25; color: var(--ink); }
.cs-steps p { margin: 0; font-size: 15.5px; line-height: 1.55; color: var(--ink-soft); }

.cs-note { margin: 0 0 24px; max-width: 680px; color: var(--ink-soft); }

/* ---------- Prove visive: sempre intere, mai tagliate ---------- */
.cs-phones { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(24px, 4vw, 56px); }
.cs-phone { margin: 0; width: 240px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.cs-phone-frame {
  width: 100%; background: linear-gradient(155deg, #14171f, #0b0d13);
  border-radius: 32px; padding: 9px; box-shadow: var(--shadow-strong);
}
.cs-phone-frame img { width: 100%; height: auto; border-radius: 24px; background: #000; }
/* Telefoni affiancati della stessa misura: l'immagine resta intera dentro lo schermo */
.cs-phones--equal .cs-phone { width: var(--phone-w, 290px); }
.cs-phones--equal .cs-phone-frame img { aspect-ratio: var(--phone-ratio, 900 / 1308); object-fit: contain; }
.cs-phone figcaption, .cs-figcap { font-size: 14px; color: var(--caption); text-align: center; line-height: 1.4; }
.cs-phone figcaption strong { display: block; color: var(--ink); font-size: 15px; }
.cs-phone figcaption a { display: inline-block; margin-top: 4px; white-space: nowrap; color: var(--plum); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.cs-phone figcaption a:hover { color: var(--ink); }

.cs-campaigns { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.cs-campaign {
  display: grid; grid-template-columns: 140px 1fr; gap: 18px; align-items: center;
  background: var(--white); border: 1px solid var(--divider); border-radius: 20px; padding: 16px;
  color: inherit; text-decoration: none; transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.cs-campaign:hover { color: inherit; box-shadow: var(--shadow-soft); transform: translateY(-2px); }
.cs-campaign img { width: 140px; height: 180px; object-fit: contain; background: var(--sand); border-radius: 12px; }
.cs-campaign-place { margin: 0; font-size: 12px; letter-spacing: 1.4px; text-transform: uppercase; font-weight: 700; color: var(--plum); }
.cs-campaign h3 { margin: 4px 0 8px; font-family: 'Playfair Display', Georgia, serif; font-weight: 700; font-size: 19px; line-height: 1.25; color: var(--ink); }
.cs-campaign-desc { margin: 0 0 12px; font-size: 14px; line-height: 1.45; color: var(--caption); }
.cs-campaign ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 18px; flex-wrap: wrap; }
.cs-campaign li { display: flex; flex-direction: column; font-size: 12.5px; color: var(--caption); }
.cs-campaign li b { font-family: 'Playfair Display', Georgia, serif; font-size: 22px; color: var(--trust); font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1; }

.cs-collage {
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
  grid-template-areas: "ws ws os" "ws ws pl" "sa mt cs";
  gap: 8px; aspect-ratio: 1 / 1; width: 100%; max-width: 460px; margin: 0 auto;
  border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-strong);
}
.cs-collage figure { margin: 0; overflow: hidden; background: #14171f; }
.cs-collage img { width: 100%; height: 100%; object-fit: cover; }
.cs-collage .c-ws { grid-area: ws; } .cs-collage .c-os { grid-area: os; } .cs-collage .c-pl { grid-area: pl; }
.cs-collage .c-sa { grid-area: sa; } .cs-collage .c-mt { grid-area: mt; } .cs-collage .c-cs { grid-area: cs; }
.cs-collage .c-ws img { object-position: 40% 20%; }
.cs-collage .c-pl img { object-position: 50% 70%; }

.cs-split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.cs-split h3 { margin: 0 0 10px; font-family: 'Playfair Display', Georgia, serif; font-weight: 700; font-size: 24px; color: var(--ink); }
.cs-split p { margin: 0 0 12px; color: var(--ink-soft); }

.cs-tablets { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(24px, 4vw, 56px); }
.cs-tablet { margin: 0; width: 300px; display: flex; flex-direction: column; gap: 12px; }
.cs-tablet-frame { background: linear-gradient(150deg, #2a2f3a, #14171f); border-radius: 22px; padding: 12px; box-shadow: var(--shadow-strong); }
.cs-tablet-screen {
  background: #fff; border-radius: 8px; max-height: 420px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: rgba(62,74,115,0.35) transparent;
}
.cs-tablet-screen img { width: 100%; height: auto; }
.cs-tablet-screen a { display: block; line-height: 0; }

.cs-articles { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 28px; }
.cs-article {
  display: flex; flex-direction: column; gap: 6px; padding: 22px 24px;
  background: var(--white); border: 1px solid var(--divider); border-radius: 20px;
  color: inherit; text-decoration: none; transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.cs-article:hover { color: inherit; box-shadow: var(--shadow-soft); transform: translateY(-2px); }
.cs-article-meta { font-size: 12px; letter-spacing: 1.4px; text-transform: uppercase; font-weight: 700; color: var(--plum); }
.cs-article h3 { margin: 0; font-family: 'Playfair Display', Georgia, serif; font-weight: 700; font-size: 20px; color: var(--ink); }
.cs-article p { margin: 0; font-size: 15px; color: var(--ink-soft); }
.cs-article-go { margin-top: 6px; font-weight: 700; color: var(--trust); font-size: 14.5px; }

.cs-photo { margin: 0 auto; max-width: 280px; }
.cs-photo img { width: 100%; height: auto; border-radius: 20px; box-shadow: var(--shadow-strong); }

/* ---------- Altri casi studio ---------- */
.cs-more { padding-block: clamp(36px, 5vw, 56px); border-top: 1px solid var(--divider); }
.cs-more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cs-more a {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 20px 24px; border-radius: 20px; background: var(--sand);
  color: var(--ink); text-decoration: none; transition: background 0.2s ease;
}
.cs-more a:hover { background: var(--accent-soft); color: var(--ink); }
.cs-more small { display: block; font-size: 12px; letter-spacing: 1.4px; text-transform: uppercase; font-weight: 700; color: var(--plum); }
.cs-more b { font-family: 'Playfair Display', Georgia, serif; font-size: 19px; }

@media (max-width: 820px) {
  .cs-kpis { grid-template-columns: 1fr; max-width: 420px; }
  .cs-steps, .cs-campaigns, .cs-split, .cs-articles, .cs-more-grid { grid-template-columns: 1fr; }
  .cs-intro { font-size: 17px; }
}
@media (max-width: 820px) { .br-wide { display: none; } }
@media (max-width: 480px) {
  .cs-campaign { grid-template-columns: 104px 1fr; gap: 14px; }
  .cs-campaign img { width: 104px; height: 136px; }
  .cs-phone, .cs-phones--equal .cs-phone { width: 220px; }
}
