/*
 * WB1 Discovery Shell 1.0.0
 * The pages that already look correct are the control group.
 * Discovery pages now plug into the exact same page shell; only the gallery
 * expands from the reading measure to the full shell.
 */

/* Standard WB1 pages */
.wb1-page-template > .wb1-page-template__gallery{
  width:100%!important;
  max-width:none!important;
  margin-left:auto!important;
  margin-right:auto!important;
}

/* Homepage uses the same physical shell even though WordPress routes via front-page.php. */
.wb1-home-frame{
  box-sizing:border-box!important;
  width:min(calc(100% - 64px),1440px)!important;
  max-width:1440px!important;
  margin-left:auto!important;
  margin-right:auto!important;
}
.wb1-home-frame > .wb1-reading-frame{
  width:min(100%,1180px)!important;
  max-width:1180px!important;
  margin-left:auto!important;
  margin-right:auto!important;
}
.wb1-home-frame > .wb1-wide-frame{
  box-sizing:border-box!important;
  width:100%!important;
  max-width:none!important;
  margin:48px 0 0!important;
}

/* Core discovery wrappers cannot create a second container. */
.wb1-page-template__gallery > .wb1-structured-discovery,
.wb1-home-frame > .wb1-wide-frame > .wb1-structured-discovery,
.wb1-structured-discovery,
.wb1-structured-discovery > .epr-project-discovery,
.wb1-structured-discovery .epr-pd-surface{
  box-sizing:border-box!important;
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  margin-left:0!important;
  margin-right:0!important;
  padding-left:0!important;
  padding-right:0!important;
}

/* Remove inherited article/readability caps from every discovery descendant. */
.wb1-structured-discovery .epr-pd-grid,
.wb1-structured-discovery .wb1-portfolio-grid{
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
}

/* Tablet */
@media(max-width:1024px){
  .wb1-home-frame{
    width:calc(100% - 48px)!important;
  }
  .wb1-home-frame > .wb1-wide-frame{
    margin-top:40px!important;
  }
}

/* Mobile */
@media(max-width:760px){
  .wb1-home-frame{
    width:calc(100% - 32px)!important;
  }
  .wb1-home-frame > .wb1-reading-frame{
    width:100%!important;
    max-width:none!important;
  }
  .wb1-home-frame > .wb1-wide-frame{
    margin-top:32px!important;
  }
}
