/* Theme A 1.9.11 leftovers — column + cards + same modest air top AND bottom.
   Anthony addendum: reduce the old 5rem voids, but leave breathing room
   under the nav AND before the footer — not flush, not huge.
   Desktop ~1–1.5rem; mobile ~0.75–1.25rem. Same token both ends.
   Do not touch favicon, header avatar, nav, GTM, or the measurement-check gate. */

:root {
  --mg-col: min(56rem, 100%);
  --mg-read: var(--mg-col);
  --mg-wide: var(--mg-col);
  --mg-card-radius: 12px;
  --mg-card-pad: 1.25rem 1.35rem;
  --mg-edge-pad: 1.25rem; /* desktop air under nav AND before footer */
}

/* Inner column is 56rem; side gutters sit outside so 三關 / 01–04 can use the full 896. */
html body.kadence-theme .content-container,
html body.page .content-container,
html body.single .content-container,
html body.blog .content-container,
html body.archive .content-container,
html body.search .content-container,
html body.kadence-theme .site-container.content-container,
html body.kadence-theme.single .content-container {
  max-width: min(calc(56rem + 2 * var(--mg-inline)), 100%) !important;
  width: 100% !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-top: var(--mg-edge-pad) !important;
  padding-bottom: var(--mg-edge-pad) !important;
  padding-left: var(--mg-inline) !important;
  padding-right: var(--mg-inline) !important;
  box-sizing: border-box !important;
}

/* Kadence customizer still prints .content-area { margin-top/bottom: 5rem } — the leftover voids. */
html body.kadence-theme #primary.content-area,
html body.kadence-theme .content-area,
html body.content-vertical-padding-show .content-area,
html body.page .content-area,
html body.single .content-area,
html body.blog .content-area,
html body.archive .content-area,
html body.search .content-area,
html body.page-template-page-no-title .content-area {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

html body.kadence-theme #inner-wrap,
html body.kadence-theme .site-main,
html body.kadence-theme #main,
html body.kadence-theme .content-wrap,
html body.kadence-theme .entry-content-wrap,
html body.kadence-theme .content-bg,
html body.kadence-theme .entry-content,
html body.kadence-theme article.entry,
html body.kadence-theme article.single-entry {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* Hidden Kadence page title band must not leave a 200px spacer under the nav. */
html body.page .entry-hero,
html body.page .entry-hero-container,
html body.page .entry-hero-container-inner,
html body.page .entry-hero .entry-header,
html body.page-template-page-no-title .entry-hero,
html body.page-template-page-no-title .entry-header,
html body.blog .entry-hero {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
}

/* Singles keep the title, lose the empty hero band. */
html body.single .entry-hero,
html body.single .entry-hero-container,
html body.single .entry-hero-container-inner,
html body.single .hero-section,
html body.single .entry-hero .entry-header {
  min-height: 0 !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* WP constrained groups were shrinking blog / contact / 自查 to a skinny island. */
html body .is-layout-constrained,
html body .wp-block-group__inner-container,
html body .wp-block-group.alignwide,
html body .mg-content-width,
html body .mg-blog-index,
html body .mg-page,
html body .mg-read,
html body .mg-mc-gate {
  max-width: none !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box !important;
}

/* One section-card format: white well, hairline, 12px corners. */
html body .mg-section,
html body .mg-mc-gate,
html body.single .entry-header,
html body.single .entry-content,
html body.single .mg-related,
html body.single #comments,
html body.page-id-10 .mg-content-width,
html body.page-id-8 .mg-content-width {
  background: var(--mg-card) !important;
  border: 1px solid var(--mg-border) !important;
  border-radius: var(--mg-card-radius) !important;
  box-shadow: 0 1px 2px rgba(12, 14, 18, 0.06);
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: none !important;
}

html body .mg-section {
  padding: var(--mg-card-pad) !important;
  margin: 0 0 1.25rem !important;
}

html body .mg-section:last-child,
html body .mg-page > .mg-section:last-child,
html body.single #comments {
  margin-bottom: 0 !important;
}

/* First/last cards have no extra margin — the only end air is --mg-edge-pad. */
html body .mg-page > .mg-section:first-child,
html body .entry-content > .mg-section:first-child,
html body .entry-content > .mg-page > .mg-section:first-child,
html body .mg-section--hero,
html body .mg-mc-gate,
html body.single .mg-single-wrap,
html body.single .entry-header,
html body.page-id-10 .mg-content-width,
html body.page-id-8 .mg-content-width {
  margin-top: 0 !important;
}

html body .mg-section--hero {
  background: linear-gradient(135deg, var(--mg-chip) 0%, var(--mg-card) 100%) !important;
  border-left: 4px solid var(--mg-accent) !important;
  padding: 1.15rem 1.35rem !important;
}

/* Stretch homepage 自查三關 + 01–04 to the full inner column. */
html body .mg-figure--wide,
html body .mg-process-figure,
html body .mg-illus.mg-figure,
html body .mg-process,
html body .mg-grid,
html body .mg-grid--3 {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

html body .mg-illus svg,
html body .mg-figure svg,
html body .mg-figure--wide svg,
html body .mg-process-figure svg {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
}

html body .mg-process {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 0.75rem !important;
}

/* Blog list uses the same wells. */
html body .mg-blog-featured,
html body .mg-blog-compact {
  background: var(--mg-card);
  border: 1px solid var(--mg-border);
  border-radius: var(--mg-card-radius);
  box-sizing: border-box;
  width: 100%;
}

html body .mg-blog-featured {
  padding: 1.25rem 1.35rem !important;
}

html body.single .mg-single-wrap {
  margin: 0 !important;
  padding: 0.85rem 0 0 !important;
}

html body.single .entry-header {
  padding: var(--mg-card-pad) !important;
  margin: 0 0 1.25rem !important;
}

html body.single .entry-content {
  padding: var(--mg-card-pad) !important;
  margin: 0 0 1.25rem !important;
}

html body.single .mg-related,
html body.single #comments {
  padding: var(--mg-card-pad) !important;
  margin: 0 0 1.25rem !important;
}

html body.page-id-10 .mg-content-width,
html body.page-id-8 .mg-content-width,
html body .mg-mc-gate {
  padding: var(--mg-card-pad) !important;
  margin: 0 !important;
}

/* Footer: no extra 5rem paper strip. Breathing room lives on --mg-edge-pad. */
html body #colophon,
html body #colophon .site-footer-wrap,
html body #colophon .site-bottom-footer-wrap,
html body #colophon .site-footer-row-container-inner,
html body #colophon .site-container {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

html body #colophon .site-bottom-footer-inner-wrap {
  padding-top: 0.75rem !important;
  padding-bottom: 0.75rem !important;
}

html body #colophon .site-bottom-footer-inner-wrap .widget,
html body #colophon .footer-widget-area,
html body #colophon .site-info {
  margin: 0 !important;
}

@media (max-width: 782px) {
  html body .mg-process {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 600px) {
  html body .mg-process {
    grid-template-columns: 1fr !important;
  }
  html body.kadence-theme .content-container,
  html body.page .content-container,
  html body.single .content-container,
  html body.blog .content-container {
    padding-top: 1rem !important; /* mobile ~0.75–1.25rem both ends */
    padding-bottom: 1rem !important;
  }
}
