/* Public dynasties directory · November 5: compact Cards and a Grid table of the same page of leagues.
   On cards the game sits top left as a small badge, the season and current stage top right; the Grid gives
   the game its own column. My dynasties keeps the Editorial card (wireframes.css). */
html:has(.dynasty-directory) { scrollbar-gutter: stable; }
.dynasty-directory .explore-result-row { min-height: 44px; }
.directory-result-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.directory-result-actions form { margin: 0; }
.directory-result-actions .plain-button { min-height: 40px; }
.directory-result-actions .plain-button:disabled { opacity: .45; cursor: default; }

/* Cards · Grid */
.directory-view-toggle { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: var(--quiet); }
.directory-view-toggle button { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 0; border-radius: 4px; background: transparent; color: var(--secondary); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.directory-view-toggle button:hover { color: var(--ink); }
.directory-view-toggle button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / 10%); }
.directory-view-toggle button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.directory-view-toggle svg { width: 15px; height: 15px; }

.directory-results { transition: opacity 120ms ease; }
.directory-results[aria-busy="true"] { opacity: .55; }
.directory-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

/* Compact card: about 170 px tall (the Editorial card is about 280), and the whole card opens the league. */
.directory-card { position: relative; container-type: inline-size; min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); overflow: clip; box-shadow: 0 1px 2px rgb(0 0 0 / 3%); transition: box-shadow 160ms ease, border-color 160ms ease; }
.directory-card:hover { border-color: var(--secondary); box-shadow: 0 4px 14px rgb(0 0 0 / 7%); }
.directory-card:focus-within { outline: 3px solid var(--accent); outline-offset: 3px; }
.directory-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0; padding: 12px 16px 0; color: var(--secondary); font-size: 12px; line-height: 1.3; }
.game-badge { flex: none; display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border: 1px solid var(--ink); border-radius: 3px; color: var(--ink); font: 700 12px/1 "Barlow Condensed", sans-serif; letter-spacing: .05em; text-decoration: none; white-space: nowrap; cursor: inherit; }
.directory-season { min-width: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.directory-season strong { color: var(--ink); font-weight: 700; }
.directory-card h2 { margin: 7px 16px 0; font: 700 24px/1.08 "IBM Plex Sans Condensed", sans-serif; letter-spacing: -.03em; overflow-wrap: anywhere; }
.directory-card h2 a { color: inherit; text-decoration: none; }
.directory-card h2 a::after { content: ""; position: absolute; inset: 0; }
.directory-card h2 a:focus-visible { outline: none; }
.directory-card .dynasty-teams { display: flex; align-items: center; min-height: 46px; margin-top: auto; padding: 8px 16px; }
.directory-card .dynasty-team-logos { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0; list-style: none; min-width: 0; }
.directory-card .dynasty-team-logo, .directory-card .dynasty-team-more,
.directory-table .dynasty-team-logo, .directory-table .dynasty-team-more { display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; }
.directory-card .dynasty-team-logo img { display: block; width: 28px; height: 28px; object-fit: contain; }
.directory-card .dynasty-team-more, .directory-table .dynasty-team-more { border: 1px solid var(--line); border-radius: 5px; background: var(--quiet); color: var(--ink); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.directory-card .dynasty-team-initials, .directory-table .dynasty-team-initials { color: var(--ink); font-size: 11px; font-weight: 700; }
.directory-card .dynasty-teams-pending, .directory-table .dynasty-teams-pending { margin: 0; color: var(--secondary); font-size: 13px; }
.directory-card-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; margin: 0; padding: 8px 16px 9px; border-top: 1px solid var(--line); }
.directory-card-stats dt { margin: 0 0 2px; color: var(--secondary); font-size: 11px; }
.directory-card-stats dd { margin: 0; font-size: 13px; line-height: 1.35; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
/* Hover titles (local time, how the pace is measured) sit above the card's link. */
.directory-card-stats time, .directory-card-stats strong[title] { position: relative; }

/* Average advance: four bars fill as a league advances faster (12 h, a day, three days, slower). */
.directory-pace { display: inline-flex; align-items: center; gap: 6px; }
.directory-pace strong { font-weight: 600; }
.pace-tempo { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; flex: none; }
.pace-tempo span { width: 3px; border-radius: 1px; background: var(--line); }
.pace-tempo span:nth-child(1) { height: 4px; }
.pace-tempo span:nth-child(2) { height: 6px; }
.pace-tempo span:nth-child(3) { height: 9px; }
.pace-tempo span:nth-child(4) { height: 12px; }
.pace-tempo span.on { background: var(--success); }

/* Grid: one row per league; the league column stays put while the rest scrolls on phones. */
/* Positioned, so the school names kept for screen readers scroll with the table instead of widening the page. */
.directory-table-region { position: relative; }
.directory-table { min-width: 840px; }
.directory-table th, .directory-table td { height: 50px; }
.directory-table td { white-space: nowrap; }
.directory-table .directory-league-column { position: sticky; left: 0; z-index: 1; background: var(--paper); min-width: 220px; }
.directory-table thead .directory-league-column { background: var(--quiet); }
.directory-table tbody tr:hover .directory-league-column { background: var(--hover, var(--paper)); }
.directory-league { color: var(--ink); font-weight: 700; text-decoration: none; overflow-wrap: anywhere; white-space: normal; }
.directory-league:hover { text-decoration: underline; text-underline-offset: 3px; }
.directory-game { color: var(--ink); font-weight: 600; text-decoration: none; cursor: help; }
.directory-table .dynasty-teams { display: flex; align-items: center; min-height: 0; margin: 0; padding: 0; background: none; }
.directory-table .dynasty-team-logos { display: flex; align-items: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.directory-table .dynasty-team-logo, .directory-table .dynasty-team-more { flex-basis: 26px; width: 26px; height: 26px; }
.directory-table .dynasty-team-logo img { display: block; width: 24px; height: 24px; object-fit: contain; }
.directory-table .dynasty-teams-pending { font-size: 12px; white-space: nowrap; }
.directory-table .directory-advance time, .directory-table .directory-advance strong { font-weight: 600; }
.directory-sort { display: inline-flex; align-items: center; gap: 4px; min-height: 34px; padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.directory-sort svg { width: 12px; height: 12px; opacity: 0; }
.directory-sort:hover svg { opacity: .45; }
.directory-sort svg.active { opacity: 1; }
[aria-sort] > .directory-sort { color: var(--ink); }
.directory-sort:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.directory-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 18px; }
.directory-pagination .plain-button { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
.directory-pagination .plain-button[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.directory-pagination svg { width: 15px; height: 15px; }
.directory-page-number { min-width: 96px; color: var(--secondary); font-size: 13px; text-align: center; font-variant-numeric: tabular-nums; }

@media (max-width: 1023px) {
  .directory-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .directory-cards { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .dynasty-directory .explore-result-row { align-items: center; }
  .directory-result-actions { width: 100%; justify-content: space-between; }
  .directory-table .directory-league-column { min-width: 150px; max-width: 46vw; }
  .directory-pagination { justify-content: space-between; }
}
@container (max-width: 300px) {
  .directory-card-meta { padding-inline: 12px; }
  .directory-card h2 { margin-inline: 12px; font-size: 22px; }
  .directory-card .dynasty-teams, .directory-card-stats { padding-inline: 12px; }
  .directory-card .dynasty-team-logos { gap: 5px; }
  .directory-card-stats { gap: 4px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .directory-card, .directory-results { transition: none; }
}
