/* A new reader's Feed while it syncs (partials/empty_feed.html, discover.js): their sources over three
   skeleton cards; then a slim strip while later sources finish; cards that arrive drop in one after
   another. Only transform and opacity move, and with reduced motion only opacity. */
:root { --sync-glint: #ffffffb8; }
/* Keep both dark blocks identical, as design.css does. */
:root[data-theme="dark"] { --sync-glint: #ffffff12; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --sync-glint: #ffffff12; } }

.syncing { display: grid; justify-items: center; gap: 6px; margin: 0 0 22px; padding: 30px 20px 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-align: center; }
.sync-title { margin: 0; font-size: var(--text-xl); letter-spacing: -.02em; }
.sync-sub { margin: 0; color: var(--muted); font-size: var(--text-md); line-height: 1.5; }

/* The reader's sources: a ring breathes out of each one still syncing; a check lands once it has. */
.sync-faces { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; max-width: 100%; margin: 0 0 14px; padding: 0; list-style: none; }
.sync-face { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: hsl(var(--hue, 210) 52% 46%); color: #fff; font-size: var(--text-xs); font-weight: 700; letter-spacing: .02em; }
.sync-face img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.sync-face::before { content: ""; position: absolute; inset: -4px; border: 2px solid var(--accent); border-radius: 50%; opacity: 0; animation: sync-ring 1.8s cubic-bezier(.23, 1, .32, 1) infinite; }
.sync-face:nth-child(2n)::before { animation-delay: .3s; }
.sync-face:nth-child(3n)::before { animation-delay: .6s; }
.sync-face.is-done::before, .sync-more::before { display: none; }
.sync-more { background: var(--surface-2); color: var(--ink-2); }
.sync-check { position: absolute; right: -4px; bottom: -4px; width: 18px; height: 18px; padding: 3px; border-radius: 50%; background: var(--ok); color: #fff; stroke-width: 3.2; box-shadow: 0 0 0 2px var(--surface); opacity: 0; transform: scale(.5); transition: opacity .2s ease, transform .3s cubic-bezier(.23, 1, .32, 1); }
.sync-face.is-done .sync-check { opacity: 1; transform: none; }

/* Skeleton cards shaped like real ones, a band of light sweeping across. */
.card.sync-card { position: relative; display: grid; gap: 12px; padding: 20px 26px 28px; }
.sync-card i { display: block; height: 12px; border-radius: 6px; background: var(--surface-2); }
.sync-card i.short { width: 58%; }
.sync-card .sync-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.sync-card .sync-meta > span { display: grid; flex: 1; gap: 7px; }
.sync-card .sync-meta > span i { width: 42%; height: 10px; }
.sync-card .sync-meta > span i.short { width: 24%; }
.sync-card .sync-dot { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 11px; }
.sync-card .sync-head { width: 84%; height: 16px; margin-bottom: 4px; }
.sync-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, var(--sync-glint) 50%, transparent 70%); transform: translateX(-100%); animation: sync-sweep 1.6s linear infinite; pointer-events: none; }
.sync-card:nth-child(2) { opacity: .75; }
.sync-card:nth-child(2)::after { animation-delay: .15s; }
.sync-card:nth-child(3) { opacity: .5; }
.sync-card:nth-child(3)::after { animation-delay: .3s; }

/* Some posts are in while other sources sync: a slim strip with a bar running along its foot. */
.sync-strip { position: relative; display: flex; align-items: center; max-width: 680px; min-height: 40px; margin: 0 auto 12px; padding: 8px 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink-2); font-size: var(--text-sm); font-weight: 600; transition: opacity .3s ease, transform .3s cubic-bezier(.23, 1, .32, 1); }
.sync-strip-bar { position: absolute; right: 0; bottom: 0; left: 0; height: 2px; overflow: hidden; }
.sync-strip-bar::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 40%; border-radius: 2px; background: var(--accent); transform: translateX(-100%); animation: sync-run 1.4s cubic-bezier(.65, 0, .35, 1) infinite; }
.sync-strip.is-done { opacity: 0; transform: translateY(-4px); }

/* Cards that arrive drop in one after another; discover.js numbers them (--i). */
.card.sync-in { animation: sync-in .28s cubic-bezier(.23, 1, .32, 1) both; animation-delay: calc(var(--i, 0) * 50ms); }

/* A card whose TL;DR is still coming: its own opening lines, then this quiet line with a faint sweep. */
.summary-coming { position: relative; display: inline-block; margin: 10px 0 0; overflow: hidden; color: var(--muted); font-size: var(--text-xs); font-weight: 600; }
.summary-coming::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--surface) 75%, transparent) 50%, transparent 70%); transform: translateX(-100%); animation: sync-sweep 2.2s linear infinite; }
.paid-label { color: var(--warn); }

@keyframes sync-ring { 0% { opacity: .6; transform: scale(.9); } 100% { opacity: 0; transform: scale(1.35); } }
@keyframes sync-sweep { to { transform: translateX(100%); } }
@keyframes sync-run { to { transform: translateX(250%); } }
@keyframes sync-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes sync-breathe { 50% { opacity: .45; } }
@keyframes sync-fade-in { from { opacity: 0; } }

/* design.css stops every animation for reduced motion. A sync in progress is news, so it keeps a slow
   fade here, which moves nothing; hence !important, and selectors more specific than design.css's "*". */
@media (prefers-reduced-motion: reduce) {
  .sync-face::before { opacity: .5; transform: none; animation: sync-breathe 1.8s ease-in-out infinite !important; }
  .sync-check { transform: none; }
  .sync-card::after, .summary-coming::after { display: none; }
  .sync-card i, .summary-coming { animation: sync-breathe 1.6s ease-in-out infinite !important; }
  .sync-strip-bar::after { width: 100%; transform: none; animation: sync-breathe 1.4s ease-in-out infinite !important; }
  .sync-strip.is-done { transform: none; }
  .card.sync-in { animation: sync-fade-in .28s ease-out both !important; animation-delay: calc(var(--i, 0) * 50ms) !important; }
}
