/* -- The blog ------- */
/* Long-form reading, in the site's "Glass, neutral" design: the grey page, the article on a white
   card, a translucent bar on top. The measure is narrow on purpose: an article is read, not
   scanned, and a line of prose past about 70 characters is measurably harder to follow back to
   the start of the next one. */

/* Headings and prose both use the reader's own system face (San Francisco on Apple devices, Inter
   where there is none), which is already on their machine and costs no request. */
.blog-page {
  line-height: 1.7;
  font-family: var(--body);
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* The landing page sets `p { margin: 0 }` because every block there positions itself. An article
   is the opposite: paragraphs are the structure, and without space between them the text becomes
   one grey slab. */
.blog-page article p,
.blog-page .blog-lead,
.blog-page blockquote p,
.blog-page .blog-cta p {
  margin-block: 0 18px;
}

.blog-page article p:last-child {
  margin-bottom: 0;
}

.blog-shell {
  width: min(720px, calc(100% - 40px));
  margin-inline: auto;
}

/* -- Chrome ------- */

/* The one floating layer: a translucent bar, blurred, with a hairline, as a navigation bar on iOS. */
.blog-top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--glass);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  box-shadow:
    inset 0 -1px 0 var(--glass-edge),
    0 1px 0 var(--glass-hairline);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .blog-top {
    background: var(--glass-solid);
  }
}

.blog-top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px 24px;
  flex-wrap: wrap;
  padding-block: 10px;
}

.blog-home {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.022em;
  text-decoration: none;
  color: var(--ink);
}

.blog-languages {
  display: flex;
  gap: 4px 16px;
  flex-wrap: wrap;
  font-size: 0.92rem;
}

.blog-languages a {
  color: var(--muted);
  text-decoration: none;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}

.blog-languages a:hover {
  color: var(--ink);
}

.blog-languages a[aria-current="true"] {
  color: var(--ink);
  font-weight: 600;
}

.blog-foot {
  margin-top: 48px;
  padding-block: 28px;
}

.blog-foot .blog-shell {
  display: flex;
  gap: 12px 28px;
  flex-wrap: wrap;
  font-size: 0.92rem;
}

.blog-foot a {
  color: var(--muted);
}

.blog-foot a:hover {
  color: var(--ink);
}

/* -- The article ------- */

.blog-page main {
  padding-top: 24px;
}

/* The article is a white card on the grey page, borderless, as a grouped section on iOS. */
.blog-page article {
  padding: 40px 48px 48px;
  border-radius: 32px;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(29, 29, 31, 0.04);
}

.blog-kicker {
  margin: 0;
  font-size: 0.9rem;
}

.blog-kicker a {
  color: var(--muted);
}

.blog-page h1,
.blog-page h2 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

.blog-page h1 {
  font-size: clamp(1.9rem, 5.6vw, 2.8rem);
  line-height: 1.1;
  margin: 12px 0 14px;
}

.blog-page h2 {
  font-size: clamp(1.35rem, 3.4vw, 1.7rem);
  line-height: 1.2;
  margin: 44px 0 12px;
}

.blog-page h3 {
  font-family: var(--display);
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 30px 0 8px;
}

.blog-meta {
  display: flex;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 22px;
}

.blog-lead {
  font-size: 1.12rem;
  color: var(--muted);
  margin: 0 0 30px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.blog-page article p,
.blog-page article li {
  overflow-wrap: break-word;
}

.blog-page article ul,
.blog-page article ol {
  padding-inline-start: 22px;
}

.blog-page article li {
  margin-block: 6px;
}

/* Links are ink with an underline, never the browser's blue. */
.blog-page article a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: rgba(29, 29, 31, 0.35);
  text-underline-offset: 3px;
}

.blog-page article a:hover {
  text-decoration-color: currentColor;
}

.blog-page code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.9em;
  background: var(--fill-soft);
  border-radius: 6px;
  padding: 1px 5px;
}

.blog-page blockquote {
  margin: 26px 0;
  padding: 16px 20px;
  border-radius: 16px;
  background: var(--fill-soft);
  color: var(--ink);
}

.blog-page hr {
  margin: 40px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

/* A table of tense markers is wider than the measure on a phone, so it scrolls rather than
   squeezing the words into one letter per line. */
.blog-table {
  overflow-x: auto;
  margin: 24px 0;
  border-radius: 16px;
  background: var(--fill-soft);
}

.blog-table table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.96rem;
}

.blog-table th,
.blog-table td {
  text-align: start;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
}

.blog-table th {
  font-family: var(--display);
  font-weight: 600;
  background: var(--fill);
}

.blog-table tr:last-child td {
  border-bottom: 0;
}

/* -- The way out ------- */
/* Every article ends where the site wants the reader to go. It is the same offer the landing
   page makes, in the language the article is written in. */

.blog-cta {
  margin: 20px 0 0;
  padding: 32px 32px 34px;
  border-radius: 32px;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(29, 29, 31, 0.04);
}

.blog-cta h2 {
  margin: 0 0 8px;
  font-size: clamp(1.3rem, 3.2vw, 1.6rem);
}

.blog-cta p {
  margin: 0 0 20px;
  color: var(--muted);
}

/* The graphite glass pill of the funnel's main action. */
.blog-cta-button {
  display: inline-block;
  padding: 15px 28px;
  border-radius: 999px;
  background: var(--graphite);
  box-shadow: var(--graphite-shadow);
  color: #fff;
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.022em;
  text-decoration: none;
}

/* A button inside the text (the level test page) is still a button, not an underlined link. */
.blog-page article .blog-cta-button {
  color: #fff;
  text-decoration: none;
}

.blog-cta-button:hover {
  background: var(--graphite-hover);
}

/* -- After an article: the level test and what to read next ------- */
/* Articles linked only to the home page and the funnel, so they passed no weight to one another or
   to the test (docs/seo/strategy.md, technical audit). */
.blog-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

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

.blog-page .blog-crumbs a:hover {
  color: var(--ink);
}

.blog-test,
.blog-related {
  margin: 20px 0 0;
  padding: 28px 32px 30px;
  border-radius: 32px;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(29, 29, 31, 0.04);
}

.blog-test h2,
.blog-related h2 {
  margin: 0 0 8px;
  font-size: clamp(1.15rem, 3vw, 1.35rem);
}

.blog-test p {
  margin: 0 0 18px;
  color: var(--muted);
}

/* A quieter pill than the funnel's: the test is one step, not the page's main action. */
.blog-test-button {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 600;
  text-decoration: none;
}

.blog-test-button:hover {
  background: var(--graphite);
  color: #fff;
}

.blog-related ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.blog-related a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line);
}

/* -- The index ------- */

.blog-list {
  list-style: none;
  padding: 0;
  margin: 30px 0 0;
  display: grid;
  gap: 12px;
}

.blog-card a {
  display: block;
  padding: 24px 26px;
  border-radius: 24px;
  background: var(--card);
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 2px rgba(29, 29, 31, 0.04);
  transition: transform 120ms ease;
}

.blog-card a:active {
  transform: scale(0.99);
}

.blog-card h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.blog-card p {
  margin: 0;
  color: var(--muted);
}

.blog-card .blog-meta {
  margin: 12px 0 0;
}

.blog-languages-list {
  list-style: none;
  padding: 0;
  margin: 30px 0 0;
  display: grid;
  gap: 12px;
}

.blog-languages-list a {
  display: block;
  padding: 18px 22px;
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(29, 29, 31, 0.04);
  text-decoration: none;
  color: inherit;
}

@media (max-width: 560px) {
  .blog-shell {
    width: calc(100% - 24px);
  }

  .blog-top .blog-shell,
  .blog-foot .blog-shell,
  .blog-page main > h1,
  .blog-page main > .blog-lead {
    padding-inline: 8px;
  }

  .blog-page article {
    padding: 28px 20px 32px;
    border-radius: 26px;
  }

  .blog-cta,
  .blog-test,
  .blog-related {
    padding: 26px 20px 28px;
    border-radius: 26px;
  }
}
