/*
 * thelastapi blog. On top of site.css: the shared tokens (tokens.css), the console's
 * tabs, inputs, pills and buttons, light and dark. Quiet, monochrome, line-art covers;
 * blue only on the short answer's label and focus. Mobile first.
 */

.ico {
  display: block;
  flex: none;
}

/* ── tiles: a line icon on a quiet wash ── */
.tile {
  display: inline-grid;
  place-items: center;
  flex: none;
  background: var(--wash-2);
  color: var(--fg-2);
  border: 1px solid var(--hair-2);
}

/* ── hero ── */
.blog-hero {
  position: relative;
  padding: clamp(40px, 8vw, 96px) 0 clamp(24px, 4vw, 40px);
  background: var(--glow);
  overflow: hidden;
}
.blog-hero .wrap {
  position: relative;
}
.blog-hero .pill {
  margin-bottom: 20px;
}
.blog-title {
  font-size: clamp(38px, 7vw, 76px);
  line-height: 1;
  max-width: 13em;
}
.blog-title .soft {
  color: var(--muted);
}
.blog-hero .lede {
  margin-top: 20px;
  max-width: 38em;
}
.blog-hero .lede a {
  color: var(--fg);
}

/* ── breadcrumbs ── */
.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-small);
  color: var(--muted);
}
.crumbs li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.crumbs li + li::before {
  content: "/";
  color: var(--hair-2);
}
.crumbs a {
  color: var(--muted);
  text-decoration: none;
}
.crumbs a:hover {
  color: var(--fg);
}
.crumbs [aria-current] {
  color: var(--fg-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 28ch;
}

/* ── section labels ── */
.sec-label {
  margin: 0 0 16px;
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--muted);
}

/* ── index: featured and topics ── */
.featured {
  margin-bottom: 48px;
}

/* ── try it ── */
.try {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin: 48px 0 64px;
  padding: 24px;
  border-radius: var(--r-card);
  border: 1px solid var(--hair-2);
  background:
    radial-gradient(80% 120% at 0% 0%, var(--wash-2), transparent 60%),
    radial-gradient(70% 120% at 100% 100%, var(--accent-soft), transparent 60%), var(--card);
  overflow: hidden;
}
.try-art {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: var(--r-inner);
  background: var(--wash-2);
  border: 1px solid var(--hair-2);
  color: var(--fg-2);
  transform: rotate(-6deg);
}
.try h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -0.025em;
}
.try p {
  margin: 8px 0 18px;
  color: var(--fg-2);
  font-size: 15.5px;
  max-width: 40em;
}
.try .cta-row {
  margin: 0;
  flex-wrap: wrap;
}

/* ── the post ── */
.post-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px var(--gutter) 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.post {
  min-width: 0;
  max-width: 740px;
  width: 100%;
  margin: 0 auto;
}
.post-side {
  display: none;
}
.post-head {
  margin: 22px 0 26px;
}
.post-tag {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  background: var(--wash-2);
  border: 1px solid var(--hair-2);
  color: var(--fg);
  font-size: var(--fs-small);
  font-weight: 600;
  text-decoration: none;
}
.post-tag .tile {
  border-radius: 999px;
  background: var(--card);
}
.post-head h1 {
  margin: 18px 0 0;
  font-family: var(--display);
  font-size: clamp(32px, 5.2vw, 52px);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.post-desc {
  margin: 16px 0 0;
  font-size: clamp(17px, 2vw, 19.5px);
  line-height: 1.55;
  color: var(--fg-2);
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-top: 18px;
  font-size: var(--fs-small);
  color: var(--muted);
}
.post-meta a {
  color: var(--muted);
}
.post-prose {
  font-size: 17px;
  line-height: 1.75;
}
.post-prose p,
.post-prose li {
  color: var(--fg-2);
}
.post-prose p strong,
.post-prose li strong {
  color: var(--fg);
}
/* The answer comes first: the opening paragraph is set apart, for readers and answer engines. */
.post-prose > p:first-child {
  position: relative;
  margin: 0 0 28px;
  padding: 18px 20px 18px 22px;
  border-radius: var(--r-inner);
  background: var(--card);
  border: 1px solid var(--hair);
  color: var(--fg);
  font-size: 17.5px;
}
.post-prose > p:first-child::before {
  content: "The short answer";
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--blue);
}
.post-prose h2 {
  font-size: clamp(24px, 3vw, 29px);
}
.post-prose .codeblock {
  margin: 22px 0;
}
.toc-m {
  margin: 0 0 28px;
  border: 1px solid var(--hair);
  border-radius: var(--r-inner);
  background: var(--card);
}
.toc-m summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 14.5px;
}
.toc-m summary::-webkit-details-marker {
  display: none;
}
.toc-m summary span {
  color: var(--muted);
  font-weight: 500;
}
.toc-m ul {
  margin: 0;
  padding: 0 16px 12px 30px;
  font-size: 14.5px;
}
.toc-m li {
  margin: 6px 0;
}
.toc-m a {
  color: var(--fg-2);
  text-decoration: none;
}
.post-faq {
  margin-top: 44px;
}
.post-faq h2 {
  position: relative;
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: clamp(24px, 3vw, 29px);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.post-faq summary {
  font-size: 18px;
}
.post-faq p {
  color: var(--fg-2);
}

/* ── related ── */
.related {
  padding: 48px 0 64px;
  border-top: 1px solid var(--hair);
  background: var(--bg-elev);
}

/* ── wider screens ── */
@media (min-width: 700px) {
  .try {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 24px;
    padding: 30px 32px;
  }
}
@media (min-width: 1180px) {
  .post-wrap {
    grid-template-columns: minmax(0, 740px) 220px;
    justify-content: center;
    gap: 64px;
  }
  .post {
    margin: 0;
  }
  .post-side {
    display: block;
  }
  .post-side .toc {
    padding-top: 120px;
  }
  .toc-m {
    display: none;
  }
}
@media (max-width: 640px) {
  .post-prose {
    font-size: 16.5px;
  }
  .post-prose > p:first-child {
    font-size: 16.5px;
    padding: 16px;
  }
  .crumbs [aria-current] {
    max-width: 18ch;
  }
}

/* ── listing: index, topics, related ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.lin {
  padding: clamp(48px, 8vw, 96px) 0 112px;
}
.ltitle {
  font-family: var(--display);
  font-size: clamp(44px, 7vw, 76px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
  margin: 0 0 36px;
}
.llede {
  color: var(--muted);
  max-width: 62ch;
  margin: -16px 0 32px;
  font-size: 17px;
  line-height: 1.55;
}
.lbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 56px;
}
/* The topic tabs are the console's .tab pills; this is the scrolling row. */
.ltabs {
  display: flex;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
  mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
  padding-right: 32px;
}
.ltabs::-webkit-scrollbar {
  display: none;
}
.ltools {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: none;
}
/* The search field is the console's .input, with the icon inside. */
.lsearch {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 300px;
  color: var(--muted);
  cursor: text;
}
.lsearch input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: 0;
  color: var(--fg);
  font: inherit;
  font-size: 15px;
}
.lsearch input::placeholder {
  color: var(--muted);
}
.lsearch input::-webkit-search-cancel-button {
  filter: grayscale(1);
}
.lrss {
  color: var(--muted);
  display: grid;
  place-items: center;
  transition: color 0.15s;
}
.lrss:hover {
  color: var(--fg);
}
.lgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  row-gap: 72px;
  margin: 0 -28px;
}
.lcard {
  display: flex;
  flex-direction: column;
  padding: 0 28px;
  border-left: 1px solid var(--hair);
  color: inherit;
  text-decoration: none;
  content-visibility: auto;
  contain-intrinsic-size: auto 470px;
}
.lcard:nth-child(3n + 1),
.lgrid.is-filtered .lcard {
  border-left-color: transparent;
}
.lcard[hidden] {
  display: none;
}
.lcover {
  aspect-ratio: 600 / 340;
  border: 1px solid var(--hair);
  border-radius: var(--r-inner);
  background: var(--card);
  color: var(--fg);
  overflow: hidden;
  margin-bottom: 30px;
  transition: border-color 0.2s;
}
.cover-art {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0.62;
  transition: opacity 0.25s;
}
.lcard:hover .lcover {
  border-color: var(--hair-2);
}
.lcard:hover .cover-art {
  opacity: 0.9;
}
.lcard h3 {
  font-family: var(--display);
  font-size: 20px;
  line-height: 1.25;
  font-weight: 750;
  letter-spacing: -0.028em;
  margin: 0 0 12px;
  color: var(--fg);
}
.lcard p {
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.6;
  margin: 0 0 24px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lmeta {
  margin-top: auto;
  display: flex;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  opacity: 0.85;
}
.lempty {
  color: var(--muted);
  padding: 48px 0;
}
.lempty a {
  color: var(--fg);
}
.related .lgrid {
  margin-top: 0;
}

@media (max-width: 1000px) {
  .lgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .lcard:nth-child(3n + 1) {
    border-left-color: var(--hair);
  }
  .lcard:nth-child(2n + 1) {
    border-left-color: transparent;
  }
  .lbar {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .ltools {
    justify-content: space-between;
  }
  .lsearch {
    flex: 1;
    width: auto;
  }
}
@media (max-width: 640px) {
  .lgrid {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 48px;
    margin: 0;
  }
  .lcard {
    padding: 0;
    border-left: 0;
  }
  .lbar {
    margin-bottom: 40px;
  }
}
