/* Announcements (templates/pages/announcements-list.ts, announcement.ts) and
 * the 404 (not-found.ts). The home is a full-width hero for the newest
 * announcement and a list of the rest; a post puts the hero image across
 * the width and the text in an article-width column. tokens.css supplies
 * every colour, so both follow the light and dark themes. */

/* ---- Home and post frame ----
 * The same full-width column and fluid gutters as the docs home. */

.an {
  --gutter: clamp(16px, 3.4vw, 80px);

  box-sizing: border-box;
  max-width: calc(1440px + 2 * var(--gutter));
  margin: 0 auto;
  padding: 72px var(--gutter) 24px;
  font-family: var(--d-font);
  color: var(--d-fg);
}

.an-head {
  margin-bottom: 32px;
}

.an-head__title {
  margin: 0;
  font-size: 40px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--d-fg);
}

.an-head__sub {
  margin: 10px 0 0;
  font-size: 17px;
  line-height: 1.55;
  color: var(--d-muted);
}

/* ---- Covers: the image, or initials on a soft grey pattern ---- */

.an-cover {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The hero shows the whole image: it is often full of text. */
.an-cover--hero {
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: contain;
  background: var(--d-bg-soft);
}

.an-cover--blank {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 1px 1px, var(--d-line-strong) 1px, transparent 0) 0 0 / 10px 10px,
    linear-gradient(135deg, var(--d-panel-soft), var(--d-bg-soft));
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--d-muted);
}

/* ---- Meta line and type tag ---- */

.an-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 13px;
  color: var(--d-muted);
}

.an-type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px;
  border: 1px solid var(--d-line-strong);
  border-radius: var(--d-radius-pill);
  font-size: 12px;
  font-weight: 500;
  color: var(--d-fg-2);
}

.an-type::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--d-accent);
}

.an-type--release::before {
  background: var(--d-success);
}

.an-type--product::before {
  background: var(--d-info);
}

/* ---- Featured ---- */

.an-feature {
  display: block;
  overflow: hidden;
  border: 1px solid var(--d-line);
  border-radius: var(--d-radius-lg);
  background: var(--d-panel);
  color: inherit;
  text-decoration: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    transform 0.2s;
}

.an-feature:hover {
  border-color: var(--d-line-strong);
  box-shadow: var(--d-shadow-pop);
  transform: translateY(-2px);
}

.an-feature:focus-visible,
.an-row:focus-visible {
  outline: 2px solid var(--d-focus);
  outline-offset: 3px;
}

.an-feature__art {
  display: block;
  border-bottom: 1px solid var(--d-line);
}

.an-feature__body {
  display: grid;
  gap: 12px;
  max-width: 820px;
  padding: 28px 32px 32px;
}

.an-feature__title {
  font-size: 36px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--d-fg);
}

.an-feature__desc {
  font-size: 17px;
  line-height: 1.6;
  color: var(--d-fg-2);
}

.an-more {
  justify-self: start;
  margin-top: 4px;
  font-size: 15px;
  font-weight: 500;
  color: var(--d-fg);
  text-decoration: underline;
  text-decoration-color: var(--d-accent-line);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.an-feature:hover .an-more {
  text-decoration-color: var(--d-accent);
}

/* ---- More announcements ---- */

.an-rest {
  margin-top: 56px;
}

.an-rest__title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--d-fg);
}

.an-year {
  margin: 28px 0 4px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--d-muted);
}

.an-rows {
  margin: 0 -12px;
  padding: 0;
  list-style: none;
}

.an-rows > :where(li + li) {
  border-top: 1px solid var(--d-line);
}

.an-row {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 24px;
  padding: 20px 12px;
  border-radius: var(--d-radius);
  color: inherit;
  text-decoration: none;
  transition:
    background-color 0.15s,
    transform 0.2s;
}

.an-row:hover {
  background: var(--d-hover);
  transform: translateY(-1px);
}

.an-row__thumb {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--d-line);
  border-radius: var(--d-radius);
}

.an-row__body {
  display: grid;
  gap: 6px;
}

.an-row__title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--d-fg);
}

.an-row__desc {
  overflow: hidden;
  display: -webkit-box;
  font-size: 15px;
  line-height: 1.55;
  color: var(--d-fg-2);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.an-row__arrow {
  color: var(--d-muted);
  opacity: 0;
  transform: translateX(-4px);
  transition:
    opacity 0.15s,
    transform 0.15s;
}

.an-row:hover .an-row__arrow,
.an-row:focus-visible .an-row__arrow {
  opacity: 1;
  transform: none;
}

/* ---- One announcement ---- */

.an-post {
  padding-top: 48px;
}

.an-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--d-muted);
}

.an-crumbs a {
  color: var(--d-muted);
  text-decoration: none;
}

.an-crumbs a:hover {
  color: var(--d-fg);
}

.an-crumbs span:last-child {
  overflow: hidden;
  max-width: 420px;
  color: var(--d-fg-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.an-post__art {
  overflow: hidden;
  margin: 0 0 40px;
  border: 1px solid var(--d-line);
  border-radius: var(--d-radius-lg);
}

.an-post__column {
  max-width: var(--d-content-w);
  margin: 0 auto;
}

.an-post__title {
  margin: 14px 0 0;
  font-size: 40px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--d-fg);
}

.an-post__lead {
  margin: 14px 0 0;
  font-size: 18px;
  line-height: 1.6;
  color: var(--d-fg-2);
}

.an-post__by {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.an-post__by::before {
  content: "";
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}

/* The body, typeset like a docs article. */
.an-prose {
  font-size: 16px;
  line-height: 1.75;
  color: var(--d-fg-2);
}

.an-prose > :first-child {
  margin-top: 24px;
}

.an-prose h2 {
  margin: 40px 0 12px;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--d-fg);
}

.an-prose h3 {
  margin: 32px 0 8px;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--d-fg);
}

.an-prose p,
.an-prose ul,
.an-prose ol {
  margin: 0 0 16px;
}

.an-prose ul,
.an-prose ol {
  padding-left: 22px;
}

.an-prose li {
  margin: 6px 0;
}

.an-prose strong {
  font-weight: 600;
  color: var(--d-fg);
}

.an-prose a {
  color: var(--d-link);
  text-decoration: underline;
  text-decoration-color: var(--d-link-line);
  text-underline-offset: 4px;
}

.an-prose a:hover {
  text-decoration-color: var(--d-accent);
}

/* Headings link to themselves (rehype-autolink-headings): no underline. */
.an-prose :is(h2, h3) a {
  color: inherit;
  text-decoration: none;
}

.an-prose code {
  padding: 2px 6px;
  border-radius: var(--d-radius-sm);
  background: var(--d-inline-code-bg);
  font-family: var(--d-mono);
  font-size: 0.88em;
  color: var(--d-code-fg);
}

.an-prose pre {
  overflow-x: auto;
  margin: 0 0 16px;
  padding: 16px 18px;
  border: 1px solid var(--d-line);
  border-radius: var(--d-radius);
  background: var(--d-code-bg);
  line-height: 1.6;
}

.an-prose pre code {
  padding: 0;
  background: none;
}

.an-prose blockquote {
  margin: 0 0 16px;
  padding: 2px 0 2px 16px;
  border-left: 3px solid var(--d-accent);
  color: var(--d-fg-2);
}

.an-prose table {
  width: 100%;
  margin: 0 0 16px;
  border-collapse: collapse;
  font-size: 14px;
}

.an-prose th,
.an-prose td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--d-line);
  text-align: left;
}

.an-prose th {
  background: var(--d-panel-soft);
  font-weight: 600;
  color: var(--d-fg);
}

.an-prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--d-radius);
}

.an-back {
  display: inline-flex;
  gap: 8px;
  margin-top: 32px;
  font-size: 14px;
  font-weight: 500;
  color: var(--d-fg);
  text-decoration: underline;
  text-decoration-color: var(--d-accent-line);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.an-back:hover {
  text-decoration-color: var(--d-accent);
}

/* ---- 404 ---- */

.nf {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 560px;
  margin: 0 auto;
  padding: clamp(48px, 12vh, 120px) 24px calc(var(--d-dock-h) + 2 * var(--d-dock-gap));
  font-family: var(--d-font);
  text-align: center;
  color: var(--d-fg);
}

.nf-code {
  margin: 0;
  font-size: 112px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.06em;
  color: var(--d-accent);
}

.nf-title {
  margin: 20px 0 0;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--d-fg);
}

.nf-text {
  margin: 10px 0 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--d-muted);
}

.nf-search {
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  width: 100%;
  height: 48px;
  margin-top: 32px;
  padding: 0 10px 0 18px;
  border: 1px solid var(--d-line-strong);
  border-radius: var(--d-radius-pill);
  background: var(--d-panel);
  box-shadow: var(--d-shadow-dock);
  font-size: 15px;
  color: var(--d-muted);
  text-decoration: none;
}

.nf-search:hover {
  border-color: var(--d-faint);
}

.nf-search:focus-visible {
  outline: 2px solid var(--d-focus);
  outline-offset: 2px;
}

.nf-search span {
  flex: 1;
  text-align: left;
}

.nf-search kbd {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: var(--d-radius-sm);
  background: var(--d-panel-soft);
  font-family: var(--d-font);
  font-size: 12px;
  color: var(--d-muted);
}

.nf-actions {
  margin: 20px 0 0;
}

.nf-home {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 20px;
  border-radius: var(--d-radius-pill);
  background: var(--d-fg);
  font-size: 14px;
  font-weight: 500;
  color: var(--d-bg);
  text-decoration: none;
}

.nf-home:hover {
  opacity: 0.88;
}

.nf-places {
  margin-top: 40px;
  font-size: 13px;
  color: var(--d-muted);
}

.nf-places p {
  margin: 0 0 12px;
}

.nf-places ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nf-places a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--d-line-strong);
  border-radius: var(--d-radius-pill);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--d-fg-2);
  text-decoration: none;
}

.nf-places a:hover {
  background: var(--d-hover);
  color: var(--d-fg);
}

@media (prefers-reduced-motion: reduce) {
  .an-feature,
  .an-row,
  .an-row__arrow {
    transition: none;
  }

  .an-feature:hover,
  .an-row:hover {
    transform: none;
  }
}

@media (max-width: 720px) {
  .an {
    padding: 72px 16px 24px;
  }

  .an-head__title,
  .an-post__title {
    font-size: 30px;
  }

  .an-feature__body {
    padding: 20px;
  }

  .an-feature__title {
    font-size: 26px;
  }

  .an-rows {
    margin: 0 -4px;
  }

  .an-row {
    grid-template-columns: 88px minmax(0, 1fr);
    align-items: start;
    gap: 14px;
    padding: 16px 4px;
  }

  .an-row__arrow {
    display: none;
  }

  .an-cover--blank {
    font-size: 16px;
  }

  .an-post__art {
    margin-bottom: 28px;
  }

  .nf-code {
    font-size: 88px;
  }
}
