/*
Theme Name: Wayrent Theme v1
Theme URI: https://wayrent.it
Author: Polara AI
Author URI: https://polara-ai.com
Description: Custom WordPress theme for Wayrent — Broker NLT indipendente. Vehicle catalog (CPT), lead capture (email + Google Sheets), SEO-foundations baked in (12-point checklist), automated content engine. v1.0.43: phone number now mandatory on the contact + gestione-flotta forms (HTML required) AND server-side in the lead handler (rejected as invalid_fields if empty); the Academy newsletter (form_type=academy) stays exempt. v1.0.42: mobile PageSpeed — hero LCP now serves car-fleet.webp via <picture> (matches the header preload; adds fetchpriority=high + width/height), Google Fonts + Swiper CSS load non-blocking (media=print onload; structural theme CSS stays blocking to avoid CLS), car-1/car-3 section images converted to webp + lazy-loaded, dropped unused Inter weight 900. JS was already deferred. v1.0.35: smoke-test mode for the daily health check — X-Smoke-Test request (key = wayrent_smoke_key option, else falls back to the content-bridge POLARA_BRIDGE_SECRET constant) skips spam controls, mails ONLY wayrent_smoke_email (default luca@polara-ai.com), and writes to the Healthcheck sheet tab; real leads untouched.
Version: 1.0.82
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: wayrent
Tags: custom, business, italian, automotive

Reference implementation: Polara AI WP theme (clients/polara/websites/polara-landing/wordpress/).
*/

/*
Changelog (kept OUT of the Description header to stay under WP's 8KB header parse window):
v1.0.82 (2026-09-10): GSC quick wins for furgoni and fleet management. The furgoni landing now owns transactional catalog intent and routes informational searches to the guide; the fleet page adds a direct renewal and delivery-planning answer without supplier delivery guarantees.
v1.0.81 (2026-09-08): Strip legacy FAQPage JSON-LD emitted late by the content bridge while preserving all other wp_head output. This closes the separate `_polara_schema_jsonld` path without modifying or redeploying the shared bridge plugin.
v1.0.80 (2026-09-08): Do not emit legacy per-post FAQPage overrides. Google limits FAQ rich results to authoritative government/health sites, and old stored FAQ JSON-LD could contradict refreshed visible copy.
v1.0.79 (2026-09-08): SEO recovery — category archives noindex and removed from Yoast XML, duplicate fleet-management post excluded defensively, commercial landing-page intent made distinct from editorial guides, and redundant custom FAQ/Article/Organization JSON-LD consolidated into Yoast's graph.
v1.0.53 (deployed 2026-07-26): header logo enlarged on desktop. Raising the height alone was not enough — header.php declared width="120" height="38" (3.16:1) while assets/img/wayrent-logo.png is intrinsically 200x152 (1.32:1), and the CSS sets width:auto;height:auto, so the attributes never sized it and it rendered ~53x40 with the declared ratio fighting the real one. Changed max-height 40px -> 48px in wp-components.css (the rule that WINS, since it loads after shared.css at equal specificity) plus height 38px -> 48px in shared.css for consistency, and corrected the attributes to 63x48. Verified live cache-busted at 1280x860 and 1440x900: logo 63.2x48, header bar 75px, no collision with the nav. Non-deployed static twin (partials/header.html, css/shared.css) kept in sync.
v1.0.54: FIX — business leads with an empty Partita IVA were being rejected and lost. The change that made partita_iva mandatory server-side ($need_piva in inc/lead-handler.php) added the input to every form but never made it `required` in the browser: assets/js/main.js only toggled `display`, and the Adam widget labelled it "opzionale" (required:false). A visitor who picked "azienda" and left it blank got a 400 invalid_fields — no email, no sheet row, no trace. Proven live 2026-07-26: business lead without P.IVA -> 400 {"missing":["partita_iva"]}, same lead with P.IVA -> 200. Now: main.js setPartitaIvaRequired() adds/removes `required` in lockstep with the block's visibility on BOTH the front-page (#company-fields) and the reusable form (.js-company-fields), page-contatti.php does the same for #piva-field (azienda + libero-professionista), and the Adam widget asks privato/azienda and then requires company name + P.IVA for business leads (sending tipo + azienda so $is_business matches). The attribute is REMOVED when the block is hidden — a hidden `required` input makes the whole form unsubmittable. The duplicate display-only #tipo-lead handler in front-page.php was removed so main.js is the single source of truth. Caught by the daily lead-healthcheck; its Wayrent form probe now sends a partita_iva and failed posts report the response body, not a bare status code.
v1.0.51: staging-only hero video swapped to the new cinematic clip (kling 2026-07), baked at 0.8x speed via ffmpeg (8.79s loop, audio stripped, faststart, 0.96MB), source URL cache-busted (?v=2), heroFade keyframes now ease-in-out on the fade-in/out segments. Production untouched — video renders only when wayrent_is_staging().
v1.0.50: [wayrent_offerte] segment="all" now filters to the canonical privati|aziende|furgoni segments (excludes usato-auto as cheapest anchor); truly-unfiltered only as empty-catalog fallback.
v1.0.49: vehicle CPT + taxonomies now register at init priority 0 — the content-bridge plugin's HMAC preview handler runs on init before the theme's default-priority callbacks and exits, so shortcodes touching the CPT rendered degraded in previews (no segment filter, ?p= permalinks, empty archive link).
v1.0.48: [wayrent_offerte] shortcode (inc/offers-embed.php) — embeds live vehicle offer cards inside post content for BOFU SEO posts (segment=privati|aziende|furgoni|all, max 1-6, cheapest first, falls back unfiltered then renders nothing if the catalog is empty). .post-offers styles in wp-components.css. single.php CTA band gains a secondary "Guarda le offerte" button to /auto/.
v1.0.47: CSP frame-src — added www.openstreetmap.org. The /contatti/ map is an OSM embed iframe that frame-src never allowed, so the map had never rendered for anyone (found while verifying the gtag CSP fix in a real browser). Map tiles only, no tracking origin.
v1.0.46: CSP — the Google Tag (GT-WB77B2RT) was installed but googletagmanager was never allowlisted, so gtag.js was blocked on every page and all tracking was silently dead. Added www.googletagmanager.com to script-src, the conversion beacon hosts (pagead2.googlesyndication / googleads.g.doubleclick / google / google-analytics / region1 / googleadservices) to connect-src, and td.doubleclick+gtm to frame-src. Allowing only the script makes the tag load while every conversion stays blocked (the Polara 2026-07-14 trap) — connect-src is the half that matters. Turnstile directives (blob:, worker-src, challenges.cloudflare.com) untouched.
v1.0.45: C4 fix — vehicle cards showed a grey placeholder because the CPT posts have no WP featured image. wayrent_render_vehicle_card() now falls back to the static assets/img/products/{slug}.(webp|jpg) that ships with the theme (keyed by _vehicle_ayvens_slug / post_name, file_exists-guarded).
v1.0.44: SEO audit 2026-07-16 — vehicle meta descriptions + titles, 3 dup -2 redirects, noindex+sitemap-exclude vehicle_body/vehicle_fuel taxonomies.
*/

/* Fallback only — real styling lives in assets/css/main.css (Tailwind compiled) + assets/css/shared.css */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #1A1D23;
    background: #F7F8FA;
    margin: 0;
}
