/**
 * Photoprompt unified content spacing v3.13.4
 * One measured shell-to-content rhythm for every public route.
 * The homepage remains intentionally immersive and is excluded.
 */

body.photoprompt-site{
  --pp-shell-top:12px;
  --pp-shell-brand-h:58px;
  --pp-shell-quick-h:50px;
  --pp-content-gap:24px;
  --pp-creative-hero-gap:64px;
  --pp-shell-static-bottom:calc(var(--pp-shell-top) + var(--pp-shell-brand-h) + var(--pp-shell-quick-h));
  --pp-content-start:calc(var(--pp-shell-measured-bottom, var(--pp-shell-static-bottom)) + var(--pp-content-gap));
}

/* Exactly one route owner receives the global shell offset. */
body.photoprompt-site:not(.photoprompt-home) .pp-content-start-owner{
  box-sizing:border-box!important;
  margin-top:0!important;
  padding-top:var(--pp-content-start)!important;
}

/* Single products own their first-screen geometry themselves.
 * shell.js deliberately never adds .pp-content-start-owner on this route,
 * preventing the post-load jump caused by late header measurement. */
body.photoprompt-site.pp-product-route .pp-product-page{
  margin-top:0!important;
  padding-top:0!important;
}

/* The first visual block must start cleanly under the measured shell. */
body.photoprompt-site:not(.photoprompt-home) .pp-content-start-owner > :first-child,
body.photoprompt-site:not(.photoprompt-home) .pp-content-start-owner > article:first-child,
body.photoprompt-site:not(.photoprompt-home) .pp-content-start-owner > section:first-child{
  margin-top:0!important;
}

/* Parent-theme / plugin defaults must not create a second offset. */
body.photoprompt-site:not(.photoprompt-home) :is(.site-main,main.site-main):not(.pp-content-start-owner){
  margin-top:0!important;
  padding-top:0!important;
}

/* Route surfaces hand off their OUTER top spacing to the shell system. */
body.photoprompt-site:not(.photoprompt-home) :where(
  .ppc-studio--saas,
  .ppfl,
  .pp-platform-main,
  .pp-shop,
  .pp-favorites-page,
  .pp-magazine,
  .pp-journal-article,
  .pp-creators-page,
  .pp-creator-profile,
  .pp-collections,
  .pp-collection-single,
  .pp-about-portal,
  .ppc-model-lab,
  .ppc-model-lab--editorial,
  .ppc-model-single,
  .ppc-model-single--editorial,
  .ppc-model-archive,
  .pp-credits-page,
  .pp-studio-gate,
  #wcfm-main-contentainer
):not(.pp-content-start-owner){
  margin-top:0!important;
  padding-top:0!important;
}

/* Keep route roots flush when they are the selected content owner. */
body.photoprompt-site:not(.photoprompt-home) .pp-content-start-owner:where(
  .ppc-studio--saas,
  .ppfl,
  .pp-platform-main,
  .pp-shop,
  .pp-favorites-page,
  .pp-magazine,
  .pp-journal-article,
  .pp-creators-page,
  .pp-creator-profile,
  .pp-collections,
  .pp-collection-single,
  .pp-about-portal,
  .ppc-model-lab,
  .ppc-model-lab--editorial,
  .ppc-model-single,
  .ppc-model-single--editorial,
  .ppc-model-archive,
  .pp-credits-page,
  .pp-studio-gate,
  #wcfm-main-contentainer
){
  margin-top:0!important;
}

/* Video / hero routes start on the same vertical beat. */
body.photoprompt-site:not(.photoprompt-home) .pp-content-start-owner :is(
  .ppc-model-lab-hero,
  .ppc-model-single__hero,
  .pp-journal-hero,
  .pp-magazine-hero,
  .pp-platform-hero
):first-child{
  margin-top:0!important;
}

/* WooCommerce/account surfaces: shell owns the outer rhythm, cards own the inside. */
body.photoprompt-site:not(.photoprompt-home).photoprompt-woocommerce :is(
  .woocommerce,
  .woocommerce-page
):not(.pp-content-start-owner){
  margin-top:0!important;
}

@media(max-width:980px){
  body.photoprompt-site{
    --pp-shell-brand-h:54px;
    --pp-shell-quick-h:46px;
    --pp-content-gap:20px;
    --pp-creative-hero-gap:36px;
  }
}

@media(max-width:680px){
  body.photoprompt-site{
    --pp-shell-top:max(8px, env(safe-area-inset-top, 0px));
    --pp-shell-brand-h:52px;
    --pp-shell-quick-h:0px;
    --pp-content-gap:16px;
    --pp-creative-hero-gap:16px;
  }
}

@media(max-width:430px){
  body.photoprompt-site{
    --pp-content-gap:16px;
  }
}

/* WordPress admin bar shifts the fixed shell; JS measures the real top, this is the no-JS fallback. */
@media(min-width:783px){
  body.admin-bar.photoprompt-site{
    --pp-shell-top:44px;
  }
}
@media(max-width:782px){
  body.admin-bar.photoprompt-site{
    --pp-shell-top:max(54px, calc(env(safe-area-inset-top, 0px) + 46px));
  }
}
