/* ==========================================================================
   Assessment promo — compact banner right under the pillar cards that
   promotes the self-assessment on the learning platform
   (https://resilience-edu.mnss.eu/local/resilience/index.php). Not in Figma.
   One light-blue row:
   .assessment-emblem          decorative score tile: the logo's four columns as
                               bars in the pillar colours, a dashed target line
                               and a blue tick badge; the bars rise a little
                               when the banner is hovered
   .assessment-promo__body     title, one-line lead, facts as small pills
   .assessment-promo__button   the one action
   .assessment-banner           wrapper with container-type, so the banner lays
                                itself out by the width it gets: full width on
                                the homepage, a chapter column on the pillar page
   ========================================================================== */

/* Homepage section, right under the pillar cards: tighter than the usual gap */
.assessment-promo {
  padding-block: 0 120px;
  background: var(--color-bg);
}

.pillars + .assessment-promo {
  margin-top: -46px; /* 102px pillar padding → 56px gap */
}

.assessment-banner {
  container-type: inline-size;
}

.assessment-promo__panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 48px;
  padding: 44px 56px;
  background: var(--color-icon-bg);
}

/* ---- Emblem: a small score tile --------------------------------------------- */
.assessment-emblem {
  position: relative;
  display: block;
  width: 116px;
  height: 116px;
  padding: 20px 18px 16px;
  background: var(--white);
  box-shadow: 0 10px 28px rgb(4 36 74 / 10%);
}

/* Dashed "goal" line the bars aim for */
.assessment-emblem__target {
  position: absolute;
  top: 26px;
  right: 14px;
  left: 14px;
  border-top: 2px dashed color-mix(in srgb, var(--color-primary) 35%, transparent);
}

.assessment-emblem__bars {
  display: flex;
  height: 100%;
  align-items: flex-end;
  justify-content: space-between;
  border-bottom: 3px solid var(--color-heading);
}

.assessment-emblem__bar {
  --bar: var(--pillar-blue-accent);

  width: 14px;
  height: var(--h);
  border-radius: 4px 4px 0 0;
  background: linear-gradient(to top, var(--bar), color-mix(in srgb, var(--bar) 55%, white));
  transition: height 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.assessment-emblem__bar--blue   { --h: 46%; }
.assessment-emblem__bar--orange { --h: 70%; --bar: var(--pillar-orange-accent); transition-delay: 40ms; }
.assessment-emblem__bar--green  { --h: 58%; --bar: var(--pillar-green-accent); transition-delay: 80ms; }
.assessment-emblem__bar--gray   { --h: 80%; --bar: var(--pillar-gray-accent); transition-delay: 120ms; }

/* Tick badge on the corner: the result */
.assessment-emblem__badge {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 32px;
  height: 32px;
  border: 3px solid var(--color-icon-bg);
  border-radius: 50%;
  background: var(--color-primary);
}

.assessment-emblem__badge::before {
  position: absolute;
  inset: 0;
  background: var(--white);
  content: "";
  -webkit-mask: url("../../assets/icons/check.svg") center / 15px no-repeat;
  mask: url("../../assets/icons/check.svg") center / 15px no-repeat;
}

/* Hovering the banner: every pillar climbs towards the goal */
.assessment-promo__panel:hover .assessment-emblem__bar--blue   { --h: 70%; }
.assessment-promo__panel:hover .assessment-emblem__bar--orange { --h: 86%; }
.assessment-promo__panel:hover .assessment-emblem__bar--green  { --h: 80%; }
.assessment-promo__panel:hover .assessment-emblem__bar--gray   { --h: 92%; }

@media (prefers-reduced-motion: reduce) {
  .assessment-emblem__bar {
    transition: none;
  }
}

/* ---- Text --------------------------------------------------------------------- */
.assessment-promo__title {
  color: var(--color-heading);
  font-size: 32px;
  letter-spacing: var(--letter-spacing-tight);
  line-height: var(--leading-title);
}

.assessment-promo__text {
  max-width: 760px;
  margin-top: 10px;
  color: var(--color-text);
  font-size: var(--font-size-base);
  line-height: var(--line-height-body);
}

.assessment-promo__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.assessment-promo__facts li {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  color: var(--color-heading);
  background: var(--white);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  line-height: 1.3;
}

/* ---- Action ------------------------------------------------------------------- */
.assessment-promo__button {
  border-color: rgb(15 98 254 / 14%); /* same see-through ring as the hero CTA */
  background-clip: padding-box;
  white-space: nowrap;
}

/* ---- Narrower banner: button under the text ------------------------------------ */
@container (max-width: 1180px) {
  .assessment-promo__panel {
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 40px;
    row-gap: 24px;
    padding: 40px 44px;
  }

  .assessment-emblem {
    grid-row: 1 / 3;
    align-self: start;
  }

  .assessment-promo__button {
    justify-self: start;
  }
}

/* ---- Narrow banner: one column, emblem small on top ------------------------------ */
@container (max-width: 620px) {
  .assessment-promo__panel {
    grid-template-columns: minmax(0, 1fr);
    padding: 32px 24px;
  }

  .assessment-emblem {
    grid-row: auto;
    width: 84px;
    height: 84px;
    justify-self: start;
    padding: 14px 13px 11px;
  }

  .assessment-emblem__target {
    top: 19px;
    right: 10px;
    left: 10px;
  }

  .assessment-emblem__bar {
    width: 10px;
  }

  .assessment-emblem__badge {
    top: -10px;
    right: -10px;
    width: 26px;
    height: 26px;
  }

  .assessment-promo__title {
    font-size: 26px;
  }

  .assessment-promo__button {
    width: 100%;
    padding-inline: 20px;
  }
}

/* ---- Homepage section spacing ------------------------------------------------- */
@media (max-width: 1100px) {
  .assessment-promo {
    padding-bottom: 80px;
  }

  .pillars + .assessment-promo {
    margin-top: -40px; /* 88px → 48px */
  }
}

@media (max-width: 700px) {
  .assessment-promo {
    padding-bottom: 64px;
  }

  .pillars + .assessment-promo {
    margin-top: -32px; /* 72px → 40px */
  }

  /* On the homepage the banner runs edge to edge */
  .assessment-promo .assessment-promo__panel {
    margin-inline: calc(var(--page-padding) * -1);
    padding-inline: var(--page-padding);
  }
}
