/* Shared shell/primitives for the browse (AFL Tables replica) section.
   Reuses frontend/style.css's :root tokens — every browse page links both
   stylesheets, this one after style.css. Page-specific CSS files
   (season.css, team.css, etc.) layer on top of this, never redefine it. */

.b-shell { width: min(100% - 40px, 1120px); margin: 0 auto; padding: 40px 0 96px; }

.b-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 22px; color: var(--muted); font-family: var(--font-mono); font-size: 12px; }
.b-crumb a { color: var(--muted); text-decoration: none; }
.b-crumb a:hover { color: var(--accent); text-decoration: underline; }
.b-crumb-sep { color: var(--subtle); }
.b-crumb-current { color: var(--text); font-weight: 600; }

.b-h1 { margin: 0 0 6px; font-size: clamp(28px, 4.5vw, 42px); font-weight: 800; letter-spacing: 0; line-height: 1.05; }
.b-subtitle { margin: 0 0 28px; color: var(--muted); font-size: 14px; line-height: 1.6; }

.b-section { margin-top: 36px; }
.b-section:first-of-type { margin-top: 0; }

/* .b-section-title is shared by real <h2>/<h3> section headings (styled below,
   tag-qualified so each gets genuinely hierarchical size/weight) and by a
   couple of non-heading caption uses (e.g. player.js's milestone-card label),
   which fall through to this base rule and keep the compact label look. */
.b-section-title { margin: 0 0 14px; color: var(--muted); font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
h2.b-section-title { margin: 0 0 16px; color: var(--text); font-family: var(--font-body); font-size: 21px; font-weight: 800; letter-spacing: 0; line-height: 1.25; text-transform: none; }
h3.b-section-title { margin: 0 0 12px; color: var(--text); font-family: var(--font-body); font-size: 16px; font-weight: 700; letter-spacing: 0; line-height: 1.3; text-transform: none; }

.b-card { padding: 18px 20px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
.b-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }

.b-table-wrap { overflow-x: auto; border: 1px solid var(--line-strong); border-radius: 8px; }
.b-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.b-table th, .b-table td { padding: 9px 12px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
.b-table th { position: sticky; top: 0; background: var(--surface-raised); color: var(--muted); font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.b-table tbody tr:hover { background: var(--surface-hover); }
.b-table tbody tr:last-child td { border-bottom: none; }
.b-table td.num, .b-table th.num { text-align: right; font-family: var(--font-mono); }

/* Generic click-to-sort affordance, wired up in browse-common.js. A table
   opts out via [data-no-sort] on the <table> (fixed 2-row layouts etc.) —
   this stays generic, never targets a specific table by class. */
.b-table:not([data-no-sort]) th { cursor: pointer; user-select: none; }
.b-table:not([data-no-sort]) th:hover { background: var(--surface-hover); color: var(--text); }
.b-table th[data-sort-active] { background: var(--surface-hover); color: var(--text); }
.b-table th[data-sort-active]::after { content: "▲"; display: inline-block; margin-left: 5px; font-size: 9px; }
.b-table th[data-sort-active="desc"]::after { content: "▼"; }

.b-badge { display: inline-grid; width: 22px; height: 22px; flex: 0 0 auto; place-items: center; vertical-align: middle; }
.b-badge--initials { border: 1px solid var(--line-strong); border-radius: 50%; color: var(--muted); font-family: var(--font-mono); font-size: 8px; }

.b-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 100px; background: var(--surface-raised); color: var(--muted); font-family: var(--font-mono); font-size: 11px; font-weight: 600; }
.b-pill--win { color: var(--accent); }
.b-pill--loss { color: var(--danger); }

.b-link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.b-link-card { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--text); text-decoration: none; font-size: 13px; font-weight: 700; transition: border-color .16s ease, background .16s ease; }
.b-link-card:hover { border-color: var(--accent); background: var(--surface-hover); }

.b-empty { padding: 24px; border: 1px dashed var(--line-strong); border-radius: 8px; color: var(--subtle); font-size: 13px; line-height: 1.6; text-align: center; }
.b-loading { padding: 20px 0; color: var(--muted); font-family: var(--font-mono); font-size: 12px; }
.b-note { margin-top: 10px; color: var(--subtle); font-family: var(--font-mono); font-size: 10.5px; line-height: 1.6; }

.b-search-input { width: 100%; min-height: 46px; padding: 12px 16px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 15px; }
.b-search-input:focus { border-color: var(--accent); background: var(--surface-raised); outline: none; }

.b-index-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 8px; }
.b-index-card { display: block; padding: 22px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .16s ease, background .16s ease, transform .12s ease; }
.b-index-card:hover { border-color: var(--accent); background: var(--surface-hover); transform: translateY(-1px); }
.b-index-card-title { margin: 0 0 6px; font-size: 18px; font-weight: 800; align-content:centre; display:flex; justify-content:center; }
.b-index-card-desc { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

@media (max-width: 700px) {
  .b-shell { width: min(100% - 32px, 1120px); padding-top: 24px; }
  .b-table th, .b-table td { padding: 7px 9px; }
}
