/* Shared public design. The portal and administration routes use independent layouts. */
#hfx-public-pages {
  --public-ink: #09243d;
  --public-copy: #354c5d;
  --public-link: #245f85;
  --public-line: #d3e1e9;
  --public-mist: #edf5fa;
  --public-wash: linear-gradient(180deg, #fff, #edf5fa 48%, #fff);
  --public-heading: "Inter Tight", Inter, Arial, sans-serif;
  --public-sans: Inter, Arial, sans-serif;
  color: var(--public-ink);
  font-family: var(--public-sans);
}

/* Also override the older, ID-scoped header styles on the two homepages. */
:is(#hfx-public-pages, #hydrofluxx-home#hydrofluxx-home.worksite-home) {
  & .hfx-public-shell {
    --menu-font: var(--public-sans);
    background-color: white;
    border-bottom: 0;
  }
  & .hx-header { min-height: clamp(4.5rem, 6vw, 6rem); }
  & .hx-brand img { width: clamp(12rem, 21vw, 20rem); }
  & .hx-desktop-nav { margin-inline: auto; gap: clamp(1.1rem, 1.8vw, 2rem); }
  & .hx-desktop-nav a { font: 500 .97rem/1.35 var(--public-sans); }
  & .hx-desktop-nav a:nth-child(3) { margin-left: 0; }
  & .hx-desktop-nav a:nth-child(3)::before { display: none; }
  & .hx-head-cta, & .hx-connect-link {
    border-radius: 2px;
    padding-inline: clamp(.85rem, 1.15vw, 1.25rem);
    font: 600 .9375rem/1.35 var(--public-sans);
  }
  & .hx-head-cta { color: white; background: var(--public-ink); }
  & .hx-connect-link { border: 1px solid var(--public-ink); color: var(--public-ink); }
  & .hx-connect-link strong { font: inherit; }
  & .hx-connect-link svg, & .hx-connect-link small { display: none; }

  @media (max-width: 44rem) {
    & .hx-header { min-height: 4.2rem; }
    & .hx-header .hx-brand img { width: clamp(7rem, 40vw, 12rem); }
    & .hx-connect-link { padding-inline: .5rem; }
  }
}

#hfx-public-pages {
  /* Historic templates set different fonts, including on spans inside the title. */
  & main :is(h1, h2), & main :is(h1, h2) :is(span, em, strong) {
    font-family: var(--public-heading) !important;
    font-weight: 650 !important;
    letter-spacing: -.035em !important;
    text-transform: none;
  }
  & main :is(h1, h2) { line-height: 1.12; overflow-wrap: break-word; }
  & main :is(button, input, select, textarea) { font-family: var(--public-sans); }
  & .hfx-public-footer { background: white; border-top-color: var(--public-line); }

  /* Text-first openings. Photographic captions keep their original dark backplates. */
  & :is(.public-library-hero, .public-article-hero, .hf26-directory-hero, .kg-hero,
        .fr-case-hero, .architect-cover, .legal-hero, .service-landing, .local-hub-showcase,
        .local-hero, .project-detail-hero, .about-hero, .antwerp-service-hero) {
    background: var(--public-wash);
    color: var(--public-ink);
    border-block: 0;
    border-radius: 0;
  }
  & :is(.public-library-hero, .public-article-hero, .hf26-directory-hero,
        .kg-hero-copy, .fr-case-hero, .legal-hero, .hf26-breadcrumb) :is(h1,h1 span,h1 em) {
    color: var(--public-ink);
  }
  & :is(.public-library-hero, .public-article-hero, .hf26-directory-hero,
        .kg-hero-copy, .fr-case-hero, .legal-hero) :is(p, .kg-lead, .hf26-breadcrumb, .eyebrow, h1 ~ span) {
    color: var(--public-copy);
  }
  & .kg-page { --kg-ink: var(--public-ink); --kg-teal: var(--public-link); background: white; }
  & .kg-feature { border-radius: 3px; }
  /* Fades are applied to cover art only, leaving documentary galleries and their captions intact. */
  & :is(.service-cover-art, .hf26-directory-photo, .architect-plate, .fr-case-hero .wrap > img) {
    mask-image: linear-gradient(to bottom, black 71%, transparent);
  }
  & .hf26-directory-photo { border: 0; border-radius: 0; }
  & .service-cover-details, & .detail-method-band, & .fr-process-band, & .pro-expertise,
  & .division-proof, & .public-library-cta, & .fr-closing, & .detail-contact, & .hfx-next-banner {
    border-block: 0;
    border-radius: 0;
    background: var(--public-wash);
    color: var(--public-ink);
  }
  & :is(.public-library-cta, .fr-closing, .detail-contact, .hfx-next-banner) :is(h2,h2 span,h2 em,p,small) { color: var(--public-ink); }
  & :is(.detail-method-band, .fr-process-band) > .wrap > :is(h2,p) { color: var(--public-ink); }
  & .hfx-next-banner span { color: var(--public-copy); }
  & .hfx-next-actions a { background: var(--public-ink); color: white; border-radius: 2px; }
  & .hfx-next-actions a + a { background: transparent; color: var(--public-ink); border-color: #617e92; }
  & .public-library-grid article { border-color: transparent; border-radius: 0; box-shadow: none; }
  & .public-library-grid article > div { padding-inline: 0; }
  & .public-library-tools :is(input, button), & .kg-tools :is(input,select) { border-color: #9cb2c2; }
  & .public-library-tools button[aria-pressed=true] { background: var(--public-ink); color: white; }

  /* The household hero has a cut-out photo and a secondary project link. */
  & .hx-edition .hx-hero { background: white; color: var(--public-ink); }
  & .hx-edition .hx-hero::before { content: none; }
  & .hx-edition .hx-opening-photo, & .hx-edition .hx-opening-photo img { clip-path: none; background: transparent; }
  & .hx-edition .hx-opening-photo { mask-image: linear-gradient(to bottom, black 64%, transparent); }
  & .hx-edition .hx-hero :is(h1, h1 em, .hx-lead, .hx-trade, .hx-hero-textlink) { color: var(--public-ink); }
  & .hx-edition .hx-featured-work { border: 0; background: var(--public-wash); color: var(--public-ink); }
  & .hx-featured-work :is(.hx-featured-place,.hx-featured-action) { color: var(--public-link); }

  & .detail-hero, & .fr-hero { background: white; color: var(--public-ink); }
  & :is(.detail-hero,.fr-hero)::after {
    background: linear-gradient(90deg, white 0%, #fffffff5 40%, #ffffff44 74%, transparent),
      linear-gradient(0deg, white, transparent 26%);
  }
  & :is(.detail-hero-copy,.fr-hero > .wrap) :is(h1,h1 span,p,small,.detail-back,.detail-hero-note,.detail-kicker,.fr-region) { color: var(--public-ink); }
  & .fr-hero > .wrap > a:first-child:not(.fr-button) { color: var(--public-link); }

  & .original-site .service-landing .service-hero {
    background: transparent !important; color: var(--public-ink);
  }
  & .original-site .service-landing .service-hero :is(h1, h1 em, h1 span, p, .back) { color: var(--public-ink) !important; }
  & .original-site .service-landing .service-hero > span { color: var(--public-copy); }

  & .contact-studio.contact-v4 { background: white; color: var(--public-ink); }
  & .contact-v4 .contact-hero, & .contact-v4 .contact-hero > div {
    border: 0; border-radius: 0; background: var(--public-wash); color: var(--public-ink);
  }
  & .contact-v4 .contact-hero > div :is(h1,h1 em,p,small,.assessment-inline-note,.contact-hero-phone) { color: var(--public-ink); }
  & .contact-v4 .contact-hero .assessment-inline-note { color: var(--public-copy) !important; }
  & .contact-v4 .assessment-inline-note a, & .contact-v4 .contact-hero-phone { color: var(--public-link) !important; }
  & .contact-studio .contact-form-intro, & .contact-studio .contact-concierge .contact-fair-note {
    background: var(--public-mist); color: var(--public-ink); border-color: var(--public-line);
  }
  & .contact-studio .contact-form-intro :is(strong,p,small,span) { color: var(--public-ink); }
  & .contact-v4 .contact-hero-units span { color: var(--public-link); border-color: var(--public-line); }
  & .contact-studio .contact-concierge, & .contact-studio .contact-concierge .concierge-content {
    background: #edf5fa !important; color: var(--public-ink) !important;
  }
  & .contact-studio .contact-concierge :is(h2,h3,p,strong,small,a,li,.eyebrow) { color: var(--public-ink) !important; }
  & .contact-studio .contact-concierge svg { color: var(--public-link); }

  & :is(.service-cover-primary,.architect-primary,.kg-primary,.hf26-directory-hero .hf26-button,
        .fr-button,.fr-closing a,.detail-contact .detail-btn,.hx-edition .hx-hero .hx-button,
        .contact-v4 .contact-hero-link,.original-site .service-landing .service-cta) {
    background: var(--public-ink) !important;
    color: white !important;
    border-color: var(--public-ink) !important;
    border-radius: 2px;
  }
  & :is(.service-cover-primary,.architect-primary,.kg-primary,.fr-button,.contact-hero-link):hover { background: #174263 !important; }
  & main :is(a,button,summary,input,select,textarea):focus-visible { outline: 3px solid #347fae; outline-offset: 3px; }

  & .lead-page {
    --lead-ink: var(--public-ink); --lead-accent: var(--public-link); --lead-muted: var(--public-copy);
    background: var(--public-wash);
  }
  & .lead-header { border: 0; }
  & .lead-case { background: transparent; border: 0; }
  & .lead-case figcaption { padding-inline: 0; }
  & .lead-form-card { border: 1px solid var(--public-line); box-shadow: none; }
  & .lead-submit { background: var(--public-ink); }
  & .lead-submit:hover { background: #174263; }
  & .lead-assurances li::before { color: var(--public-link); }

  & .premium-footer {
    background: linear-gradient(to bottom, white, #f1f6fa);
    border-top: 0;
    color: var(--public-ink);
  }
  & .premium-footer :is(a,p,b,strong,span,button) { color: var(--public-ink); }

  @media (max-width: 48rem) {
    & :is(.detail-hero,.fr-hero)::after { background: linear-gradient(90deg, #fffffffa, #ffffffe8 63%, #ffffffbc); }
    & .contact-v4 .contact-hero > div { background: linear-gradient(90deg, #fffffffa, #fffffff5); }
    & :is(.service-mobile-cta,.hfx-mobile-contact) {
      position: static; background: white; box-shadow: none; border-color: var(--public-line);
    }
    & .detail-page:has(.service-mobile-cta) { padding-bottom: 0; }
    & :is(.service-mobile-cta,.hfx-mobile-contact) a { border-radius: 2px; }
    & :is(.service-mobile-cta,.hfx-mobile-contact) a:first-child { background: var(--public-mist); color: var(--public-ink) !important; }
    & :is(.service-mobile-cta,.hfx-mobile-contact) a:last-child { background: var(--public-ink); color: white !important; }
    & .public-library-tools label { min-width: 0; }
    & .hx-edition .hx-opening-photo { mask-image: linear-gradient(to bottom, black 62%, transparent); }
    & .hfx-public-footer img { max-width: 100%; }
  }
}
