/* Football Kit Encyclopedia v3.7.10.8
 * Global mobile responsive system.
 * This is intentionally loaded last for every encyclopedia route.
 * It fixes layout families, never individual slugs/URLs.
 */

@media (max-width:700px){
  html{overflow-x:clip}
  body.fke-encyclopedia-shell{
    overflow-x:clip!important;
    background:#fbfaf6;
  }

  body.fke-encyclopedia-shell *,
  body.fke-encyclopedia-shell *::before,
  body.fke-encyclopedia-shell *::after{box-sizing:border-box}

  /* Every major shell/track is allowed to shrink to the viewport. */
  body.fke-encyclopedia-shell :is(
    .fke-main,
    .fke-home-v36,
    .fke-home-v3752,
    .fke-page-columns,
    .fke-kit-reconstruction,
    .fke-player-profile,
    .fke-team-profile,
    .fke-national-team-profile,
    .fke-country-profile-v3760,
    .fke-brand-profile,
    .fke-competition-profile,
    .fke-story-profile,
    .fke-collection-profile,
    .fke-brand-detail-track,
    .fke-global-detail-track,
    .fke-explore-v37105,
    .fke-compare-v37105,
    .fke-kit-archive-v36,
    .fke-search-v36,
    .fke-finder-v36,
    section,
    article,
    nav,
    header,
    footer,
    div
  ){
    min-width:0;
    max-width:100%;
  }

  .fke-main{
    width:100%!important;
    padding:14px 12px calc(92px + env(safe-area-inset-bottom))!important;
    margin:0 auto!important;
  }

  /* Prevent desktop grids from expanding the document. */
  body.fke-encyclopedia-shell :is(
    .fke-kit-grid,
    .fke-relation-grid,
    .fke-related-entities__grid,
    .fke-v377-entity-grid,
    .fke-player-archive__grid,
    .fke-country-archive-v3751__grid,
    .fke-search-v36__results,
    .fke-kit-archive-v36__grid,
    .fke-finder-v36__results,
    .fke-story-list__grid,
    .fke-article-grid,
    .fke-collection-grid
  ){
    width:100%;
    min-width:0;
  }

  body.fke-encyclopedia-shell img,
  body.fke-encyclopedia-shell video,
  body.fke-encyclopedia-shell iframe{max-width:100%;height:auto}

  /* Typography must wrap as words, never letter-by-letter columns. */
  body.fke-encyclopedia-shell :is(h1,h2,h3,h4,p,span,strong,small,a,dd,dt){
    word-break:normal!important;
    overflow-wrap:break-word;
    hyphens:none;
  }
  body.fke-encyclopedia-shell h1{font-size:clamp(32px,10vw,42px)!important;line-height:1.02!important;letter-spacing:-.025em!important}
  body.fke-encyclopedia-shell h2{font-size:clamp(27px,8vw,34px)!important;line-height:1.06!important}
  body.fke-encyclopedia-shell h3{line-height:1.14!important}

  /* ---------- Encyclopedia home ---------- */
  .fke-home-v36,
  .fke-home-v3752{padding:0!important;gap:16px!important}

  .fke-home-v3752__hero,
  .fke-home-v36__hero{
    display:flex!important;
    flex-direction:column!important;
    width:calc(100% + 24px)!important;
    max-width:none!important;
    min-height:0!important;
    margin:0 -12px!important;
    border-left:0!important;
    border-right:0!important;
    border-radius:0!important;
    overflow:hidden!important;
  }
  .fke-home-v3752__hero-visual,
  .fke-home-v36__hero-image{
    order:-1!important;
    width:100%!important;
    min-height:0!important;
    height:240px!important;
    max-height:240px!important;
    margin:0!important;
  }
  .fke-home-v3752__hero-visual>a{height:100%!important;padding:12px!important}
  .fke-home-v3752__hero-visual img,
  .fke-home-v36__hero-image img{width:100%!important;height:100%!important;max-height:220px!important;object-fit:contain!important}
  .fke-home-v3752__hero-visual figcaption{
    left:12px!important;right:12px!important;bottom:10px!important;
    padding:10px 12px!important;border-radius:10px!important
  }
  .fke-home-v3752__hero .fke-home-v36__hero-copy,
  .fke-home-v36__hero-copy{padding:24px 16px 26px!important}
  .fke-home-v3752__hero h1,
  .fke-home-v36__hero h1{
    max-width:none!important;
    font-size:clamp(34px,10.5vw,44px)!important;
    line-height:1.01!important;
    letter-spacing:-.035em!important;
  }
  .fke-home-v3752__lead{margin-top:14px!important;font-size:15px!important;line-height:1.55!important}

  .fke-home-v3752__search,
  .fke-home-v36__hero form{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    width:100%!important;
    max-width:none!important;
    margin:18px 0 0!important;
  }
  .fke-home-v3752__search input,
  .fke-home-v36__hero input{width:100%!important;min-width:0!important;padding:13px 12px!important;font-size:14px!important}
  .fke-home-v3752__search button,
  .fke-home-v36__hero button{min-width:82px!important;padding:0 14px!important}

  .fke-home-v3752__actions,
  .fke-home-v36__hero nav{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
    width:100%!important;
    margin-top:12px!important;
  }
  .fke-home-v3752__actions .fke-home-v36__primary{grid-column:1/-1!important}
  .fke-home-v3752__actions a,
  .fke-home-v36__hero nav a{
    width:100%!important;
    min-width:0!important;
    padding:10px 8px!important;
    text-align:center!important;
    white-space:normal!important;
  }

  /* Home counters: never let the second column disappear off screen. */
  .fke-home-v3752__quick{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
    width:100%!important;
    margin:0!important;
  }
  .fke-home-v3752__quick a{min-width:0!important;padding:12px 14px!important}
  .fke-home-v3752__quick strong{font-size:30px!important}
  .fke-home-v3752__quick span{font-size:9px!important;white-space:normal!important;text-align:right}

  .fke-home-v3752__section,
  .fke-home-v36__featured-clubs,
  .fke-home-v36__national,
  .fke-home-v36__players,
  .fke-home-v36__historic,
  .fke-home-v36__stories,
  .fke-home-v36__stats{
    width:100%!important;
    margin:0!important;
    padding:16px!important;
    border-radius:12px!important;
    overflow:hidden;
  }
  .fke-home-v3752__section>header,
  .fke-home-v36 section>header{
    align-items:flex-end!important;
    gap:10px!important;
    margin-bottom:12px!important;
  }
  .fke-home-v3752__section>header h2,
  .fke-home-v36 section>header h2{font-size:30px!important}
  .fke-home-v3752__section>header a,
  .fke-home-v36 section>header a{flex:0 0 auto;font-size:11px!important}

  /* Latest kits: a real grid, not 3 half-visible desktop cards. */
  .fke-home-v36__latest>div{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:10px!important;
    overflow:visible!important;
    width:100%!important;
  }
  .fke-home-v36__latest .fke-kit-card,
  .fke-home-v36__latest .fke-kit-card--compact{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    flex:none!important;
    height:auto!important;
  }
  .fke-home-v36__latest .fke-kit-card--compact .fke-kit-card__image{aspect-ratio:4/3!important}
  .fke-home-v36__latest .fke-kit-card--compact h3{font-size:15px!important;min-height:2.3em!important}

  /* Featured clubs / national teams: readable horizontal cards, stacked vertically. */
  .fke-home-v3752__entity-row,
  .fke-home-v36__entity-row{display:grid!important;grid-template-columns:1fr!important;gap:14px!important;width:100%!important}
  .fke-home-v3761__team-section{padding:16px!important}
  .fke-home-v3761__team-section>div,
  .fke-home-v36__featured-clubs>div,
  .fke-home-v36__national>div{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:9px!important;
    overflow:visible!important;
    width:100%!important;
  }
  .fke-home-v3761__team-section .fke-team-card,
  .fke-home-v3761__team-section .fke-team-card--home,
  .fke-home-v36__featured-clubs .fke-team-card,
  .fke-home-v36__national .fke-team-card{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    min-height:104px!important;
    height:auto!important;
    flex:none!important;
  }
  .fke-home-v3761__team-section .fke-team-card .fke-entity-card__link,
  .fke-home-v36__featured-clubs .fke-team-card .fke-entity-card__link,
  .fke-home-v36__national .fke-team-card .fke-entity-card__link{
    display:grid!important;
    grid-template-columns:68px minmax(0,1fr)!important;
    align-items:center!important;
    gap:12px!important;
    width:100%!important;
    height:auto!important;
    padding:12px!important;
  }
  .fke-home-v3761__team-section .fke-team-card__mark,
  .fke-home-v36__featured-clubs .fke-team-card__mark,
  .fke-home-v36__national .fke-team-card__mark,
  .fke-home-v3761__team-section .fke-team-card__visual{
    width:64px!important;height:64px!important;min-width:64px!important;min-height:64px!important;
    display:grid!important;place-items:center!important
  }
  .fke-home-v3761__team-section .fke-team-card__mark img,
  .fke-home-v36__featured-clubs .fke-team-card__mark img,
  .fke-home-v36__national .fke-team-card__mark img,
  .fke-home-v3761__team-section .fke-entity-card__image{
    width:56px!important;height:56px!important;max-width:56px!important;max-height:56px!important;object-fit:contain!important
  }
  .fke-home-v3761__team-section .fke-entity-card__body,
  .fke-home-v36__featured-clubs .fke-entity-card__body,
  .fke-home-v36__national .fke-entity-card__body{width:100%!important;min-width:0!important;text-align:left!important}
  .fke-home-v3761__team-section .fke-entity-card__type,
  .fke-home-v36__featured-clubs .fke-entity-card__type,
  .fke-home-v36__national .fke-entity-card__type{
    display:block!important;
    width:auto!important;
    margin:0 0 3px!important;
    font-size:9px!important;
    line-height:1.2!important;
    letter-spacing:.08em!important;
    white-space:normal!important;
  }
  .fke-home-v3761__team-section .fke-team-card h3,
  .fke-home-v36__featured-clubs .fke-team-card h3,
  .fke-home-v36__national .fke-team-card h3{
    display:block!important;
    width:100%!important;
    margin:0 0 3px!important;
    font-size:20px!important;
    line-height:1.1!important;
    white-space:normal!important;
    overflow:visible!important;
    text-overflow:clip!important;
  }
  .fke-home-v3761__team-section .fke-team-card :is(.fke-team-card__country,p,small,strong),
  .fke-home-v36__featured-clubs .fke-team-card :is(.fke-team-card__country,p,small,strong),
  .fke-home-v36__national .fke-team-card :is(.fke-team-card__country,p,small,strong){
    width:auto!important;
    max-width:100%!important;
    margin:2px 0!important;
    font-size:11px!important;
    line-height:1.35!important;
    white-space:normal!important;
  }
  .fke-home-v3761__team-section .fke-team-card small{display:none!important}

  /* Player/story/collection home modules do not inherit desktop fixed columns. */
  .fke-home-v3752__players>div{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:10px!important;
    overflow:visible!important;
  }
  .fke-home-v3752__players .fke-player-card{width:100%!important;min-width:0!important;max-width:none!important;flex:none!important}
  .fke-home-v3752__stories>div,
  .fke-home-v36__stories>div{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:10px!important;
    overflow:visible!important;
  }
  .fke-home-v3752__stories .fke-story-card,
  .fke-home-v36__stories .fke-story-card{width:100%!important;min-width:0!important;max-width:none!important;flex:none!important}
  .fke-home-v37104__collections .fke-home-v37104__collection-grid{grid-template-columns:1fr!important;gap:10px!important}

  .fke-home-v3752__browse-grid{grid-template-columns:1fr!important;gap:10px!important}
  .fke-home-v3752__browse-card{padding:16px!important}

  /* ---------- Generic archives / discovery ---------- */
  .fke-kit-archive-v36,
  .fke-search-v36,
  .fke-finder-v36{padding-left:0!important;padding-right:0!important;width:100%!important}
  .fke-kit-archive-v36__hero,
  .fke-search-v36__hero,
  .fke-finder-v36__hero{padding:18px!important;border-radius:12px!important}
  .fke-kit-archive-v36__filter-grid,
  .fke-finder-v36__form{grid-template-columns:1fr!important}
  .fke-kit-archive-v36__grid,
  .fke-finder-v36__results,
  .fke-search-v36__results,
  .fke-v377-entity-grid,
  .fke-player-archive__grid,
  .fke-country-archive-v3751__grid{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:10px!important;
    overflow:visible!important;
  }

  /* Generic cards: keep their body wide enough for words. */
  body.fke-encyclopedia-shell :is(.fke-team-card,.fke-player-card,.fke-country-card,.fke-brand-card,.fke-competition-card,.fke-sponsor-card,.fke-collection-card,.fke-story-card,.fke-kit-card){
    min-width:0!important;
    max-width:100%!important;
  }
  body.fke-encyclopedia-shell :is(.fke-team-card,.fke-player-card,.fke-country-card,.fke-brand-card,.fke-competition-card,.fke-sponsor-card) .fke-entity-card__body{
    min-width:0!important;
  }
  body.fke-encyclopedia-shell :is(.fke-team-card,.fke-player-card,.fke-country-card,.fke-brand-card,.fke-competition-card,.fke-sponsor-card) h3{
    white-space:normal!important;
    overflow:visible!important;
    text-overflow:clip!important;
  }

  /* Shared relation/article grids on entity detail pages. */
  body.fke-encyclopedia-shell :is(.fke-relation-grid,.fke-related-entities__grid,.fke-kit-relations__grid,.fke-story-context-grid,.fke-team-knowledge-grid,.fke-national-relation-summary__grid){
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:10px!important;
    width:100%!important;
  }
  body.fke-encyclopedia-shell :is(.fke-article-grid,.fke-story-list__grid){
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:10px!important;
    width:100%!important;
    overflow:visible!important;
  }

  /* Internal horizontal timelines may scroll; the page itself may not. */
  body.fke-encyclopedia-shell :is(.fke-kit-timeline,.fke-related-items,.fke-player-career__track,.fke-timeline-scroll){
    max-width:100%!important;
    overflow-x:auto!important;
    overscroll-behavior-inline:contain;
    -webkit-overflow-scrolling:touch;
  }

  /* Fixed bottom nav needs a real content safe area. */
  .fke-footer{padding-bottom:calc(78px + env(safe-area-inset-bottom))!important}
  .fke-mobile-navigation{
    width:100%!important;
    max-width:100vw!important;
    min-width:0!important;
    z-index:80!important;
  }
}

@media (max-width:480px){
  .fke-main{padding-left:10px!important;padding-right:10px!important}
  .fke-home-v3752__hero,.fke-home-v36__hero{width:calc(100% + 20px)!important;margin-left:-10px!important;margin-right:-10px!important}
  .fke-home-v3752__hero-visual,.fke-home-v36__hero-image{height:210px!important;max-height:210px!important}
  .fke-home-v3752__hero-visual img,.fke-home-v36__hero-image img{max-height:190px!important}
  .fke-home-v3752__hero h1,.fke-home-v36__hero h1{font-size:34px!important}
  .fke-home-v3752__actions,.fke-home-v36__hero nav{grid-template-columns:1fr!important}
  .fke-home-v3752__actions .fke-home-v36__primary{grid-column:auto!important}
  .fke-home-v3752__quick{grid-template-columns:1fr 1fr!important}
  .fke-home-v36__latest>div,
  .fke-kit-archive-v36__grid,
  .fke-finder-v36__results,
  .fke-search-v36__results,
  .fke-v377-entity-grid,
  .fke-player-archive__grid,
  .fke-country-archive-v3751__grid{grid-template-columns:1fr!important}
  .fke-home-v3752__players>div{grid-template-columns:1fr!important}
  .fke-home-v3752__section>header,
  .fke-home-v36 section>header{align-items:flex-start!important;flex-direction:column!important}
}
