/* =========================================================================
   page-systems-index.css — styles unique to systems/index.html
   All canonical tokens, .card, .btn, .pill, .container, .card-grid come
   from foundation.css, layout.css, and design-system.css.
   ========================================================================= */

main a { color: var(--hvb-teal); text-decoration: none; }
main a:hover { text-decoration: underline; }

/* ── Secondary text ──────────────────────────────────────────────────────── */
.sub {
  margin: 6px 0 0;
  color: var(--hvb-slate);
  font-size: 15px;
  line-height: 1.5;
}

.note {
  color: var(--hvb-slate);
  font-size: 13.5px;
  margin: 10px 0 0;
}

/* ── Button group ────────────────────────────────────────────────────────── */
.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* ── Filter toolbar ──────────────────────────────────────────────────────── */
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0 0;
}

.search {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
  justify-content: space-between;
}

.search input {
  width: min(520px, 100%);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(14, 59, 46, 0.18);
  outline: none;
  font-size: 14px;
  background: #fff;
}

.search input:focus {
  border-color: rgba(31, 111, 98, 0.55);
  box-shadow: 0 0 0 4px rgba(31, 111, 98, 0.16);
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid rgba(14, 59, 46, 0.14);
  background: rgba(31, 111, 98, 0.06);
  color: var(--hvb-green);
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.chip.active {
  background: rgba(14, 59, 46, 0.12);
  border-color: rgba(14, 59, 46, 0.24);
}

/* ── System card grid ────────────────────────────────────────────────────── */
.system-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.system-card {
  border-radius: var(--radius-card);
  background: #fff;
  border: 1px solid rgba(14, 59, 46, 0.12);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.system-card:hover,
.system-card:focus-within {
  transform: translateY(-6px);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.18);
}

.system-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.system-card-media {
  position: relative;
  padding-top: 56.25%;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.4)),
    var(--hero-image, none);
  background-size: cover;
  background-position: center;
}

.system-card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0) 60%);
  opacity: 0.25;
  z-index: 1;
}

.system-card-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  z-index: 0;
}

.system-card.has-hero .system-card-media::after { opacity: 0; }

.system-card-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.system-card-info h3 {
  font-family: var(--font-head);
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.system-card-subtitle {
  margin: 0;
  color: var(--hvb-slate);
  font-size: 0.95rem;
  min-height: 2.5em;
}

/* Static / placeholder variants */
.system-card--static .system-card-media.static-media {
  background:
    linear-gradient(180deg, rgba(13, 60, 43, 0.08), rgba(13, 60, 43, 0)),
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0)),
    #e8f4eb;
}

.system-card--static .system-card-info { min-height: 120px; }

/* Skeleton loading state */
.system-card--skeleton {
  pointer-events: none;
  opacity: 0.9;
}

.system-card--skeleton .system-card-media {
  background: linear-gradient(180deg, #d9e7de, #f5faf7);
}

.system-card--skeleton .system-card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  animation: shimmer 1.4s ease-in-out infinite;
}

.system-card--skeleton .system-card-info { gap: 10px; }

.skeleton-line {
  width: 100%;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(13, 60, 43, 0.06), rgba(13, 60, 43, 0.2), rgba(13, 60, 43, 0.06));
  animation: shimmer 1.4s ease-in-out infinite;
}

.skeleton-line--title { height: 16px; width: 60%; }
.skeleton-line--short { width: 78%; }

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.system-card-placeholder {
  padding: 2rem;
  border-radius: var(--radius-card);
  border: 1px dashed rgba(14, 59, 46, 0.3);
  text-align: center;
  background: rgba(31, 111, 98, 0.04);
  color: var(--hvb-slate);
}

/* ── Sub-system archetype cards ──────────────────────────────────────────── */
.sys {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  overflow: hidden;
  padding: 0;
}

.thumb {
  background:
    linear-gradient(180deg, rgba(31, 111, 98, 0.06), rgba(31, 111, 98, 0.02)),
    url("../textures/tx_recycled-paper_tile.png");
  background-repeat: no-repeat, repeat;
  background-size: cover, 640px 640px;
  border-bottom: 1px solid rgba(14, 59, 46, 0.10);
  padding: 12px;
}

.thumb figure { margin: 0; }

.sysbody {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sys h3 {
  margin: 0;
  font-family: var(--font-head);
  font-size: 16px;
  letter-spacing: -0.01em;
}

.meta {
  color: var(--hvb-slate);
  font-size: 13.5px;
  margin: 0;
}

.sysactions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

/* ── Code inline ─────────────────────────────────────────────────────────── */
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
}
