/* Capital City Roots FC — hard isolate static homepage from Allez front-page rails */
html, body { max-width:100%; overflow-x:hidden; }

.home .wp-block-post-title,
.home .wp-block-query-title,
.home .entry-title { display:none !important; }

/* Reset every ancestor that contains the custom homepage */
body.home main:has(.ccr-home),
body.home .site-main:has(.ccr-home),
body.home .site-content:has(.ccr-home),
body.home .content-area:has(.ccr-home),
body.home article:has(.ccr-home),
body.home .entry-content:has(.ccr-home) {
  display:block !important;
  width:100% !important;
  max-width:none !important;
  min-width:0 !important;
  margin:0 !important;
  padding:0 !important;
  position:static !important;
  float:none !important;
  transform:none !important;
  grid-template-columns:none !important;
  grid-auto-flow:row !important;
  columns:auto !important;
  overflow:visible !important;
}

/* Hide Allez sibling rails/widgets around the homepage, but keep anything that actually contains .ccr-home */
body.home main:has(.ccr-home) > *:not(:has(.ccr-home)),
body.home .site-main:has(.ccr-home) > *:not(:has(.ccr-home)),
body.home .site-content:has(.ccr-home) > *:not(:has(.ccr-home)),
body.home .content-area:has(.ccr-home) > *:not(:has(.ccr-home)) {
  display:none !important;
}

body.home aside,
body.home .widget-area,
body.home .sidebar,
body.home .footer-widgets,
body.home .site-footer,
body.home footer {
  display:none !important;
}

body.home .ccr-home {
  display:block !important;
  width:100vw !important;
  max-width:100vw !important;
  min-width:0 !important;
  margin-left:calc(50% - 50vw) !important;
  margin-right:calc(50% - 50vw) !important;
  padding:0 !important;
  position:relative !important;
  float:none !important;
  transform:none !important;
  overflow-x:hidden !important;
  columns:auto !important;
}

body.home .ccr-home,
body.home .ccr-home * { box-sizing:border-box !important; }

body.home .ccr-home > section {
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  margin:0 !important;
  position:relative !important;
  inset:auto !important;
  float:none !important;
  clear:both !important;
  transform:none !important;
  grid-column:auto !important;
  grid-row:auto !important;
  columns:auto !important;
}

body.home .ccr-home .ccr-inner {
  width:calc(100% - 48px) !important;
  max-width:1180px !important;
  min-width:0 !important;
  margin-left:auto !important;
  margin-right:auto !important;
  float:none !important;
  position:relative !important;
  transform:none !important;
}

body.home .ccr-home img { max-width:100% !important; height:auto !important; }

body.home .ccr-home h1,
body.home .ccr-home h2,
body.home .ccr-home h3,
body.home .ccr-home p,
body.home .ccr-home a,
body.home .ccr-home span,
body.home .ccr-home div {
  writing-mode:horizontal-tb !important;
  text-orientation:mixed !important;
  word-break:normal !important;
  overflow-wrap:break-word !important;
  white-space:normal !important;
}

/* intended desktop grids */
body.home .ccr-hero-grid { display:grid !important; grid-template-columns:minmax(0,1.35fr) minmax(0,.65fr) !important; }
body.home .ccr-two-col { display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
body.home .ccr-match-grid { display:grid !important; grid-template-columns:repeat(5,minmax(0,1fr)) !important; }
body.home .ccr-stats-grid { display:grid !important; grid-template-columns:repeat(3,minmax(0,1fr)) !important; }

@media (max-width:782px) {
  body.home .ccr-home .ccr-inner { width:calc(100% - 36px) !important; }

  body.home .ccr-home .ccr-hero,
  body.home .ccr-home .ccr-matches,
  body.home .ccr-home .ccr-community,
  body.home .ccr-home .ccr-partners,
  body.home .ccr-home .ccr-about { padding:48px 18px !important; }

  body.home .ccr-hero-grid,
  body.home .ccr-two-col,
  body.home .ccr-match-grid {
    display:grid !important;
    grid-template-columns:minmax(0,1fr) !important;
    gap:24px !important;
  }

  body.home .ccr-stats-grid {
    display:grid !important;
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:4px !important;
  }

  body.home .ccr-home h1 { font-size:clamp(2.35rem,10.5vw,3.35rem) !important; line-height:1.02 !important; }
  body.home .ccr-home h2 { font-size:clamp(1.9rem,7.5vw,2.6rem) !important; line-height:1.08 !important; }

  body.home .ccr-actions {
    display:flex !important;
    flex-direction:column !important;
    align-items:stretch !important;
    gap:12px !important;
  }
  body.home .ccr-actions a { width:100% !important; text-align:center !important; }

  .wp-block-navigation__responsive-container-open,
  .wp-block-navigation__responsive-container-close { display:none !important; }
}

@media (max-width:480px) {
  body.home .ccr-stats-grid { grid-template-columns:1fr !important; }
}


/* --- WPWriter addition --- */

/* Homepage emergency isolation: Allez template regions are rendering beside page content */
@media (max-width: 900px) {
  body.home main:has(.ccr-home) > *:not(.ccr-home):not(:has(.ccr-home)),
  body.home .site-main:has(.ccr-home) > *:not(.ccr-home):not(:has(.ccr-home)),
  body.home .wp-block-post-content:has(.ccr-home) > *:not(.ccr-home):not(:has(.ccr-home)),
  body.home .entry-content:has(.ccr-home) > *:not(.ccr-home):not(:has(.ccr-home)) {
    display: none !important;
  }

  body.home main:has(.ccr-home),
  body.home .site-main:has(.ccr-home),
  body.home .wp-block-post-content:has(.ccr-home),
  body.home .entry-content:has(.ccr-home) {
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    grid-template-columns: 1fr !important;
    columns: 1 !important;
    overflow: hidden !important;
  }

  body.home .ccr-home {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
}
