/* ══ Teams hub (teams.php) ════════════════════════════════════════════════════
   Builds on includes/team.css (.tpd-* cards, lists, tables) and the .tp-* hero in
   _styles.css. Team cards take their colour from --c (Teams.TeamColor1).
   Versioned by filemtime like the other page stylesheets. */

.th-page .th-mark { width: 132px; }
.th-hero-link { color: #fff; font-weight: 700; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.35); }
.th-hero-link:hover { border-bottom-color: #fff; }

.th-first { margin-top: 0; }
.th-section { margin-top: 38px; }

/* ── Team cards ───────────────────────────────────────────────────────────── */
.th-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 18px; }
.th-card { position: relative; display: flex; flex-direction: column; overflow: hidden; background: #fff;
           border: 1px solid #e3e6ea; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.07);
           transition: transform .15s ease, box-shadow .15s ease; }
.th-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(0,0,0,.15); }
/* The whole card is the link; the stretched anchor sits above the content. */
.th-card-link { position: absolute; inset: 0; z-index: 3; border-radius: 12px; }
.th-card-link:focus-visible { outline: 3px solid #252f52; outline-offset: 2px; }

.th-card-top { position: relative; display: flex; align-items: center; gap: 14px; padding: 18px 18px 16px; overflow: hidden;
               color: #fff; background: linear-gradient(135deg,#262b33 0%,#3b434f 100%); border-top: 5px solid var(--c,#3d4852); }
.th-card-top:before { content: ''; position: absolute; left: -40px; top: 50%; width: 190px; height: 190px; transform: translateY(-50%);
                      border-radius: 50%; pointer-events: none; opacity: .38;
                      background: radial-gradient(circle, var(--c,#3d4852) 0%, transparent 68%); }
.th-card-top:after { content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 120px; pointer-events: none;
                     background: repeating-linear-gradient(115deg,transparent 0 18px,rgba(255,255,255,.045) 18px 24px); }
.th-crest { position: relative; z-index: 1; flex: none; width: 66px; height: 66px; object-fit: contain;
            filter: drop-shadow(0 4px 9px rgba(0,0,0,.5)); transition: transform .2s ease; }
.th-card:hover .th-crest { transform: scale(1.06) rotate(-3deg); }
.th-card-id { position: relative; z-index: 1; flex: 1 1 auto; min-width: 0; }
.th-est { display: block; font-size: 9.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.6); }
.th-card-id h3 { margin: 3px 0 0; font-family: 'Josefin Sans', helvetica, arial, sans-serif; font-size: 27px; line-height: 1;
                 font-weight: 600; text-transform: uppercase; letter-spacing: .01em; color: #fff;
                 white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-capt { display: block; margin-top: 5px; font-size: 12px; color: rgba(255,255,255,.72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-place { position: relative; z-index: 1; flex: none; text-align: center; }
.th-place b { display: block; font-family: 'Josefin Sans', helvetica, arial, sans-serif; font-size: 30px; line-height: 1; font-weight: 600; color: #fff; }
.th-place span { display: block; margin-top: 3px; font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.56); }

.th-stats { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); border-bottom: 1px solid #eef0f2; }
.th-stats div { padding: 10px 4px 9px; text-align: center; border-left: 1px solid #eef0f2; }
.th-stats div:first-child { border-left: 0; }
.th-stats b { display: block; font-size: 16px; line-height: 1.15; font-weight: 700; color: #22262b; white-space: nowrap; }
.th-stats span { display: block; margin-top: 2px; font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #9aa1a9; }

.th-body { display: flex; flex: 1 1 auto; flex-direction: column; gap: 9px; padding: 12px 16px 14px; }
.th-line { display: flex; align-items: center; gap: 10px; min-height: 22px; }
.th-line .tpd-eyebrow { flex: none; width: 40px; }
.th-next { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 12.5px; color: #4a5058; white-space: nowrap; overflow: hidden; }
.th-next b { color: #22262b; }
.th-next em { margin-left: 3px; font-size: 10px; font-style: normal; font-weight: 700; color: #9aa1a9; }
.th-next img { width: 20px; height: 20px; object-fit: contain; }
.th-next.is-muted { color: #9aa1a9; }
.th-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; margin-top: auto; padding-top: 10px;
           border-top: 1px solid #eef0f2; font-size: 11.5px; color: #8a929c; }
.th-cups { font-weight: 700; color: #7a560f; }
.th-cups.is-none { font-weight: 400; color: #b3b9bf; }

/* ── Cup champions ────────────────────────────────────────────────────────── */
.th-row { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(0,1fr); gap: 20px; align-items: start; }
.th-champs { max-height: 640px; overflow-y: auto; }
.th-champs li { box-shadow: inset 4px 0 0 var(--c,#3d4852); }
.th-champs li.is-holder { background: linear-gradient(90deg,#fffaf0 0%,#fff 70%); }
.th-year { flex: none; width: 48px; font-family: 'Josefin Sans', helvetica, arial, sans-serif; font-size: 20px; line-height: 1; font-weight: 600; color: #22262b; }
.th-score { color: #22262b; text-decoration: none; }
.th-score:hover { color: #252f52; text-decoration: underline; }
.th-yearchips { display: flex !important; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.th-yearchips em { padding: 0 6px; border-radius: 9px; background: #b8841c; color: #fff; font-size: 10px; font-style: normal; font-weight: 700; line-height: 17px; }

/* ── All-time table ───────────────────────────────────────────────────────── */
.th-team-cell { display: inline-flex; align-items: center; gap: 7px; padding-left: 8px; border-left: 3px solid var(--c,#3d4852); }
.th-team-cell img { width: 22px; height: 22px; object-fit: contain; }
.th-active { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 9px; background: #eaf6ec; color: #256b2c;
             font-size: 9.5px; font-weight: 700; line-height: 16px; letter-spacing: .04em; text-transform: uppercase; vertical-align: 1px; }
.th-aka { display: block; margin: 2px 0 0 13px; font-size: 10.5px; font-weight: 400; color: #9aa1a9; }
.th-table tr.is-retired td { color: #6a7178; }
.th-table tr.is-retired .th-team-cell img { filter: grayscale(.5); opacity: .8; }

/* ── Retired franchises ───────────────────────────────────────────────────── */
.th-retired { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.th-mini { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: inherit; text-decoration: none;
           border-left: 4px solid var(--c,#3d4852); transition: transform .15s ease, box-shadow .15s ease; }
.th-mini:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.12); }
.th-mini img { flex: none; width: 44px; height: 44px; object-fit: contain; filter: grayscale(.35); transition: filter .15s; }
.th-mini:hover img { filter: none; }
.th-mini-main { flex: 1 1 auto; min-width: 0; }
.th-mini-main b { display: block; font-size: 15px; color: #22262b; }
.th-mini-main span { display: block; font-size: 11.5px; color: #8a929c; }
.th-mini-cups { flex: none; padding: 2px 8px; border-radius: 10px; background: #fbf1dc; color: #7a560f; font-size: 11px; font-weight: 700; }

@media (max-width: 900px) {
  .th-row { grid-template-columns: minmax(0,1fr); }
  .th-page .th-mark { width: 96px; }
}
@media (max-width: 620px) {
  .th-grid { grid-template-columns: minmax(0,1fr); gap: 14px; }
  .th-card-top { padding: 14px 14px 13px; gap: 11px; }
  .th-crest { width: 54px; height: 54px; }
  .th-card-id h3 { font-size: 23px; }
  .th-place b { font-size: 25px; }
  .th-stats b { font-size: 14px; }
  .th-page .th-mark { width: 76px; }
  .th-retired { grid-template-columns: minmax(0,1fr); }
}
