/* ==========================================================================
   pages.css — special pages: Notes (Article Selection), note detail meta,
   Playground. About lives in /css/about.css (loaded by layout/about.ejs).
   Selectors are prefixed with .hx-prose where they must beat prose defaults.
   ========================================================================== */

/* ---------- Shared card (notes + playground) ---------- */
.note-card,
.pg-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--hx-border); border-radius: var(--hx-radius-lg);
  background: var(--hx-bg); box-shadow: var(--hx-shadow-sm);
  color: inherit; text-decoration: none;
  transition: border-color var(--hx-dur) var(--hx-ease), box-shadow var(--hx-dur) var(--hx-ease), transform var(--hx-dur) var(--hx-ease);
}
.note-card:hover,
.pg-card:hover { border-color: var(--hx-border-strong); box-shadow: var(--hx-shadow); transform: translateY(-1px); }
.hx-prose a.note-card,
.hx-prose a.pg-card { color: inherit; text-decoration: none; border-bottom: 1px solid var(--hx-border); }
.hx-prose a.note-card:hover,
.hx-prose a.pg-card:hover { border-bottom-color: var(--hx-border-strong); }

/* ---------- Notes index ---------- */
.notes-intro { margin: 0 0 28px; color: var(--hx-fg-muted); font-size: 16px; line-height: 1.7; }
.hx-prose .notes-intro a { color: var(--hx-fg-strong); }

.notes-tab-bar {
  display: inline-flex; flex-wrap: wrap; gap: 2px;
  margin-bottom: 20px; padding: 3px;
  border: 1px solid var(--hx-border); border-radius: calc(var(--hx-radius) + 3px);
  background: var(--hx-bg-subtle);
}
.notes-tab-btn {
  min-height: 34px; padding: 4px 14px;
  border: 0; border-radius: var(--hx-radius);
  background: transparent; color: var(--hx-fg-muted);
  font: 500 14px/1 var(--hx-font); cursor: pointer;
  transition: color var(--hx-dur), background var(--hx-dur), box-shadow var(--hx-dur);
}
.notes-tab-btn:hover { color: var(--hx-fg); }
.notes-tab-btn.is-active { background: var(--hx-bg); color: var(--hx-fg-strong); box-shadow: var(--hx-shadow-sm); }

.notes-filter-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.notes-filter-chip {
  min-height: 30px; padding: 2px 12px;
  border: 1px solid var(--hx-border); border-radius: 999px;
  background: var(--hx-bg); color: var(--hx-fg-muted);
  font: 500 12.5px/1.4 var(--hx-font); cursor: pointer;
  transition: color var(--hx-dur), border-color var(--hx-dur), background var(--hx-dur);
}
.notes-filter-chip:hover { color: var(--hx-fg); border-color: var(--hx-border-strong); }
.notes-filter-chip.is-active { background: var(--hx-accent); border-color: var(--hx-accent); color: var(--hx-accent-fg); }

.notes-tab-btn:focus-visible, .notes-filter-chip:focus-visible,
.note-card:focus-visible, .note-tag:focus-visible, .pg-card:focus-visible { outline: 2px solid var(--hx-ring); outline-offset: 2px; }

.notes-tab-section { display: none; }
.notes-tab-section.is-active { display: block; animation: hx-fade-in 240ms var(--hx-ease) both; }

.notes-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 14px; }
.note-card { min-height: 160px; padding: 18px 18px 16px; }
.hx-prose .note-card-title,
.note-card-title {
  margin: 0 0 8px; padding: 0; border: 0;
  color: var(--hx-fg-strong); font-size: 16px; font-weight: 650; line-height: 1.45; letter-spacing: 0;
}
.note-card-title::before { display: none; }
.hx-prose .note-card-tldr,
.note-card-tldr {
  display: -webkit-box; overflow: hidden; margin: 0 0 14px;
  color: var(--hx-fg-muted); font-size: 13.5px; line-height: 1.6;
  -webkit-box-orient: vertical; -webkit-line-clamp: 2;
}
.note-card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: auto; color: var(--hx-fg-faint); font-size: 12px; }
.note-card-date { margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }

.note-tag {
  display: inline-flex; align-items: center; min-height: 22px; padding: 1px 8px;
  border: 1px solid var(--hx-border); border-radius: 999px;
  background: var(--hx-bg-muted); color: var(--hx-fg-muted);
  font-size: 12px; line-height: 1.5; text-decoration: none;
}
.hx-prose a.note-tag { color: var(--hx-fg-muted); text-decoration: none; }
a.note-tag:hover, .hx-prose a.note-tag:hover { color: var(--hx-fg); border-color: var(--hx-border-strong); }

.notes-tag-cloud { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px 20px; padding: 4px 0; }
.hx-prose .notes-tag-cloud-item,
.notes-tag-cloud-item { color: var(--hx-fg); text-decoration: none; transition: color var(--hx-dur); }
.hx-prose .notes-tag-cloud-item:hover,
.notes-tag-cloud-item:hover { color: var(--hx-highlight); }
.notes-tag-count, .notes-source-count { color: var(--hx-fg-faint); font-size: 0.72em; font-weight: 400; font-variant-numeric: tabular-nums; }

.notes-source-group { margin-bottom: 32px; }
.hx-prose .notes-source-title,
.notes-source-title { margin: 0 0 12px; padding: 0; border: 0; font-size: 15px; font-weight: 600; line-height: 1.4; }
.hx-prose .notes-source-title a,
.notes-source-title a { color: var(--hx-fg-strong); text-decoration: none; border-bottom: 1px dashed var(--hx-border-strong); }
.notes-source-title a:hover { border-bottom-style: solid; }

@media (max-width: 720px) {
  .note-card-date { width: 100%; margin-left: 0; }
}

/* ---------- Note detail meta block (generated by tools/lib/render-note.js) ---------- */
.note-meta {
  margin: 0 0 28px; padding: 14px 16px;
  border: 1px solid var(--hx-border); border-radius: var(--hx-radius-lg);
  background: var(--hx-bg-muted);
  font-size: 14px;
}
.note-meta-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0; }
.note-meta-label {
  min-width: 76px; color: var(--hx-fg-faint);
  font: 500 11px/1.6 var(--hx-mono); letter-spacing: 0.06em; text-transform: uppercase;
}
.note-meta-row time { color: var(--hx-fg-muted); font-variant-numeric: tabular-nums; margin-right: 12px; }
.hx-prose a.note-source-link,
.note-source-link { color: var(--hx-fg-strong); text-decoration: underline; text-decoration-color: var(--hx-border-strong); text-underline-offset: 3px; }
.note-source-link:hover { text-decoration-color: currentColor; }

/* ---------- Playground ---------- */
.pg-intro { margin: 0 0 28px; color: var(--hx-fg-muted); font-size: 16px; }
.pg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 14px; }
.pg-card { padding: 20px; }
.pg-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin-bottom: 14px;
  border: 1px solid var(--hx-border); border-radius: var(--hx-radius);
  background: var(--hx-bg-muted); font-size: 22px; line-height: 1;
}
.pg-title { margin-bottom: 6px; color: var(--hx-fg-strong); font-size: 16px; font-weight: 650; }
.pg-desc {
  display: -webkit-box; overflow: hidden;
  color: var(--hx-fg-muted); font-size: 13.5px; line-height: 1.6;
  -webkit-box-orient: vertical; -webkit-line-clamp: 2;
}
