/* Summit Sideline Solutions — clean, pro, mobile-first */

/* =========================
   Theme / base
   ========================= */
:root{
  --bg:#e6e8ec;
  --card:#ffffff;
  --text:#1f2937;
  --muted:#6b7280;
  --border:#d1d5db;
  --accent:#0033A0;     /* Primary */
  --accent2:#5DA9E9;    /* Accent */
  --shadow: 0 8px 24px rgba(0,0,0,.08);
  --radius: 16px;
  --maxw: 1100px;
  --masthead-h: 65px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
}

.container{
  width: min(var(--maxw), calc(100% - 32px));
  margin: 0 auto;
}

/* =========================
   Controls / inputs
   ========================= */
.controls{ display:flex; gap:10px; align-items:center; }
.search{ min-width:220px; max-width:320px; width:38vw; }

.input{
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  outline: none;
  background: rgba(255,255,255,.85);
}
.input:focus{
  border-color: var(--accent2);
  box-shadow: 0 0 0 3px rgba(93,169,233,.25);
}

.button{
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 650;
  cursor: pointer;
}
.button:hover{ border-color: rgba(0,0,0,.2); }
.button--ghost{ background: transparent; }

/* =========================
   Cards
   ========================= */
.card{
  background: var(--card);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 18px 0;
  overflow: hidden;
}
.card__header{ padding: 18px 18px 8px 18px; }
.card__footer{ padding: 12px 18px 18px 18px; }

.card__header--row{
  display:flex;
  align-items:flex-end;
  justify-content: space-between;
  gap: 12px;
}

/* View toggle */
.viewToggle{
  display:inline-flex;
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 999px;
  overflow:hidden;
  background: rgba(255,255,255,.7);
}
.viewToggle__btn{
  appearance:none;
  border:none;
  background: transparent;
  padding: 8px 12px;
  font-weight: 800;
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
}
.viewToggle__btn.is-active{
  background: var(--accent);
  color:#fff;
}

/* Team cell inline record (mobile) */
.teamRow{
  display:flex;
  align-items:center;
  gap: 8px;
  min-width: 0;
}
.teamRow a{ min-width:0; }
.teamRecordInline{
  display:none;
  font-weight: 800;
  color: #334155;
  white-space: nowrap;
}

/* Text utilities */
.h1{ margin:0; font-size:22px; letter-spacing:.2px; }
.h2{ margin:0; font-size:18px; letter-spacing:.2px; }
.muted{ color: var(--muted); }
.fineprint{ font-size: 12px; }

.link{
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}
.link:hover{ text-decoration: underline; }

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  border: 1px solid rgba(0,0,0,.08);
  background: #f8fafc;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: #334155;
}

/* =========================
   ESPN-style masthead (sticky)
   ========================= */
.topbar{
  position: sticky;
  top: 0;
  z-index: 200;
  background: #000;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.topbar__inner--espn{
  display:flex;
  align-items:center;
  gap: 14px;
  padding: 0 14px 0 0;
  height: var(--masthead-h);
  min-width: 0;
}

/* Logo */
.masthead__logoLink{
  display:flex;
  align-items: stretch;
  justify-content: flex-start;
  height: 100%;
  background: #000;
  padding: 0;
  border-right: none;
  flex: 0 0 auto;
  width: auto;
}
.masthead__logo{
  height: 100%;
  width: auto;
  object-fit: contain;
  display: block;
}

/* Title */
.masthead__titleWrap{
  display:flex;
  flex-direction:column;
  justify-content:center;
  min-width: 0;
  margin-left: 10px;
  padding-left: 6px;
  flex: 1 1 auto;
}
.masthead__title{
  font-weight: 900;
  font-size: 20px;
  line-height: 1.15;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.masthead__sub{
  margin-top: 2px;
  font-size: 12px;
  color: rgba(255,255,255,.7);
}
.masthead__spacer{ flex: 1; }

/* Masthead controls */
.controls--masthead{
  display:flex;
  align-items:center;
  gap: 10px;
  padding-right: 14px;
  position: relative; /* anchor overlay search */
  flex: 0 0 auto;
}

.input--masthead{
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
}
.input--masthead::placeholder{ color: rgba(255,255,255,.65); }
.input--masthead:focus{
  border-color: rgba(93,169,233,.9);
  box-shadow: 0 0 0 3px rgba(93,169,233,.25);
}

.button--masthead{
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  font-weight: 700;
}
.button--masthead:hover{ border-color: rgba(255,255,255,.35); }

/* Search results dropdown inside overlay */
.searchOverlay__stack{ position: relative; }

.searchResults{
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 320px;
  overflow: auto;
  border-radius: 14px;
  background: rgba(0,0,0,.78);
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  padding: 6px;
  z-index: 270;
}

.searchResults a{
  display:block;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration:none;
  color:#fff;
  font-weight: 800;
  font-size: 14px;
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
}
.searchResults a:hover{ background: rgba(255,255,255,.12); }
.searchResults .mutedLine{
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,.70);
  padding: 6px 10px 0;
}

.teamHeader{
  position: relative;
  padding-right: 160px; /* room for back link */
}
.teamHeader__left{ min-width: 0; }
.teamHeader__pillRow{ margin-top: 8px; }

.teamHeader__back{
  position: absolute;
  top: 14px;
  right: 18px;
  white-space: nowrap;
  font-weight: 800;
}


.backLinkTop{
  position: absolute;
  top: 18px;
  right: 18px;
  font-weight: 700;
  text-decoration: none;
  color: var(--accent);
  white-space: nowrap;
}

.backLinkTop:hover{
  text-decoration: underline;
}

/* Icon buttons */
.button--icon{
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.button--icon .icon{ font-size: 18px; line-height: 1; }

/* Menu */
.menuWrap{ position: relative; }

.menuDropdown{
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 220px;
  display: none;
  padding: 8px;
  border-radius: 14px;
  background: rgba(0,0,0,.78);
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(10px);
  z-index: 260;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.menuDropdown.is-open{ display:block; }

.menuItem{
  display:block;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration:none;
  color:#fff;
  font-weight:800;
  font-size:14px;
  white-space: nowrap;
}
.menuItem:hover{ background: rgba(255,255,255,.12); }

/* Overlay search */
.searchOverlay{
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(0,0,0,.65);
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(8px);
  z-index: 250;
}
.searchOverlay.is-open{ display:flex; }

.searchOverlay__input{ width: clamp(220px, 34vw, 520px); }

@media (max-width: 520px){
  .searchOverlay{ left: 10px; right: 10px; }
  .searchOverlay__input{ width: 100%; }
}

/* =========================
   Tables (NO sticky header)
   ========================= */
.tableWrap{
  overflow-x: auto;
  overflow-y: hidden;
  border-top: 1px solid rgba(0,0,0,.06);
  -webkit-overflow-scrolling: touch;
}

.table{
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
  table-layout: auto;
}

.table thead th{
  background: #f8fafc;
  border-bottom: 1px solid rgba(0,0,0,.10);
  padding: 10px 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #475569;
  text-align: left;
}

.table td{
  padding: 10px 10px;
  border-bottom: 1px solid rgba(0,0,0,.06);
  font-size: 15px;
  vertical-align: middle;
}

.table tbody tr:hover{ background: rgba(93,169,233,.08); }

/* Team cell truncation */
.team-cell{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.team-cell a{
  display:inline-block;
  max-width:100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========= Rankings table alignment ========= */
/* Center Rank + W/L/T */
.rankingsTable th:nth-child(1),
.rankingsTable td:nth-child(1),
.rankingsTable th:nth-child(3),
.rankingsTable td:nth-child(3),
.rankingsTable th:nth-child(4),
.rankingsTable td:nth-child(4),
.rankingsTable th:nth-child(5),
.rankingsTable td:nth-child(5){
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Right align Win% + Power */
.rankingsTable th:nth-child(6),
.rankingsTable td:nth-child(6),
.rankingsTable th:nth-child(7),
.rankingsTable td:nth-child(7){
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Divider before Win % */
.rankingsTable th:nth-child(6),
.rankingsTable td:nth-child(6){
  border-left: 1px solid rgba(0,0,0,.12);
}

/* Slightly darker W/L/T values */
.rankingsTable td:nth-child(3),
.rankingsTable td:nth-child(4),
.rankingsTable td:nth-child(5){
  color: #334155;
}

/* =========================
   View modes
   ========================= */

/* Top 20 mobile: hide W/L/T and show inline record */
@media (max-width: 720px){
  .col-w, .col-l, .col-t{ display:none; }
  .teamRecordInline{ display:inline; }
}

/* All Teams: hide everything but Team */
.rankingsTable.is-all .col-rank,
.rankingsTable.is-all .col-w,
.rankingsTable.is-all .col-l,
.rankingsTable.is-all .col-t,
.rankingsTable.is-all .col-win,
.rankingsTable.is-all .col-power{
  display:none;
}
.rankingsTable.is-all .teamRecordInline{ display:inline; }

.rankingsTable.is-all .team-cell{ white-space: normal; }
.rankingsTable.is-all .teamRow a{ white-space: normal; }

/* =========================
   Team page summary grid
   ========================= */
.grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.summary{
  padding: 10px 18px 18px 18px;
  display:flex;
  flex-direction:column;
  gap: 10px;
}
.summary__row{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap: 12px;
}
.summary__row--big .summary__val{
  font-size: 28px;
  font-weight: 900;
  color: var(--accent);
}
.summary__val{
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}
.divider{
  height:1px;
  background: rgba(0,0,0,.08);
  margin: 6px 0;
}

/* =========================
   Footer
   ========================= */
.siteFooter{ margin: 18px 0 26px 0; }

.siteFooter__inner{
  width: min(var(--maxw), calc(100% - 32px));
  margin: 0 auto;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 14px;
  background: rgba(255,255,255,.60);
  border: 1px solid rgba(0,0,0,.06);
}

.siteFooter__brand{ min-width: 0; }

.siteFooter__brandLink{
  display:flex;
  align-items:center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.siteFooter__brandLink:hover .siteFooter__company{ text-decoration: underline; }

.siteFooter__logo{
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 10px;
  background: transparent;
  border: none;
  padding: 0;
  flex: 0 0 auto;
}

.siteFooter__brandText{
  display:flex;
  flex-direction:column;
  gap: 2px;
  min-width: 0;
}

.siteFooter__company{
  font-weight: 900;
  font-size: 16px;
  color: var(--text);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.siteFooter__byline{
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.siteFooter__nav{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.siteFooter__navLink{
  font-size: 13px;
  font-weight: 750;
  color: var(--accent);
  text-decoration: none;
}
.siteFooter__navLink:hover{ text-decoration: underline; }

.siteFooter__sep{
  color: rgba(0,0,0,.35);
  font-size: 12px;
}

.siteFooter__bottom{
  width: min(var(--maxw), calc(100% - 32px));
  margin: 10px auto 0 auto;
  display:flex;
  gap: 10px;
  justify-content: center;
  font-size: 12px;
  text-align: center;
}
.siteFooter__bottomSep{ color: rgba(0,0,0,.35); }

/* =========================
   Responsive
   ========================= */
@media (max-width: 720px){
  :root{ --masthead-h: 56px; }
  .masthead__title{ font-size: 16px; }

  .siteFooter__inner{
    flex-direction: column;
    align-items: flex-start;
  }
  .siteFooter__nav{ justify-content: flex-start; }
  .siteFooter__bottom{ justify-content: flex-start; }
  .siteFooter__logo{ width: 56px; height: 56px; }
  .siteFooter__company{ font-size: 15px; }
}

@media (min-width: 980px){
  .grid{
    grid-template-columns: 1.8fr .9fr;
    align-items: start;
  }
}
