/* Andrea Michielan | intensivo/question | original component stylesheet */
/* =========================================================
   SEZIONE 02 — LA DOMANDA
   Identità: Layers / Essenziale
   Namespace: am-chi-question
========================================================= */

.am-chi-question,
.am-chi-question * {
  box-sizing: border-box;
}

.am-chi-question {
  --am-question-bg: var(--am-ds-ivory);
  --am-question-bg-secondary: var(--am-ds-ivory);

  --am-question-text: var(--am-ds-ink);
  --am-question-text-secondary: var(--am-ds-body);

  --am-question-accent: var(--am-ds-brand);
  --am-question-accent-secondary: var(--am-ds-brand);

  --am-question-button: var(--am-ds-brand);
  --am-question-button-hover: var(--am-ds-primary);

  --am-question-border: rgba(0, 0, 0, 0.08);
  --am-question-border-accent: rgba(127, 167, 160, 0.25);

  --am-question-shadow-small:
    0 12px 35px rgba(0, 0, 0, 0.07);

  /*
   * IMMAGINE DECORATIVA OPZIONALE
   * DIMENSIONE CONSIGLIATA: 1600 × 1200 PX
   */
  --am-question-image:
    url("https://andreamichielan.com/wp-content/uploads/2026/09/am_corso_chi_sono_io_andrea_michielan_scorze.webp");

  position: relative;
  isolation: isolate;
  width: 100%;
  overflow: hidden;
  padding:
    clamp(105px, 11vw, 170px)
    0
    clamp(100px, 10vw, 155px);
  background:
    linear-gradient(
      180deg,
      var(--am-question-bg) 0%,
      var(--am-question-bg-secondary) 100%
    );
  color: var(--am-question-text);
  font-family: var(--am-ds-font-body), sans-serif;
}

/* =========================================================
   SFONDO
========================================================= */

.am-chi-question__background {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.am-chi-question__background::before {
  content: "";
  position: absolute;
  top: 12%;
  right: -8%;
  width: min(44vw, 680px);
  height: 78%;
  background:
    linear-gradient(
      90deg,
      var(--am-question-bg-secondary) 0%,
      rgba(247, 246, 243, 0.60) 45%,
      rgba(247, 246, 243, 0.13) 100%
    ),
    var(--am-question-image)
    center center / cover
    no-repeat;
  opacity: 0.09;
  filter:
    grayscale(1)
    contrast(0.88);
  transform: rotate(1deg);
}

.am-chi-question__background-word {
  position: absolute;
  right: -1.5%;
  bottom: -2%;
  color: var(--am-question-text);
  font-family: var(--am-ds-font-display), Georgia, serif;
  font-size: clamp(105px, 15vw, 245px);
  font-weight: 400;
  line-height: 0.8;
  letter-spacing: -0.065em;
  opacity: 0.025;
  white-space: nowrap;
}

.am-chi-question__background-line {
  position: absolute;
  top: 0;
  left: 18%;
  width: 1px;
  height: 100%;
  background:
    linear-gradient(
      180deg,
      transparent,
      rgba(127, 167, 160, 0.17) 18%,
      rgba(127, 167, 160, 0.17) 82%,
      transparent
    );
}

/* =========================================================
   CONTAINER
========================================================= */

.am-chi-question__container {
  position: relative;
  z-index: 2;
  width: min(calc(100% - 48px), 1320px);
  margin: 0 auto;
}

/* =========================================================
   HEADER
========================================================= */

.am-chi-question__header {
  display: grid;
  grid-template-columns:
    minmax(190px, 0.32fr)
    minmax(0, 1fr);
  gap: clamp(45px, 8vw, 125px);
  align-items: start;
  margin-bottom: clamp(65px, 8vw, 110px);
}

.am-chi-question__eyebrow {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 15px 0 0;
  color: var(--am-question-accent);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.21em;
  text-transform: uppercase;
}

.am-chi-question__index {
  color: var(--am-question-button);
  font-family: var(--am-ds-font-display), Georgia, serif;
  font-size: 23px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
}

.am-chi-question__eyebrow-line {
  display: block;
  width: 42px;
  height: 1px;
  background: var(--am-question-accent);
}

.am-chi-question__title {
  max-width: 930px;
  margin: 0;
  color: var(--am-question-text);
  font-family: var(--am-ds-font-display), Georgia, serif;
  font-size: clamp(56px, 6.9vw, 105px);
  font-weight: 400;
  line-height: 0.97;
  letter-spacing: -0.048em;
  text-wrap: balance;
}

.am-chi-question__title em {
  display: block;
  margin-top: 9px;
  color: var(--am-question-accent);
  font-weight: 400;
}

/* =========================================================
   COMPOSIZIONE
========================================================= */

.am-chi-question__composition {
  display: grid;
  grid-template-columns:
    minmax(360px, 0.92fr)
    minmax(0, 1fr);
  gap: clamp(65px, 9vw, 145px);
  align-items: center;
}

/* =========================================================
   STRATI VISIVI
========================================================= */

.am-chi-question__layers {
  position: relative;
  width: min(100%, 530px);
  min-height: 590px;
}

.am-chi-question__layer {
  position: absolute;
  display: flex;
  align-items: flex-end;
  padding: 25px 29px;
  border: 1px solid var(--am-question-border-accent);
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.76),
      rgba(247, 246, 243, 0.50)
    );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.80);
  color: var(--am-question-text-secondary);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.am-chi-question__layer span {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  opacity: 0.74;
}

.am-chi-question__layer--one {
  top: 0;
  left: 0;
  width: 84%;
  height: 72%;
  opacity: 0.58;
  transform: rotate(-1.8deg);
  animation:
    amQuestionLayerOne 16s ease-in-out infinite;
}

.am-chi-question__layer--two {
  top: 8%;
  left: 8%;
  width: 83%;
  height: 72%;
  opacity: 0.66;
  transform: rotate(1.4deg);
  animation:
    amQuestionLayerTwo 18s ease-in-out infinite;
}

.am-chi-question__layer--three {
  top: 17%;
  left: 17%;
  width: 76%;
  height: 67%;
  opacity: 0.74;
  transform: rotate(-0.8deg);
  animation:
    amQuestionLayerThree 15s ease-in-out infinite;
}

.am-chi-question__layer--four {
  top: 27%;
  left: 28%;
  width: 66%;
  height: 59%;
  border-color: rgba(27, 138, 138, 0.20);
  opacity: 0.82;
  transform: rotate(1.2deg);
  animation:
    amQuestionLayerFour 17s ease-in-out infinite;
}

.am-chi-question__empty-space {
  position: absolute;
  top: 39%;
  left: 42%;
  display: block;
  width: 38%;
  aspect-ratio: 1 / 1.05;
  border: 1px solid rgba(27, 138, 138, 0.23);
  background:
    linear-gradient(
      145deg,
      rgba(252, 252, 250, 0.91),
      rgba(252, 252, 250, 0.58)
    );
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.045),
    0 0 0 14px rgba(252, 252, 250, 0.16);
  animation:
    amQuestionEmptySpace 13s ease-in-out infinite;
}

/* =========================================================
   CONTENUTO
========================================================= */

.am-chi-question__content {
  width: min(100%, 650px);
}

.am-chi-question__lead {
  margin: 0;
  color: var(--am-question-text);
  font-family: var(--am-ds-font-display), Georgia, serif;
  font-size: clamp(29px, 3vw, 43px);
  font-weight: 400;
  line-height: 1.28;
  letter-spacing: -0.025em;
}

.am-chi-question__text {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 43px);
  margin-top: 40px;
}

.am-chi-question__text p {
  margin: 0;
  color: var(--am-question-text-secondary);
  font-size: clamp(14px, 1.08vw, 16px);
  font-weight: 400;
  line-height: 1.88;
}

.am-chi-question__quote {
  position: relative;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  gap: 20px;
  margin: clamp(43px, 5vw, 67px) 0 0;
  padding: 29px 0 0;
  border-top: 1px solid var(--am-question-border);
}

.am-chi-question__quote-mark {
  display: block;
  width: 9px;
  height: 9px;
  margin-top: 8px;
  background: var(--am-question-button);
  box-shadow:
    0 0 0 7px rgba(27, 138, 138, 0.08);
}

.am-chi-question__quote p {
  margin: 0;
  color: var(--am-question-text);
  font-family: var(--am-ds-font-display), Georgia, serif;
  font-size: clamp(24px, 2.2vw, 32px);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

/* =========================================================
   DEFINIZIONI
========================================================= */

.am-chi-question__definitions {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-top: clamp(85px, 9vw, 125px);
  border-top: 1px solid var(--am-question-border);
  border-bottom: 1px solid var(--am-question-border);
}

.am-chi-question__definitions span {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 81px;
  padding: 20px 14px;
  color: var(--am-question-text-secondary);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.16em;
  text-align: center;
  text-transform: uppercase;
}

.am-chi-question__definitions span:not(:last-child) {
  border-right: 1px solid var(--am-question-border);
}

.am-chi-question__definitions span::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 50%;
  width: 0;
  height: 1px;
  background: var(--am-question-button);
  transform: translateX(-50%);
  transition: width 0.35s ease;
}

.am-chi-question__definitions span:hover::after {
  width: 40%;
}

/* =========================================================
   ANIMAZIONI
========================================================= */

@keyframes amQuestionLayerOne {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(-1.8deg);
  }

  50% {
    transform: translate3d(-5px, 3px, 0) rotate(-1.8deg);
  }
}

@keyframes amQuestionLayerTwo {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(1.4deg);
  }

  50% {
    transform: translate3d(4px, -4px, 0) rotate(1.4deg);
  }
}

@keyframes amQuestionLayerThree {
  0%,
  100% {
    opacity: 0.74;
    transform: translate3d(0, 0, 0) rotate(-0.8deg);
  }

  50% {
    opacity: 0.88;
    transform: translate3d(-4px, -3px, 0) rotate(-0.8deg);
  }
}

@keyframes amQuestionLayerFour {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(1.2deg);
  }

  50% {
    transform: translate3d(5px, 4px, 0) rotate(1.2deg);
  }
}

@keyframes amQuestionEmptySpace {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.025);
  }
}

/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1024px) {
  .am-chi-question {
    padding:
      115px
      0
      120px;
  }

  .am-chi-question__container {
    width: min(calc(100% - 56px), 900px);
  }

  .am-chi-question__header {
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 45px;
  }

  .am-chi-question__composition {
    grid-template-columns:
      minmax(300px, 0.82fr)
      minmax(0, 1fr);
    gap: 55px;
  }

  .am-chi-question__layers {
    min-height: 490px;
  }

  .am-chi-question__text {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .am-chi-question__definitions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .am-chi-question__definitions span:nth-child(3) {
    border-right: 0;
  }

  .am-chi-question__definitions span:nth-child(-n + 3) {
    border-bottom: 1px solid var(--am-question-border);
  }
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 767px) {
  .am-chi-question {
    padding:
      88px
      0
      92px;
  }

  .am-chi-question__background::before {
    top: 28%;
    right: -45%;
    width: 105vw;
    height: 50%;
    opacity: 0.055;
  }

  .am-chi-question__background-line {
    left: 20px;
    opacity: 0.65;
  }

  .am-chi-question__background-word {
    right: -20%;
    bottom: 2%;
    font-size: 100px;
  }

  .am-chi-question__container {
    width: 100%;
    padding: 0 20px;
  }

  .am-chi-question__header {
    display: block;
    margin-bottom: 56px;
  }

  .am-chi-question__eyebrow {
    margin: 0 0 24px;
    font-size: 9px;
  }

  .am-chi-question__index {
    font-size: 21px;
  }

  .am-chi-question__eyebrow-line {
    width: 31px;
  }

  .am-chi-question__title {
    font-size: clamp(47px, 13.5vw, 67px);
    line-height: 0.99;
  }

  .am-chi-question__title em {
    margin-top: 8px;
  }

  .am-chi-question__composition {
    display: flex;
    flex-direction: column;
    gap: 57px;
  }

  .am-chi-question__layers {
    width: min(100%, 430px);
    min-height: 430px;
    margin: 0 auto;
  }

  .am-chi-question__layer {
    padding: 17px 19px;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }

  .am-chi-question__layer span {
    font-size: 8px;
    letter-spacing: 0.13em;
  }

  .am-chi-question__layer--one {
    width: 84%;
    height: 71%;
  }

  .am-chi-question__layer--two {
    top: 8%;
    left: 7%;
    width: 84%;
    height: 70%;
  }

  .am-chi-question__layer--three {
    top: 17%;
    left: 15%;
    width: 77%;
    height: 66%;
  }

  .am-chi-question__layer--four {
    top: 27%;
    left: 25%;
    width: 68%;
    height: 58%;
  }

  .am-chi-question__empty-space {
    top: 39%;
    left: 40%;
    width: 41%;
  }

  .am-chi-question__content {
    width: 100%;
  }

  .am-chi-question__lead {
    font-size: clamp(27px, 8vw, 35px);
    line-height: 1.28;
  }

  .am-chi-question__text {
    margin-top: 29px;
  }

  .am-chi-question__text p {
    font-size: 14px;
    line-height: 1.82;
  }

  .am-chi-question__quote {
    margin-top: 38px;
    padding-top: 25px;
  }

  .am-chi-question__quote p {
    font-size: 24px;
  }

  .am-chi-question__definitions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 70px;
  }

  .am-chi-question__definitions span {
    min-height: 70px;
    padding: 17px 8px;
    font-size: 8px;
    letter-spacing: 0.13em;
  }

  .am-chi-question__definitions span:nth-child(odd) {
    border-right: 1px solid var(--am-question-border);
  }

  .am-chi-question__definitions span:nth-child(even) {
    border-right: 0;
  }

  .am-chi-question__definitions span:nth-child(-n + 4) {
    border-bottom: 1px solid var(--am-question-border);
  }
}

/* =========================================================
   MOBILE PICCOLO
========================================================= */

@media (max-width: 390px) {
  .am-chi-question__container {
    padding: 0 17px;
  }

  .am-chi-question__layers {
    min-height: 385px;
  }

  .am-chi-question__title {
    font-size: 45px;
  }

  .am-chi-question__lead {
    font-size: 26px;
  }
}

/* =========================================================
   ACCESSIBILITÀ — RIDUZIONE MOVIMENTO
========================================================= */

@media (prefers-reduced-motion: reduce) {
  .am-chi-question *,
  .am-chi-question *::before,
  .am-chi-question *::after {
    animation: none !important;
    transition: none !important;
  }
}
