/* /blog pages. Loaded after legal.css, which brings the homepage's fonts,
   colours, header and footer; this adds the list, the post and the CTA. */

:root {
  --mint: #cdefe3;
  --butter: #ffedb3;
  --sky-soft: #dcf1fd;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
}

/* ───────────── Preview mode bar (admin only) ───────────── */

.admin-bar {
  background: var(--ink);
  color: #fff;
  font: 700 14px/1 var(--display);
}

.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 40px;
}

.admin-bar nav {
  display: flex;
  gap: 20px;
}

.admin-bar a {
  color: #fff;
  text-decoration-color: rgba(255, 255, 255, 0.45);
  text-underline-offset: 3px;
}

/* ───────────── The list ───────────── */

.blog {
  max-width: calc(880px + var(--gutter) * 2);
  margin: 0 auto;
  padding: clamp(40px, 7vw, 88px) var(--gutter) clamp(72px, 9vw, 120px);
}

.blog-head h1,
.post h1 {
  font-family: var(--display);
  font-weight: 800;
  margin: 0;
  text-wrap: balance;
  font-size: clamp(38px, 5.6vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.blog-head p {
  margin: 14px 0 0;
  color: var(--ink-2);
  font-size: 19px;
}

.blog-head a,
.back a,
.drafts a {
  color: var(--purple-ink);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(113, 72, 220, 0.4);
}

.empty {
  margin: 48px 0 0;
  padding: 28px;
  border-radius: 24px;
  background: var(--lavender);
  font: 700 19px/1.3 var(--display);
  text-align: center;
}

.cards {
  list-style: none;
  margin: 48px 0 0;
  padding: 0;
  display: grid;
  gap: 28px;
}

.card a {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  text-decoration: none;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.card a:hover {
  border-color: #ddd2ea;
  box-shadow: 0 18px 40px -26px rgba(42, 30, 54, 0.35);
}

/* Screenshots are often portrait iPhone shots: show them whole, never cropped. */
.card-media {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  background:
    radial-gradient(60% 90% at 100% 0%, rgba(255, 217, 227, 0.9), transparent 70%),
    radial-gradient(70% 90% at 0% 100%, rgba(232, 224, 255, 0.95), transparent 70%),
    var(--peach-soft);
}

.card-media img {
  width: auto;
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: 16px;
}

.card-text {
  padding: 22px clamp(20px, 3vw, 28px) 26px;
}

.card h2 {
  margin: 0;
  font: 800 clamp(24px, 2.6vw, 28px) / 1.15 var(--display);
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.card time {
  display: block;
  margin-top: 8px;
  font-size: 15px;
  color: var(--ink-3);
}

.card p {
  margin: 10px 0 0;
  color: var(--ink-2);
  line-height: 1.55;
  text-wrap: pretty;
}

@media (min-width: 760px) {
  .card a:has(.card-media) {
    grid-template-columns: 280px minmax(0, 1fr);
    align-items: center;
  }

  .card-media {
    height: 100%;
  }

  .card-media img {
    max-height: 320px;
  }
}

/* ───────────── A post ───────────── */

.post {
  max-width: calc(var(--read) + var(--gutter) * 2);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) var(--gutter) clamp(72px, 9vw, 120px);
}

.status-banner {
  margin: 0 0 28px;
  padding: 14px 18px;
  border-radius: 16px;
  font: 800 17px/1.3 var(--display);
  background: var(--butter);
}

.status-banner.status-scheduled {
  background: var(--sky-soft);
}

.status-banner.status-archived {
  background: var(--line);
}

.back {
  margin: 0 0 20px;
  font-size: 15px;
}

.byline {
  margin: 16px 0 0;
  font-size: 15px;
  color: var(--ink-3);
}

.featured {
  margin: 32px 0 0;
  padding: clamp(16px, 4vw, 28px);
  border-radius: 28px;
  display: flex;
  justify-content: center;
  background:
    radial-gradient(60% 90% at 100% 0%, rgba(255, 217, 227, 0.9), transparent 70%),
    radial-gradient(70% 90% at 0% 100%, rgba(232, 224, 255, 0.95), transparent 70%),
    var(--peach-soft);
}

.featured img {
  width: auto;
  max-width: 100%;
  max-height: min(78vh, 720px);
  object-fit: contain;
  border-radius: 18px;
}

/* body_html from Blog 3. */
.prose {
  margin-top: 36px;
  line-height: 1.65;
  overflow-wrap: break-word;
}

.prose > :first-child {
  margin-top: 0;
}

.prose h2,
.prose h3,
.prose h4 {
  font-family: var(--display);
  font-weight: 800;
  text-wrap: balance;
}

.prose h2 {
  font-size: clamp(25px, 3vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 48px 0 14px;
}

.prose h3 {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.3;
  margin: 36px 0 8px;
}

.prose h4 {
  font-size: 18px;
  font-weight: 700;
  margin: 28px 0 6px;
}

.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose figure,
.prose table,
.prose pre {
  margin: 0 0 18px;
}

.prose p {
  text-wrap: pretty;
}

.prose ul,
.prose ol {
  padding-left: 1.3em;
}

.prose li {
  margin: 0 0 8px;
}

.prose li::marker {
  color: var(--orange);
}

.prose strong {
  font-weight: 650;
}

.prose a {
  color: var(--purple-ink);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(113, 72, 220, 0.4);
}

.prose a:hover {
  text-decoration-color: currentColor;
}

/* <a class="btn"> in a post: the site's orange button, not a prose link. */
.prose a.btn {
  color: #fff;
  text-decoration: none;
}

.prose img,
.prose video {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(78vh, 720px);
  height: auto;
  margin: 28px auto;
  border-radius: 18px;
  object-fit: contain;
}

.prose figure img {
  margin-bottom: 10px;
}

.prose figcaption {
  font-size: 15px;
  color: var(--ink-3);
  text-align: center;
}

.prose blockquote {
  padding: 4px 0 4px 18px;
  border-left: 4px solid var(--peach-soft);
  color: var(--ink-2);
}

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

.prose code {
  font: 0.88em/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #f6f3f8;
  border-radius: 6px;
  padding: 0.12em 0.36em;
}

.prose pre {
  overflow-x: auto;
  padding: 16px 18px;
  border-radius: 16px;
  background: #f6f3f8;
  -webkit-overflow-scrolling: touch;
}

.prose pre code {
  background: none;
  padding: 0;
  font-size: 15px;
}

/* Tables scroll sideways on a phone instead of squashing. */
.prose table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 16px;
  -webkit-overflow-scrolling: touch;
}

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

.prose th {
  font-weight: 650;
  white-space: nowrap;
}

/* ───────────── App Store CTA ───────────── */

.cta {
  margin: 56px 0 0;
  padding: 30px clamp(20px, 4vw, 34px);
  border-radius: 28px;
  display: grid;
  justify-items: start;
  gap: 12px;
  background:
    radial-gradient(60% 90% at 100% 0%, rgba(255, 217, 227, 0.9), transparent 70%),
    radial-gradient(70% 90% at 0% 100%, rgba(232, 224, 255, 0.95), transparent 70%),
    var(--peach-soft);
}

.cta-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  box-shadow: 0 0 0 1px rgba(42, 30, 54, 0.06);
}

.cta h2 {
  margin: 4px 0 0;
  font: 800 clamp(24px, 3vw, 28px) / 1.15 var(--display);
  letter-spacing: -0.015em;
}

.cta p {
  margin: 0;
  color: var(--ink-2);
}

.cta .store {
  margin-top: 8px;
}

/* ───────────── Drafts list (admin only) ───────────── */

.drafts {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.drafts li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 14px;
  align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.drafts a {
  font-weight: 650;
}

.drafts-meta {
  grid-column: 2;
  font-size: 14px;
  color: var(--ink-3);
  overflow-wrap: anywhere;
}

.pill {
  grid-row: span 2;
  padding: 5px 10px;
  border-radius: 999px;
  font: 700 13px/1 var(--display);
  white-space: nowrap;
  background: var(--butter);
}

.pill.status-published {
  background: var(--mint);
}

.pill.status-scheduled {
  background: var(--sky-soft);
}

.pill.status-archived {
  background: var(--line);
}

@media (max-width: 600px) {
  .blog-head p {
    font-size: 17px;
  }

  .drafts li {
    grid-template-columns: minmax(0, 1fr);
  }

  .pill {
    grid-row: auto;
    justify-self: start;
    white-space: normal;
    line-height: 1.25;
  }

  .drafts-meta {
    grid-column: 1;
  }
}
