/* Inner-page scale-down.
   Linked after fix6.css on every page except the homepage (build.py
   link_site_scale). Every rule is also scoped so the homepage is
   untouched if this sheet is ever loaded there.
   Brand colors, fonts and section order are unchanged. */

/* Short exclusion: the current homepage (main.home-main) and the
   earlier directory/search shells, which already had their own scale. */
/* --u is the 935px-mockup unit, previously capped at 1.25px from
   ~1169px up. --w is the facility/guide content width (was 1240px).
   --lc-u and the homepage type tokens are not changed. */
body:not(:has(main.home-main)):not(:has(#view-directory)):not(:has(#view-search)){
  --u:clamp(1px,calc(100vw / 935),1.08px);
  --w:1280px;
}

/* Drop the 5% CSS zoom that inner pages picked up at 1280px and up.
   Search, the homepage and the earlier directory shell never had it. */
@media (min-width:1280px){
  body:not(:has(main.home-main)):not(:has(#view-directory)):not(:has(#view-search)) > :is(main,.page,.wrap,.content),
  body.fx:not(:has(main.home-main)) > main{
    zoom:1 !important;
  }
  body:not(:has(main.home-main)) > .page > .v4footer{
    zoom:1 !important;
  }
}

/* Facility pages. A general body.fx-df2.fx h1 rule still sets 72px;
   the visible name lives in .d-h1a (52px at 1440). Both step down.
   Body text in .fxm was 17px. */
@media (min-width:1000px){
  body.fx:not(:has(main.home-main)) :where(.fxm,.fx-dialog){
    font-size:16px;
    line-height:1.55;
  }
  body.fx:not(:has(main.home-main)) h1,
  body.fx-df2.fx:not(:has(main.home-main)) h1,
  body.fx-df2.fx-df:not(:has(main.home-main)) h1{
    font-size:clamp(36px,3.1vw,44px) !important;
    line-height:1.06 !important;
  }
  body.fx:not(:has(main.home-main)) .d-h1a,
  body.fx-df:not(:has(main.home-main)) .d-h1a,
  body.fx-df2:not(:has(main.home-main)) .d-h1a,
  body.fx-df2.fx-df:not(:has(main.home-main)) .d-h1a{
    font-size:clamp(36px,3.1vw,44px) !important;
    line-height:1.04 !important;
  }
  body.fx:not(:has(main.home-main)) .d-h1b,
  body.fx-df:not(:has(main.home-main)) .d-h1b,
  body.fx-df2:not(:has(main.home-main)) .d-h1b,
  body.fx-df2.fx-df:not(:has(main.home-main)) .d-h1b{
    font-size:clamp(18px,1.4vw,20px) !important;
  }
  body.fx:not(:has(main.home-main)) h2,
  body.fx-df2.fx:not(:has(main.home-main)) h2,
  body.fx:not(:has(main.home-main)) .d-ch-h h2,
  body.fx:not(:has(main.home-main)) .d-ch-rev #reviews h2,
  body.fx-df:not(:has(main.home-main)) .d-ch-h h2,
  body.fx-df:not(:has(main.home-main)) .d-ch-rev #reviews h2,
  body.fx-df2:not(:has(main.home-main)) .d-ch-h h2,
  body.fx-df2:not(:has(main.home-main)) .d-ch-rev #reviews h2{
    font-size:clamp(26px,2.3vw,34px) !important;
  }
  body.fx:not(:has(main.home-main)) .d-lede,
  body.fx-df:not(:has(main.home-main)) .d-lede,
  body.fx-df2:not(:has(main.home-main)) .d-lede,
  body.fx-df2.fx-df:not(:has(main.home-main)) .d-lede{
    font-size:20px !important;
    line-height:1.4 !important;
  }
  body.fx:not(:has(main.home-main)) .d-dek,
  body.fx-df2:not(:has(main.home-main)) .d-dek,
  body.fx:not(:has(main.home-main)) .d-ch-rev #reviews p{
    font-size:16px !important;
  }
  body.fx:not(:has(main.home-main)) .d-card-id,
  body.fx:not(:has(main.home-main)) .d-card-score{
    padding:22px 26px 22px !important;
  }
}

/* Guide / article pages. A body.fx h1 rule (72px at 1440) beats the
   article h1 rule (52px) on specificity. Body copy is 18.5 / 17.5px,
   dek 22px. The 18ch title cap is lifted so the new size can use the
   column width. */
@media (min-width:1000px){
  body.fx:not(:has(main.home-main)) article h1,
  body.fx.fx-df2:not(:has(main.home-main)) article h1,
  body.fx.fx-df2:not(:has(main.home-main)) #main article h1,
  body:not(:has(main.home-main)) article h1{
    font-size:clamp(34px,3.2vw,42px) !important;
    line-height:1.08 !important;
    max-width:none !important;
  }
  body.fx:not(:has(main.home-main)) article h2,
  body.fx.fx-df2:not(:has(main.home-main)) article h2,
  body:not(:has(main.home-main)) article h2{
    font-size:clamp(24px,2.2vw,30px) !important;
  }
  body.fx:not(:has(main.home-main)) article .dek,
  body:not(:has(main.home-main)) article .dek,
  body:not(:has(main.home-main)) p.dek{
    font-size:18px !important;
    line-height:1.45 !important;
  }
  body.fx:not(:has(main.home-main)) article p,
  body.fx:not(:has(main.home-main)) article ul,
  body.fx:not(:has(main.home-main)) article ol,
  body.fx:not(:has(main.home-main)) article li,
  body:not(:has(main.home-main)) article p,
  body:not(:has(main.home-main)) article ul,
  body:not(:has(main.home-main)) article li,
  body:not(:has(main.home-main)) .art-sources li{
    font-size:16.5px !important;
    line-height:1.65 !important;
  }
}

/* State / county / city listings. Body 17→16px. Container 1160→1280
   on desktop only (the 80px side inset must not apply on phones).
   Headings were already in range (max 40px) once zoom is removed. */
@media (min-width:1000px){
  html body:not(:has(main.home-main)) main.content{
    width:min(1280px, calc(100% - 80px)) !important;
    max-width:1280px !important;
    padding:20px 0 64px !important;
  }
  html body:not(:has(main.home-main)) main.content :is(.directory-layout, .county-overview, .lc-cost, .section, .local-comparisons, .local-information, .county-faq, .bottom-communities, .bottom-browse, .bp-area){
    font-size:16px !important;
    line-height:1.65 !important;
  }
  html body:not(:has(main.home-main)) main.content .plain-hero.state-plain-hero > div > p{
    font-size:16px !important;
  }
}
