/* ============================================================
   ROBIOS — Apps & Plugins catalog (apps.html)
   Layout chrome only: the cards and the info window come from
   css/cms.css. Tokens only (css/tokens.css). Prefix: apps-
   ============================================================ */

.apps-body { min-height: 100vh; }

/* The UA's [hidden] rule loses to any author `display`, and this page toggles
   .hidden on flex containers (the empty panel, the derived category row). */
.apps-body [hidden] { display: none !important; }

.apps-nav-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.apps-main { padding-block: 28px 56px; }

/* ------------------------------- hero ------------------------------- */

.apps-hero {
  padding-block: 20px 24px;
  border-bottom: 1px solid var(--bg-white-5);
  margin-bottom: 20px;
}

.apps-title {
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 1.08;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--ls-display);
  color: var(--text-primary);
}

.apps-sub {
  max-width: 62ch;
  margin-top: 10px;
  font-size: 15px;
  line-height: 22px;
  color: var(--text-secondary);
}

.apps-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-white-5);
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  color: var(--text-muted);
}
.apps-count b { color: var(--accent); font-weight: 500; }

/* ----------------------------- toolbar ----------------------------- */

.apps-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.apps-filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.apps-pillrow {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}
.apps-pillrow .pill svg { width: 14px; height: 14px; flex: none; }

/* second row: derived category pills — quieter than the kind row */
.apps-cats { padding-top: 2px; }
.apps-cats .pill { text-transform: capitalize; }
.apps-cats .pill:not(.active) { background: var(--bg-white-5); }
.apps-cats .pill:not(.active):hover { background: var(--bg-white-10); }

.apps-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  width: 260px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  box-shadow: var(--inset-highlight-soft);
  color: var(--text-faint);
  transition: box-shadow var(--dur-fast) var(--ease-ui);
}
.apps-search:focus-within { box-shadow: var(--ring-accent); }
.apps-search svg { width: 14px; height: 14px; flex: none; }
.apps-search input {
  width: 100%;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  font-size: 13px;
  color: var(--text-primary);
}
.apps-search input::placeholder { color: var(--text-faint); }
.apps-search input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* ------------------------------- grid ------------------------------- */

/* .cms-grid does the columns; this only carries the loading shimmer. */
.apps-grid { min-height: 40px; }

.apps-skeleton {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-card-lg);
  background: var(--bg-card);
  box-shadow: var(--inset-highlight);
  opacity: 0.6;
  animation: apps-pulse 1.4s var(--ease-ui) infinite;
}
.apps-skeleton:nth-child(2) { animation-delay: 0.12s; }
.apps-skeleton:nth-child(3) { animation-delay: 0.24s; }
.apps-skeleton:nth-child(4) { animation-delay: 0.36s; }

@keyframes apps-pulse {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 0.7; }
}

/* --------------------------- empty state --------------------------- */

.apps-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 48px 20px;
  border-radius: var(--radius-card-lg);
  background: var(--bg-card);
  box-shadow: var(--inset-highlight);
  text-align: center;
}
.apps-empty-ic {
  width: 44px;
  height: 44px;
  margin-bottom: 4px;
  color: var(--accent);
  opacity: 0.55;
}
.apps-empty-title {
  font-family: var(--font-display);
  font-size: var(--fs-card-title);
  font-weight: var(--fw-card-title);
  text-transform: uppercase;
  letter-spacing: var(--ls-display);
  color: var(--text-primary);
}
.apps-empty-text {
  max-width: 46ch;
  font-size: 13px;
  line-height: 20px;
  color: var(--text-secondary);
}
.apps-empty-cta { margin-top: 6px; text-decoration: none; }

/* ---------------------------- responsive ---------------------------- */

@media (max-width: 1100px) {
  .apps-title { font-size: 28px; }
}

@media (max-width: 760px) {
  .apps-main { padding-block: 20px 40px; }
  .apps-title { font-size: 24px; }
  .apps-sub { font-size: 14px; }
  .apps-toolbar { flex-direction: column; align-items: stretch; }
  .apps-search { width: 100%; }
  .apps-pillrow {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .apps-pillrow::-webkit-scrollbar { display: none; }
  .apps-pillrow .pill { flex: none; }
  .apps-empty { padding: 36px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .apps-skeleton { animation: none; }
}
