/*
  Newsletters (index + article) — aligned on the corp site's blog layout
  (src/corp-anantys `.blog-paper`, `/blog/[slug]`), which is the reference.

  The site shell stays dark; the article reads on a light "paper" sheet whose
  palette is re-declared locally, exactly like `.blog-paper` does.
*/

.nl-page {
  --nl-paper: #f0f2f7;          /* blog paper surface, hsl(220 22% 96%) */
  --nl-ink: #20242e;            /* anthracite */
  --nl-ink-body: rgba(32, 36, 46, 0.9);
  --nl-muted: #606774;          /* slate */
  --nl-rule: #dbdfe6;           /* hairlines */
  --nl-tint: #e6e9ef;           /* code / quiet surfaces */
  --nl-link: #007a55;           /* brand green darkened for AA on paper */

  padding: 2rem 0 3rem;
  font-family: var(--ap-font-body);
}

.nl-wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ---------- Reading progress ---------- */

.nl-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 9999;
  pointer-events: none;
}

.nl-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ap-accent);
  transition: width 80ms linear;
}

/* ---------- Paper sheet ---------- */

.nl-paper {
  background: var(--nl-paper);
  color: var(--nl-ink);
  border-radius: 1.5rem;
  /* Same trick as .blog-paper: a shell-colored border masks the rounded-clip seam. */
  border: 1px solid var(--ap-bg);
  overflow: hidden;
}

.nl-paper-inner {
  padding: 1.75rem 1.5rem 2.5rem;
}

.nl-eyebrow {
  display: inline-block;
  font-family: var(--ap-font-title);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--nl-link);
  text-decoration: none;
}

.nl-eyebrow:hover {
  color: var(--nl-ink);
}

.nl-title {
  margin: 0.75rem 0 0;
  font-family: var(--ap-font-title);
  font-weight: 600;
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--nl-ink);
}

.nl-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--nl-muted);
}

.nl-rule {
  margin: 2rem 0;
  border: 0;
  border-top: 1px solid var(--nl-rule);
  opacity: 1;
}

/* ---------- Article body (prose-lg equivalent) ---------- */

.nl-body {
  font-size: 1.125rem;
  line-height: 1.78;
  letter-spacing: 0.01em;
  color: var(--nl-ink-body);
}

.nl-body p {
  margin: 0 0 1.35em;
}

.nl-body h2,
.nl-body h3,
.nl-body h4 {
  margin: 2.25em 0 0.75em;
  font-family: var(--ap-font-title);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--nl-ink);
}

.nl-body h2 {
  font-size: 1.625rem;
  line-height: 1.3;
}

.nl-body h3 {
  font-size: 1.375rem;
  line-height: 1.35;
}

.nl-body h4 {
  font-size: 1.125rem;
}

.nl-body > :first-child,
.nl-edito > :first-child {
  margin-top: 0;
}

.nl-body strong,
.nl-body b {
  font-weight: 600;
  color: var(--nl-ink);
}

.nl-body a {
  color: var(--nl-link);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.nl-body a:hover {
  color: var(--nl-ink);
}

.nl-body ul,
.nl-body ol {
  margin: 0 0 1.35em;
  padding-left: 1.4em;
}

.nl-body li {
  margin: 0.5em 0;
  padding-left: 0.25em;
}

.nl-body li::marker {
  color: rgba(0, 122, 85, 0.5);
}

.nl-body li p {
  display: inline;
  margin: 0;
}

.nl-body hr {
  margin: 2.5em 0;
  border: 0;
  border-top: 1px solid var(--nl-rule);
  opacity: 1;
}

/* Magazine pull-quote, as on the blog. */
.nl-body blockquote {
  position: relative;
  margin: 2.5rem 0;
  padding: 0.25rem 0 0.25rem 3rem;
  font-style: italic;
  font-size: 1.375rem;
  line-height: 1.5;
  color: var(--nl-ink);
}

.nl-body blockquote::before {
  content: "\201C";
  position: absolute;
  top: -0.2em;
  left: 0;
  font-family: Georgia, Cambria, serif;
  font-style: normal;
  font-size: 5rem;
  line-height: 1;
  color: rgba(0, 122, 85, 0.16);
}

.nl-body blockquote p {
  margin: 0;
}

.nl-body blockquote p + p {
  margin-top: 0.5rem;
}

.nl-body blockquote footer {
  margin-top: 0.75rem;
  font-family: var(--ap-font-title);
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--nl-link);
}

/* The editorial note opens the issue: same text, set apart by a left rule. */
.nl-edito {
  margin: 2rem 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--nl-rule);
}

.nl-edito p:last-child {
  margin-bottom: 0;
}

/* A highlighted takeaway: a quiet tinted band, no card. */
.nl-punchline {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--nl-tint);
  border-radius: 0.75rem;
  color: var(--nl-ink);
  font-weight: 500;
}

.nl-punchline p:last-child {
  margin-bottom: 0;
}

/* Stock heading: name on the left, quote on the right, all on one hairline. */
.nl-stock {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin: 2.25em 0 0.75em;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--nl-rule);
}

.nl-body .nl-stock h2 {
  margin: 0;
}

.nl-body .nl-stock h2 a {
  color: var(--nl-ink);
  text-decoration: none;
}

.nl-body .nl-stock h2 a:hover {
  color: var(--nl-link);
}

.nl-stock-quote {
  font-family: var(--ap-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
  color: var(--nl-ink);
}

/* The DS mint fails contrast on paper: darken the semantic colors locally. */
.nl-stock-quote .text-success {
  color: #007a55 !important;
}

.nl-stock-quote .text-danger {
  color: #c8243f !important;
}

.nl-video {
  display: block;
  margin: 0 0 1.25em;
  border-radius: 0.75rem;
  overflow: hidden;
}

.nl-video img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.nl-cta {
  margin: 2.5rem 0 0;
}

/* ---------- Buttons & form ---------- */

.nl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.6rem 1.25rem;
  border: 1px solid var(--ap-accent);
  border-radius: 9999px;
  background: var(--ap-accent);
  color: #161a22;
  font-family: var(--ap-font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.nl-body a.nl-btn {
  color: #161a22;
  text-decoration: none;
}

.nl-btn:hover {
  background: var(--ap-accent-hover);
  border-color: var(--ap-accent-hover);
  color: #161a22;
}

.nl-btn--ghost,
.nl-btn--ghost:hover {
  background: transparent;
  border-color: var(--nl-rule);
  color: var(--nl-muted);
}

.nl-input {
  flex: 1 1 220px;
  min-height: 44px;
  padding: 0.6rem 1rem;
  border: 1px solid var(--nl-rule);
  border-radius: 9999px;
  background: #fff;
  color: var(--nl-ink);
  font-size: 1rem;
}

.nl-input:focus {
  outline: 2px solid var(--nl-link);
  outline-offset: 1px;
}

/* ---------- Article footer ---------- */

.nl-footer {
  margin-top: 3rem;
  color: var(--nl-ink-body);
}

.nl-subscribe-title {
  margin: 0;
  font-family: var(--ap-font-title);
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--nl-ink);
}

.nl-subscribe-text {
  margin: 0.35rem 0 0;
  color: var(--nl-muted);
}

.nl-subscribe-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  max-width: 480px;
}

/* The rating widget sits flat on the paper: no card inside the sheet. */
.nl-paper .anantys-rating-card {
  margin-top: 2rem;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  text-align: left;
}

.nl-read-also {
  margin: 0;
  font-size: 1.125rem;
}

.nl-read-also span {
  color: var(--nl-muted);
}

.nl-read-also a,
.nl-social a {
  color: var(--nl-link);
  font-weight: 500;
  text-decoration: none;
}

.nl-read-also a:hover,
.nl-social a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.nl-all {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  margin-top: 0.5rem;
  font-weight: 500;
  color: var(--nl-ink);
  text-decoration: underline;
  text-decoration-color: var(--nl-rule);
  text-underline-offset: 4px;
}

.nl-all:hover {
  color: var(--nl-ink);
  text-decoration-color: var(--nl-ink);
}

.nl-social {
  margin: 1rem 0 0;
  font-size: 0.875rem;
  color: var(--nl-muted);
}

.nl-paper .anantys-rating-card .anantys-rating {
  justify-content: flex-start;
}

/* The shared app CTA (_unified_cta.html) is authored for the SEO pages'
   editorial register (serif, square corners), and the editorial layer in
   light-theme.css paints it from --seo-* tokens. Re-declaring those tokens
   here (the same trick as the blog's paper sheet) lets it take the site's
   dark shell and type roles without a specificity war. */
.nl-page .seo-conclusion {
  --seo-font-serif: var(--ap-font-title);
  --seo-text-primary: var(--ap-text);
  --seo-text-secondary: var(--ap-text-muted);
  --seo-accent: var(--ap-accent);
  --seo-bg-alt: var(--ap-surface-1);
  --seo-border: var(--ap-surface-3);
  --seo-radius: 1.5rem;

  padding: 1.5rem 0 0;
}

.nl-page .seo-action-box {
  padding: 1.75rem 1.5rem;
}

.nl-page .seo-action-title {
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Mint takes dark ink, as on the rest of the site (white on mint is 1.6:1). */
body.portal .nl-page .seo-action-box .btn.seo-cta-primary {
  border-radius: 9999px;
  font-family: var(--ap-font-body);
  font-weight: 600;
  color: #161a22;
}

body.portal .nl-page .seo-action-box .btn.seo-cta-primary:hover {
  background: var(--ap-accent-hover);
  border-color: var(--ap-accent-hover);
  color: #161a22;
}

/* ---------- Index ---------- */

.nl-index-head {
  max-width: 760px;
  padding: 2rem 0 2.5rem;
}

.nl-index-title {
  margin: 0;
  font-family: var(--ap-font-title);
  font-weight: 600;
  font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--ap-text);
}

.nl-index-lead {
  margin: 1rem 0 0;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--ap-text-muted);
}

.nl-index-head .nl-subscribe-form {
  margin-top: 1.5rem;
}

.nl-index-head .nl-input {
  background: var(--ap-surface-1);
  border-color: var(--ap-surface-3);
  color: var(--ap-text);
}

.nl-index-head .nl-btn--ghost {
  border-color: var(--ap-surface-3);
  color: var(--ap-text-secondary);
}

.nl-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nl-list-item a {
  display: block;
  padding: 1.75rem 0;
  border-top: 1px solid var(--nl-rule);
  color: inherit;
  text-decoration: none;
}

.nl-list-item:first-child a {
  border-top: 0;
  padding-top: 0;
}

.nl-list-date {
  font-family: var(--ap-font-mono);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  color: var(--nl-muted);
}

.nl-list-title {
  margin: 0.4rem 0 0;
  font-family: var(--ap-font-title);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--nl-ink);
}

.nl-list-item a:hover .nl-list-title {
  color: var(--nl-link);
}

.nl-list-excerpt {
  margin: 0.5rem 0 0;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--nl-ink-body);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nl-archive-title {
  margin: 0 0 1rem;
  font-family: var(--ap-font-title);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--nl-muted);
}

.nl-archive {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nl-archive li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.65rem 0;
  border-top: 1px solid var(--nl-rule);
}

.nl-archive a {
  color: var(--nl-ink);
  font-weight: 500;
  text-decoration: none;
}

.nl-archive a:hover {
  color: var(--nl-link);
}

.nl-archive .nl-list-date {
  white-space: nowrap;
}

/* ---------- Breakpoints ---------- */

@media (min-width: 768px) {
  .nl-page {
    padding: 3.5rem 0 4rem;
  }

  .nl-paper {
    border-radius: 2rem;
  }

  .nl-paper-inner {
    padding: 2.25rem 6rem 4rem;
  }

  .nl-page .seo-conclusion {
    --seo-radius: 2rem;
  }

  .nl-page .seo-action-box {
    padding: 2rem 6rem;
  }

  .nl-body h2 {
    font-size: 1.875rem;
  }

  .nl-body h3 {
    font-size: 1.5rem;
  }

  .nl-body blockquote {
    padding-left: 3.75rem;
    font-size: 1.6rem;
  }

  .nl-list-title {
    font-size: 1.75rem;
  }
}
