/* ==========================================================================
   Grind Hog — Product Sidebar
   --------------------------------------------------------------------------
   Styles [gh_other_models] and [gh_retrofit_sidebar], rendered by
   inc/sidebar.php into a GeneratePress sidebar widget area on singular
   grindhog_product pages. Narrow column (~250-300px) — no multi-column
   list layout, no sticky filter bar; this is a small nav block, not a
   full-page index like the sitemap.

   Every selector is scoped under .gh-sidebar so nothing leaks elsewhere.
   The markup/class contract is owned by inc/sidebar.php — do not rename
   classes here without updating that file.

   Font family is intentionally NOT declared: it inherits GeneratePress's
   body font stack. Colors reuse the theme's existing custom properties
   (--base, --base-2, --base-3, --accent, --accent-2, already used in this
   child theme's style.css and assets/sitemap.css) with hard-coded
   fallbacks in case the Customizer values are ever unset.

   Table of contents:
     1. Custom properties (retune here)
     2. Layout wrapper
     3. Title
     4. List / items / links
     5. Current-item state (.is-current)
     6. Retrofit brand grouping
     7. Empty state
     8. Reduced motion
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Custom properties — retune here
   -------------------------------------------------------------------------- */
.gh-sidebar {
	--gh-sidebar-border-color: var(--base, #d7d7d7);
	--gh-sidebar-bg: var(--base-3, #fff);
	--gh-sidebar-bg-muted: var(--base-2, #f5f5f5);
	--gh-sidebar-accent: var(--accent, #c0392b);
	--gh-sidebar-accent-2: var(--accent-2, #a83226);
	--gh-sidebar-accent-contrast: #fff;
	--gh-sidebar-text-muted: #6b7280;

	--gh-sidebar-radius: 4px;
	--gh-sidebar-gap: 1.5rem;
	--gh-sidebar-transition: 0.15s ease;

	display: block;
	max-width: 100%;
}

.gh-sidebar *,
.gh-sidebar *::before,
.gh-sidebar *::after {
	box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   2. Layout wrapper — a bit of separation when two sidebar blocks
      ([gh_other_models] + [gh_retrofit_sidebar]) stack in the same column.
   -------------------------------------------------------------------------- */
.gh-sidebar + .gh-sidebar {
	margin-top: var(--gh-sidebar-gap);
	padding-top: var(--gh-sidebar-gap);
	border-top: 1px solid var(--gh-sidebar-border-color);
}

/* --------------------------------------------------------------------------
   3. Title
   -------------------------------------------------------------------------- */
.gh-sidebar__title {
	margin: 0 0 0.85rem;
	padding-bottom: 0.5rem;
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.25;
	border-bottom: 2px solid var(--gh-sidebar-accent);
}

/* --------------------------------------------------------------------------
   4. List / items / links
   -------------------------------------------------------------------------- */
.gh-sidebar__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.gh-sidebar__item {
	margin: 0;
	padding: 0;
}

.gh-sidebar__item + .gh-sidebar__item {
	border-top: 1px solid var(--gh-sidebar-border-color);
}

.gh-sidebar__link {
	display: block;
	padding: 0.55rem 0.15rem;
	color: inherit;
	text-decoration: none;
	border-radius: var(--gh-sidebar-radius);
	transition: color var(--gh-sidebar-transition), background-color var(--gh-sidebar-transition), padding-left var(--gh-sidebar-transition);
}

.gh-sidebar__link:hover {
	color: var(--gh-sidebar-accent);
	background: var(--gh-sidebar-bg-muted);
	padding-left: 0.4rem;
}

.gh-sidebar__link:focus-visible {
	outline: 2px solid var(--gh-sidebar-accent);
	outline-offset: -2px;
	color: var(--gh-sidebar-accent);
}

/* --------------------------------------------------------------------------
   5. Current-item state — marks the mounting type already being viewed in
      [gh_other_models]. Distinct from hover/focus: solid accent fill, not
      just a color change, so it reads at a glance.
   -------------------------------------------------------------------------- */
.gh-sidebar__link.is-current {
	color: var(--gh-sidebar-accent-contrast);
	background: var(--gh-sidebar-accent);
	font-weight: 700;
	cursor: default;
}

.gh-sidebar__link.is-current:hover {
	color: var(--gh-sidebar-accent-contrast);
	background: var(--gh-sidebar-accent-2);
	padding-left: 0.15rem;
}

.gh-sidebar__link.is-current:focus-visible {
	outline-color: var(--gh-sidebar-accent-2);
}

/* --------------------------------------------------------------------------
   6. Retrofit brand grouping — [gh_retrofit_sidebar] with show_brand="yes"
   -------------------------------------------------------------------------- */
.gh-sidebar__group + .gh-sidebar__group {
	margin-top: 1rem;
}

.gh-sidebar__brand {
	margin: 0 0 0.3rem;
	font-size: 0.78rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--gh-sidebar-text-muted);
}

/* --------------------------------------------------------------------------
   7. Empty state — shown when the retrofit -> product_family backfill
      hasn't populated any matches yet for the current mounting type.
   -------------------------------------------------------------------------- */
.gh-sidebar__empty {
	margin: 0;
	padding: 0.75rem;
	font-size: 0.9rem;
	color: var(--gh-sidebar-text-muted);
	background: var(--gh-sidebar-bg-muted);
	border: 1px dashed var(--gh-sidebar-border-color);
	border-radius: var(--gh-sidebar-radius);
}

/* --------------------------------------------------------------------------
   8. Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.gh-sidebar * {
		transition: none !important;
	}
}
