fix: Astra style conflicts, full-width, responsive hero images, header search

Plugin (viator-collector 1.8.1):
- is_vc_page() now matches any Viator shortcode, so shortcode Pages (home)
  get the full-width no-sidebar canvas
- load vc-design.css after Astra + inline overrides: strip Astra page-builder
  article padding (removes extra gap above hero), full-bleed containers,
  enforce design font inside .vc-app
- vc_hero_img_html(): render hero from the WP media library with responsive
  srcset when the image is an attachment; used in listing + [viator_hero]
  ([viator_hero image_id=".."])

Theme (astra child):
- remove the user/profile header item
- working header search (expands, submits to the tours archive ?vc_q=)
- load chrome.css after Astra + enforce design font inside .hoho
- rebuild installable ZIP

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J4hNL1PSHxXbu94SCenpKj
This commit is contained in:
2026-09-15 17:32:07 +03:30
parent eab161aa5c
commit 67c88c795b
10 changed files with 158 additions and 29 deletions

View File

@@ -63,6 +63,31 @@
}
}
/* ---------- header search: expand, then submit ---------- */
var search = document.querySelector(".header__search");
if (search) {
var searchInput = search.querySelector(".header__search-input");
var searchBtn = search.querySelector(".header__search-btn");
if (searchInput && searchBtn) {
searchBtn.addEventListener("click", function (e) {
if (!search.classList.contains("is-open")) {
e.preventDefault();
search.classList.add("is-open");
searchInput.focus();
} else if (!searchInput.value.trim()) {
e.preventDefault();
search.classList.remove("is-open"); /* empty → collapse instead of submit */
}
/* open + has text → let the form submit to the tours archive (?vc_q=) */
});
document.addEventListener("click", function (e) {
if (!search.contains(e.target) && !searchInput.value.trim()) {
search.classList.remove("is-open");
}
});
}
}
/* ---------- footer: back to top ---------- */
var toTop = document.querySelector(".ring-badge--top");
if (toTop) {