/* ============================================================
   CRATOS CAN — one real 1280px content rail across the complete site
   Root + Clean Energy + Cyber Resilience + Business Resilience.

   Full-bleed section backgrounds remain untouched. All visible page
   content is placed inside .site-width-shell, matching the max-width
   used by the automatic Customers & Partners carousel.
   ============================================================ */
:root{
  --site-content-max:1280px;
  --site-content-side:clamp(20px,6vw,76px);
}

.site-width-shell{
  width:100%;
  max-width:var(--site-content-max);
  margin-left:auto;
  margin-right:auto;
  min-width:0;
}

/* Use the same outer breathing room as the logo-carousel section. */
main > section,
body > section{
  padding-left:var(--site-content-side);
  padding-right:var(--site-content-side);
}

/* ---------------- Header / navigation rail ---------------- */
.entry-header,
.site-header{
  padding-left:clamp(20px,4vw,64px);
  padding-right:clamp(20px,4vw,64px);
}
.entry-header > .site-header-shell,
.site-header > .site-header-shell{
  display:flex;
  align-items:center;
  width:100%;
}
.entry-header > .site-header-shell{justify-content:space-between;gap:20px}
.site-header > .site-header-shell{gap:25px}
.site-header > .site-header-shell .main-nav{margin-left:auto}

/* Mega-menu aligns to the exact same maximum rail. */
.megamenu-inner{
  width:calc(100% - 40px);
  max-width:var(--site-content-max)!important;
  margin-left:auto;
  margin-right:auto;
}
@media(min-width:1081px){
  .megamenu-inner{padding-left:0!important;padding-right:0!important}
  .megamenu-close{right:0!important}
}

/* ---------------- Footer rail ---------------- */
.site-footer{
  padding-left:var(--site-content-side);
  padding-right:var(--site-content-side);
}

/* ---------------- Layouts that previously lived on the SECTION itself ----------------
   The outer section remains full-bleed; its shell now owns the layout. */

/* Root two-column intro */
.site-area-root main > .entry-section.intro-grid{display:block}
.site-area-root main > .entry-section.intro-grid > .site-section-shell{
  display:grid;grid-template-columns:.9fr 1.1fr;gap:60px;align-items:start;
}

/* Clean / Business / Cyber index hero grids */
main > .hero{display:flex;align-items:center}
.site-area-clean main > .hero > .site-section-shell{
  display:grid;grid-template-columns:minmax(0,1.12fr) minmax(330px,.88fr);gap:60px;align-items:center;
}
.site-area-clean main > .hero.energy-hero > .site-section-shell{
  grid-template-columns:minmax(0,1.2fr) 420px;
}
.site-area-cyber main > .hero > .site-section-shell{
  display:grid;grid-template-columns:minmax(0,1.2fr) 420px;gap:60px;align-items:center;
}
.site-area-business main > .hero > .site-section-shell{
  display:grid;grid-template-columns:minmax(0,1.12fr) minmax(330px,.88fr);gap:60px;align-items:center;
}

/* Two-column intro sections on service/detail pages */
main > .intro{display:block}
.site-area-clean main > .intro > .site-section-shell,
.site-area-business main > .intro > .site-section-shell{
  display:grid;grid-template-columns:.92fr 1.08fr;gap:72px;align-items:start;
}
.site-area-cyber main > .intro > .site-section-shell{
  display:grid;grid-template-columns:.9fr 1.1fr;gap:80px;align-items:start;
}
.site-area-clean .intro > .site-section-shell > div:last-child,
.site-area-business .intro > .site-section-shell > div:last-child{
  font-size:1.08rem;color:#344653;
}

/* Cyber card grids that are top-level sections. */
.site-area-cyber main > .cards,
.site-area-cyber main > .detail-grid,
.site-area-cyber main > .product-list,
.site-area-cyber main > .industry-grid,
.site-area-cyber main > .contact-grid{
  display:block;
}
.site-area-cyber main > .cards > .site-section-shell,
.site-area-cyber main > .detail-grid > .site-section-shell,
.site-area-cyber main > .product-list > .site-section-shell,
.site-area-cyber main > .industry-grid > .site-section-shell,
.site-area-cyber main > .contact-grid > .site-section-shell{
  display:grid;gap:24px;
}
.site-area-cyber main > .detail-grid > .site-section-shell{grid-template-columns:1fr}
.site-area-cyber main > .product-list > .site-section-shell{grid-template-columns:repeat(2,1fr)}
.site-area-cyber main > .industry-grid > .site-section-shell{grid-template-columns:repeat(2,1fr)}
.site-area-cyber main > .contact-grid > .site-section-shell{grid-template-columns:1fr 1fr}
.site-area-cyber main > .cards.three > .site-section-shell{grid-template-columns:repeat(3,1fr)}
.site-area-cyber main > .cards.four > .site-section-shell{grid-template-columns:repeat(4,1fr)}
.site-area-cyber main > .cards.service-cards > .site-section-shell{grid-template-columns:repeat(2,1fr)}

/* Clean Energy top-level expert/contact grids */
.site-area-clean main > .expert-strip,
.site-area-clean main > .contact-teaser,
.site-area-clean main > .contact-grid{
  display:block;
}
.site-area-clean main > .expert-strip > .site-section-shell{
  display:grid;grid-template-columns:250px 1fr;gap:38px;align-items:center;
}
.site-area-clean main > .contact-teaser > .site-section-shell{
  display:grid;grid-template-columns:1fr 270px;gap:38px;align-items:center;
}
.site-area-clean main > .contact-teaser > .site-section-shell > img{order:2}
.site-area-clean main > .contact-grid > .site-section-shell{
  display:grid;grid-template-columns:1fr 1fr;gap:24px;
}

/* Page hero direct-child selectors need to point through the shell. */
.page-hero > .site-section-shell{position:relative;z-index:1}
.site-area-clean .page-hero > .site-section-shell > p:last-child,
.site-area-business .page-hero > .site-section-shell > p:last-child{
  max-width:850px;font-size:1.22rem;color:#dce9e4;
}

/* Legal-page direct child rules moved one level inward. */
.site-area-clean .legal > .site-section-shell > p,
.site-area-clean .legal > .site-section-shell > ul,
.site-area-business .legal > .site-section-shell > p,
.site-area-business .legal > .site-section-shell > ul,
.site-area-cyber .legal > .site-section-shell > p,
.site-area-cyber .legal > .site-section-shell > ul{max-width:900px}

/* Root hero and legal hero keep their intended narrower text measure inside the rail. */
.site-area-root .entry-hero > .site-section-shell{position:relative;z-index:1}
.site-area-root .legal-hero > .site-section-shell{position:relative;z-index:1}
.site-area-root .legal-main > .site-section-shell{width:100%}

/* Moved resilience sections + exact logo-carousel / industries alignment. */
.resilience-head,
.deliver-grid,
.matrix-wrap,
.evidence-box,
.section-actions,
.energy-references,
.partner-logo-inner,
.partner-logo-viewport,
.partner-grid,
.industry-grid,
.industry-legend,
.closing-grid{
  max-width:var(--site-content-max)!important;
}

/* Root Industries: keep readable card widths instead of forcing a brittle column count. */
.site-area-root .industry-grid{
  grid-template-columns:repeat(4,minmax(0,1fr));
}

/* ---------------- Responsive ---------------- */
@media(max-width:1180px){
  .site-area-root .industry-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .site-area-cyber main > .cards.four > .site-section-shell{grid-template-columns:repeat(2,1fr)}
}

/* Collapse area navigation a little earlier so the fixed rail never forces overflow. */
@media(max-width:1080px){
  .site-header .main-nav{
    display:none;position:absolute;left:20px;right:20px;top:78px;background:#fff;
    border:1px solid var(--line);border-radius:20px;padding:14px;flex-direction:column;
    align-items:stretch;box-shadow:0 24px 56px rgba(7,20,33,.18);z-index:180;
  }
  .site-header .main-nav.is-open{display:flex}
  .site-header .main-nav a,.site-header .services-trigger{width:100%;justify-content:space-between;text-align:left}
  .site-header .nav-toggle{display:block}
  .site-header > .site-header-shell > .btn-primary{display:none}
  .site-header .megamenu{position:fixed;top:78px;left:20px;right:20px;border-radius:20px;border:1px solid var(--line);max-height:calc(100vh - 100px)}
  .site-header .megamenu-inner{width:100%;padding-left:20px!important;padding-right:20px!important}

  main > .hero > .site-section-shell,
  main > .intro > .site-section-shell,
  .site-area-clean main > .expert-strip > .site-section-shell,
  .site-area-clean main > .contact-teaser > .site-section-shell,
  .site-area-clean main > .contact-grid > .site-section-shell,
  .site-area-cyber main > .contact-grid > .site-section-shell{
    grid-template-columns:1fr!important;
  }
  .site-area-clean main > .contact-teaser > .site-section-shell > img{order:0}
  .site-area-cyber main > .product-list > .site-section-shell,
  .site-area-cyber main > .industry-grid > .site-section-shell{grid-template-columns:1fr}
}

@media(max-width:950px){
  .site-area-root main > .entry-section.intro-grid > .site-section-shell{grid-template-columns:1fr}
  .site-area-root .industry-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media(max-width:720px){
  :root{--site-content-side:20px}
  .site-area-cyber main > .cards.three > .site-section-shell,
  .site-area-cyber main > .cards.four > .site-section-shell,
  .site-area-cyber main > .cards.service-cards > .site-section-shell{grid-template-columns:1fr}
}

@media(max-width:680px){
  .site-area-root .industry-grid{grid-template-columns:1fr}
  .entry-header,.site-header{padding-left:18px;padding-right:18px}
}

/* Root navigation: switch before the six links can crowd the 1280px rail. */
@media(max-width:1100px){
  body.site-area-root > .entry-header{
    position:relative;background:#fff;flex-wrap:nowrap;gap:12px;
    box-shadow:0 8px 28px rgba(7,20,33,.07);
  }
  body.site-area-root > .entry-header .brand{color:#071421}
  body.site-area-root > .entry-header .brand span{border-left-color:#005578}
  body.site-area-root > .entry-header .brand small{color:#005578}
  body.site-area-root > .entry-header .brand img{content:url('../assets-cratos-logo.png')}
  body.site-area-root > .entry-header .root-nav-toggle{
    display:block;color:#071421;border-color:var(--line);background:#f2f6f8;backdrop-filter:none;
  }
  body.site-area-root > .entry-header .top-links{
    display:none;position:absolute;left:20px;right:20px;top:100%;width:auto;background:#fff;
    border:1px solid var(--line);border-radius:20px;padding:12px;
    box-shadow:0 24px 56px rgba(7,20,33,.18);flex-direction:column;align-items:stretch;
    overflow:visible;z-index:20;
  }
  body.site-area-root > .entry-header .top-links.is-open{display:flex}
  body.site-area-root > .entry-header .top-links a{
    color:#071421!important;background:transparent;border:0;text-align:left;width:100%;padding:10px 12px;
  }
  body.site-area-root > .entry-header .top-links a:hover,
  body.site-area-root > .entry-header .top-links a.active{background:#eef4f6;color:#005578!important}
}
