/*
   CANOPY DESKTOP PAGE-HEADER AUTHORITY

   This is the single desktop source of truth for the shared page-header
   presentation. The Greenhouse section header is the visual reference:
   one large authored title, optional kicker/description/actions, one straight
   1px divider, then the page/section navigation or body content. Standard
   desktop pages also share the same 42px top gap below the Field top bar. It is
   deliberately loaded after page-local styles.

   It controls:
   - Page H1/H2 font size, weight, line-height, letter spacing, casing, and ink.
   - Kicker/eyebrow color, weight, spacing, and casing.
   - Header-description color, size, weight, and line-height.
   - The one straight divider between a page header and its body, plus the
     desktop and compact-screen spacing around that divider.
   - Known legacy header structures, including Seller, Cart, Checkout,
     Greenhouse, Payout, Community Chat, Catalog, Auction, and lifecycle pages.
   - Greenhouse's runtime heading slot: it removes the legacy rounded heading
     border so the shared divider remains straight.

   It does not control page-body card layout, data tables, menus/section strips,
   live-room overlays, or mobile-specific component design. Those stay in their
   owning component stylesheets.

   Keep new desktop page-header rules here rather than duplicating font,
   divider, or header-spacing rules in individual page stylesheets.
*/
html.canopy-field {
    --canopy-page-title-size: clamp(30px, 3.2vw, 46px);
    --canopy-page-title-weight: 830;
    --canopy-page-description-color: #496550;
    --canopy-page-divider: rgba(18, 69, 56, .18);
    --canopy-page-header-divider-width: 1px;
    --canopy-page-header-padding-bottom: 24px;
    --canopy-page-header-margin-bottom: 24px;
    --canopy-page-header-top-gap: 42px;
}

/*
   GREENHOUSE VERTICAL START AUTHORITY

   Greenhouse uses the standard Field desktop canvas start: 42px below the
   fixed top bar/safe area. Several older page families still override the
   main canvas with route-specific values (for example 24px), which makes
   otherwise identical headers appear vertically misaligned.

   Normalize only the top edge here. Right/bottom/left page geometry remains
   owned by the Field shell and page-specific layout. Full-screen broadcast
   and immersive live canvases are deliberately excluded.
*/
@media (min-width: 760px) {
    html.canopy-field body:not(.canopy-broadcast-page):not(.canopy-broadcast-mobile-web):not(.canopy-immersive-live-v2063) > main.cf-main,
    html.canopy-field body:not(.canopy-broadcast-page):not(.canopy-broadcast-mobile-web):not(.canopy-immersive-live-v2063) main.cf-main,
    html.canopy-field body:not(.canopy-broadcast-page):not(.canopy-broadcast-mobile-web):not(.canopy-immersive-live-v2063) [role="main"].cf-main,
    html.canopy-field body:not(.canopy-broadcast-page):not(.canopy-broadcast-mobile-web):not(.canopy-immersive-live-v2063) > main.page-content {
        padding-top: calc(
            var(--cf-topbar-height) +
            var(--cf-safe-top) +
            var(--canopy-page-header-top-gap)
        ) !important;
    }
}

/*
   Legacy views did not all receive a named page-header class. This semantic
   fallback catches only the root page section/header/div that owns a direct
   h1; nested card and content headings remain outside this contract.
*/
html.canopy-field :is(.page-content, .cf-content-frame) > :is(section, header, div):not(.live-sale-room):not(.canopy-immersive-live-stage-v2063):not(.canopy-bidder-layout-v20617):has(> h1, > div > h1) {
    border-bottom: var(--canopy-page-header-divider-width) solid var(--canopy-page-divider) !important;
    margin-top: 0 !important;
    margin-bottom: var(--canopy-page-header-margin-bottom) !important;
    padding-top: 0 !important;
    padding-bottom: var(--canopy-page-header-padding-bottom) !important;
}

html.canopy-field :is(.page-content, .cf-content-frame) > :is(section, header, div):not(.live-sale-room):not(.canopy-immersive-live-stage-v2063):not(.canopy-bidder-layout-v20617):has(> h1, > div > h1) > h1,
html.canopy-field :is(.page-content, .cf-content-frame) > :is(section, header, div):not(.live-sale-room):not(.canopy-immersive-live-stage-v2063):not(.canopy-bidder-layout-v20617):has(> h1, > div > h1) > div > h1 {
    color: var(--cf-ink, #18231f) !important;
    font-size: var(--canopy-page-title-size) !important;
    font-weight: var(--canopy-page-title-weight) !important;
    letter-spacing: -.035em !important;
    line-height: 1.04 !important;
    text-transform: none !important;
}

html.canopy-field :is(.page-content, .cf-content-frame) > :is(section, header, div):not(.live-sale-room):not(.canopy-immersive-live-stage-v2063):not(.canopy-bidder-layout-v20617):has(> h1, > div > h1) :is(.eyebrow, .cf-page-kicker, .studio-kicker, .canopy-live-lifecycle__eyebrow, .payout-admin-kicker) {
    color: var(--cf-forest-600, #17653b) !important;
    font-weight: 850 !important;
}

html.canopy-field :is(.page-content, .cf-content-frame) > :is(section, header, div):not(.live-sale-room):not(.canopy-immersive-live-stage-v2063):not(.canopy-bidder-layout-v20617):has(> h1, > div > h1) > p,
html.canopy-field :is(.page-content, .cf-content-frame) > :is(section, header, div):not(.live-sale-room):not(.canopy-immersive-live-stage-v2063):not(.canopy-bidder-layout-v20617):has(> h1, > div > h1) > div > p {
    max-width: 820px !important;
    margin: 12px 0 0 !important;
    color: var(--canopy-page-description-color) !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.55 !important;
}

html.canopy-field :is(
    .cf-page-header,
    .cf-compact-workspace-header,
    .page-heading,
    .catalog-hero,
    .auction-hero,
    .canopy-live-lifecycle__header,
    .greenhouse-event-admin-header,
    .greenhouse-event-editor-header,
    .canopy-cart-header,
    .canopy-checkout-heading,
    .community-chat-header,
    .seller-payout-header,
    .payout-admin-header,
    .account-moderation-heading,
    .pc-head,
    .bid-console-heading,
    .canopy-manage-live-heading,
    .greenhouse-native-heading-slot > .greenhouse-native-heading,
    .greenhouse-native-heading-slot > .greenhouse-news-status,
    .greenhouse-native-heading-slot > .greenhouse-events-heading
) {
    width: 100% !important;
    min-width: 0 !important;
    border-bottom: var(--canopy-page-header-divider-width) solid var(--canopy-page-divider) !important;
    margin-top: 0 !important;
    margin-bottom: var(--canopy-page-header-margin-bottom) !important;
    padding-top: 0 !important;
    padding-bottom: var(--canopy-page-header-padding-bottom) !important;
}

/*
   The Greenhouse heading is moved into this slot at runtime. Some of the
   original Greenhouse presentation rules left a rounded container border on
   that moved heading, which made the shared divider appear to curl upward at
   both ends. The slot is structural only; its child owns one straight divider.
*/
html.canopy-field body.cf-greenhouse-page .greenhouse-native-heading-slot,
html.canopy-field body.cf-greenhouse-page .greenhouse-native-heading-slot > :is(
    .greenhouse-native-heading,
    .greenhouse-news-status,
    .greenhouse-events-heading
) {
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

html.canopy-field body.cf-greenhouse-page .greenhouse-native-heading-slot > :is(
    .greenhouse-native-heading,
    .greenhouse-news-status,
    .greenhouse-events-heading
) {
    border-bottom: var(--canopy-page-header-divider-width) solid var(--canopy-page-divider) !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
}

html.canopy-field :is(
    .cf-page-header,
    .cf-compact-workspace-header,
    .page-heading,
    .catalog-hero,
    .auction-hero,
    .canopy-live-lifecycle__header,
    .greenhouse-event-admin-header,
    .greenhouse-event-editor-header,
    .canopy-cart-header,
    .canopy-checkout-heading,
    .community-chat-header,
    .seller-payout-header,
    .payout-admin-header,
    .account-moderation-heading,
    .pc-head,
    .bid-console-heading,
    .canopy-manage-live-heading,
    .greenhouse-native-heading-slot
) :is(h1, h2) {
    color: var(--cf-ink, #18231f) !important;
    font-size: var(--canopy-page-title-size) !important;
    font-weight: var(--canopy-page-title-weight) !important;
    letter-spacing: -.035em !important;
    line-height: 1.04 !important;
    margin: 0 !important;
    text-transform: none !important;
}

/*
   Final title fallback. Every actual page H1 inside the desktop content host
   uses the Greenhouse title typography even when a specialized page has not
   adopted one of the standard header wrapper classes. This does not add
   dividers to cards, dialogs, live-room overlays, or nested H2 content.
*/
html.canopy-field :is(.page-content, .cf-content-frame) > h1 {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

html.canopy-field :is(.page-content, .cf-content-frame) h1 {
    color: var(--cf-ink, #18231f) !important;
    font-size: var(--canopy-page-title-size) !important;
    font-weight: var(--canopy-page-title-weight) !important;
    letter-spacing: -.035em !important;
    line-height: 1.04 !important;
    text-transform: none !important;
}

/* Kicker text is the small, green, high-emphasis label above a page title. */
html.canopy-field :is(
    .cf-page-header,
    .cf-compact-workspace-header,
    .page-heading,
    .catalog-hero,
    .auction-hero,
    .canopy-live-lifecycle__header,
    .greenhouse-event-admin-header,
    .greenhouse-event-editor-header,
    .canopy-cart-header,
    .canopy-checkout-heading,
    .community-chat-header,
    .seller-payout-header,
    .payout-admin-header,
    .account-moderation-heading,
    .pc-head,
    .bid-console-heading,
    .canopy-manage-live-heading,
    .greenhouse-native-heading-slot
) :is(.cf-page-kicker, .studio-kicker, .eyebrow, .canopy-live-lifecycle__eyebrow, .payout-admin-kicker) {
    color: var(--cf-forest-600, #17653b) !important;
    display: inline-block !important;
    margin: 0 0 12px !important;
    font-weight: 850 !important;
}

/* Page descriptions use the muted green treatment from the reference design. */
html.canopy-field :is(
    .cf-page-header,
    .cf-compact-workspace-header,
    .page-heading,
    .catalog-hero,
    .auction-hero,
    .canopy-live-lifecycle__header,
    .greenhouse-event-admin-header,
    .greenhouse-event-editor-header,
    .canopy-cart-header,
    .canopy-checkout-heading,
    .community-chat-header,
    .seller-payout-header,
    .payout-admin-header,
    .account-moderation-heading,
    .pc-head,
    .bid-console-heading,
    .canopy-manage-live-heading
) :is(.cf-page-description, p) {
    color: var(--canopy-page-description-color) !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.55 !important;
}

/* Cart retains its count on the right, but its header geometry is governed
   here with every other page-level heading. */
html.canopy-field .canopy-cart-header {
    display: grid !important;
    width: 100% !important;
    min-width: 0 !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: end !important;
    gap: 28px !important;
}

html.canopy-field .canopy-cart-header > div:first-child {
    min-width: 0 !important;
}

html.canopy-field .canopy-cart-header .eyebrow {
    display: inline-block !important;
    margin: 0 0 12px !important;
}

html.canopy-field .canopy-cart-header h1 {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
}

html.canopy-field .canopy-cart-header p {
    max-width: 720px !important;
    margin: 12px 0 0 !important;
}

/* Inventory is server-rendered with the compact-header class; a few legacy
   workspace routes can carry that class too. Keep both on the same authored
   header rhythm: title, 24px divider inset, then a 16px gap to the strip. */
html.canopy-field body.cf-compact-workspace-page .cf-compact-workspace-header,
html.canopy-field body[data-cf-payout-exact="true"] .cf-payout-exact-header {
    align-items: end !important;
    min-height: 0 !important;
    margin: 0 0 16px !important;
    margin-top: 0 !important;
    padding: 0 0 var(--canopy-page-header-padding-bottom) !important;
    padding-top: 0 !important;
    border-bottom: var(--canopy-page-header-divider-width) solid var(--canopy-page-divider) !important;
}

html.canopy-field body.cf-compact-workspace-page .cf-compact-workspace-section-navigation,
html.canopy-field body[data-cf-payout-exact="true"] .cf-payout-exact-nav {
    margin: 0 0 16px !important;
}

@media (max-width: 759.98px) {
    html.canopy-field :is(
        .cf-page-header,
        .cf-compact-workspace-header,
        .page-heading,
        .catalog-hero,
        .auction-hero,
        .canopy-live-lifecycle__header,
        .greenhouse-event-admin-header,
        .greenhouse-event-editor-header,
        .canopy-cart-header,
        .canopy-checkout-heading,
        .community-chat-header,
        .seller-payout-header,
        .payout-admin-header,
        .account-moderation-heading,
        .pc-head,
        .bid-console-heading,
        .canopy-manage-live-heading,
        .greenhouse-native-heading-slot > .greenhouse-native-heading,
        .greenhouse-native-heading-slot > .greenhouse-news-status,
        .greenhouse-native-heading-slot > .greenhouse-events-heading
    ) {
        margin-bottom: 20px !important;
        padding-bottom: 18px !important;
    }

    html.canopy-field :is(
        .cf-page-header,
        .cf-compact-workspace-header,
        .page-heading,
        .catalog-hero,
        .auction-hero,
        .canopy-live-lifecycle__header,
        .greenhouse-event-admin-header,
        .greenhouse-event-editor-header,
        .canopy-cart-header,
        .canopy-checkout-heading,
        .community-chat-header,
        .seller-payout-header,
        .payout-admin-header,
        .account-moderation-heading,
        .pc-head,
        .bid-console-heading,
        .canopy-manage-live-heading,
        .greenhouse-native-heading-slot
    ) :is(h1, h2) {
        font-size: clamp(28px, 9vw, 38px) !important;
    }

    html.canopy-field :is(.page-content, .cf-content-frame) > :is(section, header, div):not(.live-sale-room):not(.canopy-immersive-live-stage-v2063):not(.canopy-bidder-layout-v20617):has(> h1, > div > h1) {
        margin-bottom: 20px !important;
        padding-bottom: 18px !important;
    }

    html.canopy-field :is(.page-content, .cf-content-frame) > :is(section, header, div):not(.live-sale-room):not(.canopy-immersive-live-stage-v2063):not(.canopy-bidder-layout-v20617):has(> h1, > div > h1) > h1,
    html.canopy-field :is(.page-content, .cf-content-frame) > :is(section, header, div):not(.live-sale-room):not(.canopy-immersive-live-stage-v2063):not(.canopy-bidder-layout-v20617):has(> h1, > div > h1) > div > h1 {
        font-size: clamp(28px, 9vw, 38px) !important;
    }

    html.canopy-field .canopy-cart-header {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    html.canopy-field .canopy-cart-header-count {
        justify-items: start !important;
        margin-top: 12px !important;
    }

    html.canopy-field body.cf-compact-workspace-page .cf-compact-workspace-header,
    html.canopy-field body[data-cf-payout-exact="true"] .cf-payout-exact-header {
        margin-bottom: 12px !important;
        padding-bottom: 18px !important;
    }
}
