/* AntiGrav assignable inner-page shell. Scoped to this template only. */

html:has(body.ag-inner-page-template-body),
html body.ag-inner-page-template-body {
  min-height: 100%;
  margin: 0;
  background: #fff;
}

body.ag-inner-page-template-body .ag-inner-page-document {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: #fff;
}

body.ag-inner-page-template-body .ag-inner-page-header,
body.ag-inner-page-template-body .ag-inner-page-content {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 0;
}

body.ag-inner-page-template-body .ag-inner-page-content {
  flex: 1 0 auto;
  padding-top: 64px;
  padding-bottom: clamp(32px, 3.5vw, 48px);
  background: #fff;
}

body.ag-inner-page-template-body .ag-header-top-tagline {
  font-size: 12px !important;
  line-height: 18px !important;
}

body.ag-inner-page-template-body .ag-inner-page-heading {
  margin-bottom: 32px;
  padding: 0;
}

html body.ag-inner-page-template-body h1.ag-inner-page-title {
  margin: 0;
  padding: 0;
  color: #1c1c1c !important;
  font-family: Inter, Arial, sans-serif !important;
  font-size: 36px !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
  letter-spacing: normal;
  text-transform: none;
  overflow-wrap: anywhere;
}

/*
 * Direct Gutenberg content uses the same central measure as Header/Footer.
 * Kadence Row Layout wrappers keep their own full-width/container behavior.
 */
body.ag-inner-page-template-body .ag-inner-page-content > :not(.alignfull):not(.wp-block-kadence-rowlayout):not(.kb-row-layout-wrap) {
  box-sizing: border-box;
  width: min(1140px, calc(100% - 32px));
  max-width: 100%;
  margin-right: auto;
  margin-left: auto;
}

body.ag-inner-page-template-body .ag-inner-page-content > .alignwide {
  width: min(1140px, calc(100% - 32px));
  max-width: 100%;
  margin-right: auto;
  margin-left: auto;
}

body.ag-inner-page-template-body .ag-inner-page-content > .alignfull,
body.ag-inner-page-template-body .ag-inner-page-content > .wp-block-kadence-rowlayout,
body.ag-inner-page-template-body .ag-inner-page-content > .kb-row-layout-wrap {
  width: 100%;
  max-width: none;
  margin-right: 0;
  margin-left: 0;
}

body.ag-inner-page-template-body .ag-service-footer-section {
  flex: 0 0 auto;
}

@media (max-width: 1024px) {
  body.ag-inner-page-template-body .ag-inner-page-content {
    padding-top: 48px;
  }

  body.ag-inner-page-template-body .ag-inner-page-heading {
    margin-bottom: 24px;
  }

  html body.ag-inner-page-template-body h1.ag-inner-page-title {
    font-size: 32px !important;
    line-height: 1.25 !important;
  }
}

@media (max-width: 768px) {
  body.ag-inner-page-template-body .ag-inner-page-content {
    padding-top: 40px;
  }

  body.ag-inner-page-template-body .ag-inner-page-heading {
    margin-bottom: 20px;
  }

  html body.ag-inner-page-template-body h1.ag-inner-page-title {
    font-size: 28px !important;
    line-height: 1.25 !important;
  }
}

@media (max-width: 767px) {
  body.ag-inner-page-template-body .ag-header-menu-shell::after {
    right: 0;
    left: 0;
    width: auto;
    transform: none;
  }
}

/* Shared technical shell for content-led AntiGrav page and post templates. */

html:has(body.ag-content-template-body),
html body.ag-content-template-body {
  min-height: 100%;
  margin: 0;
  overflow-x: clip;
  background: #fff;
}

body.ag-content-template-body .ag-content-template-document {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: #fff;
}

body.ag-content-template-body .ag-content-template-header,
body.ag-content-template-body .ag-content-template-main,
body.ag-content-template-body .ag-content-template-content {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 0;
}

body.ag-content-template-body .ag-content-template-main {
  flex: 1 0 auto;
  background: #fff;
}

body.ag-content-template-body .ag-content-template-content > .alignfull,
body.ag-content-template-body .ag-content-template-content > .wp-block-kadence-rowlayout,
body.ag-content-template-body .ag-content-template-content > .kb-row-layout-wrap {
  width: 100%;
  max-width: none;
  margin-right: 0;
  margin-left: 0;
}

body.ag-content-template-body .ag-service-footer-section {
  flex: 0 0 auto;
}
