/* ==========================================================================
   TEAMS DIRECTORY — global team browser
   ========================================================================== */

.td-page {
  min-height: 100vh;
  background: var(--fa-bg, var(--navy));
  color: var(--fa-text, var(--white));
}

/* ---------- Dashboard grid ---------- */

.td-dash {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(16px, 2vw, 24px) clamp(16px, 3vw, 28px) 80px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 1080px) {
  .td-dash {
    grid-template-columns: 240px minmax(0, 1fr) 260px;
    gap: clamp(16px, 2vw, 24px);
    align-items: start;
  }
}

@media (min-width: 768px) and (max-width: 1079px) {
  .td-dash {
    grid-template-columns: minmax(0, 1fr) 240px;
  }
  .td-rail--left { display: none; }
}

/* ---------- Rails ---------- */

.td-rail {
  position: sticky;
  top: calc(var(--nav-h, 64px) + 16px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------- Panels ---------- */

.td-panel {
  border: 1px solid var(--fa-surface-3);
  border-radius: 8px;
  background: var(--fa-border-subtle);
  overflow: hidden;
}

.td-panel-head {
  padding: 10px 14px;
  border-bottom: 1px solid var(--fa-border-subtle);
}

.td-panel-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fa-text, var(--white));
  margin: 0;
  position: relative;
  padding-left: 10px;
}

.td-panel-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1px;
  bottom: 1px;
  width: 3px;
  border-radius: 2px;
  background: var(--teal, #00C2CB);
}

.td-panel-body {
  padding: 10px 14px;
}

/* ---------- Header ---------- */

.td-head {
  margin-bottom: 12px;
}

.td-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 36px);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--white);
  margin: 0 0 4px;
}

.td-lead {
  font-size: 14px;
  color: var(--muted, rgba(255,255,255,0.6));
  margin: 0 0 6px;
}

.td-summary {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim, rgba(255,255,255,0.4));
  margin: 0;
}

/* ---------- Filter chips ---------- */

.td-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.td-chips--col {
  flex-direction: column;
}

.td-chips--scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.td-chips--scroll::-webkit-scrollbar { display: none; }

.td-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted, rgba(255,255,255,0.6));
  background: transparent;
  border: 1px solid var(--fa-border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.td-chip:hover {
  background: var(--fa-surface-3);
  border-color: var(--fa-input-border);
}

.td-chip.is-active {
  background: rgba(0,194,203,0.12);
  border-color: rgba(0,194,203,0.4);
  color: var(--teal, #00C2CB);
}

.td-chip-count {
  font-size: 10px;
  opacity: 0.6;
}

.td-chips--col .td-chip {
  justify-content: space-between;
  width: 100%;
}

/* Mobile filters */
.td-mobile-filters {
  display: none;
  margin-bottom: 12px;
  gap: 8px;
  flex-direction: column;
}

@media (max-width: 1079px) {
  .td-mobile-filters { display: flex; }
}

/* ---------- Sections ---------- */

.td-section {
  margin-bottom: 20px;
}

.td-section:last-child { margin-bottom: 0; }

.td-section-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--fa-border-subtle);
}

.td-section-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--white, #fff);
  margin: 0;
  position: relative;
  padding-left: 10px;
}

.td-section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 2px;
  background: var(--teal, #00C2CB);
}

.td-section-count {
  font-size: 11px;
  color: var(--dim, rgba(255,255,255,0.4));
}

/* ---------- Team grid ---------- */

.td-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ---------- Team card (row) ---------- */

.td-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  transition: background 0.12s;
}

.td-card:hover {
  background: var(--fa-surface-3);
}

.td-card-flag {
  flex-shrink: 0;
}

.td-flag {
  border-radius: 2px;
  object-fit: cover;
}

.td-logo {
  border-radius: 4px;
  object-fit: contain;
  background: transparent;
}

.td-card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.td-card-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--white, #fff);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.td-card-meta {
  font-size: 10px;
  color: var(--dim, rgba(255,255,255,0.4));
}

.td-card-badges {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.td-card-rank {
  font-size: 11px;
  font-weight: 700;
  color: var(--teal, #00C2CB);
}

.td-card-group {
  font-size: 10px;
  font-weight: 600;
  color: var(--dim, rgba(255,255,255,0.5));
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--fa-border-subtle);
}

/* Badges */
.td-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.td-badge--national {
  background: rgba(0,194,203,0.12);
  color: var(--teal, #00C2CB);
}

.td-badge--club {
  background: rgba(123,97,255,0.12);
  color: #7B61FF;
}

.td-status {
  font-size: 9px;
  font-weight: 600;
  color: var(--dim, rgba(255,255,255,0.35));
}

.td-status--active {
  color: rgba(0,194,203,0.7);
}

/* ---------- Featured list (sidebar) ---------- */

.td-feat-list {
  display: flex;
  flex-direction: column;
  padding: 0;
}

.td-feat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  text-decoration: none;
  color: inherit;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.12s;
}

.td-feat-row:hover {
  background: var(--fa-surface-3);
}

.td-feat-row + .td-feat-row {
  border-top: 1px solid var(--fa-surface-3);
}

.td-feat-name {
  color: var(--body, rgba(255,255,255,0.85));
}

/* ---------- Quick links ---------- */

.td-links {
  display: flex;
  flex-direction: column;
  padding: 0;
}

.td-link {
  display: block;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--teal, #00C2CB);
  text-decoration: none;
  transition: background 0.12s;
}

.td-link:hover {
  background: var(--fa-surface-3);
  opacity: 0.88;
}

.td-link + .td-link {
  border-top: 1px solid var(--fa-surface-3);
}

/* ---------- Empty ---------- */

.td-empty {
  text-align: center;
  padding: 32px 20px;
  color: var(--muted, rgba(255,255,255,0.5));
  font-size: 14px;
}

/* ---------- Mobile ---------- */

@media (max-width: 767px) {
  .td-rail--left { display: none; }
  .td-rail--right { position: static; }
  .td-dash { grid-template-columns: 1fr; }

  .td-title { font-size: clamp(22px, 5.5vw, 26px); }
  .td-card { padding: 6px 8px; gap: 8px; }
  .td-card-name { font-size: 12px; }
  .td-badge { font-size: 8px; padding: 1px 5px; }
}
