/*
 * Tile home — copied from SongBook Hub's kit (drsaji-songbook-hub/docs/ui/
 * tiles.css + TILE_HOME_KIT.md, 2026-11-10), the platform's shared style for
 * a home page made of tiles. The rules below the variable map are the kit's,
 * unchanged, so the two can be diffed. Only the variables are ours: they
 * point at the Academy's tokens from styles.css / brand.css.
 */
:root {
  --brand: var(--color-primary);
  --brand-soft: var(--color-primary-light);
  --on-brand: #fff;
  --ink: var(--color-text);
  --muted: var(--color-text-muted);
  --line: var(--color-border);
  --bg: var(--color-bg);
  --card: var(--color-surface);
}

/* ---------- The launcher: every page as a tile ---------- */

.tile-group {
  padding: 12px 14px 14px;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr));
  gap: 10px;
}

/* A tile is the whole target: icon, name, and one line saying what it is for. */
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 92px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
  text-decoration: none;
}

.tile:hover,
.tile:focus-visible {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.tile-icon {
  display: inline-flex;
  color: var(--brand);
  margin-bottom: 2px;
}

.tile-label {
  font-weight: 700;
}

.tile-hint {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
}

/* Only ever a count the app already works out elsewhere. */
.tile-count {
  position: absolute;
  top: 8px;
  right: 10px;
  min-width: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--brand);
  color: var(--on-brand);
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  line-height: 20px;
}


/* A tile that leads with its number: what it counts, then where it goes. */
.tile-stat .tile-number {
  font-size: 1.6rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

/* Heading, hint and tiles share one left edge. */
.tile-group .link-list-title {
  padding: 4px 0 6px;
}

.tile-group-hint {
  margin: 0 0 10px;
}

/* ---- Base rules SongBook gets from its own stylesheet; included so this file stands alone. ---- */

.tile-group {
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.tile-group .link-list-title {
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.tile-group-hint {
  color: var(--muted);
  font-size: 0.85rem;
}

/* Keyboard users see where they are, on top of the hover treatment. */
.tile:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ---- Academy additions ---- */
/* The number in the brand's heading face, like the rest of the Academy's headings. */
.tile-stat .tile-number { font-family: var(--font-heading); }
/* A tile whose work is waiting: the logo's orange as a left edge, so "needs
   you" shows without relying on colour alone (the hint says it in words). */
.tile.tile-waiting { border-left: 4px solid var(--color-accent); }
/* Group headings are small labels, not page headings: the body face. */
.tile-group .link-list-title { font-family: var(--font-family); font-weight: 700; }
