/* Ghost scaffolds: the shapes of content that hasn't arrived yet (still loading, or couldn't be
   fetched). Warm paper tone, with a soft light sweeping across. Shared by the home page sections. */
.ghost {
  position: relative;
  overflow: hidden;
  background: color-mix(in srgb, var(--color-name) 9%, var(--color-paper));
  border-radius: 10px;
}
.ghost::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 25%, rgba(255, 255, 255, 0.6) 50%, transparent 75%);
  translate: -100% 0;
  animation: ghost-sweep 1.9s cubic-bezier(0.45, 0, 0.25, 1) infinite;
  animation-delay: var(--ghost-delay, 0s);
}
@keyframes ghost-sweep { 70%, 100% { translate: 100% 0; } }

/* the content couldn't be fetched (or there's nothing yet): the scaffold stays as a calm, still outline */
:host([state="offline"]) .ghost::after, :host([state="empty"]) .ghost::after { animation: none; opacity: 0; }
:host([state="offline"]) .ghost, :host([state="empty"]) .ghost { background: color-mix(in srgb, var(--color-name) 8%, var(--color-paper)); }

/* a quiet note shown over a scaffold when content couldn't be fetched / there's none yet */
.offline-note {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 99px;
  font: italic 600 16px/1.2 var(--font-serif);
  color: var(--color-ink);
  text-decoration: none;
  background: color-mix(in srgb, var(--color-paper) 80%, transparent);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 12px 30px -18px rgba(36, 31, 38, 0.45);
}
:host([state="offline"]) .offline-note, :host([state="empty"]) .offline-note { display: inline-flex; }
.when-empty { display: none; }
:host([state="empty"]) .when-empty { display: inline; }
:host([state="empty"]) .when-offline { display: none; }

@media (prefers-reduced-motion: reduce) {
  .ghost::after { animation: none; opacity: 0; }
}
