/*
 * EAM redesign: Awards (page 371, /activities/awards/). Rulebook P-10.
 *
 * Code-rendered by eam-activities ([eam_awards] inside the eam/section block,
 * templates/awards.php). The hero, hero card, cards, section headers, chips and
 * CTA band look come from components.css; this file only does the page layout:
 * section rhythm, the award-types grid, the recipient grids (RS CardList:
 * text cards 3 / 2 / 1 per row, PersonCards 4 / 3 / 2 / 1) and the inside of
 * the recipient cards printed by the redesign branch of the template
 * (.rd-awards-*). Loaded only on this page, only while the redesign is on.
 */

/* ---- Section rhythm (RS: 48px between sections, x1.5 like the other
 * code-rendered bands in components.css section 6; 24 at <= 820). ---- */
body.eam-redesign.page-id-371 .eam-act--awards .eam-act-intro {
  padding: calc(var(--rd-space-section) * 1.5) 0 0;
}

body.eam-redesign.page-id-371 .eam-act--awards .eam-act-band {
  padding: var(--rd-space-l) 0 calc(var(--rd-space-section) * 1.5);
}

body.eam-redesign.page-id-371 .eam-act--awards .eam-act-cta {
  padding: calc(var(--rd-space-section) * 1.5) 0;
}

/* Intro (RS BlogSection rich text): eyebrow, H2 and text on one measure. */
body.eam-redesign.page-id-371 .eam-act--awards .eam-act-intro .eam-act-eyebrow {
  margin-bottom: var(--rd-space-2xs);
}

/* ---- Award types: text cards, two per row, equal heights. ---- */
body.eam-redesign.page-id-371 .eam-act--awards .eam-act-band .eam-act-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--rd-space-base);
}

body.eam-redesign.page-id-371 .eam-act--awards .rd-awards-type .eam-act-card__eyebrow {
  margin-bottom: var(--rd-space-2xs);
}

body.eam-redesign.page-id-371 .eam-act--awards .rd-awards-type .eam-act-card__title {
  margin-top: 0;
}

/* Criteria lists: the tick look is shared (components.css section 7); here
 * only the list's own spacing. */
body.eam-redesign.page-id-371 .eam-act--awards .eam-act-checks {
  margin: 0;
}

/* ---- Recipients ---- */

/* Second award group: a full section space above its heading. */
body.eam-redesign.page-id-371 .eam-act--awards .eam-act-subhead--gap {
  margin-top: calc(var(--rd-space-section) * 1.5);
}

/* "New" tag on the Open-Source Software heading (R-41): RS tag shape. */
body.eam-redesign.page-id-371 .eam-act--awards .rd-awards-new {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin-left: var(--rd-space-xs);
  padding: 2px var(--rd-space-xs);
  border-radius: var(--rd-radius-pill);
  background: var(--rd-color-primary);
  color: var(--rd-color-on-primary);
  font-size: var(--rd-fs-small);
  font-weight: var(--rd-fw-semibold);
  line-height: var(--rd-lh-tight);
  letter-spacing: 0;
  vertical-align: middle;
  white-space: nowrap;
}

/* Grids (RS CardList): cards max 428px, three per row; person cards max
 * 317px, four per row. Cards keep their column width when a row is short. */
body.eam-redesign.page-id-371 .eam-act--awards .rd-awards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--rd-space-base);
  align-items: stretch;
}

body.eam-redesign.page-id-371 .eam-act--awards .rd-awards-grid--people {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Card inside (frame, lift, type: components.css section 5). */
body.eam-redesign.page-id-371 .eam-act--awards .rd-awards-person {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

body.eam-redesign.page-id-371 .eam-act--awards .rd-awards-person__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

/* Year: the RS tag type of the shared chips (components.css section 10),
 * smaller box; ink on tint (D-07: no small indigo text on the tint). */
body.eam-redesign.page-id-371 .eam-act--awards .rd-awards-person .eam-act-person__year {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: var(--rd-space-xs);
  padding: 2px var(--rd-space-xs);
  background: var(--rd-tint);
  color: var(--rd-color-text);
  font-size: var(--rd-fs-small);
  font-weight: var(--rd-fw-semibold);
  line-height: var(--rd-lh-tight);
}

body.eam-redesign.page-id-371 .eam-act--awards .rd-awards-person .eam-act-person__name {
  margin: 0 0 var(--rd-space-2xs);
}

body.eam-redesign.page-id-371 .eam-act--awards .rd-awards-person .eam-act-person__affil {
  margin: 0;
  color: var(--rd-color-primary);
}

body.eam-redesign.page-id-371 .eam-act--awards .rd-awards-person .eam-act-person__desc {
  margin: var(--rd-space-xs) 0 0;
}

/* Person card (RS PersonCard): portrait edge to edge on top, 16px text box.
 * The square well and the hover zoom come from .rd-card--person. */
body.eam-redesign.page-id-371 .eam-act--awards .rd-awards-person--photo {
  padding: 0;
  overflow: hidden;
}

/* Text box: the shared person-card padding (components.css --rd-person-*,
 * same as the committee cards on About and Executive Committee). */
body.eam-redesign.page-id-371 .eam-act--awards .rd-awards-person--photo .rd-awards-person__body {
  flex: 1 1 auto;
  padding: var(--rd-person-text-padding);
}

/* D-49: the software-award portraits stay grayscale, in colour on hover. */
body.eam-redesign.page-id-371 .eam-act--awards .rd-awards-person__photo img {
  display: block;
  filter: grayscale(1);
  transition: transform var(--rd-dur-slow) var(--rd-ease-out-cubic), filter var(--rd-dur-base) var(--rd-ease-out-cubic);
}

body.eam-redesign.page-id-371 .eam-act--awards .rd-awards-person--photo:hover .rd-awards-person__photo img {
  filter: none;
}

/* Below desktop: text cards 2 per row, person cards 3. */
@media (max-width: 1080px) {
  body.eam-redesign.page-id-371 .eam-act--awards .rd-awards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.eam-redesign.page-id-371 .eam-act--awards .rd-awards-grid--people {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Tablet: person cards 2 per row (RS 50vw), tighter grid gap. */
@media (max-width: 820px) {
  body.eam-redesign.page-id-371 .eam-act--awards .rd-awards-grid--people {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.eam-redesign.page-id-371 .eam-act--awards :is(.rd-awards-grid, .eam-act-band .eam-act-grid) {
    gap: var(--rd-space-s);
  }

  body.eam-redesign.page-id-371 .eam-act--awards .rd-awards-new {
    margin-left: var(--rd-space-2xs);
  }
}

/* Phone: one card per row everywhere. */
@media (max-width: 480px) {
  body.eam-redesign.page-id-371 .eam-act--awards :is(.rd-awards-grid, .rd-awards-grid--people, .eam-act-band .eam-act-grid) {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.eam-redesign.page-id-371 .eam-act--awards .rd-awards-person__photo img {
    transition: none;
  }
}
