/* News cards, as embedded in product pages and elsewhere.
   Scoped under .nr-* so nothing here can leak into the rest of the site. */

.nr-related {
  --nr-accent: #7c4b8c;
  margin: 3rem 0 0;
}

.nr-related__heading {
  margin: 0 0 1rem;
}

.nr-related__more {
  margin: 1rem 0 0;
  font-size: 0.875rem;
}

.nr-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nr-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.14);
  transition: box-shadow 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.nr-card:hover {
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.3);
}

.nr-card__media {
  display: block;
  line-height: 0;
}

.nr-card__media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 5;
  object-fit: cover;
}

.nr-card__body {
  padding: 1rem 1.25rem 1.25rem;
}

.nr-card__date {
  display: block;
  margin: 0 0 0.25rem;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--nr-accent, #7c4b8c);
}

.nr-card__title {
  margin: 0 0 0.5rem;
  padding: 0;
  font-size: 1.125rem;
  line-height: 1.3;
}

.nr-card__title a {
  color: inherit;
  text-decoration: none;
}

.nr-card__title a:hover {
  text-decoration: underline;
}

.nr-card__intro {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.nr-card__more {
  font-size: 0.875rem;
  font-weight: bold;
}

/* Latest news block, for landing pages.
   Self-contained like references' .ref-wall: it declares its own custom
   properties, constrains itself to the site width and picks a look from the
   `variant` parameter of the recent_newsroom tag:
     grid    — quiet editorial grid, three cards under an eyebrow heading
     ledger  — ruled rows: date, title, one line of intro, small thumbnail
     feature — one lead story with a large picture, the rest as a ruled list

   Colour and type scale are inherited from the site stylesheet on purpose:
   override the custom properties below rather than editing these rules. */

.nr-latest {
  --nr-rule: rgba(0, 0, 0, 0.14);
  --nr-rule-strong: rgba(0, 0, 0, 0.45);
  --nr-quiet: rgba(0, 0, 0, 0.6);
  --nr-accent: #7c4b8c;
  --nr-max: 1350px;
  margin: 4rem 0;
}

.nr-latest__inner {
  max-width: var(--nr-max);
  margin: 0 auto;
  padding: 0 1rem;
  box-sizing: border-box;
}

.nr-latest__head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  align-items: baseline;
  justify-content: space-between;
}

.nr-latest__heading {
  margin: 0;
  line-height: 1.2;
}

.nr-latest__more {
  margin: 0;
  font-size: 0.875rem;
}

.nr-latest__list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
}

/* One story, in any variant */

.nr-item__media {
  display: block;
  line-height: 0;
}

.nr-item__media img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.nr-item__body {
  min-width: 0;
}

.nr-item__date {
  display: block;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--nr-accent);
  font-variant-numeric: tabular-nums;
}

.nr-item__title {
  margin: 0.25rem 0 0.4rem;
  line-height: 1.25;
}

.nr-item__title a {
  color: inherit;
  font-weight: normal;
  text-decoration: none;
}

.nr-item__title a:hover,
.nr-item__title a:focus-visible {
  color: var(--nr-accent);
  text-decoration: underline;
}

.nr-item__intro {
  margin: 0;
  color: var(--nr-quiet);
}

/* grid: hairline rule, eyebrow heading, cards with a picture on top.
   Same furniture as .ref-wall--grid, so the two blocks stack cleanly. */

.nr-latest--grid .nr-latest__inner {
  padding-top: 1.5rem;
  border-top: 1px solid var(--nr-rule-strong);
}

.nr-latest--grid .nr-latest__heading {
  font-size: 1.125rem;
  letter-spacing: 0.08em;
  color: var(--nr-quiet);
}

.nr-latest--grid .nr-latest__list {
  /* auto-fit, not auto-fill: with only three stories the empty tracks would
     collapse the cards into the left third of the page. */
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 2.5rem 2rem;
  margin-top: 2rem;
}

.nr-latest--grid .nr-item {
  display: flex;
  flex-direction: column;
}

.nr-latest--grid .nr-item__media {
  margin: 0 0 0.875rem;
}

.nr-latest--grid .nr-item__media img {
  aspect-ratio: 8 / 5;
}

.nr-latest--grid .nr-item__title {
  font-size: 1.1875rem;
}

.nr-latest--grid .nr-item__intro {
  font-size: 0.9375rem;
}

/* ledger: ruled rows, the thumbnail small and to the left */

.nr-latest--ledger .nr-latest__heading {
  font-size: 1.5rem;
}

.nr-latest--ledger .nr-latest__list {
  grid-template-columns: 1fr;
  border-top: 1px solid var(--nr-rule-strong);
}

.nr-latest--ledger .nr-item {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  box-sizing: border-box;
  margin: 0 -0.75rem;
  padding: 1rem 0.75rem;
  border-bottom: 1px solid var(--nr-rule);
}

.nr-latest--ledger .nr-item:hover {
  background: #f6f6f6;
}

.nr-latest--ledger .nr-item__media {
  flex: 0 0 7rem;
}

.nr-latest--ledger .nr-item__media img {
  aspect-ratio: 4 / 3;
}

.nr-latest--ledger .nr-item__title {
  font-size: 1.0625rem;
}

.nr-latest--ledger .nr-item__intro {
  font-size: 0.875rem;
}

/* feature: one story large, the others as a ruled column beside it */

.nr-latest--feature .nr-latest__heading {
  font-size: 1.5rem;
}

.nr-latest--feature .nr-latest__split {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 2.5rem;
  margin: 1.5rem 0 0;
  padding: 1.5rem 0 0;
  border-top: 1px solid var(--nr-rule-strong);
}

.nr-latest--feature .nr-latest__list {
  grid-template-columns: 1fr;
  margin: 0;
  align-content: start;
}

.nr-latest--feature .nr-item--lead .nr-item__media {
  margin: 0 0 1rem;
}

.nr-latest--feature .nr-item--lead .nr-item__media img {
  aspect-ratio: 16 / 9;
}

.nr-latest--feature .nr-item--lead .nr-item__title {
  font-size: 1.75rem;
}

.nr-latest--feature .nr-item--lead .nr-item__intro {
  max-width: 34rem;
  font-size: 1rem;
}

.nr-latest--feature .nr-latest__list--rest .nr-item {
  padding: 0 0 1rem;
  border-bottom: 1px solid var(--nr-rule);
}

.nr-latest--feature .nr-latest__list--rest .nr-item + .nr-item {
  padding-top: 1rem;
}

.nr-latest--feature .nr-latest__list--rest .nr-item__media {
  display: none;
}

.nr-latest--feature .nr-latest__list--rest .nr-item__title {
  font-size: 1.0625rem;
}

.nr-latest--feature .nr-latest__list--rest .nr-item__intro {
  font-size: 0.875rem;
}

@media (max-width: 40rem) {
  .nr-latest--feature .nr-latest__split {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .nr-latest--feature .nr-item--lead .nr-item__title {
    font-size: 1.375rem;
  }

  .nr-latest--ledger .nr-item__media {
    flex-basis: 5rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .nr-item__title a,
  .nr-latest--ledger .nr-item {
    transition: color 120ms ease-out, background-color 120ms ease-out;
  }
}

:where(.nr-latest) a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
