/* styles.css — Template Library. Plain CSS, light + dark via prefers-color-scheme. */

:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --surface-1: #f1efe8;
  --border: rgba(0, 0, 0, 0.10);
  --border-strong: rgba(0, 0, 0, 0.18);
  --text: #1d1d1b;
  --text-secondary: #5f5e5a;
  --text-muted: #888780;
  --accent: #155e63;
  --radius: 8px;

  /* product tints */
  --elbert-bg: #e1f5ee;
  --elbert-fg: #085041;
  --e28e-bg: #eeedfe;
  --e28e-fg: #26215c;

  /* status tints */
  --production-bg: #eaf3de; --production-fg: #3b6d11;
  --live-bg: #e6f1fb;       --live-fg: #185fa5;
  --demo-bg: #faeeda;       --demo-fg: #854f0b;
  --internal-bg: #f1efe8;   --internal-fg: #5f5e5a;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1a18;
    --surface: #242422;
    --surface-1: #2c2c2a;
    --border: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.20);
    --text: #f1efe8;
    --text-secondary: #b4b2a9;
    --text-muted: #888780;
    --accent: #5dcaa5;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 980px; margin: 0 auto; padding: 40px 24px 64px; }

header h1 { font-size: 26px; font-weight: 600; margin: 0 0 6px; }
header p { font-size: 15px; color: var(--text-secondary); margin: 0; max-width: 60ch; }

.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin: 28px 0 18px;
}
.filters { display: flex; gap: 8px; align-items: center; }
.filters .label { font-size: 13px; color: var(--text-secondary); }
.chip {
  font-size: 13px; padding: 6px 14px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: transparent;
  color: var(--text); cursor: pointer; font: inherit;
}
.chip[aria-pressed="true"] { background: var(--surface-1); }
.count { font-size: 13px; color: var(--text-muted); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
}
.thumb { height: 110px; display: grid; place-items: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .placeholder { font-size: 30px; font-weight: 600; }

.body { padding: 16px 18px; flex: 1; }
.pills { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.pill { font-size: 11px; padding: 3px 9px; border-radius: var(--radius); font-weight: 500; }
.card h2 { font-size: 16px; font-weight: 600; margin: 0 0 5px; }
.card .blurb { font-size: 13.5px; color: var(--text-secondary); margin: 0; line-height: 1.5; }

.actions { display: flex; border-top: 1px solid var(--border); }
.actions a, .actions span {
  flex: 1; text-align: center; padding: 11px; font-size: 13px;
  text-decoration: none; color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
}
.actions a:hover { background: var(--surface-1); }
.actions a + a, .actions a + span, .actions span + a { border-left: 1px solid var(--border); }
.actions .muted { color: var(--text-muted); }

.new-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; min-height: 220px; border: 1px dashed var(--border-strong);
  border-radius: 12px; color: var(--text-secondary); background: transparent;
  text-decoration: none; font-size: 14px;
}
.new-tile:hover { background: var(--surface); }
.new-tile .plus { font-size: 30px; line-height: 1; }

footer { margin-top: 40px; font-size: 12.5px; color: var(--text-muted); }
footer a { color: var(--text-secondary); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
