/*
Theme Name:   Question Mentor - Hello Elementor Child
Theme URI:    https://questionmentor.com
Description:  Child theme of Hello Elementor for Question Mentor. Adds the custom
              site header, category sub-header, footer, and the Tools Directory
              module (categories, sub-categories with images, per-tool icons,
              a homepage hero/search/filter grid, and an automatic single Tool
              page template for any Page assigned a Tool Category).
Author:       Question Mentor
Author URI:   https://questionmentor.com
Template:     hello-elementor
Version:      1.8
Text Domain:  qm-hello-elementor-child

Changelog
1.8
- Fixed Elementor's own Global Colors / Global Fonts / Site Settings
  CSS (and any Theme-Builder or per-post Custom CSS) bleeding into the
  single Tool detail page and overriding our blues/oranges. That page
  is 100% custom markup and never uses Elementor, so its Elementor
  stylesheets are now dequeued entirely on that template instead of
  trying to out-rank them with more !important rules.
1.7
- Fixed: on mobile, opening a category's sub-menu (tap-to-expand) and
  then scrolling the page left the sub-menu floating on screen,
  detached from the category it belonged to. It now closes
  automatically the instant the page (or the category row itself) is
  scrolled, on both the Tool Category sub-header and the WooCommerce
  category sub-header.
- Fixed the Tool Category sub-header's left/right scroll arrows: they
  had no styling at all (invisible/unstyled buttons) and were not
  wired up to actually scroll the row. They now match the polished
  circular, semi-transparent look used elsewhere in the site header,
  fade out automatically at either end of the row, and scroll smoothly
  on click.
- Hardened the single Tool detail page's styling: every CSS property
  in that section now carries !important, so the page-builder/parent
  theme's own styles can no longer partially override our layout,
  spacing, or colors on that page.
1.5
- Fixed: searching on a Tool Category (or sub-category) page could show
  "No tools match your search" for a tool that was clearly visible on
  the page. Category-page search now queries the qm_tool_search AJAX
  endpoint live, scoped to that category via qm_get_category_pages() —
  the exact same function used to render the category's own cards — so
  results can never drift out of sync with what's on the page. The
  homepage hero search is unchanged (still instant, client-side).
- Hardened the embedded search-index JSON: previously, one tool with an
  invalid-UTF-8 character anywhere in its title/description made the
  entire index fail to encode and silently fall back to an empty "[]"
  (breaking search for every tool in scope, not just the bad one). Now
  only the offending row is dropped and the rest stay searchable.
1.3.4
- Fixed a search regression from 1.3.3: the extra has_term() "re-verify"
  check added to close a leak was itself unreliable and could zero out
  legitimate results (a tool that IS in the category showing "no
  results"). Removed it — the existing tax_query scoping in
  qm_get_category_pages() was already correct on its own. Kept the one
  unambiguous, always-safe guard: every search result must be
  post_type "page" (a Blog Post can never appear in search results).
- Tool Category pages (both the archive/category page and the single
  tool page) now force full width, breaking out of any container the
  parent theme or a page-builder's global content-width setting wraps
  #content in — our own layout already centers itself internally, so it
  no longer renders "boxed"/narrower than the rest of the site.
1.3.3
- Search on a category/sub-category page is double-verified: every
  result must be a published Page assigned to that category via the
  existing, correctly-scoped tax_query. (See 1.3.4 above — an extra
  re-check added here was rolled back the next release.)
- Tool CARDS (homepage grid, category grids, search results, sidebar
  "Popular Tools" list, related/latest sections) now always show the ACF
  "Tool Title" field when it has text in it, falling back to the actual
  Page Title only if that field is empty. The single tool page's own big
  title still defaults to the actual Page Title (with its own toggle from
  1.3.2) — that's a separate, deliberate setting from the card title.
1.3.2
- Search (native ?s= search AND the [qm_tools_directory] AJAX search) now
  strictly returns Pages that have a Tool Category assigned — Blog Posts,
  and any Page with no category, are excluded everywhere.
- Tool title now defaults to the actual WordPress Page Title everywhere
  (cards, search results, the single tool page). New ACF toggle "Use this
  custom Tool Title instead of the Page Title?" (off by default) lets you
  opt a specific tool into showing the "Tool Title" field text instead.
- Single tool page: the hero (icon + title) now sits inside the main
  column instead of a separate full-width block above it, so the sidebar's
  top edge lines up with the title instead of starting further down.
- Tool card titles are smaller on mobile / small screens across all
  breakpoints (was still fairly large below 768px).
- Hello Elementor's own default header/footer markup is now force-disabled
  via its own `hello_elementor_header_footer` filter (plus a CSS
  safety net), so only our custom header/footer ever render — no more
  risk of a duplicate header/footer from the parent theme.
1.3.1
- New: /tools/ — isolated, protected tool-logic files (same convention as
  our other tools sites). Each real tool's working code lives in its own
  file, loaded from functions.php by an explicit require_once path, and
  registers its own shortcode. See /tools/README.md. Ships with a real,
  working example: tools/qm-tool-word-counter.php -> [qm_tool_word_counter].
1.3.0
- Pasted SVG icon (Tool Card Settings box) now always takes priority over
  the ACF "Tool logo" image, everywhere: cards, live search results, and
  the new single tool page hero.
- Tool cards: icon + title + Free/Paid tag now share one compact row, and
  the whole card is smaller (less padding, smaller icon/text, tighter grid).
- New: single-tool.php — any Page with a Tool Category assigned
  automatically gets a full tool-page design (no manual Elementor building
  needed): hero, the tool's own embed shortcode (new ACF "Tool Embed
  Shortcode" field) in a highlighted box, "About This Tool" (the page's
  own content), and a sidebar with Popular Tools, Categories, Latest
  Posts, plus Related Tools and Latest Tools sections below. Pages with no
  Tool Category keep using the default page template untouched.
- New: Settings > Tool Page Ads — two ad-code slots (sidebar top/bottom).
  Each only renders when it actually has code in it; empty slots print
  nothing at all.
1.2.0
- Previous release (Tools Directory homepage, taxonomy archive template).
*/

/* Intentionally left minimal — all layout/component CSS is injected inline
   from functions.php so it lives next to the markup it styles. Add any
   extra global overrides below if needed. */
