/* Owner correction (2026-08-20): this opaque white fill was the real reason
   Discover's masthead never matched the other pages' shared purple
   atmosphere -- `.hp-discovery` is Discover's own `<main>` wrapper, and the
   masthead renders INSIDE it (unlike Directory/What's On/Free Tools, which
   have no such wrapper at all -- their masthead is a direct child of
   <body>). A solid `background` on this box paints above the shared
   `body::before` glow (z-index:-1) for its entire height, so the glow was
   only ever visible in the ~70px gap between the header and where this box
   begins -- never behind the actual title, confirmed live via
   elementFromPoint sampling. Dropping this rule lets Discover fall through
   to the same plain body background every other standard-layout page
   already uses, so the glow shows through identically. Nothing below the
   masthead needs an explicit white fill here -- the body/canvas background
   is already effectively white. */
.hp-discovery { color: var(--hp-color-ink); font-family: var(--hp-font-body); }
.hp-discovery *, .hp-discovery *::before, .hp-discovery *::after { box-sizing: border-box; }
.hp-discovery__shell { width: min(100% - 2rem, 1180px); margin-inline: auto; }
/* Wave 6 owner correction (2026-08-19): the title/intro used to live inside
   this page's own bespoke .hp-discovery__hero (a flat gradient box with a
   hard bottom edge) -- that markup is gone, replaced by the shared
   .hp-page-masthead component (hp_render_contextual_page_masthead(),
   inc/discovery.php), which owns its own type scale/fade. Only the
   page-specific search form + directory link remain page-owned, in
   .hp-discovery__search-intro immediately below the masthead. */
.hp-discovery__search-intro { padding-block: 0 clamp(1.5rem, 3vw, 2.25rem); }
.hp-discovery__search { display: flex; gap: var(--hp-space-3); max-width: 700px; }
.hp-discovery__search input { flex: 1; min-width: 0; min-height: 48px; padding: var(--hp-space-3) var(--hp-space-4); border: 1px solid var(--hp-color-border-strong); border-radius: var(--hp-radius-md); background: var(--hp-color-white); color: var(--hp-color-ink); font: inherit; }
.hp-discovery .hp-c-btn--primary { border-color: transparent; background: var(--hp-color-primary-500); color: var(--hp-color-white); }
.hp-discovery .hp-c-btn--primary:hover { background: var(--hp-color-primary-700); color: var(--hp-color-white); }
.hp-discovery__search input:focus-visible, .hp-discovery a:focus-visible, .hp-discovery button:focus-visible { outline: 3px solid var(--hp-color-primary-400); outline-offset: 3px; }
.hp-discovery__directory-link { display: inline-flex; align-items: center; gap: var(--hp-space-2); min-height: 44px; margin-top: var(--hp-space-3); color: var(--hp-color-primary-700); font-weight: 700; }
.hp-discovery svg { width: 1.2rem; height: 1.2rem; flex: none; }
.hp-discovery__section { padding-block: clamp(2.75rem, 7vw, 5.5rem); }
/* Wave 6 (2026-08-19): the double-padding this used to fix (.hp-discovery__
   hero's own up-to-6rem bottom padding stacking with this section's own
   top padding) no longer applies -- the hero is gone, replaced by the
   shared masthead (small margin-block-end only) plus the compact
   .hp-discovery__search-intro block above, neither of which owns a large
   gap the way the old hero did. This section's normal top padding is the
   right amount of space now, so no override remains. */
.hp-discovery__section--soft { background: var(--hp-color-primary-100); }
.hp-discovery__section header { display: flex; align-items: end; justify-content: space-between; gap: var(--hp-space-6); margin-bottom: var(--hp-space-6); }
.hp-discovery__section h2 { margin: 0; font: 700 clamp(1.6rem, 4vw, 2.35rem)/1.15 var(--hp-font-heading); }
.hp-discovery__section header p { max-width: 720px; margin: var(--hp-space-2) 0 0; color: var(--hp-color-body); line-height: 1.55; }
/* Owner fix (2026-08-19): the "View directory" link in this header had no
   colour rule at all, so it fell back to the browser's own default link
   colour (blue unvisited / reddish-purple visited) instead of HertsPartners
   purple -- matches .hp-home-heading > a's own equivalent rule. */
.hp-discovery__section header > a { display: inline-flex; align-items: center; gap: var(--hp-space-2); min-height: 44px; color: var(--hp-color-primary-700); font-weight: 700; text-decoration: none; white-space: nowrap; }
.hp-discovery__section header > span { color: var(--hp-color-body); font-size: var(--hp-text-sm); }
/* Owner fix (2026-08-18): a hard-coded 3-track grid used to allocate 3
   equal columns regardless of the real item count -- with 1 real boosted
   business (or 1 real category/town), the browser still laid out 3 tracks
   and left 2 genuinely empty, reading as "a small card in a large mostly-
   empty area". auto-fit derives the track count from the real content
   instead, matching the existing bounded auto-fit convention already used
   for the homepage's own card grids (assets/css/homepage.css). */
.hp-discovery__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 340px)); gap: var(--hp-space-3); }
/* A single real item still gets exactly one bounded, intentionally-sized
   track rather than stretching to fill the whole shell width. */
.hp-discovery__grid--single { grid-template-columns: minmax(280px, 340px); }
.hp-discovery__grid > a { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--hp-space-3); min-height: 76px; padding: var(--hp-space-4); border: 1px solid var(--hp-color-border); border-radius: var(--hp-radius-md); background: var(--hp-color-white); color: var(--hp-color-ink); text-decoration: none; transition: transform var(--hp-transition-card), box-shadow var(--hp-transition-card); }
.hp-discovery__grid > a:hover { transform: translateY(-2px); box-shadow: var(--hp-shadow-card-hover); }
.hp-discovery__grid strong, .hp-discovery__grid small { display: block; }
.hp-discovery__grid small { margin-top: var(--hp-space-1); color: var(--hp-color-body); }
.hp-discovery__icon { display: grid; width: 40px; height: 40px; place-items: center; border-radius: var(--hp-radius-sm); background: var(--hp-color-primary-100); color: var(--hp-color-primary-700); overflow: hidden; }
.hp-discovery__icon img { width: 100%; height: 100%; object-fit: cover; }

/* Owner priority (2026-08-20): "review Directory, Discover and business
   detail pages together so Boost feels like one premium system" -- this
   list previously reused the plain generic row style shared with the
   Categories/Locations lists on this same page, so "Boosted" read as an
   ordinary grey subtitle with no border/glow/icon -- a visibly weaker
   treatment than the same feature on the Directory archive and homepage
   rail. Same gradient-border-card + gradient-badge-with-bolt-icon system,
   not a new one; scoped to this list only via its own modifier class
   (assets/js/discovery.php), since .hp-discovery__grid is shared. */
.hp-discovery__grid--boosted > a {
	position: relative;
	border: 1px solid transparent;
	background:
		linear-gradient( var(--hp-color-white), var(--hp-color-white) ) padding-box,
		linear-gradient( 135deg, var(--hp-color-primary-400), var(--hp-color-primary-700) ) border-box;
	box-shadow: 0 4px 22px rgba( 124, 58, 237, .16 );
}
.hp-discovery__grid--boosted > a:hover {
	box-shadow: 0 14px 34px rgba( 124, 58, 237, .26 );
}
.hp-discovery__grid--boosted small {
	display: inline-flex;
	align-items: center;
	padding: .15rem .55rem;
	border-radius: var(--hp-radius-pill);
	background: linear-gradient( 135deg, var(--hp-color-primary-500), var(--hp-color-primary-700) );
	box-shadow: 0 3px 10px rgba( 124, 58, 237, .3 );
	color: var(--hp-color-white);
	font-weight: 800;
	letter-spacing: .01em;
}
.hp-discovery__grid--boosted small::before {
	content: "";
	display: inline-block;
	width: .8em;
	height: .8em;
	margin-inline-end: .3em;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 2 3 14h7l-1 8 11-14h-7l1-6z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 2 3 14h7l-1 8 11-14h-7l1-6z'/%3E%3C/svg%3E") center / contain no-repeat;
	vertical-align: -.05em;
}

/* Genuine gap found (2026-08-20) while surveying image-cropping coverage:
   this Boosted-business icon never got the same real-aspect-ratio logo
   detection already proven on the Directorist archive grid and homepage
   rail (the shared assets/js/directory-media-fixes.js classifier)
   -- a business-supplied square logo was still hard-cropped by object-fit:
   cover here. Reuses the identical heuristic (assets/js/discovery-media-
   fixes.js), just with smaller padding to suit a 40px icon rather than a
   full-size card thumbnail. */
.hp-discovery__icon.hp-thumb-logo-safe img { object-fit: contain; padding: 4px; background: var(--hp-color-white); }
.hp-discovery__empty { padding: clamp(1.5rem, 5vw, 3rem); border: 1px solid var(--hp-color-border); border-radius: var(--hp-radius-lg); background: var(--hp-color-white); }
.hp-discovery__empty h3 { margin: 0; font: 700 var(--hp-text-xl)/1.3 var(--hp-font-heading); }
.hp-discovery__empty p { max-width: 720px; color: var(--hp-color-body); line-height: 1.6; }
/* V27 (Stage B Wave 5, 2026-08-06): the "View all N categories" disclosure for categories beyond the top 12. */
.hp-discovery__more { margin-top: var(--hp-space-6); }
.hp-discovery__more summary { display: inline-flex; align-items: center; min-height: 44px; padding: var(--hp-space-2) var(--hp-space-4); border: 1px solid var(--hp-color-border-strong); border-radius: var(--hp-radius-pill); color: var(--hp-color-primary-700); font-weight: 700; cursor: pointer; list-style: none; }
.hp-discovery__more summary::-webkit-details-marker { display: none; }
.hp-discovery__more summary:hover { border-color: var(--hp-color-primary-400); background: var(--hp-color-primary-100); }
.hp-discovery__more[open] summary { margin-bottom: var(--hp-space-4); }
.hp-discovery__filter { display: block; width: 100%; max-width: 24rem; min-height: 44px; margin: var(--hp-space-4) 0; padding: var(--hp-space-2) var(--hp-space-4); border: 1px solid var(--hp-color-border-strong); border-radius: var(--hp-radius-md); background: var(--hp-color-white); color: var(--hp-color-ink); font: inherit; }
.hp-discovery__grid--more { margin-top: var(--hp-space-2); }
/* Owner correction (2026-08-20): real 375px measurement (getBoundingClientRect,
   not a screenshot guess) found the first genuine business card ("Kelsey's
   Happy Tails" in Boosted local businesses) starting at y=967 on an 812px
   viewport -- masthead (132px) + this page's own search-intro block (184px,
   its Search button drops to its own row on mobile) + the "Boosted local
   businesses" section's DESKTOP-scale padding-block (min 2.75rem/44px top
   alone, meant for a spacious editorial section, never reduced for mobile)
   left no real content visible without scrolling at all. Trims the
   search-intro's own bottom gap and this section's top padding/header
   margin specifically on mobile -- the search bar and section heading stay,
   just tighter, so the first real card moves meaningfully closer to the
   fold without removing anything a resident would actually look for. */
@media (max-width: 767px) {
	.hp-discovery__shell { width: min(100% - 1.5rem, 1180px); }
	.hp-discovery__search { flex-direction: column; }
	.hp-discovery__search .hp-c-btn { width: 100%; }
	.hp-discovery__search-intro { padding-block: 0 14px; }
	.hp-discovery__directory-link { margin-top: 10px; }
	.hp-discovery__section { padding-block: 18px clamp(2.75rem, 7vw, 5.5rem); }
	.hp-discovery__section header { align-items: flex-start; flex-direction: column; gap: 8px; margin-bottom: 14px; }
	.hp-discovery__grid { grid-template-columns: 1fr; }
}
@media (min-width: 768px) and (max-width: 1024px) { .hp-discovery__grid { grid-template-columns: repeat(2, 1fr); } }
@media (prefers-reduced-motion: reduce) { .hp-discovery__grid > a { transition: none; } .hp-discovery__grid > a:hover { transform: none; } }

/* L01.1 (2026-09-12): the "View all N categories" disclosure uses the brand
   purple-700 directly, which measured 2.34:1 against the dark canvas. */
.hp-experience-dark .hp-discovery__more summary {
	color: #d6b4ff;
}

.hp-experience-dark .hp-discovery__more summary:hover {
	background: rgba( 255, 255, 255, .07 );
	border-color: #8b5cf6;
}
