/* What's new (/news/…): the list of posts and each post's page. One column,
   the width of a comfortable read; the posts are a dated list set apart by
   hairlines, and a post's page opens on the site's pastel hero. The tags
   take the colour of their kind: the brand blue for a version, purple for
   what the data says, teal for the rest. */

:root {
  --news-column: 720px;
  --news-prose: 660px;
  --news-tint-release: var(--brand-tint);
  --news-ink-release: var(--brand-ink);
  --news-tint-insight: color-mix(in srgb, var(--purple) 12%, var(--bg-card));
  --news-ink-insight: var(--purple-ink);
  --news-tint-news: color-mix(in srgb, var(--teal) 12%, var(--bg-card));
  --news-ink-news: var(--teal-ink);
}

.news {
  width: 100%;
  max-width: var(--news-column);
  margin-inline: auto;
  padding: 0 20px 72px;
}

@media (min-width: 640px) {
  .news {
    padding: 0 32px 96px;
  }
}

/* Hero ------------------------------------------------------------------- */

.news-hero {
  padding-bottom: 40px;
}

/* Tags ------------------------------------------------------------------- */

.news-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--news-tint-news);
  color: var(--news-ink-news);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.5;
  text-transform: uppercase;
  white-space: nowrap;
}

.news-tag-launch,
.news-tag-release {
  background: var(--news-tint-release);
  color: var(--news-ink-release);
}

.news-tag-insight {
  background: var(--news-tint-insight);
  color: var(--news-ink-insight);
}

/* The list: a grid of cards the width of the site, the latest post first
   and wider, lying down, its picture beside its words. A card's picture is
   the post's cover, or a drawn mark of its kind on a pastel ground. */

.news-index {
  max-width: var(--container);
}

.news-grid {
  display: grid;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .news-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.news-grid > li {
  display: grid;
}

.news-card {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--bg-card);
  transition:
    border-color 0.2s var(--ease-apple),
    box-shadow 0.2s var(--ease-apple),
    translate 0.2s var(--ease-apple);
}

.news-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
  translate: 0 -2px;
}

.news-card:has(h2 a:focus-visible),
.news-card:has(h3 a:focus-visible) {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.news-card-visual {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-alt);
}

.news-card-visual > img,
.news-mark {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-mark {
  display: grid;
  place-items: center;
  --mark: var(--teal);
  --mark-ink: var(--teal-ink);
  background:
    radial-gradient(70% 80% at 20% 15%, color-mix(in srgb, var(--pastel-1) 80%, transparent), transparent 70%),
    radial-gradient(60% 70% at 85% 90%, color-mix(in srgb, var(--pastel-blue) 90%, transparent), transparent 70%),
    linear-gradient(160deg, var(--pastel-2), var(--bg-card));
  color: var(--mark-ink);
}

.news-mark-launch,
.news-mark-release {
  --mark: var(--brand);
  --mark-ink: var(--brand-strong);
  background:
    radial-gradient(70% 80% at 20% 15%, color-mix(in srgb, var(--pastel-blue) 95%, transparent), transparent 70%),
    radial-gradient(60% 70% at 85% 90%, color-mix(in srgb, var(--pastel-1) 80%, transparent), transparent 70%),
    linear-gradient(160deg, #f0f7ff, var(--bg-card));
}

.news-mark-insight {
  --mark: var(--purple);
  --mark-ink: var(--purple-ink);
  background:
    radial-gradient(70% 80% at 20% 15%, color-mix(in srgb, var(--pastel-3) 85%, transparent), transparent 70%),
    radial-gradient(60% 70% at 85% 90%, color-mix(in srgb, var(--pastel-blue) 90%, transparent), transparent 70%),
    linear-gradient(160deg, #fbf3fb, var(--bg-card));
}

.news-mark-version {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 2rem + 6vw, 5.5rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
  background: linear-gradient(135deg, var(--brand-strong), var(--brand-soft));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.news-mark-chart {
  width: 34%;
  max-width: 96px;
  color: var(--purple);
}

.news-mark-logo {
  width: 18%;
  max-width: 64px;
  height: auto;
}

.news-mark-logo-large {
  width: 24%;
  max-width: 88px;
}

.news-card-body {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 10px;
  padding: 20px 22px 24px;
}

.news-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0;
  color: var(--ink-tertiary);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.news-card h2,
.news-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.3125rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.news-card h2 a,
.news-card h3 a {
  color: var(--ink);
  text-decoration: none;
}

/* The whole card opens the post: the title's link covers it. */
.news-card h2 a::after,
.news-card h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.news-card {
  position: relative;
}

.news-card h2 a:focus-visible,
.news-card h3 a:focus-visible {
  outline: none;
}

/* A card shows the start of the summary; the whole of it is on the post. */
.news-card-summary {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--ink-secondary);
  font-size: 15.5px;
  line-height: 1.5;
  text-wrap: pretty;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.news-more,
.news-all a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  color: var(--brand-ink);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.news-more svg,
.news-all a svg {
  transition: translate 0.2s var(--ease-apple);
}

.news-card:hover .news-more svg,
.news-all a:hover svg {
  translate: 3px 0;
}

/* The latest post, across the grid. */

.news-grid > li:has(.news-card-featured) {
  grid-column: 1 / -1;
}

@media (min-width: 760px) {
  .news-card-featured {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    grid-template-rows: none;
  }

  .news-card-featured .news-card-visual {
    aspect-ratio: auto;
    min-height: 300px;
  }

  .news-card-featured .news-card-body {
    align-content: center;
    gap: 14px;
    padding: 40px 44px;
  }

  .news-card-featured h2 {
    font-size: clamp(1.5rem, 1.2rem + 0.9vw, 1.875rem);
    letter-spacing: -0.02em;
    line-height: 1.15;
  }

  .news-card-featured .news-card-summary {
    font-size: 16.5px;
  }
}

/* No post yet: a panel that says the news is on its way, with the badge. */
.news-soon {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: clamp(48px, 8vw, 80px) 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--wash);
  text-align: center;
}

.news-soon-mark {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  margin-bottom: 8px;
  border-radius: 24px;
  background: var(--bg-card);
  box-shadow: 0 10px 30px rgba(0, 40, 120, 0.1);
}

.news-soon-mark img {
  width: 40px;
  height: auto;
}

.news-soon h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.news-soon p {
  max-width: 48ch;
  margin: 0 0 12px;
  color: var(--ink-secondary);
  font-size: 17px;
  line-height: 1.5;
  text-wrap: pretty;
}

/* A post: a classic article, its head set at the left of the reading
   column, as a newspaper would. */

.news-post-page {
  max-width: var(--container);
  padding-top: 32px;
}

@media (min-width: 640px) {
  .news-post-page {
    padding-top: 48px;
  }
}

.news-post {
  max-width: var(--news-prose);
  margin-inline: auto;
}

.news-post-head {
  margin: 0 0 32px;
}

.news-crumb {
  margin: 0 0 24px;
  font-size: 14px;
}

.news-crumb a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-secondary);
  text-decoration: none;
}

.news-crumb a::before {
  content: "‹";
  font-size: 18px;
  line-height: 1;
}

.news-crumb a:hover {
  color: var(--brand-ink);
}

.news-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 0 0 16px;
  color: var(--ink-tertiary);
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.news-post-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 1.35rem + 1.3vw, 2.25rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.news-lead {
  max-width: 56ch;
  margin: 18px 0 0;
  color: var(--ink-secondary);
  font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  line-height: 1.5;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.news-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--ink-tertiary);
  font-size: 14px;
}

.news-byline > span:first-child {
  color: var(--ink-secondary);
  font-weight: 500;
}

.news-cover {
  margin: 0 0 36px;
}

.news-cover img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--bg-alt);
}

/* The text, as the help center sets it. */

.news-prose {
  font-size: 17.5px;
  line-height: 1.65;
}

.news-prose > * + * {
  margin-top: 16px;
}

.news-prose > :first-child {
  margin-top: 0;
}

.news-prose h2 {
  margin: 44px 0 0;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.022em;
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.news-prose h3 {
  margin: 28px 0 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.news-prose h2 + *,
.news-prose h3 + * {
  margin-top: 10px;
}

.news-prose p,
.news-prose ul,
.news-prose ol {
  margin-bottom: 0;
  text-wrap: pretty;
}

.news-prose ul {
  padding-inline-start: 22px;
}

.news-prose li + li {
  margin-top: 8px;
}

.news-prose ol {
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.news-prose ol > li {
  position: relative;
  padding-inline-start: 40px;
  counter-increment: step;
}

.news-prose ol > li::before {
  content: counter(step);
  position: absolute;
  inset-inline-start: 0;
  top: 2px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand-tint);
  color: var(--brand-strong);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.news-prose ol > li + li {
  margin-top: 12px;
}

.news-prose strong {
  font-weight: 600;
}

.news-prose a {
  color: var(--brand-ink);
}

.news-prose code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--fill);
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.news-prose figure {
  margin: 28px 0 0;
}

.news-prose img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-tile);
  background: var(--bg-alt);
}

.news-prose figcaption {
  margin-top: 8px;
  color: var(--ink-tertiary);
  font-size: 14px;
}

.news-prose .table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-tile);
}

.news-prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.45;
}

.news-prose th,
.news-prose td {
  padding: 10px 14px;
  text-align: start;
  vertical-align: top;
}

.news-prose th {
  background: var(--bg-alt);
  color: var(--ink-secondary);
  font-size: 13px;
  font-weight: 600;
}

.news-prose tr + tr td,
.news-prose tbody tr:first-child td {
  border-top: 1px solid var(--line);
}

.news-prose .callout {
  --tint: var(--brand);
  --tint-ink: var(--brand-strong);
  padding: 16px 20px;
  border: 1px solid color-mix(in srgb, var(--tint) 18%, transparent);
  border-radius: var(--radius-tile);
  background: color-mix(in srgb, var(--tint) 6%, var(--bg-card));
  font-size: 16px;
  line-height: 1.55;
}

.news-prose .callout > * + * {
  margin-top: 6px;
}

.news-prose .callout p {
  margin: 0;
}

.news-prose .callout-label {
  color: var(--tint-ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.news-prose .callout-tip {
  --tint: var(--green);
  --tint-ink: var(--green-ink);
}

.news-prose .callout-warning {
  --tint: var(--orange);
  --tint-ink: var(--orange-ink);
}

/* After the text: when it was corrected, and where to share it. */

.news-post-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.news-updated {
  margin: 0;
  color: var(--ink-tertiary);
  font-size: 14px;
}

.news-share {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-inline-start: auto;
  font-size: 14px;
}

.news-share > span {
  margin-inline-end: 4px;
  color: var(--ink-tertiary);
}

.news-share a,
.news-share button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition:
    background 0.2s var(--ease-apple),
    border-color 0.2s var(--ease-apple),
    color 0.2s var(--ease-apple),
    transform 0.2s var(--ease-apple);
}

.news-share a:hover,
.news-share button:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
  transform: translateY(-1px);
}

.news-share a:focus-visible,
.news-share button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.news-share svg {
  grid-area: 1 / 1;
}

/* Copy link: the check takes the link's place for a moment. */
.news-share .news-share-done,
.news-share [data-done] svg:first-child {
  opacity: 0;
  transform: scale(0.6);
}

.news-share [data-done] .news-share-done {
  opacity: 1;
  transform: none;
}

.news-share button svg {
  transition:
    opacity 0.2s var(--ease-apple),
    transform 0.2s var(--ease-apple);
}

.news-share [data-done] {
  border-color: var(--brand);
  color: var(--brand);
}

/* Try Copeel: the hero's pastel halo again, as the help center ends. */

.news-index .news-band {
  max-width: none;
}

.news-band {
  max-width: var(--news-prose);
  margin-inline: auto;
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-top: 56px;
  padding: 44px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--wash);
  text-align: center;
}

.news-band h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.news-band p {
  max-width: 46ch;
  margin: 0 0 10px;
  color: var(--ink-secondary);
  text-wrap: pretty;
}

/* Also worth reading: three small cards, as wide as the grid of the list. */

.news-also {
  max-width: var(--container);
  margin: 64px auto 0;
}

.news-also h2 {
  margin: 0 0 20px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.news-also .news-card-visual {
  aspect-ratio: 2 / 1;
}

.news-also .news-mark-version {
  font-size: 3.25rem;
}

.news-also .news-more {
  display: none;
}

.news-all {
  margin: 24px 0 0;
}
