/* الشركاء والمساهمون */

/* The banner of this page uses its own photo (1920 x 640, covering the strip and
   centred, so 480px tall at 1440) under an even dark-green veil. */
.page-header {
  --page-header-image: url('../img/partners-header.jpg');
  --page-header-top: -53.45%;
  --page-header-height: 206.9%;
  --page-header-veil: rgba(9, 42, 30, 0.8);
}

/* The intro of the old page is long: keep it to a readable measure. */
.page-header__lead {
  max-width: 880px;
}

.partners {
  display: flex;
  flex-direction: column;
  gap: 56px;
}

.partners ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.partners-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.partners-heading {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.partners-heading p {
  color: var(--text-secondary);
  line-height: 26px;
}

.partners-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 30px;
  font-weight: 700;
  line-height: 40px;
}

.partners-title .petal {
  inline-size: 20px;
  block-size: 20px;
}

/* ---------- الجهات الرئيسية ---------- */
.primary-grid {
  display: flex;
  gap: 24px;
}

.primary-card {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 220px;
  padding: 31px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-white);
}

.primary-card img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ---------- الجهات الشريكة ---------- */
/* Five 236px cards a row at 1440; the columns give way a little when a scrollbar
   narrows the page, and share the row evenly on wider screens. */
.partner-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 236px));
  gap: 24px;
}

.partner-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-width: 0;
  height: 180px;
  padding: 16px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-white);
}

/* 106px tall, giving way (down to 86px) when the name takes two lines. */
.partner-card__logo {
  display: flex;
  flex: 0 1 106px;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 0;
}

.partner-card__logo img {
  display: block;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
}

.partner-card__name {
  max-width: 100%;
  font-size: 14px;
  font-weight: 600;
  line-height: 22px;
  text-align: center;
}

/* ---------- الفريق العلمي والمساهمون ---------- */
.people-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 305px));
  gap: 16px;
}

.person-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 72px;
  /* The text block reaches 4px further than the 16px inset on its far side. */
  padding-block: 9px;
  padding-inline: 16px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-white);
}

/* The scientific team stands apart from the contributors: soft green cards and
   a solid green medallion carrying the petal mark in white. */
.people-grid--team .person-card {
  min-height: 104px;
  border-color: var(--accent-border);
  background: var(--accent-surface-subtle);
}

.people-grid--team .person-card__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green-600);
}

.people-grid--team .person-card__avatar::before {
  content: '';
  width: 20px;
  height: 20px;
  background: url('../img/ui/petal-mark.svg') center / 100% 100% no-repeat;
  filter: brightness(0) invert(1);
}

.person-card__avatar {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--green-100);
}

.person-card__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.person-card__name {
  font-size: 15px;
  font-weight: 600;
  line-height: 22px;
}

.person-card__role {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 20px;
}

/* ---------- كن من المساهمين ---------- */
.partners-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 32px 40px;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-lg);
  background: var(--accent-surface-subtle);
}

.partners-cta__text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.partners-cta__text h2 {
  font-size: 24px;
  font-weight: 700;
  line-height: 36px;
}

.partners-cta__text p {
  color: var(--text-secondary);
  line-height: 26px;
}

.partners-cta .btn {
  flex: none;
}

.partners-cta .btn .ico img {
  /* The shared arrow is drawn dark and pointing up: white, pointing left here. */
  filter: brightness(0) invert(1);
  transform: rotate(90deg);
}

/* ---------- Narrow screens ---------- */
@media (min-width: 1456px) {
  .partner-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .people-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1279px) {
  .partner-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .people-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }

  .partner-card {
    height: auto;
    min-height: 180px;
  }
}

@media (max-width: 767px) {
  .partners {
    gap: 40px;
  }

  .partners-title {
    font-size: 24px;
    line-height: 32px;
  }

  .primary-grid {
    flex-direction: column;
  }

  .primary-card {
    flex: none;
    height: 180px;
  }

  .partner-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .people-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .partners-cta {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
  }
}
