/**
 * MS Release Notes
 *
 * Timeline layout: version and date on the left, a card with the release's
 * notes on the right. Based on designs/release-notes-redesign_4.html.
 *
 * Override any value by redefining the custom properties, e.g.
 *   .ms-rn-page, .rn-release-notes { --rn-blue: #205c9a; }
 */

.ms-rn-page,
.rn-release-notes {
  --rn-navy: #0b2545;
  --rn-blue: #1a73e8;
  --rn-ink: #1d2433;
  --rn-muted: #5f6b7d;
  --rn-line: #e4e8ef;
  --rn-bg: #f6f8fb;
  --rn-card: #ffffff;
  --rn-radius: 14px;
  --rn-meta-width: 220px;
  --rn-gap: 40px;

  --rn-font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --rn-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

.ms-rn-page,
.rn-release-notes {
  font-family: var(--rn-font);
  line-height: 1.6;
  color: var(--rn-ink);
}

.ms-rn-page *,
.ms-rn-page *::before,
.ms-rn-page *::after,
.rn-release-notes *,
.rn-release-notes *::before,
.rn-release-notes *::after {
  box-sizing: border-box;
}

/* ---- Hero (page template) ---- */

.rn-hero {
  padding: 50px 24px 0px;
  text-align: center;
  color: var(--rn-navy);
  z-index: -1;
}

.rn-hero__inner {
  max-width: 1120px;
  margin: 0 auto;
}

.rn-page-title {
  margin: 0 0 14px;
  line-height: 1.15;
  color: #0f1b2d;
  font-size: 36px;
  line-height: 1.15;
  font-weight: 600;
}

.rn-page-intro {
  max-width: 620px;
  margin: 0 auto;
  font-size: 17px;
  color: var(--rn-muted);
}

.rn-page-intro p {
  margin: 0 0 1em;
  font-size: inherit;
  color: inherit;
}

.rn-page-intro > :last-child {
  margin-bottom: 0;
}

.rn-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ---- Release: meta column + card, joined by a timeline rail ---- */

.rn-release {
  position: relative;
  display: grid;
  grid-template-columns: var(--rn-meta-width) minmax(0, 1fr);
  gap: var(--rn-gap);
  padding-bottom: 48px;
}

.rn-release::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 0;
  left: calc(var(--rn-meta-width) + var(--rn-gap) / 2);
  width: 2px;
  background: var(--rn-line);
  transform: translateX(-1px);
}

.rn-release:last-of-type::before {
  bottom: 48px;
}

.rn-release::after {
  content: "";
  position: absolute;
  top: 10px;
  left: calc(var(--rn-meta-width) + var(--rn-gap) / 2);
  width: 14px;
  height: 14px;
  border: 3px solid var(--rn-blue);
  border-radius: 50%;
  background: #fff;
  transform: translateX(-7px);
}

.rn-release.is-latest::after {
  background: var(--rn-blue);
}

/* group_by="none": no heading, so no meta column. */
.rn-release--untitled {
  grid-template-columns: minmax(0, 1fr);
}

.rn-release--untitled::before,
.rn-release--untitled::after,
.rn-release--untitled .rn-meta {
  display: none;
}

.rn-release--untitled .rn-card {
  margin-left: 0;
}

.rn-meta {
  position: sticky;
  top: 110px;
  align-self: start;
  text-align: right;
}

.rn-version {
  margin: 0;
  font-family: var(--rn-mono);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--rn-navy);
  overflow-wrap: anywhere;
}

.rn-date {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  color: var(--rn-muted);
}

.rn-latest {
  display: inline-block;
  margin-top: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rn-blue);
}

.rn-card {
  margin-left: 16px;
  padding: 28px 32px;
  border-radius: var(--rn-radius);
  background: var(--rn-card);
  box-shadow:
    0 1px 2px rgba(11, 37, 69, 0.05),
    0 6px 24px rgba(11, 37, 69, 0.06);
}

/* ---- Sections and group headers ---- */

.rn-section + .rn-section {
  margin-top: 36px;
}

.rn-section__title {
  margin: 0 0 6px;
  padding: 0 16px;
  font-family: var(--rn-font);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rn-muted);
}

.rn-group + .rn-group {
  margin-top: 20px;
}

.rn-group__title {
  /* Side margins (not padding) so the border lines up with the note text. */
  margin: 0 16px 6px;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--rn-line);
  font-family: var(--rn-font);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--rn-navy);
}

/* ---- Notes ---- */

.rn-items {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rn-item {
  margin: 0;
  padding: 14px 16px;
  border-radius: 10px;
  transition: background-color 0.15s;
}

.rn-items .rn-item:hover {
  background: var(--rn-bg);
}

.rn-item__title {
  margin: 0;
  font-family: var(--rn-font);
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--rn-ink);
}

.rn-item__title a {
  color: inherit;
  text-decoration: none;
}

.rn-item__title a:hover,
.rn-item__title a:focus-visible {
  color: var(--rn-blue);
}

.rn-item__meta {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--rn-muted);
}

.rn-item__version {
  font-family: var(--rn-mono);
}

.rn-item__content {
  margin-top: 4px;
  font-size: 14.5px;
  color: var(--rn-muted);
}

/* Notes with "Hide title": the content is the whole note, so it reads in the title colour. */
.rn-items .rn-item--no-title {
  padding-top: 8px;
  padding-bottom: 8px;
}

.rn-items:has(.rn-item--no-title) {
  gap: 4px;
}

.rn-item--no-title .rn-item__content {
  margin-top: 0;
  font-size: 15px;
}

.rn-item--no-title .rn-item__content p,
.rn-item--no-title .rn-item__content li {
  color: var(--rn-ink);
}

/* The theme sets its own colour and size on p / li. */
.rn-item__content p,
.rn-item__content li {
  font-size: inherit;
  line-height: 1.6;
  color: var(--rn-muted);
}

.rn-item__content p {
  margin: 0 0 0.75em;
}

.rn-item__content ul,
.rn-item__content ol {
  margin: 0 0 0.75em;
  padding-left: 1.25em;
}

.rn-item__content > :last-child {
  margin-bottom: 0;
}

.rn-item__content a {
  color: var(--rn-blue);
}

.rn-item__content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin-top: 12px;
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(11, 37, 69, 0.06);
}

.rn-item__content figure,
.rn-item__content .wp-block-image {
  margin: 12px 0 0;
}

.rn-item__content figure img {
  margin-top: 0;
}

.rn-item__content figcaption {
  margin-top: 6px;
  font-size: 13px;
  color: var(--rn-muted);
}

/* ---- Page links ---- */

.rn-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  padding-left: calc(var(--rn-meta-width) + var(--rn-gap) + 16px);
}

.rn-pagination__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--rn-line);
  border-radius: 10px;
  background: #fff;
  font-family: var(--rn-font);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  color: var(--rn-ink);
  text-decoration: none;
  transition:
    border-color 0.15s,
    color 0.15s;
}

a.rn-pagination__item:hover,
a.rn-pagination__item:focus-visible {
  border-color: var(--rn-blue);
  color: var(--rn-blue);
  text-decoration: none;
}

.rn-pagination__item.current {
  border-color: var(--rn-navy);
  background: var(--rn-navy);
  color: #fff;
}

.rn-pagination__item--dots {
  border-color: transparent;
  background: transparent;
}

/* ---- Single view ---- */

.rn-release-notes--single {
  max-width: 820px;
  margin: 0 auto;
}

.rn-back {
  margin: 0 0 24px;
  font-size: 15px;
}

.rn-back a {
  color: var(--rn-blue);
  text-decoration: none;
}

.rn-back a:hover,
.rn-back a:focus-visible {
  text-decoration: underline;
}

.rn-single__release {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin: 0 0 16px;
}

.rn-single__release .rn-date {
  margin: 0;
}

.rn-single__context {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rn-muted);
}

.rn-release-notes--single .rn-card {
  margin-left: 0;
}

.rn-release-notes--single .rn-item {
  padding: 0;
}

.rn-release-notes--single .rn-item__title {
  margin-bottom: 10px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--rn-navy);
}

.rn-release-notes--single .rn-item__content {
  font-size: 15.5px;
}

/* ---- Empty state ---- */

.rn-empty {
  margin: 0;
  padding: 30px;
  border: 1px dashed var(--rn-line);
  border-radius: var(--rn-radius);
  color: var(--rn-muted);
  text-align: center;
}

/* ---- Small screens: meta above the card, no timeline ---- */

@media (max-width: 820px) {
  .rn-hero {
    padding: 40px 20px 15px;
  }

  .rn-container {
    padding: 32px 16px 56px;
  }

  .rn-release {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  /* No timeline rail or dots on small screens. */
  .rn-release::before,
  .rn-release::after {
    display: none;
  }

  .rn-meta {
    position: static;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    text-align: left;
  }

  .rn-date,
  .rn-latest {
    margin-top: 0;
  }

  .rn-card {
    margin-left: 0;
    padding: 20px;
  }

  .rn-item {
    padding: 12px 8px;
  }

  .rn-section__title {
    padding: 0 8px;
  }

  .rn-group__title {
    margin-right: 8px;
    margin-left: 8px;
  }

  .rn-pagination {
    padding-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rn-item,
  .rn-pagination__item {
    transition: none;
  }
}
