/*
 * Newsletters page (archive-newsletter.php), 2026 redesign (Newsletters.dc.html):
 * hero with the latest edition in a frosted card, then the archive as a compact
 * list by year. Loaded after news-media.css (the page also has the .news-page
 * body class), so headings are scoped with body to win over its h2/h3 rules. The
 * hero is shared by the News & Media and Learning pages.
 */

/* Hero ---------------------------------------------------------------------- */
.nlx-hero {
  position: relative;
  overflow: hidden;
  padding: 40px 0 96px;
  background: var(--surface-soft);
  color: var(--ink-strong);
  font-family: var(--font-ui);
}

.nlx-hero-inner {
  width: min(var(--max-wide), calc(100% - 42px));
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.nlx-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: 64px;
}

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

.nlx-hero-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 26px;
  padding-top: 64px; /* The prototype's pill (38px + 26px gap), not used. */
}

body .nlx-hero h1 {
  max-width: none;
  margin: 0;
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.035em;
}

.nlx-lead {
  max-width: 540px;
  margin: 0;
  color: var(--muted-ui);
  font-size: var(--text-ui-xl);
  line-height: 1.6;
}

.nlx-lead a {
  color: var(--purple);
  font-weight: 700;
}

/* The hero's button: every page's hero size, 54px (hidden on phones). */
.nlx-browse {
  height: var(--ds-button-lg);
}

.nlx-browse svg,
.nlx-latest-actions svg {
  width: 16px;
  height: 16px;
}

.nlx-browse svg,
.nlx-pdf svg {
  color: var(--purple);
}

.nlx-hero :focus-visible,
.nlx-archive :focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  box-shadow: none;
}

.nlx-hero-aside {
  position: relative;
  display: flex;
  justify-content: flex-end;
}

/* Latest edition card: cover (tilted, as in the prototype) + text. */
.nlx-latest {
  display: flex;
  align-items: center;
  gap: 28px;
  max-width: 620px;
  padding: 32px;
}

.nlx-cover {
  flex-shrink: 0;
  width: 200px;
  overflow: hidden;
  border-radius: var(--radius-ui);
  box-shadow: var(--shadow-menu);
  transform: rotate(-3deg);
}

.nlx-cover img {
  display: block;
  width: 100%;
  height: auto;
}

.nlx-cover--drawn {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 268px;
  padding: 22px;
  background: var(--purple);
  color: #fff;
}

.nlx-cover--drawn span {
  color: var(--cyan-light);
  font-size: var(--text-ui-3xs);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.nlx-cover--drawn span:last-child {
  color: var(--on-purple);
  letter-spacing: 0;
  text-transform: none;
}

.nlx-cover--drawn b {
  font-family: var(--font-display);
  font-size: var(--text-ui-panel);
  line-height: 1.15;
}

.nlx-latest-text {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.nlx-latest-labels {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.nlx-latest-label {
  color: var(--purple);
  font-size: var(--text-ui-2xs);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.nlx-chip {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--orange-wash);
  color: var(--tbc-ink);
  font-size: var(--text-ui-2xs);
  font-weight: 700;
}

/* A story card's quiet link ('quiet' => true), so the hero's own main button stays the one main action. */
.nlx-read {
  color: var(--purple);
  font-size: var(--text-ui);
  font-weight: 700;
  transition: color .15s ease;
}

.nlx-read:hover {
  color: var(--purple-press);
}

/* A story card's date: plain text after the label ("LATEST MEMBER INSIGHT · June 30, 2026"), as on the story cards,
   not an orange chip that reads as a status (UI/UX review). The newsletter card keeps its issue chip. */
.nlx-latest--story .nlx-latest-labels {
  gap: 0;
}

.nlx-latest--story .nlx-chip {
  padding: 0;
  border-radius: 0;
  background: none;
  color: var(--muted-ui);
}

/* The dot ends the label rather than starting the date, so when the date wraps on a narrow card it starts its own
   line cleanly ("September 30, 2026", not "· September 30, 2026"; UI/UX review). */
.nlx-latest--story .nlx-latest-label:has(+ .nlx-chip)::after {
  content: "·";
  content: "·" / "";
  margin: 0 8px;
  color: var(--muted-ui);
}

body .nlx-latest h2 {
  max-width: none;
  margin: 0;
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: var(--text-section-sm);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: normal;
}

.nlx-latest-text p {
  margin: 0;
  color: var(--muted-ui);
  font-size: var(--text-ui);
  line-height: 1.55;
}

.nlx-latest-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
}

.nlx-latest-actions .pill-button {
  height: var(--ds-button-md);
  font-size: var(--text-ui);
}

.nlx-latest-actions .pill-button--primary {
  padding: 0 20px;
}

.nlx-pdf {
  gap: 8px;
  padding: 0 18px;
}
/* Colours: the standard secondary pill (pill-button--secondary); it was see-through white with no visible edge (UI/UX audit). */

/* Text-only hero card (News & Media: latest story; Learning: next event). */
.nlx-latest--story {
  width: 100%;
  max-width: 560px;
  padding: 36px;
}

.nlx-latest--story .nlx-latest-text p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

/* With the story's picture on top (Volunteer spotlights: a story about a person): a card-sized title (UI/UX review:
   the 42px title outweighed the page heading) and a three-line summary. The picture runs to the card's edges, with no
   white frame above or beside it, and the card is narrower than the text-only one. */
/* .nlx-latest--story too: over the text-only card's padding, on phones as well. */
.nlx-latest--story.nlx-latest--photo {
  flex-direction: column;
  align-items: stretch;
  gap: 20px;
  max-width: 480px;
  overflow: hidden;
  padding: 0 0 26px;
}

.nlx-latest-photo {
  display: block;
  background: var(--purple-tint-ui);
}

.nlx-latest-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.nlx-latest--photo .nlx-latest-text {
  padding: 0 30px;
}

body .nlx-latest--photo h2 {
  font-size: var(--text-ui-panel);
  line-height: 1.25;
}

.nlx-latest--photo .nlx-latest-text p {
  -webkit-line-clamp: 3;
}

/* Archive ------------------------------------------------------------------- */
.nlx-archive {
  padding: 96px 0;
  background: #fff;
  color: var(--ink-strong);
  font-family: var(--font-ui);
}

.nlx-archive-inner {
  width: min(var(--max-wide), calc(100% - 42px));
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.nlx-archive-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nlx-label {
  color: var(--purple);
  font-size: var(--text-ui-xs);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

body .nlx-archive-head h2 {
  max-width: none;
  margin: 0;
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: var(--text-section);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.02em;
}

.nlx-years {
  border-top: 1px solid var(--line-soft);
}

.nlx-year {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: center;
  gap: 32px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line-soft);
}

body .nlx-year-title {
  margin: 0;
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: var(--text-section-sm);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.02em;
}

.nlx-editions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nlx-edition {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px 10px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-ui);
  background: var(--surface-soft);
}

.nlx-tile {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--ds-icon-sm);
  height: var(--ds-icon-sm);
  border-radius: var(--ds-radius-sm);
  background: var(--purple);
  color: #fff;
  font-family: var(--font-display);
  font-size: var(--text-ui-md);
  font-weight: 700;
}

.nlx-tile.is-teal { background: var(--teal-ink); }
.nlx-tile.is-night { background: var(--night-deep); }
.nlx-tile.is-orange { background: var(--join); color: var(--night-deep); }

.nlx-edition-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.nlx-edition-links {
  display: flex;
  gap: 14px;
  font-size: var(--text-ui-sm);
  font-weight: 700;
}

/* At least 28px tall: easier to tap than the line of text alone (UI/UX review). */
.nlx-edition-links a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  color: var(--purple);
}

.nlx-edition-links a:hover {
  color: var(--purple-press);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.nlx-empty {
  margin: 0;
  color: var(--muted-ui);
  font-size: var(--text-ui-md);
}

.nlx-empty a {
  color: var(--purple);
  font-weight: 700;
}

/* Responsive ------------------------------------------------------------------ */
@media (max-width: 1180px) {
  .nlx-hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
  }

  .nlx-hero-aside {
    justify-content: flex-start;
  }

  /* Year above its editions, so a year's four quarters still fit on one line. */
  .nlx-year {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 12px;
  }
}

@media (max-width: 767px) {
  .nlx-hero {
    padding: 24px 0 36px;
  }

  .nlx-hero-inner {
    gap: 18px;
  }

  .nlx-hero-grid {
    gap: 24px;
  }

  .nlx-hero-text {
    gap: 18px;
    padding-top: 0;
  }

  body .nlx-hero h1 {
    line-height: 1.1;
    letter-spacing: -.03em;
  }

  /* The mobile prototype colours the accent words without the underline; and no button here. */
  .nlx-hero .hero-accent svg,
  .nlx-browse {
    display: none;
  }

  .nlx-lead {
    font-size: var(--text-ui-md);
  }

  /* Mobile prototype: cover beside the labels and title, then the summary and buttons full width. */
  .nlx-latest {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    align-items: center;
    gap: 6px 16px;
    padding: 22px;
    border-radius: var(--radius-xl);
  }

  .nlx-cover {
    grid-row: 1 / span 2;
    width: 104px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-card);
  }

  .nlx-latest-text {
    display: contents;
  }

  .nlx-latest-labels {
    align-self: end;
  }

  .nlx-latest h2 {
    align-self: start;
  }

  .nlx-latest-text p,
  .nlx-latest-actions {
    grid-column: 1 / -1;
  }

  .nlx-latest-actions {
    margin-top: 8px;
  }

  body .nlx-latest h2 {
    font-size: var(--text-ui-tile-sm);
    line-height: 1.2;
  }

  .nlx-latest-label {
    font-size: var(--text-ui-3xs);
  }

  .nlx-latest-text p {
    font-size: var(--text-ui-sm);
  }

  .nlx-latest-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  .nlx-latest-actions .pill-button--primary {
    justify-content: center;
  }

  .nlx-pdf {
    font-size: var(--text-ui-sm);
  }

  /* Text-only card: a plain column (newsletters.css lays the edition card out as a grid here). */
  .nlx-latest--story {
    display: flex;
    padding: 22px;
  }

  .nlx-latest--story.nlx-latest--photo {
    gap: 16px;
    padding: 0 0 22px;
  }

  .nlx-latest--photo .nlx-latest-text {
    padding: 0 22px;
  }

  .nlx-latest--story .nlx-latest-text {
    display: flex;
    gap: 8px;
  }

  .nlx-latest--story .nlx-latest-labels,
  .nlx-latest--story h2 {
    align-self: auto;
  }

  .nlx-archive {
    padding: 40px 0 36px;
  }

  .nlx-archive-inner {
    gap: 18px;
  }

  .nlx-label {
    font-size: var(--text-ui-3xs);
  }

  body .nlx-archive-head h2 {
    font-size: var(--text-section-sm);
  }

  .nlx-year {
    padding: 18px 0;
  }

  /* Two quarters per line, links stacked under each other. */
  .nlx-editions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .nlx-edition {
    gap: 12px;
    padding-right: 12px;
  }

  .nlx-edition-links {
    flex-direction: column;
    gap: 4px;
  }
}
