/* ==========================================================
   SAY SOCIAL: token dal Design System ufficiale (Brandox).
   Abbinamento 02 Blu. Per cambiare abbinamento sostituisci
   i valori del blocco "TEMA" con quelli di tokens/themes.css
   (03 Arancione, 11 Viola, 12 Blu Chiaro, 13 Rosa Chiaro).
   ========================================================== */
@font-face { font-family: "Chopin"; src: url("assets/fonts/chopin-extrabold.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Nexa"; src: url("assets/fonts/nexa-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Helvetica Neue LT"; src: url("assets/fonts/helvetica-neue-roman.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  /* Palette brand */
  --blu: #003fc9;
  --blu-notte: #162a6a;
  --rosa: #ff88c1;
  --rosa-chiaro: #ffc6ff;
  --rosa-elettrico: #ee41ab;
  --white: #ffffff;

  /* TEMA: Abbinamento 02 Blu */
  --theme-bg: var(--blu);
  --theme-title: var(--rosa);
  --theme-sub: var(--rosa-chiaro);
  --theme-body: var(--white);
  --theme-highlight: var(--rosa-chiaro);
  --theme-btn-bg: var(--rosa-chiaro);
  --theme-btn-fg: var(--blu);
  --theme-box-bg: var(--blu-notte);
  --theme-box-fg: var(--white);

  /* Tipografia brand: Chopin titoli, Nexa UI, Helvetica Neue testo */
  --font-display: "Chopin", "Nexa", Impact, sans-serif;
  --font-ui: "Nexa", "Helvetica Neue LT", system-ui, sans-serif;
  --font-body: "Helvetica Neue LT", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --radius-box: 24px;
  --ease: cubic-bezier(.2, 0, 0, 1);

  color-scheme: dark;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--theme-bg);
}

*, *::before, *::after { box-sizing: inherit; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--theme-bg);
  color: var(--theme-body);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:focus-visible {
  outline: 3px solid var(--theme-highlight);
  outline-offset: 3px;
}

.page {
  width: 100%;
  max-width: 30rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 2rem;
}

/* ---------- Selettore lingua: pillola a due posizioni ---------- */
.topbar {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 1rem;
}

.lang {
  display: inline-flex;
  padding: 3px;
  border: 2px solid var(--theme-sub);
  border-radius: 999px;
}

.lang button {
  min-width: 44px;
  min-height: 36px;
  padding: .15rem .8rem 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--theme-sub);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: .875rem;
  cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}

.lang button[aria-pressed="true"] {
  background: var(--theme-sub);
  color: var(--theme-btn-fg);
}

/* ---------- Hero: titolo display dominante, foto a pillola che lo sovrappone ---------- */
.hero__top {
  position: relative;
  min-height: 15.5rem;
}

.hero__name {
  position: relative;
  z-index: 1;
  margin: 0;
  padding-top: 5.5rem;
  color: var(--theme-title);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(4.5rem, 25vw, 7.25rem);
  line-height: .86;
  text-transform: uppercase;
}

.hero__photo {
  position: absolute;
  top: 0;
  right: 0;
  width: 8.5rem;
  height: auto;
}

.hero__bio {
  margin: 1.5rem 0 0;
  max-width: 30ch;
  font-size: 1.1875rem;
  line-height: 1.4;
  text-wrap: pretty;
}

/* Parole chiave: si evidenziano solo cambiando colore */
.hl { color: var(--theme-highlight); }

.social {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.social a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .1rem 1.1rem 0;
  border: 2px solid var(--theme-sub);
  border-radius: 999px;
  color: var(--theme-sub);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: .9375rem;
  text-decoration: none;
  transition: background-color .2s var(--ease), color .2s var(--ease), transform .12s var(--ease);
}

.social a:hover { background: var(--theme-sub); color: var(--theme-btn-fg); }
.social a:active { transform: scale(.97); }

/* ---------- Link: box "sotto tono" a raggio 24px ---------- */
.links {
  display: grid;
  gap: .625rem;
  margin: 2.25rem 0 0;
  padding: 0;
  list-style: none;
}

.link {
  display: grid;
  grid-template-columns: 2.75rem 1fr 1.25rem;
  align-items: center;
  gap: .9rem;
  padding: 1rem 1.1rem 1rem 1rem;
  border-radius: var(--radius-box);
  background: var(--theme-box-bg);
  color: var(--theme-box-fg);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: filter .2s var(--ease), transform .12s var(--ease);
}

.link__icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--theme-sub) 16%, transparent);
  color: var(--theme-sub);
  transition: background-color .25s var(--ease), color .25s var(--ease);
}

.link__icon svg,
.link__arrow,
.share svg {
  width: 1.3rem;
  height: 1.3rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.link__text { display: grid; gap: .2rem; min-width: 0; }

.link__title {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.2;
}

.link__desc {
  color: var(--theme-sub);
  font-size: .9375rem;
  line-height: 1.35;
}

.link__arrow {
  width: 1.2rem;
  height: 1.2rem;
  color: var(--theme-sub);
  transition: transform .3s var(--ease);
}

@media (hover: hover) {
  .link:hover { filter: brightness(.94); }
  .link:hover .link__icon { background: var(--theme-sub); color: var(--theme-btn-fg); }
  .link:hover .link__arrow { transform: translate(3px, -3px); }
}

.link:active { transform: scale(.97); }

/* Etichetta per i contenuti disponibili in una sola lingua */
.tag {
  display: inline-flex;
  align-items: center;
  margin-left: .35rem;
  padding: .2rem .5rem 0;
  border: 2px solid currentColor;
  border-radius: 999px;
  font-size: .6875rem;
  line-height: 1.2;
  vertical-align: .15em;
}
.tag[hidden] { display: none; }

.link--button {
  width: 100%;
  border: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

/* Link in evidenza: pillola rosa chiaro, l'unico campo chiaro della pagina */
.link--featured {
  padding: 1.15rem 1.4rem 1.15rem 1.1rem;
  border-radius: 999px;
  background: var(--theme-btn-bg);
  color: var(--theme-btn-fg);
}

.link--featured .link__icon { background: var(--theme-btn-fg); color: var(--theme-btn-bg); }
.link--featured .link__title { font-size: 1.125rem; }
.link--featured .link__desc,
.link--featured .link__arrow { color: var(--theme-btn-fg); }

@media (hover: hover) {
  .link--featured:hover .link__icon { background: var(--rosa-elettrico); color: var(--white); }
}

/* ---------- Footer: logo piccolo, come nelle slide ---------- */
.foot {
  margin-top: 2.75rem;
}

.share {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 44px;
  padding: .1rem 1.1rem 0;
  border: 2px solid var(--theme-sub);
  border-radius: 999px;
  background: none;
  color: var(--theme-sub);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: .9375rem;
  cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease), transform .12s var(--ease);
}

.share svg { width: 1.1rem; height: 1.1rem; margin-top: -.1rem; }
.share:hover { background: var(--theme-sub); color: var(--theme-btn-fg); }
.share:active { transform: scale(.97); }

.share__status {
  min-height: 1.4em;
  margin: .4rem 0 0;
  color: var(--theme-sub);
  font-size: .875rem;
}

.foot__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
}

.foot__logo {
  width: 7.5rem;
  height: auto;
  aspect-ratio: 1278.47 / 280.9;
  color: var(--theme-body);
}

.foot__places {
  margin: 0;
  color: var(--theme-sub);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: .75rem;
  text-align: right;
}

.foot__legal {
  margin: .75rem 0 0;
  color: var(--theme-sub);
  font-size: .8125rem;
}

.foot__legal {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1rem;
}
.foot__legal a {
  color: inherit;
  text-underline-offset: .2em;
}

/* Messaggio se i contenuti non si caricano */
.load-error {
  margin: 2rem 0 0;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-box);
  background: var(--theme-box-bg);
}
.load-error a { color: var(--theme-sub); }
.load-error[hidden] { display: none; }

/* ---------- Pannello sedi ---------- */
.sheet {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
  border: 0;
  background: var(--theme-bg);
  color: var(--theme-body);
  overflow: hidden;
}

.sheet[open] { display: flex; flex-direction: column; }
.sheet::backdrop { background: rgba(22, 42, 106, .6); }

.sheet__head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 64rem;
  margin: 0 auto;
  padding: 1.25rem 1.25rem .75rem;
  touch-action: pan-x;
}

.sheet__title {
  margin: 0;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1.125rem;
}

.sheet__count {
  margin: 0;
  color: var(--theme-sub);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: .875rem;
  font-variant-numeric: tabular-nums;
}

.sheet__close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 2px solid var(--theme-sub);
  border-radius: 999px;
  background: none;
  color: var(--theme-sub);
  cursor: pointer;
}
.sheet__close svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.sheet__close:hover { background: var(--theme-sub); color: var(--theme-btn-fg); }

/* Galleria orizzontale: una card per sede, si scorre col dito */
.offices-track {
  display: flex;
  gap: .75rem;
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: .5rem 1.25rem 1.5rem;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 1.25rem;
  scrollbar-width: none;
}
.offices-track::-webkit-scrollbar { display: none; }

@media (min-width: 64rem) {
  .offices-track { max-width: 64rem; margin: 0 auto; width: 100%; }
}

.office {
  display: flex;
  flex-direction: column;
  flex: 0 0 min(84%, 22rem);
  scroll-snap-align: start;
  overflow: hidden;
  border-radius: 32px;
  background: var(--theme-box-bg);
}

/* Parte alta nel colore dell'abbinamento, foto ad arco */
.office__media {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  flex: 1;
  min-height: 12rem;
  padding: 1.5rem 1.5rem 0;
}
.office__media--arancione { background: #ff5529; }
.office__media--viola { background: #7574cd; }
.office__media--blu-chiaro { background: #6184ff; }
.office__media--rosa-chiaro { background: #ffc6ff; }
.office__media--verde-chiaro { background: #1cb176; }
.office__media--giallo { background: #ffb828; }

.office__photo,
.office__media img {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: .5rem;
  width: 78%;
  height: 100%;
  max-height: 20rem;
  border-radius: 999px 999px 0 0;
  background: rgba(22, 42, 106, .32);
  color: var(--white);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: .8125rem;
  object-fit: cover;
}
.office__photo svg { width: 1.75rem; height: 1.75rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }

.office__body {
  padding: 1.25rem 1.25rem 1.4rem;
}

.office__name {
  margin: 0;
  color: var(--theme-title);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3rem, 15vw, 4rem);
  line-height: .9;
  text-transform: uppercase;
}

.office__address {
  margin: .6rem 0 0;
  color: var(--theme-sub);
  font-size: .9375rem;
}

.office__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1.1rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 44px;
  padding: .1rem 1rem 0;
  border-radius: 999px;
  background: var(--theme-btn-bg);
  color: var(--theme-btn-fg);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: .875rem;
  text-decoration: none;
  transition: filter .2s var(--ease), transform .12s var(--ease);
}
.pill svg { width: 1.05rem; height: 1.05rem; margin-top: -.1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pill:hover { filter: brightness(.94); }
.pill:active { transform: scale(.97); }

@media (prefers-reduced-motion: no-preference) {
  .sheet[open] { animation: sheet-in .38s var(--ease) both; }
}
@keyframes sheet-in { from { transform: translateY(100%); } }

/* ---------- Un solo momento di movimento: l'ingresso ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero__name { animation: rise .42s var(--ease) both; }
  .hero__photo { animation: rise .42s .08s var(--ease) both; }
}

@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}

@media (min-width: 48rem) {
  .page { padding-top: 4rem; }
}
