/*
 * enitan hope: shared page head (follow-up 27 Nov, 3.1). One rule for breadcrumb → h1 → content.
 *
 *   header bottom → breadcrumb   --wp--custom--eh--crumb-top   24px (16px mobile)
 *   breadcrumb    → h1           --wp--custom--eh--crumb-gap   32px (24px mobile)
 *   h1            → content      --wp--custom--eh--title-gap   32px
 *   h1            → lede         --wp--custom--eh--lede-gap    12px, then 32px from the lede to content
 *
 * Loaded on every page, after the other stylesheets. Every page head on the site is listed below
 * by the markup it uses; a new page should reuse one of them (the Pages pattern "eh-page-intro":
 * [eh_breadcrumb] + h1.eh-page-title + optional p.eh-lead). Pages without a breadcrumb (Home,
 * Basket, Checkout, Order confirmation) only keep h1 → content at 32px.
 * Tokens only.
 */

@media (max-width: 689.98px) {
	:root:root {
		--wp--custom--eh--crumb-top: var(--wp--custom--eh--crumb-top-mobile);
		--wp--custom--eh--crumb-gap: var(--wp--custom--eh--crumb-gap-mobile);
		--wp--custom--eh--footer-gap: var(--wp--custom--eh--footer-gap-mobile);
	}
}

/* ---------- The breadcrumb itself ----------
 * The box is one text line high, so the gaps above are what you see; each link keeps a 44px tap
 * area by padding out into the gap (WCAG 2.2 target size). */
.eh-crumb { margin: 0; line-height: 1.5; row-gap: 4px; }
.eh-crumb a { min-height: 0 !important; padding: 12px 0; margin: -12px 0; }

/* Blocksy's own content-area top padding (60px) must not add to the gap above the breadcrumb. */
body:has(.eh-crumb) :is(.ct-container, .ct-container-full)[data-vertical-spacing*="top"] { padding-top: 0; }

/* ---------- Shop, occasion, theme and search (inc/shop.php: .eh-s01) ---------- */
.eh-s01 { padding-top: var(--wp--custom--eh--crumb-top) !important; gap: 0 !important; }
.eh-s01 > .eh-crumb + h1 { margin-top: var(--wp--custom--eh--crumb-gap) !important; }
.eh-s01 > h1 + * { margin-top: var(--wp--custom--eh--title-gap) !important; }
.woocommerce-products-header:not(:has(.eh-chips)) ~ .woo-listing-top { margin-top: var(--wp--custom--eh--title-gap) !important; }

/* ---------- Product (inc/product.php): breadcrumb → product grid ---------- */
.eh-p-crumb { padding-top: var(--wp--custom--eh--crumb-top) !important; }
.single-product .product-entry-wrapper { margin-top: var(--wp--custom--eh--crumb-gap) !important; }

/* ---------- Content pages (Help, Delivery, policies: section.eh-page-intro) ---------- */
.eh-page-intro { padding-top: var(--wp--custom--eh--crumb-top) !important; gap: 0 !important; }
.eh-page-intro > .eh-crumb + * { margin-top: var(--wp--custom--eh--crumb-gap) !important; }
.eh-page-intro > h1 + .eh-lead { margin-top: var(--wp--custom--eh--lede-gap) !important; }
.entry-content > .eh-page-intro + * { margin-top: var(--wp--custom--eh--title-gap) !important; }

/* Policies: the intro holds only the breadcrumb; the h1 is the first line of the article, with
 * "Last updated" moved under it as the lede. */
.entry-content > .eh-page-intro + .eh-pgrid { margin-top: 0 !important; padding-top: var(--wp--custom--eh--crumb-gap) !important; }
.entry-content > .eh-page-intro:has(+ .eh-pgrid) { margin-bottom: 0 !important; } /* Blocksy's 24px content spacing would add to the padding */
/* Phones: the policy menu sits above the h1 (crumb → menu 24px, menu → h1 32px, the grid's own gap). */
/* DOM order: pmeta, h1, "In short"…; shown: h1, pmeta (12px), "In short" (32px). */
.eh-part { display: flex; flex-direction: column; }
.eh-part > .eh-pmeta { margin-top: var(--wp--custom--eh--lede-gap) !important; }
.eh-part > .eh-pmeta:empty { display: none; }
.eh-part > .eh-page-title + * { margin-top: var(--wp--custom--eh--title-gap) !important; }
.eh-part > .eh-page-title { order: -1; margin-top: 0 !important; }

/* ---------- Churches & bulk (CH-01 hero) ---------- */
.eh-ch01 { padding-top: var(--wp--custom--eh--crumb-top) !important; gap: 0 !important; }
.eh-ch01 > .eh-crumb + * { margin-top: var(--wp--custom--eh--crumb-gap) !important; }
.eh-ch01__grid { align-items: start !important; }
.eh-ch01__text { gap: 0 !important; }
.eh-ch01__text > .eh-label + h1 { margin-top: var(--wp--custom--eh--lede-gap) !important; } /* kicker above the h1 */
.eh-ch01__text > h1 + * { margin-top: var(--wp--custom--eh--lede-gap) !important; }
.eh-ch01__text > h1 + * + * { margin-top: var(--wp--custom--eh--title-gap) !important; }
.eh-ch01__text > h1 + * + * + * { margin-top: var(--wp--preset--spacing--m) !important; }

/* ---------- Basket (Blocksy page title, no breadcrumb): h1 → content 32px ---------- */
.woocommerce-cart .hero-section { margin-bottom: var(--wp--custom--eh--title-gap) !important; }

/* ---------- Our story (OS-01) and Coming soon (CS-01) heroes ---------- */
.eh-os01, .eh-cs01 { padding-top: var(--wp--custom--eh--crumb-top) !important; padding-bottom: 0 !important; gap: 0 !important; }
.eh-os01 > .eh-crumb, .eh-cs01 > .eh-crumb { align-self: stretch; justify-content: flex-start; text-align: left; }
.eh-os01 > .eh-crumb + *, .eh-cs01 > .eh-crumb + * { margin-top: var(--wp--custom--eh--crumb-gap) !important; }
.eh-os01 > .eh-label + h1, .eh-cs01 > .eh-label + h1, .eh-nf01 > .eh-label + h1 { margin-top: var(--wp--custom--eh--lede-gap) !important; } /* kicker above the h1 */
.eh-os01 > h1 + *, .eh-cs01 > h1 + * { margin-top: var(--wp--custom--eh--lede-gap) !important; }
.eh-os01 > h1 + * + *, .eh-cs01 > h1 + * + * { margin-top: var(--wp--custom--eh--title-gap) !important; }
.entry-content > .eh-os01 + *, .entry-content > .eh-cs01 + * { margin-top: var(--wp--custom--eh--title-gap) !important; }

/* ---------- 404 (NF-01) ---------- */
.eh-nf01 { padding-top: var(--wp--custom--eh--crumb-top) !important; gap: 0 !important; }
.eh-nf01 > .eh-crumb { align-self: stretch; justify-content: flex-start; text-align: left; }
.eh-nf01 > .eh-crumb + * { margin-top: var(--wp--custom--eh--crumb-gap) !important; }
.eh-nf01 > h1 + * { margin-top: var(--wp--custom--eh--title-gap) !important; }
.eh-nf01 > h1 + * ~ * { margin-top: 28px !important; }

/* ---------- Sign in / Join and the password pages (.eh-si) ---------- */
.eh-si-head { padding-top: var(--wp--custom--eh--crumb-top); }
.eh-si-head + .eh-si, .eh-si-head ~ .woocommerce-notices-wrapper + .eh-si { padding-top: var(--wp--custom--eh--crumb-gap) !important; }
/* Phones: the panels have no frame, so the first panel's own top padding would add to the gap. */
@media (max-width: 689.98px) {
	.eh-si-head ~ .eh-si > .eh-si__panel:first-child { padding-top: 0 !important; }
}

/* ---------- My account (eh_account_heading(): .eh-acc-head) ---------- */
.eh-acc-head { padding-top: var(--wp--custom--eh--crumb-top) !important; }
.eh-acc-head .eh-acc-head__title { margin-top: var(--wp--custom--eh--crumb-gap) !important; margin-bottom: var(--wp--custom--eh--title-gap) !important; }
.eh-acc-head--kicker .eh-acc-head__kicker { margin: var(--wp--custom--eh--crumb-gap) 0 var(--wp--custom--eh--lede-gap) !important; }
.eh-acc-head--kicker .eh-acc-head__title { margin-top: 0 !important; }
.eh-acc-head:has(.eh-acc-head__sub) .eh-acc-head__title { margin-bottom: var(--wp--custom--eh--lede-gap) !important; }
.eh-acc-head__sub { margin-bottom: var(--wp--custom--eh--title-gap) !important; }
.eh-acc-head__acts { margin-bottom: var(--wp--custom--eh--title-gap) !important; }

/* ---------- No breadcrumb: Order confirmation (kicker, h1, text, actions) ---------- */
.eh-oc01 { gap: var(--wp--custom--eh--lede-gap) !important; }
.eh-oc01 > .eh-oc01__title + * + * { margin-top: calc(var(--wp--custom--eh--title-gap) - var(--wp--custom--eh--lede-gap)); }

/* ---------- DS-12 spacing rules (spacing brief s1, 28 Nov) ----------
 * Tokens (theme.json): section-gap 64 between sections and either side of a divider, desktop and
 * mobile; footer-gap 128 desktop / 64 mobile from the last content to the footer; title-gap 32;
 * crumb-gap 32 / 24. Old names section, section-mobile, section-end are aliases. Coloured bands
 * keep their own inner padding; the gap sits outside them. */
.eh-pgrid { margin-bottom: 0 !important; padding-bottom: var(--wp--custom--eh--footer-gap); } /* policies, Help: a last-child rule zeroed the margin */
.entry-content > .eh-msec:last-child { padding-bottom: var(--wp--custom--eh--footer-gap); } /* Membership */
body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag, .search) #main > .ct-container[data-vertical-spacing*="bottom"] { padding-bottom: var(--wp--custom--eh--footer-gap) !important; } /* Shop, categories, search: Blocksy's 60 / 50 */
/* Guest Favourites page (AL-14): last content → footer gap, grid or empty state. */
.eh-gfav, .eh-gfav[hidden] + .eh-f03 { padding-bottom: var(--wp--custom--eh--footer-gap); }
