@import url("program-ui.css");

#challenge-areas > .blind-card:nth-child(n + 4) {
  display: none;
}

#challenge-areas {
  position: relative;
}

/* Program source marks: the existing card block, compacted without changing
   card dimensions or accordion behaviour. */
#challenge-areas .card-case-organizations {
  width: min(610px, calc(100% - 230px));
  gap: 9px;
  top: 38px;
}

#challenge-areas .card-case-logos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
  align-items: center;
  gap: 9px 14px;
  width: 100%;
  min-height: 0;
}

#challenge-areas .card-case-logos img {
  width: 100%;
  max-width: 88px;
  height: 44px;
  justify-self: center;
  object-fit: contain;
}

#challenge-areas .card-case-organizations-label {
  font-size: 13px;
  line-height: 1.25;
}

#challenge-areas .card-case-organizations-list {
  font-size: 13.5px;
  line-height: 1.38;
}

#challenge-areas .program-source-disclaimer {
  color: #858585;
  letter-spacing: -0.01em;
  margin: 0;
  position: absolute;
  right: 0;
  bottom: 10px;
  left: 0;
  font-family: Apparat, Arial, sans-serif;
  font-size: 10px;
  line-height: 1.3;
}

@media (max-width: 900px) {
  #challenge-areas .card-case-organizations {
    width: calc(100% - 148px);
    gap: 5px;
    top: 18px;
  }

  #challenge-areas .card-case-logos {
    grid-template-columns: repeat(auto-fit, minmax(25px, 1fr));
    gap: 4px 7px;
  }

  #challenge-areas .card-case-logos img {
    max-width: 56px;
    height: 30px;
  }

  #challenge-areas .card-case-organizations-label {
    font-size: 10.5px;
  }

  #challenge-areas .card-case-organizations-list {
    font-size: 10px;
    line-height: 1.28;
  }

  #challenge-areas .program-source-disclaimer {
    right: 2px;
    bottom: 15px;
    left: 2px;
    font-size: 9px;
  }
}

/* Opening fragment only: the connector and the Program button share one grid
   row, so neither text wrapping nor viewport width can move them apart. */
@media (min-width: 901px) {
  .why-section > .why-copy {
    --academy-hero-gap: clamp(52px, 5vw, 96px);
    --academy-brand-half: 230px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
    grid-template-rows: auto auto;
    column-gap: var(--academy-hero-gap);
    row-gap: 66px;
    align-content: start;
  }

  .why-section > .why-copy > .why-text {
    display: contents;
  }

  .why-section > .why-copy > .why-text > .display-title {
    grid-column: 1;
    grid-row: 1;
  }

  .why-section > .why-copy > .why-text > .why-columns {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    margin-top: 0;
    border-top: 0;
    position: relative;
  }

  .why-section > .why-copy > .why-text > .why-columns::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: calc(100% + var(--academy-hero-gap) + var(--academy-brand-half) - 92px);
    border-top: 1px solid #cfcfcf;
  }

  .why-section > .why-copy > .why-brand {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    justify-self: stretch;
    width: 100%;
    height: 0;
    min-height: 0;
    margin-top: 0;
    display: block;
    position: relative;
    transform: none;
  }

  .why-section > .why-copy > .why-brand > .auth-entry {
    width: 184px;
    height: 62px;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  html[data-site-theme="dark"] .why-section > .why-copy > .why-text > .why-columns::before {
    border-color: #383838;
  }
}

@media (min-width: 901px) and (max-width: 1320px) {
  .why-section > .why-copy {
    --academy-brand-half: 160px;
    grid-template-columns: minmax(0, 1fr) 320px;
    min-height: 535px;
    padding-bottom: 0;
  }

  .why-section > .why-copy > .why-text > .why-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
