/* ==========================================================================
   Centro Astalli – Landing "Se accadesse a te?"
   ========================================================================== */

:root {
  --c-blue: #006685;
  --c-blue-dark: #004f66;
  --c-yellow: #ffce1a;
  --c-orange: #eb6608;
  --c-purple: #a877b2;
  --c-green: #79a72d;
  --c-teal: #27b2af;
  --c-ink: #1d1d1b;
  --c-gray: #eaeaea;
  --c-gray-mid: #d6d6d6;
  --c-dark: #07070d;
  --c-white: #fff;

  --font: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --container: 1120px;
  --container-narrow: 900px;
  --gutter: 24px;
  --section-y: clamp(56px, 8vw, 110px);
  --radius: 28px;
  --header-h: 112px;          /* expanded header (logo 76px + padding) */
}

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

html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0;
  /* The header is fixed: reserve its expanded height once, so shrinking it
     never moves the page (a sticky header did, causing a scroll loop). */
  padding-top: var(--header-h);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.45;
  color: var(--c-ink);
  background: var(--c-white);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; height: auto; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
a { color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
strong { font-weight: 700; }

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: calc(var(--container-narrow) + 2 * var(--gutter)); }

.section { padding-block: var(--section-y); }
.section--tight-top { padding-top: 0; }
.bg-gray { background: var(--c-gray); }

.title {
  margin: 0 0 1.1em;
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 900;
  line-height: 1.15;
  text-transform: uppercase;
  color: var(--c-blue);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 12px 40px;
  border-radius: 999px;
  background: var(--c-blue);
  color: var(--c-yellow);
  font-weight: 900;
  font-size: 20px;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color .2s, transform .2s;
}
.btn:hover { background: var(--c-blue-dark); transform: translateY(-1px); }
.btn:focus-visible { outline: 3px solid var(--c-yellow); outline-offset: 3px; }
.btn--sm { padding: 6px 18px; font-size: 14px; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--c-white);
  transition: box-shadow .2s;
}
.site-header.is-stuck { box-shadow: 0 2px 12px rgba(0, 0, 0, .08); }
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 18px;
  transition: padding .2s;
}
.site-header.is-stuck .site-header__inner { padding-block: 8px; }
.site-header__logo img { width: auto; height: 76px; transition: height .2s; }
.site-header.is-stuck .site-header__logo img { height: 52px; }
.site-header__actions { display: flex; align-items: center; gap: 18px; }

.social { display: flex; gap: 10px; }
.social__link { display: block; width: 26px; height: 26px; border-radius: 50%; transition: opacity .2s; }
.social__link:hover { opacity: .8; }
.social__link img { width: 100%; height: 100%; }
.social--lg { justify-content: center; gap: 12px; }
.social--lg .social__link { width: 32px; height: 32px; }

/* ---------- Carousel (generic) ---------- */
.carousel { position: relative; }
.carousel__viewport { overflow: hidden; touch-action: pan-y; }
.carousel__track {
  display: flex;
  transition: transform .6s cubic-bezier(.4, 0, .2, 1);
  will-change: transform;
}
.carousel__slide { flex: 0 0 100%; min-width: 0; }

.carousel__dots { display: flex; justify-content: center; gap: 10px; margin-top: 28px; }
.carousel__dots:empty { display: none; }
.carousel__dot {
  width: 14px;
  height: 14px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--c-gray-mid);
  cursor: pointer;
  transition: background-color .2s, transform .2s;
}
.carousel__dot:hover { transform: scale(1.15); }
.carousel__dot[aria-selected="true"] { background: var(--c-blue); }
.carousel__dot:focus-visible { outline: 2px solid var(--c-blue); outline-offset: 2px; }

/* ---------- Headline overlaid on campaign photos ----------
 * Sizes are expressed in --u (the size of the big word) and scale with the
 * photo through container query units, as in the printed posters.
 */
.headline {
  --u: 7.4cqw;
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: calc(var(--u) * .62) 0 0 9.7cqw;
  color: var(--c-white);
  pointer-events: none;
}
.headline__kicker {
  margin: 0;
  font-size: max(10px, calc(var(--u) * .35));
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: .5em;
  text-transform: uppercase;
  color: var(--accent);
}
.headline__title {
  margin: calc(var(--u) * 2.05) 0 0;
  font-size: var(--u);
  font-weight: 300;
  line-height: .92;
  letter-spacing: -.025em;  /* web Nunito Sans is slightly wider than print */
  text-shadow: 0 0 .25em rgba(0, 0, 0, .45);
}
.headline__word {
  display: block;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--accent);
}
.headline__question { display: block; }
.headline__mark {
  display: block;
  height: calc(var(--u) * 3.45);
  margin-top: calc(var(--u) * .62);
  color: var(--accent);
}
.headline__mark svg { width: auto; height: 100%; }

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

/* ---------- Hero ---------- */
.hero { background: var(--c-dark); }
.hero__slide {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 2560 / 1122;            /* wide hero background */
  overflow: hidden;
  background: #0a0b0f;                  /* dark tone of the campaign photos */
}
.hero__figure { position: absolute; inset: 0; margin: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
/* No wide image: the square campaign photo sits on the right, its left
   edge fading into the dark background */
.hero__slide--composed .hero__media img {
  position: absolute;
  top: 0;
  right: 0;
  width: auto;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 25%);
          mask-image: linear-gradient(to right, transparent, #000 25%);
}
.hero .headline { --u: 3.3cqw; padding-left: 20.9cqw; }
.hero .headline__title { margin-top: calc(var(--u) * 2.3); line-height: .88; }
.hero .headline__mark { margin-top: calc(var(--u) * .75); height: calc(var(--u) * 3.5); }
.carousel__dots--hero {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4%;
  margin: 0;
  padding-left: 5%;                     /* as in the mockup, just right of centre */
}
.carousel__dots--hero .carousel__dot {
  width: 16px;
  height: 16px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .85);
}
.carousel__dots--hero .carousel__dot[aria-selected="true"] { background: #ddd; border-color: #ddd; }

/* ---------- Intro + progress ---------- */
.intro__text { margin-bottom: 48px; }

.progress {
  position: relative;
  display: flex;
  align-items: center;
  height: 50px;
  padding: 4px;
  border-radius: 999px;
  background: var(--c-gray-mid);
}
.progress__bar {
  display: flex;
  align-items: baseline;
  gap: 12px;
  height: 100%;
  min-width: max-content;
  padding: 0 24px 0 clamp(20px, 6vw, 56px);
  border-radius: 999px;
  background: var(--c-blue);
  color: var(--c-white);
  line-height: 42px;
  transition: width 1.2s cubic-bezier(.4, 0, .2, 1);
}
.progress__amount { font-size: 24px; font-weight: 900; }
.progress__label { font-size: 14px; font-weight: 900; }
.progress__percent {
  position: absolute;
  right: 24px;
  font-size: 24px;
  font-weight: 900;
  color: var(--c-blue);
}

.intro__goal {
  margin: 44px 0 36px;
  font-size: clamp(19px, 2vw, 23px);
  line-height: 1.3;
  color: var(--c-blue);
}

/* ---------- Campaign carousel ---------- */
.campaign .title { margin-bottom: 24px; }
.carousel--peek .carousel__track { gap: 28px; }
.carousel--peek .carousel__slide { flex-basis: min(880px, 84vw); }
.carousel--peek .carousel__dots { margin-top: 40px; }

.campaign-card {
  --accent: var(--c-orange);
  border: 1px solid #b5b5b5;
  padding: 18px 18px 40px;
  background: var(--c-white);
  opacity: .55;
  transition: opacity .4s;
}
.campaign-card.is-active { opacity: 1; }

.campaign-card__media {
  position: relative;
  margin: 0;
  container-type: inline-size;
  aspect-ratio: 1194 / 1167;            /* photo box of the A4 posters */
  overflow: hidden;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--c-dark);
}
.campaign-card__media img { width: 100%; height: 100%; object-fit: cover; }

.campaign-card__body {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 32px;
  padding: 36px 8% 0;
}
.campaign-card__text { font-size: 15px; }
.campaign-card__highlight { font-weight: 900; color: var(--accent); }
.campaign-card__logo { width: 150px; margin-top: 28px; }
.campaign-card__dona {
  font-size: 24px;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--accent);
}
.campaign-card__claim { font-size: 16px; font-weight: 900; }
.campaign-card__tagline { margin-top: 1.4em; font-size: 16px; font-style: italic; font-weight: 300; }
.campaign-card__url {
  display: inline-block;
  margin-top: 1.8em;
  font-size: 15px;
  font-weight: 900;
  color: var(--c-blue);
  text-decoration: none;
  word-break: break-all;
}

/* ---------- Donate (private / company) ---------- */
.donate__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 48px;
}
.donate__who { text-align: center; }
.donate__who-icon { width: 84px; height: 84px; margin: 0 auto 28px; object-fit: contain; }
.donate__who-title {
  margin: 0;
  font-size: clamp(22px, 2.2vw, 26px);
  font-weight: 900;
  text-transform: uppercase;
  color: var(--c-blue);
}
.donate__who-sub { margin-bottom: 26px; font-size: 18px; font-weight: 300; }

.donate__list { display: grid; gap: 52px; justify-items: center; }
.amount { max-width: 240px; text-align: center; }
.amount__icon { width: auto; height: 64px; margin: 0 auto 12px; }
.amount__value { margin-bottom: 10px; font-size: 30px; font-weight: 900; line-height: 1; color: var(--c-blue); }
.amount__desc { font-size: 15px; }

/* ---------- Testimonials ---------- */
.testimonials__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.testimonial {
  min-height: 300px;
  margin: 0;
  padding: 52px 15% 60px;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--c-blue);
  color: var(--c-white);
}
.testimonial p { font-size: 17px; font-style: italic; font-weight: 300; }
.testimonial__name { margin-top: 36px; font-weight: 900; text-transform: uppercase; }

/* ---------- Numbers ---------- */
.numbers__row { display: grid; }
.numbers__row--3 {
  grid-template-columns: repeat(3, 1fr);
  padding-bottom: 28px;
  border-bottom: 1px solid #8a8a8a;
}
.numbers__row--2 {
  grid-template-columns: repeat(2, minmax(0, 260px));
  justify-content: center;
  padding-top: 40px;
}
.stat {
  padding: 24px 16px;
  text-align: center;
}
.numbers__row .stat + .stat { border-left: 1px solid var(--c-blue); }
.numbers__row--2 .stat + .stat { border-left-color: #8a8a8a; }
.stat__swoosh { width: 150px; margin: 0 auto 26px; color: var(--accent); }
.stat__label { margin-bottom: 0; font-weight: 300; font-size: 16px; text-transform: uppercase; color: var(--accent); }
.stat__value { margin-bottom: 10px; font-size: 34px; font-weight: 900; line-height: 1.15; color: var(--accent); }
.stat__desc { font-size: 15px; }

/* ---------- Poster ---------- */
.poster__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  align-items: center;                  /* claim centred on the cover */
  gap: 56px;
}
.poster__figure { position: relative; margin: 0; }
.poster__img { width: 100%; }
.poster__claim p {
  max-width: 300px;
  margin-bottom: 32px;
  font-size: clamp(22px, 2.2vw, 26px);
  font-weight: 900;
  line-height: 1.2;
}

/* ---------- Funds ---------- */
.funds__chart {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin: 0 0 72px;
}
.funds__chart p { max-width: 320px; font-size: 16px; }
.funds__chart p strong { font-weight: 900; font-size: 17px; }
.donut {
  --value: 75;
  flex: 0 0 auto;
  width: 120px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    conic-gradient(from 180deg, var(--c-blue) 0 calc(var(--value) * 1%), #c6c6c6 0);
  -webkit-mask: radial-gradient(circle, transparent 46%, #000 47%);
          mask: radial-gradient(circle, transparent 46%, #000 47%);
}
.funds__text { font-size: 17px; }

/* ---------- Footer ---------- */
.site-footer {
  padding: 44px 0 56px;
  text-align: center;
  font-size: 13px;
  letter-spacing: .02em;
}
.site-footer__follow { margin-bottom: 18px; font-size: 18px; letter-spacing: .03em; }
.site-footer__logo { width: 170px; margin: 56px auto 22px; }
.site-footer__info { margin-bottom: 1.4em; font-style: normal; line-height: 1.6; }
.site-footer__legal { line-height: 1.6; }
.site-footer__credits { margin-bottom: 1.4em; line-height: 1.6; }

/* ---------- Photo credits (figcaption over the picture) ---------- */
.photo-credit {
  position: absolute;
  right: 14px;
  bottom: 10px;
  z-index: 2;
  max-width: 60%;
  font-size: 11px;
  line-height: 1.3;
  letter-spacing: .02em;
  text-align: right;
  color: rgba(255, 255, 255, .85);
  text-shadow: 0 0 3px rgba(0, 0, 0, .9), 0 0 8px rgba(0, 0, 0, .6);
  pointer-events: none;
}
.campaign-card__media .photo-credit { right: 22px; }  /* clear the rounded corner */
.photo-credit__narrow { display: none; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 860px) {
  .donate__grid,
  .poster__grid { grid-template-columns: 1fr; }
  .donate__who { order: -1; }
  .poster__claim { text-align: center; }
  .poster__claim p { margin-inline: auto; }

  .numbers__row--3 { grid-template-columns: 1fr; }
  .numbers__row--2 { grid-template-columns: 1fr; }
  .numbers__row .stat + .stat { border-left: 0; border-top: 1px solid var(--c-blue); }
  .numbers__row--2 .stat + .stat { border-top-color: #8a8a8a; }

  .campaign-card__body { grid-template-columns: 1fr; padding-inline: 4%; }
}

@media (max-width: 600px) {
  :root { --gutter: 16px; --header-h: 88px; }
  body { font-size: 16px; }
  .site-header__logo img { height: 52px; }
  .site-header.is-stuck .site-header__logo img { height: 40px; }
  .site-header__actions { gap: 10px; }
  .site-header .social { display: none; }
  .campaign-card__logo,
  .campaign-card__dona,
  .campaign-card__url { display: none; }
  .btn { padding: 10px 30px; font-size: 18px; }
  .btn--sm { padding: 6px 14px; font-size: 13px; }

  .intro__text br { display: none; }
  .progress { height: 44px; }
  .progress__bar { line-height: 36px; padding-left: 18px; }
  .progress__amount, .progress__percent { font-size: 19px; }
  .progress__percent { right: 16px; }

  .carousel__dots--hero { position: static; padding: 12px 0; }
  /* Phones: the hero becomes a square box like the campaign cards, with the
     square photo and the headline overlaid at the same proportions */
  .hero__slide { aspect-ratio: 1194 / 1167; }
  .photo-credit__wide { display: none; }
  .photo-credit__narrow { display: inline; }
  .hero__media img,
  .hero__slide--composed .hero__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 100% 50%;
    -webkit-mask-image: none;
            mask-image: none;
  }
  .hero .headline { --u: 7.4cqw; padding-left: 9.7cqw; }
  .hero .headline__title { margin-top: calc(var(--u) * 2.05); line-height: .92; }
  .hero .headline__mark { height: calc(var(--u) * 3.45); margin-top: calc(var(--u) * .62); }
  .funds__chart { flex-direction: column; text-align: center; }
  .testimonial { min-height: 0; padding: 40px 28px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; }
}
