/* ClickClock blog: article and blog home. Builds on site.css (tokens, glass, nav, footer).
   Pages are written by scripts/build-blog.py. */

.post, .blog-home { position: relative; padding-block: clamp(118px, 13vw, 168px) 48px; }
.post-wrap, .blog-wrap { max-width: 800px; }
.blog-wrap { max-width: 1000px; }
.blog-home { min-height: 78vh; }

.crumbs { display: flex; gap: 8px; font-size: 15px; font-weight: 550; color: var(--ink-2); margin-bottom: 18px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; text-underline-offset: 4px; }

.post h1 { font-size: clamp(38px, 5.4vw, 62px); line-height: 1.04; letter-spacing: -.035em; }
.post-dek { margin: 18px 0 0; font-size: clamp(19px, 1.7vw, 22px); line-height: 1.45; font-weight: 450; color: var(--ink-2); max-width: 36em; }

.byline { display: flex; align-items: center; gap: 14px; margin: 26px 0 30px; }
.byline .avatar { width: 46px; height: 46px; font-size: 20px; }
.author-card .avatar { width: 72px; height: 72px; }
.byline-name { display: block; font-weight: 650; font-size: 16px; }
.byline-meta { display: block; font-size: 15px; font-weight: 500; color: var(--ink-2); }

.avatar { border-radius: 50%; flex: none; object-fit: cover; }
.avatar-initial {
  display: inline-grid; place-items: center; width: 64px; height: 64px;
  font: 700 26px/1 var(--display); color: var(--ink);
  background: linear-gradient(135deg, var(--peach), var(--lilac) 60%, var(--aqua));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 8px 20px -12px rgba(52,62,150,.45);
}

.post-fig { margin: 34px 0; }
.post-fig img { display: block; width: 100%; height: auto; border-radius: 24px; box-shadow: 0 24px 60px -32px rgba(52, 62, 150, .45); background: var(--glass-strong); }
.post-fig figcaption { margin-top: 10px; font-size: 15px; color: var(--ink-2); }
.post-hero { margin: 0 0 28px; }
.post-hero img { border-radius: 28px; }

.toc { border-radius: 24px; padding: 20px 26px 18px; margin: 0 0 40px; }
.toc-title { margin: 0 0 8px; font: 650 17px/1.3 var(--body); color: var(--ink); }
.toc ol { margin: 0; padding-left: 1.3em; columns: 2 260px; column-gap: 32px; }
.toc li { margin: 0 0 6px; font-size: 16px; font-weight: 550; break-inside: avoid; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; text-underline-offset: 4px; }

.post-body { font-size: 19px; line-height: 1.68; }
.post-body > p, .post-body li { color: var(--ink-2); }
.post-body p { margin: 0 0 20px; }
.post-body strong { color: var(--ink); font-weight: 650; }
.post-body h2 { font-size: clamp(28px, 3vw, 36px); line-height: 1.12; letter-spacing: -.025em; margin: 56px 0 16px; }
.post-body h3 { font: 650 22px/1.3 var(--display); letter-spacing: -.01em; margin: 34px 0 10px; }
.post-body ul, .post-body ol { margin: 0 0 22px; padding-left: 1.3em; }
.post-body li { margin: 0 0 10px; }
.post-body li::marker { color: var(--brand); font-weight: 650; }
.post-body blockquote { margin: 28px 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--lilac); }
.post-body code { font: 500 .88em var(--mono); background: rgba(20,22,31,.06); padding: 1px 6px; border-radius: 6px; }

/* App icons in listicles ({logo:name} in the Markdown) */
.post-body .app-logo { display: inline-block; width: 30px; height: 30px; vertical-align: -9px; margin-right: 10px; }
.post-body tbody th:has(.app-logo) { white-space: nowrap; }
.post-body h2.app-head { display: flex; align-items: center; gap: 14px; }
.post-body h2.app-head .app-logo { width: 56px; height: 56px; margin: 0; flex: none; }

/* Comparison tables: a normal table on desktop; on phones each row becomes a card
   (data-label carries the column name onto each line). */
.table-wrap { overflow-x: auto; margin: 28px 0 30px; border-radius: 22px; border: 1px solid var(--glass-edge); background: var(--glass-strong); box-shadow: var(--shadow-glass); }
.post-body table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 15.5px; line-height: 1.45; }
.post-body th, .post-body td { text-align: left; vertical-align: top; padding: 14px 16px; border-bottom: 1px solid var(--hair); color: var(--ink-2); }
.post-body thead th { font-weight: 650; color: var(--ink); background: rgba(255,255,255,.5); font-size: 15px; }
.post-body tbody th { font-weight: 650; color: var(--ink); }
.post-body tbody tr:last-child > * { border-bottom: 0; }

@media (max-width: 760px) {
  .table-wrap { overflow: visible; border: 0; background: none; box-shadow: none; border-radius: 0; }
  .post-body table.compare, .post-body table.compare tbody { display: grid; gap: 14px; min-width: 0; }
  .post-body table.compare thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .post-body table.compare tr {
    display: block; padding: 18px 20px 6px; border-radius: 22px;
    background: var(--glass-strong); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-glass);
  }
  .post-body table.compare th[scope="row"] { display: block; padding: 0; border: 0; font: 700 21px/1.2 var(--display); color: var(--ink); margin-bottom: 10px; }
  .post-body table.compare td { display: block; padding: 10px 0; border-bottom: 0; border-top: 1px solid var(--hair); font-size: 16px; line-height: 1.5; }
  .post-body table.compare td::before { content: attr(data-label); display: block; font: 650 15px/1.35 var(--body); color: var(--ink); margin-bottom: 2px; }
}

/* Sources dropdown */
.sources-box { margin: 56px 0 0; border-radius: 24px; padding: 0 26px; }
.sources-box summary { display: flex; align-items: center; gap: 14px; padding: 20px 0; cursor: pointer; list-style: none; }
.sources-box summary::-webkit-details-marker { display: none; }
.sources-box summary h2 { margin: 0; font-size: 24px; }
.sources-count { min-width: 28px; padding: 3px 9px; border-radius: 99px; font: 650 14px/1.2 var(--body); text-align: center; color: var(--brand-press); background: rgba(89,107,214,.12); }
.sources-box summary::after { content: ""; margin-left: auto; width: 11px; height: 11px; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: rotate(45deg) translateY(-3px); transition: transform .4s cubic-bezier(.22, 1, .36, 1); }
.sources-box[open]:not(.closing) summary::after { transform: rotate(-135deg) translateY(-3px); }
.sources-inner { overflow: hidden; padding: 0 0 18px; font-size: 15.5px; line-height: 1.55; }
.sources-inner p { margin: 0 0 12px; }
.sources-inner ul { margin: 0 0 18px; }
.sources-inner li { overflow-wrap: anywhere; margin-bottom: 8px; }

.author-card { display: flex; gap: 20px; align-items: flex-start; border-radius: 28px; padding: clamp(22px, 3vw, 32px); margin: 52px 0 26px; }
.author-card p { margin: 0; color: var(--ink-2); font-size: 17px; }
.author-card .author-label { font: 600 15px/1.3 var(--body); color: var(--brand-press); margin-bottom: 2px; }
.author-card .author-name { font: 700 21px/1.25 var(--display); color: var(--ink); margin-bottom: 8px; }
.post-back { font-size: 17px; margin: 0 0 20px; }

/* blog home */
.blog-home h1 { font-size: clamp(46px, 6vw, 80px); }
.blog-home .lede { margin: 18px 0 40px; max-width: 32em; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 24px; }
.card { border-radius: 30px; overflow: hidden; }
.card-link { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 28px; align-items: center; padding: 16px; text-decoration: none; }
.card .post-fig { margin: 0; }
.card .post-fig img { border-radius: 20px; box-shadow: none; }
.card h2 { font-size: clamp(24px, 2.6vw, 30px); line-height: 1.15; letter-spacing: -.02em; margin-bottom: 10px; }
.card p { margin: 0 0 12px; color: var(--ink-2); font-size: 17px; }
.card-link:hover h2 { text-decoration: underline; text-decoration-color: rgba(89,107,214,.5); text-underline-offset: 5px; text-decoration-thickness: 2px; }

@media (max-width: 760px) {
  .post-body { font-size: 18px; }
  .post-fig img, .post-hero img { border-radius: 18px; }
  .author-card { flex-direction: column; }
  .card-link { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .card-text { padding: 0 6px 6px; }
  .sources-box { padding: 0 20px; }
}

/* Looping product clips ({name}.mp4 in the Markdown) */
.post-video video { display: block; width: 100%; height: auto; border-radius: 24px; box-shadow: 0 24px 60px -32px rgba(52, 62, 150, .45); background: var(--glass-strong); }
@media (max-width: 760px) { .post-video video { border-radius: 18px; } }
