/* POLARIS / shared page canvas — v0.2.8
 * Reference = Compact Footer v0.6.1: width min(1256px, 100vw - 32px).
 * Change ONLY outer page shells. Preserve template-specific internal padding,
 * article line length, media sizing, GPX interactions and Cocoon mobile menu.
 * Do not change the footer; it is the reference. All targets use body classes
 * supplied by the existing POLARIS plugins, avoiding arbitrary WordPress pages.
 */
:root {
  --pob-canvas-max: 1256px;
  --pob-canvas-width: min(var(--pob-canvas-max), calc(100vw - 32px));
}

/* Full-page POLARIS experiences: Home, five categories, portfolio, map,
   and the dedicated Search page. Standard articles keep their internal
   two-column main/sidebar layout, handled separately below. */
body.home.page #content,
body.pob-suite-category #content,
body.pob-ui-portfolio #content,
body.polaris-trail-map-dedicated-page #content,
body.pob-suite-global-page #content {
  box-sizing: border-box !important;
  width: var(--pob-canvas-width) !important;
  max-width: none !important;
  min-width: 0 !important;
  position: relative !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}
body.home.page #content-in,
body.pob-suite-category #content-in,
body.pob-ui-portfolio #content-in,
body.polaris-trail-map-dedicated-page #content-in,
body.pob-suite-global-page #content-in {
  box-sizing: border-box !important;
  display: block !important;
  position: static !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}
body.home.page #main,
body.pob-suite-category #main,
body.pob-ui-portfolio #main,
body.polaris-trail-map-dedicated-page #main,
body.pob-suite-global-page #main {
  box-sizing: border-box !important;
  float: none !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  /* Deliberately do not override padding: each UI controls its own inset. */
}

/* Existing single-article reading UI can retain a sidebar and a narrower
   reading column. Only its *outer page frame* must line up with the footer. */
body.pob-reading-v1 #content {
  box-sizing: border-box !important;
  width: var(--pob-canvas-width) !important;
  max-width: none !important;
  min-width: 0 !important;
  position: relative !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
  margin: 0 !important;
}
body.pob-reading-v1 #content-in {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  /* No display/float changes: retain the original Cocoon sidebar grid. */
}

/* The new notice/news/misc templates bypass Cocoon's #content wrapper;
   these .pob-u-shell elements must be normalized directly. */
body.pob-u-enabled .pob-u-shell {
  box-sizing: border-box !important;
  position: relative !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
  width: var(--pob-canvas-width) !important;
  max-width: none !important;
  min-width: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  /* Do not change the template's 30px padding, hero or reading-card width. */
}

/* Portfolio shortcode should fill its page frame, not stop at 1160px. */
body.pob-ui-portfolio #main .pobpf-root,
body.pob-ui-portfolio #main .pobpf-root .site {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
}

/* Narrow devices: all outer shells share the same 16px-side gutter as the
   footer, but their interior layouts stay responsive and independently sized. */
@media (max-width: 767px) {
  body.home.page #content,
  body.pob-suite-category #content,
  body.pob-ui-portfolio #content,
  body.polaris-trail-map-dedicated-page #content,
  body.pob-suite-global-page #content,
  body.pob-reading-v1 #content,
  body.pob-u-enabled .pob-u-shell {
    width: calc(100vw - 32px) !important;
  }
}

/* POLARIS / desktop breathing room between the navigation and page canvas.
 * In the approved staging UI a 16px pale-green strip separates the white
 * navigation from the white page content. v0.2.7's full-frame reset removed
 * this spacing on production. Keep outer width and inner layouts unchanged.
 * Mobile is intentionally untouched; Cocoon uses a different menu there.
 */
@media (min-width: 835px) {
  body.home.page #content,
  body.pob-suite-category #content,
  body.pob-ui-portfolio #content,
  body.polaris-trail-map-dedicated-page #content,
  body.pob-suite-global-page #content,
  body.pob-reading-v1 #content,
  body.pob-u-enabled .pob-u-shell {
    margin-top: 16px !important;
  }
}
