/* Blog pages: the article column, figures, tables, FAQ, post cards. Loaded after site.css, which supplies the
   tokens (--ink, --muted, --line, --surface, --shadow, --display ...) and light/dark. Every rule here is scoped to
   a blog class, so the pages that load it only gain the blog parts. */

/* The header link to the blog while reading a post (on the blog index it is aria-current="page"). */
.site-head nav a[aria-current="true"] { color: var(--ink); background: var(--paper-2); }

/* ---- Frame ---- */

.blog { padding-bottom: 8px; }

.crumbs { margin: 28px 0 0; font-size: 0.875rem; color: var(--muted); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 2px 0; list-style: none; margin: 0; padding: 0; }
.crumbs li + li::before { content: "›"; margin: 0 0.55em; opacity: 0.7; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); }
.crumbs [aria-current="page"] { color: var(--ink); }

.post { width: min(100%, 42rem); margin-inline: auto; }
.blog > .crumbs { max-width: 100%; }

.post-head { padding: 22px 0 8px; }
.post-head h1 {
  margin-top: 10px;
  font-size: clamp(2.125rem, 8vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.02;
}
.byline { margin: 18px 0 0; color: var(--muted); font-size: 0.9375rem; line-height: 1.5; }
.byline a { color: var(--ink); text-decoration: none; font-weight: 600; }
.byline a:hover { text-decoration: underline; }

.preview-banner {
  margin: 20px 0 0; padding: 10px 14px; border-radius: 12px;
  background: var(--glow-sun); border: 1px dashed var(--muted); color: var(--ink); font-size: 0.875rem;
}

/* ---- Article text ---- */

.prose { font-size: 1.0625rem; line-height: 1.7; overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 1.1em 0; }
/* The opening answer is what search engines and assistants quote, so it reads as the lead. */
.prose > p:first-child { font-size: 1.1875rem; line-height: 1.6; }
.prose h2 {
  margin: 2.6em 0 0.6em;
  font-size: clamp(1.625rem, 5.5vw, 2.125rem);
  font-weight: 700; letter-spacing: -0.035em; line-height: 1.1;
  scroll-margin-top: 16px;
}
.prose h3 {
  margin: 2em 0 0.4em;
  font: 650 1.25rem/1.3 var(--body); letter-spacing: -0.01em;
  scroll-margin-top: 16px;
}
.prose ul, .prose ol { padding-left: 1.3rem; margin: 1.1em 0; }
.prose li { margin: 0.35em 0; }
.prose li::marker { color: var(--muted); }
.prose a { overflow-wrap: anywhere; }
.prose blockquote {
  margin: 1.6em 0; padding: 0.2em 0 0.2em 1.1em;
  border-left: 3px solid var(--line); color: var(--muted); font-size: 1.0625rem;
}
.prose blockquote p { margin: 0.6em 0; }
.prose code { font: 500 0.9em var(--mono); background: var(--paper-2); padding: 0.1em 0.35em; border-radius: 6px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.prose img { border-radius: 16px; }

/* Tables scroll sideways inside their own box on a phone, instead of widening the page. */
.table-wrap {
  margin: 1.6em 0; overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
}
.table-wrap:focus-visible { outline-offset: 2px; }
.table-wrap table { width: 100%; min-width: 30rem; border-collapse: collapse; font-size: 0.9375rem; line-height: 1.45; }
.table-wrap th, .table-wrap td { padding: 0.7rem 0.9rem; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
.table-wrap thead th { border-top: 0; background: var(--paper-2); font-weight: 650; white-space: nowrap; }
.table-wrap tbody tr:first-child td { border-top: 0; }

/* ---- Figures ---- */

.fig { margin: 2.2em 0; }
.fig img { width: 100%; height: auto; border-radius: 20px; box-shadow: var(--shadow); background: var(--paper-2); }
.fig figcaption { margin-top: 12px; color: var(--muted); font-size: 0.9375rem; line-height: 1.5; }
.fig-badge {
  display: block; margin-top: 10px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  font-size: 0.8125rem; line-height: 1.45;
}

.fig-stage { position: relative; }
.fig-stage .photo-tag { z-index: 2; }

/* The slider keeps the pictures' own shape (the app page's one is a tall phone portrait). */
.post .fig-compare { max-width: none; justify-self: auto; }
.post .fig-compare .compare-stage { aspect-ratio: 3 / 2; border-radius: 20px; }
.post .fig-compare .compare-stage img { border-radius: 0; box-shadow: none; }
.post .fig-compare figcaption { margin: 12px 0 0; max-width: none; text-align: left; font-size: 0.9375rem; line-height: 1.5; }

/* Two to four lens tiles of one scene. Stacked on a phone so each stays large enough to read. */
.lens-tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .lens-tiles.n-2 { grid-template-columns: repeat(2, 1fr); }
  .lens-tiles.n-3 { grid-template-columns: repeat(3, 1fr); }
  .lens-tiles.n-4 { grid-template-columns: repeat(2, 1fr); }
}
.lens-tiles li { display: grid; gap: 8px; align-content: start; }
.lens-tiles img { border-radius: 16px; }
.tile-label { font: 600 0.8125rem/1.3 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }

/* The contact sheet of 30 lenses is wider than the text column, so the tiles stay readable. */
.fig-grid {
  width: min(100vw - 32px, 64rem);
  position: relative; left: 50%; transform: translateX(-50%);
}
.fig-grid figcaption { max-width: 42rem; margin-inline: auto; }
.fig-zoom { display: block; border-radius: 20px; cursor: zoom-in; }

/* Stand-in for a picture that has not been made yet (preview builds only). */
.fig-missing {
  display: grid; place-items: center; width: 100%;
  border: 2px dashed var(--line); border-radius: 20px; background: var(--paper-2);
  color: var(--muted); font: 500 0.8125rem/1.4 var(--mono); text-align: center; padding: 16px;
}
.fig-missing-inline { color: var(--muted); font-style: italic; }

/* ---- App box and simulator card ---- */

.cta {
  display: grid; gap: 16px; margin: 2.4em 0; padding: 20px 22px 22px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow);
}
.cta p { margin: 0; }
.cta-title { font: 700 1.375rem/1.2 var(--display); letter-spacing: -0.02em; }
.cta-copy p + p { margin-top: 6px; color: var(--muted); font-size: 0.9375rem; line-height: 1.5; }
.cta .get { margin: 0; }
.cta-more { font-size: 0.9375rem; }

.sim-card {
  display: grid; gap: 4px; margin: 2.2em 0; padding: 18px 22px;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 22px;
  color: var(--ink); text-decoration: none;
  transition: transform 250ms var(--ease), border-color 250ms var(--ease);
}
.sim-card:hover { transform: translateY(-2px); border-color: var(--ink); }
.sim-title { font: 700 1.25rem/1.2 var(--display); letter-spacing: -0.02em; }
.sim-text { color: var(--muted); font-size: 0.9375rem; line-height: 1.5; }
.sim-go { margin-top: 6px; font-weight: 600; font-size: 0.9375rem; color: var(--link); }

/* ---- After the article: FAQ, sources, how we made the images, author ---- */

.faq, .sources { margin-top: 3.2rem; }
.faq h2, .sources h2, .how-made h2, .related h2 {
  font-size: clamp(1.625rem, 5.5vw, 2.125rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1.1;
}
.faq-item { padding: 1.2rem 0; border-top: 1px solid var(--line); }
.faq-item:first-of-type { margin-top: 1rem; }
.faq-item h3 { font: 650 1.1875rem/1.3 var(--body); letter-spacing: -0.01em; }
.faq-item p { margin: 0.5rem 0 0; line-height: 1.65; }

.sources ol { margin: 1rem 0 0; padding-left: 1.4rem; font-size: 0.9375rem; line-height: 1.55; }
.sources li { margin: 0.5em 0; overflow-wrap: anywhere; }

.how-made {
  margin-top: 3rem; padding: 20px 22px 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
}
.how-made h2 { font-size: 1.25rem; letter-spacing: -0.02em; }
.how-made p { color: var(--muted); font-size: 0.9375rem; line-height: 1.6; }

.author-box { display: flex; align-items: center; gap: 16px; margin: 2.4rem 0 0; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.author-avatar {
  flex: none; width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center; background: var(--ink); color: var(--paper);
  font: 700 1.5rem/1 var(--display);
}
.author-box p { margin: 0; }
.author-name { font: 700 1.125rem/1.3 var(--display); letter-spacing: -0.01em; }
.author-role { color: var(--muted); font-size: 0.9375rem; line-height: 1.4; }
.author-box p:last-child { margin-top: 4px; font-size: 0.9375rem; }

/* ---- Post cards: blog index, related posts, the app page ---- */

.related { margin-top: 4rem; }
.related h2 { margin-bottom: 1.2rem; }

.post-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .post-cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .post-cards.post-cards-3 { grid-template-columns: repeat(3, 1fr); } }

.post-card {
  position: relative; display: grid; grid-template-rows: auto 1fr; overflow: hidden;
  border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow);
  transition: transform 300ms var(--ease);
}
.post-card:hover { transform: translateY(-3px); }
.post-card-media { background: var(--paper-2); aspect-ratio: 3 / 2; overflow: hidden; }
.post-card-media img, .post-card-media .fig-missing { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.post-card-body { padding: 18px 20px 22px; display: grid; gap: 8px; align-content: start; }
.post-card-body p { margin: 0; }
.post-card-body > p:last-child { color: var(--muted); font-size: 0.9375rem; line-height: 1.5; }
.post-card h2, .post-card h3 { font-size: 1.375rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
.post-card h2 a, .post-card h3 a { color: inherit; text-decoration: none; }
/* The title's link covers the whole card. */
.post-card h2 a::after, .post-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: 24px; }
.post-card h2 a:focus-visible, .post-card h3 a:focus-visible { outline: none; }
.post-card:has(h2 a:focus-visible), .post-card:has(h3 a:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }

.blog-head { padding: 28px 0 28px; }
.blog-head h1 {
  max-width: 18ch; font-size: clamp(2.5rem, 10vw, 4.5rem); font-weight: 800; letter-spacing: -0.05em; line-height: 0.98;
}
.blog-intro { max-width: 36rem; margin: 22px 0 0; font-size: clamp(1.125rem, 4.4vw, 1.3125rem); line-height: 1.5; color: var(--muted); }
.blog-feed { margin: 14px 0 0; font-size: 0.9375rem; }
.blog-empty { padding: 28px; border: 1px dashed var(--line); border-radius: 22px; color: var(--muted); }
.blog-cta { margin-top: 3rem; max-width: 42rem; }

/* "From the blog" on the app page. */
.from-blog .section-link { font-weight: 600; font-size: 0.9375rem; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .post-card, .sim-card { transition: none; }
}
