/*
 * ml-list.css (0.3.0-r2c3): "X Manufacturers List" posts styled like the directory category pages.
 * Loaded only on allow-listed list posts (body.ml-listpage), as a normal <link> in <head> (inc/ml-list-restyle.php).
 * Everything that is visible before the script runs is laid out here, so the swap to cards does not move the hero,
 * intro or crumbs (CLS target < 0.1). The script only changes what is below the intro.
 * Uses the live theme's own HivePress classes (hp-listing--view-block, hp-form--listing-search, hp-page__sidebar...)
 * so the cards, search box, filter and sort pick up the same CSS as /listing-category/... pages.
 */

/* ---------- 1. hero: same black band as the category hero, photo dropped ---------- */
body.ml-listpage .header-hero.post--single {
	background: #111 !important;
	background-image: none !important;
	padding-top: 40px !important;
	padding-bottom: 72px !important;
	min-height: 0 !important;
}
body.ml-listpage .header-hero.post--single::before,
body.ml-listpage .header-hero.post--single::after { display: none !important; }
body.ml-listpage .header-hero.post--single .post__header {
	position: relative;
	padding-top: 38px;            /* reserved for the count badge the script adds (no shift when it appears) */
	text-align: center;
}
/* The old post-category pill points at a retired /category/ URL that 301s, and for tire/steel/plastic it names the
   wrong category. The breadcrumb now shows the real NAICS category, so the pill is not shown (still in the HTML). */
body.ml-listpage .header-hero.post--single .post__categories { display: none; }
body.ml-listpage .header-hero.post--single .post__title { color: #fff; margin: 0; }
body.ml-listpage .header-hero.post--single .post__details,
body.ml-listpage .header-hero.post--single .post__details * { color: rgba(255,255,255,.72); }
body.ml-listpage .header-hero.post--single .post__details { justify-content: center; margin-top: 10px; font-size: 13px; }
body.ml-listpage .ml-lr-count {
	position: absolute; top: 0; left: 50%; transform: translateX(-50%);
	margin: 0; padding: 4px 10px; line-height: 18px; white-space: nowrap;
	font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
	background: var(--ml-red, #d0141a); color: #fff; border-radius: 3px; font-weight: 700; /* = category hero badge */
}
@media (max-width: 767px) {
	body.ml-listpage .header-hero.post--single { padding-top: 28px !important; padding-bottom: 28px !important; }
	body.ml-listpage .header-hero.post--single .post__title { font-size: 30px; }
}

/* ---------- 2. page width: category pages use the full container, the post used 8/12 ---------- */
@media (min-width: 768px) {
	body.ml-listpage main.col-sm-offset-2 { -ms-flex-preferred-size: 100%; flex-basis: 100%; max-width: 100%; width: 100%; margin-left: 0; float: none; }
	/* ListingHive uses a flexbox grid (flex-basis/max-width on .col-sm-8), so all three are reset */
}
body.ml-listpage .site-content { padding-top: 40px; }
body.ml-listpage .post__text > *:not(.ml-lr) { max-width: 760px; margin-left: auto; margin-right: auto; }
body.ml-listpage .post--single .post-navbar { max-width: 760px; margin-left: auto; margin-right: auto; }

/* list -> category link (server HTML, inc/ml-list-naics.php) */
body.ml-listpage .post__text .ml-list-hub,
body.ml-listpage .post__text .ml-list-related { margin-top: 24px; font-size: 15px; }
body.ml-listpage .post__text .ml-list-related { margin-top: 6px; }
body.ml-listpage .post__text .ml-list-hub a,
body.ml-listpage .post__text .ml-list-related a { color: var(--ml-red, #c8161d); font-weight: 600; }

/* ---------- 3. directory block (built by assets/ml-list.js inside .post__text) ---------- */
body.ml-listpage .ml-lr { margin: 32px 0 8px; }
body.ml-listpage .ml-lr .ml-lr-search { display: flex; flex-direction: row; align-items: stretch; margin: 0 0 40px; }
body.ml-listpage .ml-lr .ml-lr-search .hp-form__fields { flex: 1 1 auto; margin: 0 10px 0 0 !important; }
body.ml-listpage .ml-lr .ml-lr-search .hp-form__field { margin: 0; }
body.ml-listpage .ml-lr .ml-lr-search input[type="search"] {
	width: 100%; height: 48px; border: 0; box-shadow: none; padding: 0 12px; font-size: 18px; background: transparent;
}
body.ml-listpage .ml-lr .ml-lr-search .hp-form__footer { flex: 0 0 auto; margin: 0; }
body.ml-listpage .ml-lr .ml-lr-search button { height: 48px; padding: 0 30px; }

body.ml-listpage .ml-lr .hp-row { display: flex; flex-wrap: wrap; }
body.ml-listpage .ml-lr .hp-page__sidebar { margin-bottom: 32px; }
body.ml-listpage .ml-lr .hp-form--listing-filter .hp-form__footer { margin-top: 20px; }
body.ml-listpage .ml-lr .hp-form--listing-filter .hp-form__footer button { width: 100%; }
body.ml-listpage .ml-lr .ml-lr-ftoggle { display: none; }
body.ml-listpage .ml-lr .hp-page__topbar { display: flex; flex-direction: row; justify-content: space-between; align-items: center; min-height: 28px; margin-bottom: 20px; }
body.ml-listpage .ml-lr .hp-result-count { margin: 0; }
body.ml-listpage .ml-lr .hp-form--listing-sort { display: flex; align-items: center; }
body.ml-listpage .ml-lr .hp-form--listing-sort .hp-field__label { display: inline; margin: 0 8px 0 0; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
body.ml-listpage .ml-lr .hp-form--listing-sort select { height: 28px; padding: 0 24px 0 8px; font-size: 12px; }

/* cards: the live .hp-listing--view-block rules apply; only the parts that differ from a real profile card */
body.ml-listpage .ml-lr .hp-grid__item[hidden] { display: none !important; }
/* r2c4 (SEO C4): the category label is printed once above the grid, not on every card */
body.ml-listpage .ml-lr .ml-lr-catlabel { color: #6b7280; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; line-height: 1.6; margin: 0 0 12px; }
body.ml-listpage .ml-lr .ml-lr-title { font-size: 17px; line-height: 1.3; }
body.ml-listpage .ml-lr .ml-lr-title u { text-decoration: none; }
body.ml-listpage .ml-lr .ml-lr-title a { color: #111; text-decoration: none; }
body.ml-listpage .ml-lr .ml-lr-title a:hover, body.ml-listpage .ml-lr .ml-lr-title a:focus { color: var(--ml-red, #c8161d); text-decoration: underline; }
body.ml-listpage .ml-lr .ml-lr-desc { margin: 0 0 6px; font-size: 13px; line-height: 1.45; color: #55555b; }
body.ml-listpage .ml-lr .ml-lr-sep { display: none; }
body.ml-listpage .ml-lr .ml-lr-host { text-transform: uppercase; letter-spacing: .06em; }
body.ml-listpage .ml-lr .ml-lr-empty { padding: 32px 0; text-align: center; }
body.ml-listpage .ml-lr .hp-pagination[hidden] { display: none; }
body.ml-listpage .ml-lr-leftover[hidden] { display: none; }

/* ---------- 4. phones: filter folds behind a button, like the category page ---------- */
@media (max-width: 767px) {
	body.ml-listpage .ml-lr .ml-lr-search { margin-bottom: 16px; }
	body.ml-listpage .ml-lr .ml-lr-search input[type="search"] { font-size: 16px; height: 44px; }
	body.ml-listpage .ml-lr .ml-lr-search button { height: 44px; padding: 0 18px; }
	body.ml-listpage .ml-lr .ml-lr-ftoggle { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin: 0 0 16px; }
	body.ml-listpage .ml-lr .ml-lr-side { display: none; }
	body.ml-listpage .ml-lr .ml-lr-side.is-open { display: block; }
	body.ml-listpage .ml-lr .hp-page__topbar { flex-wrap: wrap; gap: 8px; }
}

/* ---------- 5. no JS / script found no row block: the page reads exactly as before, just in the new frame ---------- */
body.ml-listpage:not(.ml-lr-on) .post__text u a { color: inherit; }
