/* The blog and the CMS pages (memlow-cms/blog/), on top of site.css and seo.css. The look is the
   guides': a centred header, the article beside its table of contents, cards that lead on. */

/* ---- Post header --------------------------------------------------------------------------- */

a.pill { text-decoration: none; transition: background-color .15s ease; }
a.pill:hover { background: var(--paper-deep); color: var(--ink); }
.blog-head .byline2 a { color: inherit; text-decoration: none; }
.blog-head .byline2 a:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.blog-cover { max-width: 1080px; margin: 40px auto 0; overflow: hidden; border-radius: 32px; background: var(--card); box-shadow: var(--shadow), 0 0 0 1px var(--line); }
.blog-cover img { width: 100%; height: auto; }
@media (max-width: 640px) { .blog-cover { margin-top: 28px; border-radius: 22px; } }

.preview-ribbon {
  margin: 0; padding: 12px 24px; background: var(--butter); color: var(--butter-ink);
  font: 600 15px/1.4 var(--body); text-align: center;
}
.preview-ribbon strong {
  display: inline-block; margin-inline-end: 10px; padding: 3px 10px; border-radius: 999px;
  background: var(--ink); color: var(--paper); font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase;
}

/* ---- The reading column ---------------------------------------------------------------------- */

.read.no-toc { grid-template-columns: minmax(0, 760px); }
.read-main { min-width: 0; }
.toc li.sub a { padding-inline-start: 24px; font-size: 14px; }

.prose .ta-center { text-align: center; }
.prose .ta-right { text-align: right; }
.prose .ta-justify { text-align: justify; }
.prose h4 { margin: 26px 0 6px; color: var(--ink); font: 700 17.5px/1.35 var(--body); }
.prose li > p { margin: 0 0 .5em; }
.prose li > :is(ul, ol) { margin: 8px 0 0; }
.prose blockquote {
  margin: 30px 0; padding: 4px 0; padding-inline-start: 22px;
  border-inline-start: 4px solid var(--accent, var(--butter)); color: var(--ink); font-size: 1.06em;
}
.prose blockquote p:last-child { margin: 0; }
.prose hr { height: 0; margin: 48px 0; border: 0; border-top: 2px dashed var(--line); }
.prose mark { padding: 0 .15em; border-radius: 4px; background: var(--butter); color: var(--ink); }
.prose u { text-underline-offset: 3px; }
.prose pre {
  margin: 0 0 1.4em; padding: 18px 20px; border-radius: 18px; background: var(--paper-deep); color: var(--ink);
  overflow-x: auto; font: 500 15px/1.6 ui-monospace, "Cascadia Code", Consolas, monospace; tab-size: 4;
}
.prose pre code { padding: 0; border-radius: 0; background: none; font: inherit; }

/* Ordered lists that start later than 1 use the browser's own numbers. */
.read .prose ol.from { list-style: decimal; padding-inline-start: 1.6em; }
.read .prose ol.from > li { padding-inline-start: 6px; }
.read .prose ol.from > li::before { content: none; }
.read .prose ol.from > li::marker { font-weight: 800; color: var(--ink); }

/* Pictures and videos */
.prose .fig { margin: 34px 0; }
.prose .fig img { width: 100%; height: auto; border-radius: 20px; box-shadow: 0 0 0 1px var(--line); }
.prose figcaption { margin-top: 10px; font-size: 15px; line-height: 1.5; color: var(--muted); text-align: center; }
.prose .video { position: relative; margin: 34px 0; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 20px; background: #1E1B26; box-shadow: var(--shadow-soft); }
.prose .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Tables */
.prose .table-wrap { margin: 0 0 1.6em; overflow-x: auto; border-radius: 18px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.prose .table-wrap:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.5; }
.prose th, .prose td { padding: 12px 16px; text-align: start; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose thead th { background: var(--paper-deep); color: var(--ink); font-weight: 700; }
.prose tbody th { color: var(--ink); font-weight: 700; }
.prose tbody tr:last-child > * { border-bottom: 0; }
.prose :is(th, td) p { margin: 0 0 .5em; }
.prose :is(th, td) p:last-child { margin: 0; }

/* Callouts take a note colour (tone-* from seo.css) */
.prose .callout {
  margin: 0 0 1.4em; padding: 18px 22px; border-radius: 22px; color: var(--ink);
  background: color-mix(in srgb, var(--tone, var(--butter)) 82%, var(--card));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 6%, transparent);
}
.prose .callout p:last-child, .prose .callout ul:last-child, .prose .callout ol:last-child { margin-bottom: 0; }

/* Checklists, drawn like the app's */
.prose ul.tasks { list-style: none; padding-inline-start: 0; }
.read .prose ul.tasks > li { padding-inline-start: 0; }
.read .prose ul.tasks > li::before { content: none; }
.prose ul.tasks > li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; }
.prose ul.tasks .box {
  display: grid; place-items: center; width: 22px; height: 22px; margin-top: .3em; border-radius: 7px;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--ink) 40%, transparent);
}
.prose ul.tasks li.done > .box { background: var(--ink); box-shadow: none; }
.prose ul.tasks li.done > .box::after {
  content: ""; width: 10px; height: 6px; border: solid var(--paper); border-width: 0 0 2.5px 2.5px;
  transform: translateY(-1px) rotate(-45deg);
}
.prose ul.tasks li.done > .task-body { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 70%, transparent); }

.prose .faq.in-prose { margin: 30px 0; }

/* Tags under the article */
.post-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 40px 0 0; padding: 0; }
.post-tags li { padding: 5px 12px; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); font: 600 14px/1.3 var(--body); color: var(--ink-soft); }

/* ---- The author ------------------------------------------------------------------------------- */

.author-box {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; margin-top: 48px; padding: 26px;
  border-radius: 28px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line);
}
.author-box > img { width: 72px; height: 72px; border-radius: 20px; object-fit: cover; }
.author-box small { display: block; margin-bottom: 4px; font: 700 12.5px/1.3 var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.author-box h2 { margin: 0 0 6px; font: 800 24px/1.15 var(--display); letter-spacing: -.02em; }
.author-box h2 a { color: var(--ink); text-decoration: none; }
.author-box h2 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.author-box .tagline { margin: 0 0 10px; color: var(--ink-soft); font-size: 16px; font-weight: 600; }
.author-box p { font-size: 16px; line-height: 1.6; color: var(--muted); }
.author-box p:last-child { margin-bottom: 0; }
@media (max-width: 520px) { .author-box { grid-template-columns: 1fr; } }

.writes { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; padding: 0; }
.writes li { padding: 4px 12px; border-radius: 999px; background: var(--paper-deep); font: 600 13.5px/1.4 var(--body); color: var(--ink-soft); }

.author-hero .author-photo { width: 96px; height: 96px; margin: 0 auto 4px; border-radius: 28px; object-fit: cover; box-shadow: var(--shadow-soft); }
.author-hero .author-bio { max-width: 640px; margin: 0 auto 6px; color: var(--ink-soft); font-size: 17px; }
.author-hero .writes-label { margin: 18px 0 0; font: 700 13px/1.2 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.author-hero .writes { justify-content: center; }
.author-hero .writes li { background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }

/* ---- Lists of posts ------------------------------------------------------------------------- */

.cat-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 980px; margin: 8px auto 0; }
.cat-links a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px;
  background: var(--card); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-soft);
  font: 600 15px/1 var(--body); text-decoration: none;
}
.cat-links a:hover { background: var(--paper-deep); color: var(--ink); }
.cat-links a[aria-current="page"] { background: var(--ink); color: var(--paper); box-shadow: none; }
.cat-links b { font-weight: 700; opacity: .55; }

.gcards.one { grid-template-columns: minmax(0, 1fr); }
.gcards.one + .post-grid { margin-top: 20px; }

/* A card shows the cover picture, or a little note with the title on it. */
.post-card .stage, [dir="rtl"] .post-card .stage { padding: 0; }
.post-card .stage img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.post-card:hover .stage img { transform: scale(1.03); }
.note-mock {
  position: absolute; inset: 28px 28px auto; display: grid; gap: 10px; padding: 20px 22px 26px; border-radius: 18px;
  background: var(--card); box-shadow: 0 18px 40px -18px rgba(30, 27, 38, .45), inset 0 0 0 1px var(--line);
  transform: rotate(-2deg); transition: transform .25s ease;
}
.post-card:hover .note-mock { transform: rotate(0); }
.note-mock b {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; margin-bottom: 4px;
  font: 800 21px/1.15 var(--display); letter-spacing: -.02em; color: var(--ink);
}
.note-mock i { display: block; height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--ink) 12%, transparent); }
.note-mock i:nth-of-type(1) { width: 92%; }
.note-mock i:nth-of-type(2) { width: 76%; }
.note-mock i:nth-of-type(3) { width: 52%; }
.gcard.big .note-mock { inset: 48px 48px auto; padding: 30px 30px 36px; gap: 14px; }
.gcard.big .note-mock b { font-size: clamp(26px, 3vw, 34px); }
@media (max-width: 860px) { .gcard.big .note-mock { inset: 30px 30px auto; padding: 22px 22px 28px; } }

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 18px; margin-top: 44px; }
.pager span { color: var(--muted); font-size: 16px; font-weight: 600; }
.pager .btn { min-height: 48px; }
.pager .flip { transform: scaleX(-1); }
[dir="rtl"] .pager .flip { transform: none; }

.blog-empty {
  max-width: 640px; margin: 0 auto; padding: 48px 28px; border-radius: 28px; text-align: center;
  background: var(--card); box-shadow: inset 0 0 0 1px var(--line);
}
.blog-empty h2 { margin-bottom: 10px; font-size: clamp(26px, 3vw, 34px); }
.blog-empty p { color: var(--muted); }
.blog-empty .cta-row { justify-content: center; margin: 0; }

/* ---- Comments --------------------------------------------------------------------------------- */

.comments .h-small { margin-bottom: 20px; }
.no-comments { color: var(--muted); }
.comment-list { list-style: none; display: grid; gap: 14px; margin: 0 0 36px; padding: 0; }
.comment { padding: 20px 22px; border-radius: 22px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.comment header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 10px; }
.comment .avatar {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: var(--tone, var(--butter)); color: var(--ink); font: 800 16px/1 var(--display);
}
.comment-list > li:nth-child(4n+2) .avatar { --tone: var(--sky); }
.comment-list > li:nth-child(4n+3) .avatar { --tone: var(--sage); }
.comment-list > li:nth-child(4n+4) .avatar { --tone: var(--peach); }
.comment strong { font-size: 16.5px; }
.comment time { color: var(--muted); font-size: 14px; }
.comment p { margin: 0 0 .7em; color: var(--ink-soft); font-size: 16.5px; line-height: 1.6; overflow-wrap: anywhere; }
.comment p:last-child { margin: 0; }

.cm-form {
  position: relative; display: grid; gap: 16px; padding: 28px; border-radius: 28px;
  background: var(--card); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-soft);
}
.cm-form h3 { margin: 0; font-size: 22px; }
.cm-form .fine { margin: -6px 0 0; color: var(--muted); font-size: 15px; }
.cm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .cm-form { padding: 22px 18px; } .cm-row { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; align-content: start; }
.field label { font: 700 15px/1.3 var(--body); }
.field label span { color: var(--muted); font-weight: 500; }
.field :is(input, textarea) {
  width: 100%; min-height: 50px; padding: 12px 16px; border: 0; border-radius: 16px;
  background: var(--paper); color: var(--ink); font: 400 17px/1.5 var(--body); box-shadow: inset 0 0 0 1.5px var(--line);
}
.field textarea { min-height: 150px; resize: vertical; }
.field :is(input, textarea):focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.field [aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--late); }
.field-error { margin: 0; color: var(--late); font-size: 14.5px; font-weight: 600; }
.hp { position: absolute; inset-inline-start: -10000px; width: 1px; height: 1px; overflow: hidden; }
.cm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.cm-status { margin: 0; color: var(--ink-soft); font-weight: 600; }
.cm-status:empty { display: none; }
.cm-nojs { margin: 0; color: var(--muted); }
.js .cm-nojs { display: none; }
html:not(.js) .cm-actions { display: none; }

/* ---- Print: the article, without the rest ------------------------------------------------------ */

@media print {
  .sx.post-body { display: block !important; padding: 0; }
  .post-body .toc, .comments, .author-box, .post-tags, .preview-ribbon, .gh::before { display: none !important; }
  .read { display: block; }
  .gh { padding-top: 0; }
}
