/* Shared loading templates use the same solid geometry as the finished UI. */
.ui-loading {
  --loading-paper: var(--paper);
  --loading-line: var(--ink);
  width: 100%;
  min-width: 0;
  padding: 8px 0 24px;
  color: var(--ink);
}
.loading-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 28px;
  margin-bottom: 22px;
}
.loading-label {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.loading-mark {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
}
.loading-pixel {
  width: 10px;
  height: 10px;
  border: 2px solid var(--ink);
  background: var(--accent);
  animation: loading-pulse 900ms steps(1, end) infinite;
}
.loading-pixel:nth-child(2) {
  animation-delay: 150ms;
}
.loading-pixel:nth-child(3) {
  animation-delay: 300ms;
}
.loading-placeholders {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--ui-space, 24px);
  padding-right: var(--panel-shadow);
  padding-bottom: var(--panel-shadow);
}
.loading-card {
  min-width: 0;
  border: var(--line) solid var(--ink);
  padding: var(--ui-space, 24px);
  background: var(--paper);
  box-shadow: var(--panel-shadow) var(--panel-shadow) 0 var(--ink);
}
.loading-avatar {
  width: 52px;
  height: 52px;
  margin-bottom: 24px;
  background: var(--accent);
  border: var(--line) solid var(--ink);
}
.loading-lines {
  display: grid;
  gap: 14px;
}
.loading-line {
  display: block;
  height: 4px;
  background: var(--loading-line);
}
.loading-line:first-child {
  width: 68%;
  height: 10px;
  margin-bottom: 8px;
}
.loading-line:last-child {
  width: 82%;
}
.ui-loading--events .loading-card {
  padding: 0;
}
.loading-poster {
  aspect-ratio: 3 / 4;
  background: var(--accent);
  border-bottom: var(--line) solid var(--ink);
}
.ui-loading--events .loading-lines {
  padding: 20px;
}
.ui-loading--people .loading-card {
  min-height: 230px;
}
.ui-loading--recruitment .loading-card {
  min-height: 200px;
}
.ui-loading--rows .loading-placeholders,
.ui-loading--profile .loading-placeholders {
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
.ui-loading--rows .loading-card {
  padding: 20px;
  box-shadow: none;
}
.ui-loading--rows .loading-line:last-child {
  width: 45%;
}
.ui-loading--profile {
  padding: 28px;
  margin-bottom: 24px;
  background: var(--paper);
  border: var(--line) solid var(--ink);
  box-shadow: var(--press) var(--press) 0 var(--ink);
}
.ui-loading--profile .loading-card {
  min-height: 240px;
  padding: 0;
  border: 0;
  box-shadow: none;
}
.ui-loading--compact {
  padding: 12px 0;
}
.ui-loading--compact .loading-heading {
  margin: 0;
}
button.is-loading {
  position: relative;
  overflow: hidden;
  cursor: progress;
}
button.is-loading::after {
  content: "";
  position: absolute;
  left: 8px;
  width: 30%;
  bottom: 3px;
  height: 3px;
  background: currentColor;
  animation: loading-scan 900ms steps(3, end) infinite;
  pointer-events: none;
}
@keyframes loading-pulse {
  0%,
  80%,
  100% {
    background: var(--paper);
    transform: translateY(0);
  }
  35% {
    background: var(--ink);
    transform: translateY(-3px);
  }
}
@keyframes loading-scan {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(180%);
  }
}
@media (max-width: 1279px) and (min-width: 640px) {
  .ui-loading--events .loading-placeholders,
  .ui-loading--people .loading-placeholders,
  .ui-loading--recruitment .loading-placeholders {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ui-loading--events .loading-card:last-child,
  .ui-loading--people .loading-card:last-child,
  .ui-loading--recruitment .loading-card:last-child {
    display: none;
  }
}
@media (max-width: 639px) {
  .loading-placeholders {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .ui-loading--events .loading-card:not(:first-child),
  .ui-loading--people .loading-card:not(:first-child),
  .ui-loading--recruitment .loading-card:not(:first-child) {
    display: none;
  }
  .ui-loading--profile {
    padding: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ui-loading,
  .loading-pixel,
  button.is-loading::after {
    animation: none;
  }
  .loading-pixel {
    background: var(--accent);
    transform: none;
  }
}
