/* Football Kit Encyclopedia V5.14 — Team detail density polish.
 * Keeps club pages camiseta-first: player navigation defaults to two visual rows,
 * while secondary relationships become a compact balanced summary. No JS required. */

body.single-team .fke-team-player-fold{
  position:relative;
  width:100%;
  min-width:0;
  margin:0 0 18px!important;
}
body.single-team .fke-team-player-fold__toggle{
  position:absolute!important;
  inline-size:1px!important;
  block-size:1px!important;
  opacity:0!important;
  pointer-events:none!important;
}
body.single-team .fke-team-player-fold__content{
  min-width:0;
}
/* Desktop: 3 columns x 2 rows = 6 players. */
body.single-team .fke-team-player-fold__toggle:not(:checked)+.fke-team-player-fold__content .fke-related-entities__grid>.fke-player-card:nth-child(n+7){
  display:none!important;
}
body.single-team .fke-team-player-fold__button{
  display:flex;
  width:max-content;
  min-height:40px;
  margin:14px auto 0;
  padding:9px 15px;
  align-items:center;
  justify-content:center;
  gap:8px;
  border:1px solid #cdb77e;
  border-radius:999px;
  background:#fffdf8;
  color:#102a47;
  font:700 12px/1.2 Arial,sans-serif;
  cursor:pointer;
  box-shadow:0 3px 12px rgba(7,31,61,.04);
  transition:background .16s ease,border-color .16s ease,transform .16s ease;
}
body.single-team .fke-team-player-fold__button:hover{
  background:#f8f1df;
  border-color:#b9913e;
  transform:translateY(-1px);
}
body.single-team .fke-team-player-fold__button:focus-visible{
  outline:3px solid rgba(193,151,61,.3);
  outline-offset:2px;
}

body.single-team .fke-team-player-fold--lte6 .fke-team-player-fold__button{display:none}
body.single-team .fke-team-player-fold__less{display:none}
body.single-team .fke-team-player-fold__toggle:checked~.fke-team-player-fold__button .fke-team-player-fold__more{display:none}
body.single-team .fke-team-player-fold__toggle:checked~.fke-team-player-fold__button .fke-team-player-fold__less{display:inline}
body.single-team .fke-team-player-fold__toggle:checked~.fke-team-player-fold__button .fke-team-player-fold__chevron{transform:rotate(180deg)}
body.single-team .fke-team-player-fold__chevron{display:inline-block;font-size:16px;line-height:1;transition:transform .16s ease}

/* Secondary knowledge graph: content-aware geometry.
 * Country and competitions stay compact in the first row; brand and sponsor
 * histories get wide columns below. The cards size to their own content, so a
 * one-row Country card no longer stretches into a tall empty panel. */
body.single-team .fke-team-profile__relations-summary{
  display:grid!important;
  grid-template-columns:repeat(12,minmax(0,1fr))!important;
  grid-auto-rows:auto!important;
  gap:14px!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  padding-top:16px;
  border-top:1px solid #e5dccb;
  align-items:start!important;
}
body.single-team .fke-team-profile__relations-summary>.fke-relation-card{
  position:relative;
  width:100%!important;
  min-width:0!important;
  height:auto!important;
  min-height:0!important;
  align-self:start!important;
  margin:0!important;
  padding:16px 18px!important;
  border:1px solid #dfd3be!important;
  border-radius:14px!important;
  background:linear-gradient(180deg,#fff 0%,#fcfaf5 100%)!important;
  box-shadow:0 4px 16px rgba(7,31,61,.025)!important;
  overflow:hidden;
}
/* Row 1: compact metadata. */
body.single-team .fke-team-profile__relations-summary>.fke-relation-card:nth-child(1){grid-column:span 4!important}
body.single-team .fke-team-profile__relations-summary>.fke-relation-card:nth-child(2){grid-column:span 8!important}
/* Row 2: long historical lists need room for logo/name + season. */
body.single-team .fke-team-profile__relations-summary>.fke-relation-card:nth-child(3),
body.single-team .fke-team-profile__relations-summary>.fke-relation-card:nth-child(4){grid-column:span 6!important}
body.single-team .fke-team-profile__relations-summary>.fke-relation-card h2{
  margin:0 0 11px!important;
  padding-bottom:10px!important;
  border-bottom:1px solid #e9dfcf!important;
  color:#8f6822;
  font-family:Arial,sans-serif!important;
  font-size:12px!important;
  font-weight:800!important;
  line-height:1.25!important;
  letter-spacing:.08em!important;
  text-transform:uppercase!important;
}
body.single-team .fke-team-profile__relations-summary>.fke-relation-card ul{
  display:grid!important;
  gap:8px!important;
  margin:0!important;
  padding:0!important;
  list-style:none!important;
}
body.single-team .fke-team-profile__relations-summary>.fke-relation-card li{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
  min-width:0!important;
  min-height:48px!important;
  padding:9px 11px!important;
  border:1px solid #eadfcd!important;
  border-radius:10px!important;
  background:#fdfbf7!important;
  color:#18314f;
  font-size:13px!important;
  line-height:1.3!important;
}
body.single-team .fke-team-profile__relations-summary>.fke-relation-card li:first-child{padding-top:9px!important}
body.single-team .fke-team-profile__relations-summary>.fke-relation-card li>a{
  display:flex!important;
  align-items:center!important;
  gap:10px!important;
  min-width:0!important;
  flex:1 1 auto!important;
  color:#123a66!important;
  font-weight:700;
  text-decoration:none!important;
}
body.single-team .fke-team-profile__relations-summary>.fke-relation-card li>a>span:last-child{
  min-width:0!important;
  overflow-wrap:anywhere!important;
}
body.single-team .fke-team-profile__relations-summary>.fke-relation-card a:hover{text-decoration:underline!important}
body.single-team .fke-team-profile__relations-summary .fke-relation-card__meta{
  flex:0 0 auto!important;
  margin:0 0 0 auto!important;
  color:#748196!important;
  font-size:11px!important;
  line-height:1.2!important;
  white-space:nowrap!important;
}
body.single-team .fke-team-profile__relations-summary .fke-relation-card__brand-mark{
  display:grid!important;
  place-items:center!important;
  width:34px!important;
  height:34px!important;
  min-width:34px!important;
  flex:0 0 34px!important;
  border-radius:8px!important;
}
body.single-team .fke-team-profile__relations-summary .fke-relation-card__brand-mark img{
  display:block!important;
  max-width:78%!important;
  max-height:23px!important;
  object-fit:contain!important;
}

@media (max-width:1050px){
  body.single-team .fke-team-player-fold--gt6 .fke-team-player-fold__button,
  body.single-team .fke-team-player-fold--lte6:not(.fke-team-player-fold--lte4) .fke-team-player-fold__button{display:flex}
  body.single-team .fke-team-profile__relations-summary{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:12px!important;
  }
  body.single-team .fke-team-profile__relations-summary>.fke-relation-card:nth-child(n){grid-column:auto!important}
  /* Two columns x two rows = 4 players. */
  body.single-team .fke-team-player-fold__toggle:not(:checked)+.fke-team-player-fold__content .fke-related-entities__grid>.fke-player-card:nth-child(n+5){display:none!important}
  body.single-team .fke-team-player-fold--lte4 .fke-team-player-fold__button{display:none}
}
@media (max-width:680px){
  body.single-team .fke-team-player-fold--gt6 .fke-team-player-fold__button,
  body.single-team .fke-team-player-fold--lte6:not(.fke-team-player-fold--lte2) .fke-team-player-fold__button,
  body.single-team .fke-team-player-fold--lte4:not(.fke-team-player-fold--lte2) .fke-team-player-fold__button{display:flex}
  body.single-team .fke-team-profile__relations-summary{
    grid-template-columns:1fr!important;
    gap:10px!important;
    padding-top:12px;
  }
  body.single-team .fke-team-profile__relations-summary>.fke-relation-card:nth-child(n){grid-column:auto!important}
  body.single-team .fke-team-profile__relations-summary>.fke-relation-card{padding:14px!important}
  body.single-team .fke-team-profile__relations-summary>.fke-relation-card li{min-height:46px!important;padding:8px 10px!important}
  /* One column x two rows = 2 players. */
  body.single-team .fke-team-player-fold__toggle:not(:checked)+.fke-team-player-fold__content .fke-related-entities__grid>.fke-player-card:nth-child(n+3){display:none!important}
  body.single-team .fke-team-player-fold--lte2 .fke-team-player-fold__button{display:none}
  body.single-team .fke-team-player-fold__button{width:100%;max-width:320px}
}
@media (max-width:420px){
  body.single-team .fke-team-profile__relations-summary>.fke-relation-card li{align-items:flex-start!important;gap:8px!important}
  body.single-team .fke-team-profile__relations-summary .fke-relation-card__meta{font-size:10px!important;padding-top:2px!important}
  body.single-team .fke-team-profile__relations-summary .fke-relation-card__brand-mark{width:30px!important;height:30px!important;min-width:30px!important;flex-basis:30px!important}
}
