/*
 * AI24Solutions AQENA Showcase v1
 *
 * Scope:
 * - RU/EN homepage #products only.
 * - Adds visual treatment for AQENA.
 * - Rebalances the existing showcase from four to five products.
 * - Existing product-specific styles remain untouched.
 */

#products .portfolio-grid {
  grid-template-columns:
    repeat(6, minmax(0, 1fr));
}

#products .portfolio-tile {
  grid-column: span 2;
}

/*
 * With five cards:
 * row 1 = three cards;
 * row 2 = two cards centered across the six-column grid.
 */
#products .portfolio-tile:nth-last-child(2) {
  grid-column: 2 / span 2;
}

#products .portfolio-tile:last-child {
  grid-column: 4 / span 2;
}

#products .portfolio-tile__icon--aqena {
  background:
    linear-gradient(
      145deg,
      #f2f5f1,
      #e8eee7
    );
}

#products .portfolio-tile--aqena
.portfolio-tile__icon img {
  display: block !important;
  width: 64px !important;
  height: 64px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 64px !important;
  max-height: 64px !important;
  object-fit: contain !important;
  object-position: center !important;
  margin: auto !important;
}

#products .portfolio-tile--aqena
.portfolio-tile__kicker,
#products .portfolio-tile--aqena
.portfolio-link {
  color: #526b57;
}

#products .portfolio-tile--aqena
.portfolio-points li::before {
  background: #7f9a82;
}

@media (max-width: 1180px) {
  #products .portfolio-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  #products .portfolio-tile,
  #products .portfolio-tile:nth-last-child(2) {
    grid-column: auto;
  }

  #products .portfolio-tile:last-child {
    grid-column: 1 / -1;
    width: calc(50% - 8px);
    justify-self: center;
  }

  #products .portfolio-tile--aqena
  .portfolio-tile__icon img {
    width: 60px !important;
    height: 60px !important;
    max-width: 60px !important;
    max-height: 60px !important;
  }
}

@media (max-width: 720px) {
  #products .portfolio-grid {
    grid-template-columns: 1fr;
  }

  #products .portfolio-tile,
  #products .portfolio-tile:nth-last-child(2),
  #products .portfolio-tile:last-child {
    grid-column: auto;
    width: auto;
    justify-self: stretch;
  }

  #products .portfolio-tile--aqena
  .portfolio-tile__icon img {
    width: 56px !important;
    height: 56px !important;
    max-width: 56px !important;
    max-height: 56px !important;
  }
}
