@import url('/newsletter-popup.css');
:root {
  --masthead-height: 80px;
  --hero-height: clamp(700px, 90svh, 980px);
  --type-display: clamp(43px, 7.6vw, 112px);
  --type-section: clamp(37px, 4.85vw, 72px);
  --type-subhead: clamp(25px, 2.9vw, 44px);
  --type-lead: clamp(17px, 1.42vw, 21px);
  --type-text: clamp(16px, 1.24vw, 18px);
  --type-ui: 15px;
  --type-caption: 14px;
  --type-data-small: clamp(44px, 4.1vw, 60px);
  --type-data: clamp(58px, 7.4vw, 112px);
  --enter-curve: cubic-bezier(.16, 1, .3, 1);
  --enter-time: 560ms;
}

html:has(.preview-page) { scroll-padding-top: calc(var(--masthead-height) + 12px); }

body.preview-page {
  --bg: #101010;
  --ink: #f0ede7;
  --ink2: #c5c1bb;
  --mute: #a6a29c;
  --line: #363432;
  --red: #d92131;
  --detail-accent: var(--red);
  font-size: var(--type-text);
}

.preview-page .masthead {
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  background: rgba(15, 15, 15, .92);
  border-bottom: 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.preview-page .masthead-inner {
  max-width: 1440px;
  min-height: var(--masthead-height);
  padding-inline: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.masthead-menu { display: none; }
.masthead-brand { flex: 0 0 auto; }
.masthead-brand img { width: 122px; height: auto; }
.masthead-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: end;
  column-gap: clamp(18px, 3vw, 40px);
  row-gap: 4px;
  font-size: var(--type-ui);
}
.masthead-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.masthead-nav a:not(.btn),
.sito-pie a { color: var(--ink2); }
.masthead-nav a[aria-current],
.masthead-nav a:hover:not(.btn),
.sito-pie a:hover { color: var(--ink); }
.masthead-nav a[aria-current] {
  text-decoration: underline;
  text-decoration-color: var(--mute);
  text-underline-offset: 7px;
}
.preview-page .btn {
  min-height: 46px;
  padding: 12px 22px;
  font-size: var(--type-ui);
  letter-spacing: 0;
}
.preview-page .masthead-nav .btn { min-height: 44px; }
.preview-page :is(.masthead, .sito-pie) :is(a, button):focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.preview-page .sito-pie {
  display: block;
  max-width: 1440px;
  padding-block: clamp(40px, 6vw, 80px) 16px;
  color: var(--ink2);
  font-size: var(--type-caption);
}

.sito-pie-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) repeat(3, minmax(0, 1fr));
  gap: 28px clamp(18px, 4vw, 52px);
  padding-block-end: clamp(32px, 4vw, 56px);
}
.preview-page .sito-pie-grid h2 {
  margin-block: 5px 12px;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
}
.sito-pie-sede .masthead-brand { display: inline-block; margin-block-end: 12px; }
.sito-pie-sede address { font-style: normal; }
.sito-pie-grid :is(nav, address) > a {
  display: flex;
  align-items: center;
  width: fit-content;
  min-height: 36px;
  padding-block: 4px;
}
.sito-pie-note {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  align-items: center;
  justify-content: space-between;
  padding-block-start: 12px;
  border-top: 1px solid var(--line);
  color: var(--mute);
}
.sito-pie-note nav { display: flex; flex-wrap: wrap; gap: 0 18px; }
.sito-pie-note a { display: inline-flex; align-items: center; min-height: 36px; }

@media (max-width: 800px) {
  .sito-pie-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .sito-pie-grid :is(nav, address) > a { min-height: 44px; }
  .sito-pie-note a { min-height: 44px; }
}

body.preview-page .page-hero { min-block-size: var(--hero-height); }

body.preview-page :is(.hero-intro, .editorial-hero) {
  padding-top: calc(var(--masthead-height) + clamp(32px, 6vw, 82px));
  padding-bottom: clamp(30px, 6vw, 78px);
}
body.preview-page .hero-intro {
  padding-top: calc(var(--masthead-height) + clamp(20px, 3vw, 40px));
  padding-bottom: clamp(24px, 4vw, 55px);
}

:is(.home-preview, .editorial-hub, .detail-page).preview-page .page-hero h1 {
  font-size: var(--type-display);
  line-height: .91;
  letter-spacing: -.036em;
}
.preview-page .hero-line-small {
  font-size: var(--type-section);
  line-height: .98;
}

body.preview-page h2 {
  font-size: var(--type-section);
  line-height: 1;
  letter-spacing: -.027em;
}
body.preview-page h3,
.preview-page .case-tagline,
.preview-page .promise,
.preview-page .cs-name,
.preview-page .goal-list a > .serif {
  font-size: var(--type-subhead);
  line-height: 1.08;
}
.preview-page .service-detail-intro > div > p,
.preview-page :is(.sub, .service-offer, .case-intro, .project-summary) > p:not(.case-tagline) {
  font-size: var(--type-lead);
  line-height: 1.55;
}
.preview-page :is(.case-feature-grid, .service-index, .sec-head, .cl-head, .svc-row, .laws) p,
.preview-page :is(.txt, .body, .case-paragrafi, .scope-list, .proofline, .service-proof p, .detail-close p, .press-dashboard p),
.preview-page :is(.ans, .faq dd, .inc li) {
  font-size: var(--type-text);
}
.preview-page :is(.detail-link, .fb button, .goal-list .gs, .cs-tag, .cs-res, .hero-actions .lnk) {
  font-size: var(--type-ui);
}
.preview-page :is(figcaption, .figcap, .count, .case-tags, .proof p) {
  font-size: var(--type-caption);
}
.preview-page :is(.case-feature-result .serif, .case-key-result span) {
  font-size: var(--type-data);
  line-height: .95;
}
.preview-page .proof .n { font-size: var(--type-data-small); }
.preview-page .case-key-result { font-size: var(--type-subhead); }
.preview-page .contact > svg[aria-hidden="true"] { pointer-events: none; }

.preview-page .page-hero-photo {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding-top: var(--masthead-height);
}
.preview-page .page-hero-photo .detail-hero {
  width: 100%;
  padding-block: clamp(32px, 5vw, 70px) clamp(25px, 3.3vw, 46px);
}
.preview-page .page-hero-photo .detail-wide {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  margin: 0;
}
.preview-page .page-hero-photo .photo-window {
  aspect-ratio: auto;
  min-height: clamp(205px, 31svh, 350px);
}
.preview-page .page-hero-photo .photo-window img {
  position: absolute;
  inset: 0;
}
.preview-page .page-hero-photo .case-cover-photo img { object-position: center 27%; }
.preview-page .page-hero-photo figcaption {
  width: 100%;
  padding-bottom: 14px;
}

@media (prefers-reduced-motion: no-preference) {
  .preview-page .hero-intro .l > span {
    animation-duration: 470ms;
    animation-timing-function: var(--enter-curve);
  }
  .preview-page .hero-intro .sub {
    animation: entrata-testo var(--enter-time) var(--enter-curve) 210ms both;
  }
  .preview-page :is(.editorial-hero, .page-hero-photo) h1 {
    animation: entrata-testo var(--enter-time) var(--enter-curve) both;
  }
  .preview-page .editorial-hero :is(.service-offer > p, .service-offer > .btn, .case-intro),
  .preview-page .page-hero-photo :is(.project-summary, .service-detail-intro > div, .case-tags) {
    animation: entrata-testo var(--enter-time) var(--enter-curve) 110ms both;
  }
  .preview-page .editorial-illustration {
    animation: entrata-illustrazione 800ms var(--enter-curve) 80ms both;
  }
}
@keyframes entrata-testo {
  from { opacity: .35; transform: translateY(13px); }
  to { opacity: 1; transform: none; }
}
@keyframes entrata-illustrazione {
  from { opacity: .25; transform: translateX(24px); clip-path: inset(0 0 0 18%); }
  to { opacity: 1; transform: none; clip-path: inset(0); }
}

@media (max-width: 900px) {
  .preview-page .masthead-inner { padding-inline: 32px; }
  .preview-page .page-hero-photo .detail-hero { padding-block: 36px 30px; }
}
@media (max-width: 800px) {
  .masthead-nav { gap: 4px 11px; }
  .preview-page .masthead-nav .btn { padding-inline: 14px; }
  .masthead-menu:not([hidden]) {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: var(--type-ui);
    cursor: pointer;
  }
  .masthead-menu::after {
    content: "";
    width: 6px;
    height: 6px;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
  }
  .masthead-menu[aria-expanded="true"]::after { transform: translateY(2px) rotate(225deg); }
  .masthead-menu:not([hidden]) + .masthead-nav {
    position: absolute;
    inset: 100% 0 auto;
    max-height: calc(100dvh - var(--masthead-height));
    overflow-y: auto;
    display: grid;
    justify-content: stretch;
    align-items: start;
    gap: 0;
    padding: 6px 32px 16px;
    border-block: 1px solid var(--line);
    background: var(--bg);
  }
  .masthead-menu:not([hidden])[aria-expanded="false"] + .masthead-nav { display: none; }
  .masthead-menu:not([hidden]) + .masthead-nav a:not(.btn) {
    min-height: 48px;
    border-bottom: 1px solid var(--line);
  }
  .masthead-menu:not([hidden]) + .masthead-nav .btn {
    justify-self: start;
    margin-top: 12px;
  }
  html:has(.masthead-menu[hidden]) { --masthead-height: 120px; }
  .preview-page .masthead-inner:has(.masthead-menu[hidden]) {
    flex-direction: column;
    justify-content: center;
  }
  .masthead-menu[hidden] + .masthead-nav { justify-content: center; }
}
@media (max-width: 700px) {
  :root {
    --masthead-height: 68px;
    --type-display: clamp(42px, 10.45vw, 64px);
    --type-section: clamp(34px, 7.4vw, 51px);
    --type-ui: 14px;
  }

  .preview-page :is(.masthead-inner, .sito-pie) { padding-inline: 20px; }
  .preview-page .masthead-inner { gap: 8px; }
  .masthead-brand img { width: 82px; }
  .masthead-menu:not([hidden]) + .masthead-nav { padding-inline: 20px; }
  body.preview-page .hero-intro,
  body.preview-page .editorial-hero { padding-block: calc(var(--masthead-height) + 34px) 34px; }
  .preview-page .page-hero-photo .detail-hero { padding-block: 32px 25px; }
  .preview-page .page-hero-photo .photo-window { min-height: min(205px, 25svh); }
}
@media (prefers-reduced-motion: reduce) {
  html:has(.preview-page) { scroll-behavior: auto; }
  .preview-page *,
  .preview-page *::before,
  .preview-page *::after { animation: none !important; transition: none !important; }
}

.preview-page .breadcrumb {
  position: absolute;
  z-index: 2;
  top: calc(var(--masthead-height) + 6px);
  left: 0;
  right: 0;
  color: var(--mute);
  font-size: clamp(.75rem, 1vw, .875rem);
}

@media (max-width: 600px) {
  .preview-page .breadcrumb { padding-inline: 20px; }
}

.breadcrumb ol {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.breadcrumb li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.breadcrumb li + li::before { content: "/"; opacity: .55; }
.breadcrumb li:not(:last-child) { flex: none; }
.breadcrumb li:last-child > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumb a { display: inline-flex; align-items: center; min-height: 24px; color: inherit; }
.breadcrumb a:is(:hover,:focus-visible) { color: var(--ink); text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: var(--ink2); }

.preview-page:has(.breadcrumb) :is(.article-back,.case-cover > .back-link) { display: none; }

.sito-pie-note [data-dcms-consent-open] {
  appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.sito-pie-note [data-dcms-consent-open]:hover { text-decoration: underline; }
.cms-archive { padding-block: clamp(40px,7vw,100px); }
.cms-archive h2 { font: 400 clamp(2.4rem,6vw,5rem)/1 Newsreader,serif; }
.cms-archive form { display:flex; align-items:end; gap:.8rem; margin:2rem 0; }
.cms-archive label { display:grid; gap:.5rem; }
.cms-archive input,.cms-archive button { min-height:44px; padding:.5rem .85rem; font:inherit; max-width:100%; min-width:0; }
.cms-archive ul { list-style:none; padding:0; columns:2 24rem; column-gap:4rem; }
.cms-archive li { break-inside:avoid; border-top:1px solid var(--line); padding:.85rem 0; }
.cms-archive a { color:inherit; }

@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    :is(.service-section, .service-story, .case-chapter, .cms-sezione, .intel-capitolo, .pillole-archivio) h2,
    .blog-in-evidenza h2, .article-opening h1 {
      animation: titolo-capitolo linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 18%;
    }
    @keyframes titolo-capitolo {
      from { opacity: .62; translate: 0 .28em; }
      to { opacity: 1; translate: 0 0; }
    }
    @media (forced-colors: none) {
      body.preview-page :is(.service-portfolio-copy, .guide-section-heading, .case-title, .intel-prosa) > p:first-of-type {
        background: linear-gradient(170deg, #f0ede7 38%, #a7a29b 62%) 0 100% / 100% 310%;
        background-clip: text;
        color: transparent;
        animation: lettura-capitolo linear both;
        animation-timeline: view();
        animation-range: entry 15% exit 40%;
      }
      @keyframes lettura-capitolo { to { background-position: 0 0; } }
    }
  }
}

/* Link: un solo trattamento su tutto il sito (Francesco, 22/11/2026).
   Nel testo il link e' un grassetto leggero (400 sul corpo a 300, 500 dove il corpo e' a 400) nel
   colore pieno del tema, senza sottolineatura. Al passaggio e al focus compare una linea rossa
   sottile; la freccia .ar si sposta a destra (site.css). Menu, piede e indici restano nel loro
   colore ma al passaggio prendono la stessa linea. Bottoni e schede intere non c'entrano. */
:root { --link-peso: 400; }
.public-content { --link-peso: 500; }
:is(p, dd, td, figcaption, blockquote, .faq-list li, .rich-dark li, .guide-topics li, .case-text li, .article-copy li, .public-content li, .pillole-transcript li, .pillole-links li) > a:not(:is(.btn, .button, .button-red, .detail-button, .service-other)):not(:has(img, h2, h3, h4)),
:is(.lnk, .text-link, .cms-link, .cms-managed-link, .detail-link, .pubblicazione-link, .pillole-more, .pillole-youtube, .intel-rivedi, .btn-inline, .service-reading summary, .case-index-band a, .case-next a, .case-closing a) {
  color: var(--ink);
  font-weight: var(--link-peso);
  text-decoration: none;
}
:is(p, dd, td, figcaption, blockquote, li) > a:not(:is(.btn, .button, .button-red, .detail-button, .service-other)):not(:has(img, h2, h3, h4)):is(:hover, :focus-visible),
:is(.lnk, .text-link, .cms-link, .cms-managed-link, .detail-link, .pubblicazione-link, .pillole-more, .pillole-youtube, .intel-rivedi, .btn-inline, .service-reading summary, .case-index-band a, .case-next a, .case-closing a, .sito-pie a, .breadcrumb a, .intel-indice a, .directory-index a, .detail-nav a:not(.btn), .related-services a):is(:hover, :focus-visible) {
  text-decoration: underline 1px var(--red);
  text-underline-offset: .19em;
}
