/* CHILLY GLOBAL 1.3.0 — WORDPRESS LAYOUT + INTERNAL HEADER RESTORATION
   NEW FILENAME intentionally avoids caches holding assets/style.css or wp-adjustments.css.
   No content / database updates.
*/
body.chilly-wordpress main :is(.hero-inner,.stats-inner,.service-grid,.market-grid,.case-grid,.case-stack,.commit-grid,.network-grid,.brochure-grid,.detail-block,.detail-cards,.contact-panels,.loc-grid,.team-grid,.team-card,.document-grid,.document-feature,.project-grid,.projects-grid,.value-grid,.offer-grid,.sector-grid,.footer-grid) {
  display:grid!important;
  min-width:0!important;
  max-width:none;
}
/* WordPress's block flow default must not apply its block-width / auto margins to grid cells. */
body.chilly-wordpress main :is(.hero-inner,.stats-inner,.service-grid,.market-grid,.case-grid,.case-stack,.commit-grid,.network-grid,.brochure-grid,.detail-block,.detail-cards,.contact-panels,.loc-grid,.team-grid,.team-card,.document-grid,.document-feature,.project-grid,.projects-grid,.value-grid,.offer-grid,.sector-grid) > * {
  min-width:0!important;
  max-width:none!important;
  margin-left:0!important;
  margin-right:0!important;
}
body.chilly-wordpress main .wp-block-group.container { width:min(var(--max),calc(100% - 80px))!important; margin-left:auto!important; margin-right:auto!important; }
body.chilly-wordpress main .hero-inner{grid-template-columns:minmax(0,1.05fr) minmax(0,1fr)!important}
body.chilly-wordpress main .stats-inner{grid-template-columns:repeat(4,minmax(0,1fr))!important}
body.chilly-wordpress main :is(.service-grid,.market-grid,.detail-cards,.contact-panels,.document-grid,.project-grid,.projects-grid,.value-grid,.offer-grid,.sector-grid){grid-template-columns:repeat(3,minmax(0,1fr))!important}
body.chilly-wordpress main .case-grid{grid-template-columns:minmax(0,1.2fr) minmax(0,.8fr)!important}
body.chilly-wordpress main .case-stack{grid-template-columns:1fr!important;grid-template-rows:1fr 1fr!important}
body.chilly-wordpress main .commit-grid{grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr)!important}
body.chilly-wordpress main .network-grid{grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr)!important}
body.chilly-wordpress main .brochure-grid{grid-template-columns:minmax(0,1fr) 225px!important}
body.chilly-wordpress main .detail-block{grid-template-columns:repeat(2,minmax(0,1fr))!important}
body.chilly-wordpress main .loc-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}
body.chilly-wordpress main .team-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
body.chilly-wordpress main .team-card{grid-template-columns:170px minmax(0,1fr)!important}
body.chilly-wordpress main .document-feature{grid-template-columns:150px minmax(0,1fr)!important}
body.chilly-wordpress main .mascot-feature{grid-template-columns:165px minmax(0,1fr)!important}
body.chilly-wordpress main :is(.hero-panel,.hero-actions,.section-head){display:flex!important}
/* Match ALL detail-page heroes to the smooth gradient and left circular rings used on Home. */
body.chilly-wordpress main .detail-hero {
  position:relative!important;
  isolation:isolate;
  overflow:hidden;
  background:radial-gradient(ellipse at 2% 20%,#204f69 0%,transparent 36%),linear-gradient(135deg,#0e3046 5%,#092234 85%)!important;
}
body.chilly-wordpress main .detail-hero::after {content:none!important;display:none!important;background:none!important}
body.chilly-wordpress main .detail-hero::before {
  content:""!important;display:block!important;pointer-events:none;
  position:absolute;left:-110px;bottom:-125px;width:350px;height:350px;
  border:1px solid #ffffff14;border-radius:50%;
  box-shadow:0 0 0 50px #ffffff08,0 0 0 110px #ffffff06;
  z-index:0;
}
body.chilly-wordpress main .detail-hero>.container,
body.chilly-wordpress main .detail-hero>.wp-block-group.container{position:relative;z-index:1}
@media (max-width:980px){
 body.chilly-wordpress main .hero-inner{grid-template-columns:1fr!important}
 body.chilly-wordpress main .stats-inner{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 body.chilly-wordpress main :is(.service-grid,.market-grid,.detail-cards,.document-grid,.team-grid){grid-template-columns:repeat(2,minmax(0,1fr))!important}
 body.chilly-wordpress main :is(.case-grid,.commit-grid,.network-grid,.brochure-grid){grid-template-columns:1fr!important}
 body.chilly-wordpress main .team-card{grid-template-columns:135px minmax(0,1fr)!important}
 body.chilly-wordpress main .document-feature{grid-template-columns:140px minmax(0,1fr)!important}
}
@media(max-width:680px){
 body.chilly-wordpress main .wp-block-group.container{width:calc(100% - 36px)!important}
 body.chilly-wordpress main :is(.service-grid,.market-grid,.detail-cards,.contact-panels,.detail-block,.team-grid,.document-grid,.project-grid,.projects-grid,.value-grid,.offer-grid,.sector-grid){grid-template-columns:1fr!important}
 body.chilly-wordpress main :is(.stats-inner,.loc-grid){grid-template-columns:repeat(2,minmax(0,1fr))!important}
 body.chilly-wordpress main .team-card{grid-template-columns:110px minmax(0,1fr)!important}
 body.chilly-wordpress main .document-feature{grid-template-columns:95px minmax(0,1fr)!important}
 body.chilly-wordpress main .mascot-feature{grid-template-columns:94px minmax(0,1fr)!important}
 body.chilly-wordpress main .brochure-grid{grid-template-columns:1fr 90px!important}
}

/* =========================================================
 * WORDPRESS CLASSIC GROUP OUTPUT FIX
 *
 * Staging browser diagnostics confirmed:
 * .team-grid has display:grid and two 431px columns, BUT
 * its only direct child is .wp-block-group__inner-container,
 * containing both .team-card elements. Thus both cards land
 * in the first column of the outer grid.
 *
 * Gutenberg/WordPress may insert the same wrapper around
 * other grid/flex block groups (photo/text, contact cards,
 * network locations, project boxes, team-card internals).
 * Flatten ONLY those extra wrapper divs inside existing
 * layout containers. Leave .container and normal content
 * groups intact to preserve spacing and alignments.
 * ========================================================= */
body.chilly-wordpress main :is(
  .hero-inner,
  .hero-panel,
  .hero-actions,
  .stats-inner,
  .section-head,
  .service-grid,
  .market-grid,
  .case-grid,
  .case-stack,
  .commit-grid,
  .principles,
  .principle,
  .network-grid,
  .brochure-grid,
  .detail-block,
  .detail-cards,
  .contact-panels,
  .contact-flex,
  .contact-buttons,
  .loc-grid,
  .team-grid,
  .team-card,
  .mascot-feature,
  .document-grid,
  .document-feature,
  .project-grid,
  .projects-grid,
  .value-grid,
  .offer-grid,
  .sector-grid
) > .wp-block-group__inner-container {
  display: contents !important;
}

/* Keep grid/flex items from retaining WordPress block-wide margins;
   rules act only after their group wrappers are flattened. */
body.chilly-wordpress main :is(
 .team-grid,.team-card,.contact-panels,.detail-block,.loc-grid,
 .service-grid,.market-grid,.detail-cards,.document-grid,.document-feature,
 .mascot-feature,.projects-grid,.project-grid,.stats-inner,.network-grid,
 .case-grid,.case-stack,.commit-grid,.hero-inner
) > :is(.wp-block-group, .wp-block-image, .wp-block-columns, .wp-block-html) {
  min-width: 0 !important;
  margin-block-start: 0;
  margin-block-end: 0;
}
