/*
Theme Name: jvusa-v2.1
Theme URI: https://jvusa.org/
Author: Developer Hari Krishna Paudel
Author URI: https://jvusa.org/
Description: Official theme for Jeevan Vigyan USA (JVUSA) - Features WooCommerce integration, event registration, volunteer management, contact forms, Prayogshala calendar system, and YouTube video feeds on homepage.
Tags: jeevan-vigyan, meditation, spiritual, events, courses, nonprofit, community, woocommerce
Text Domain: jeevanvigyan
Version: 2.1
Requires at least: 5.6
Tested up to: 6.7
Requires PHP: 7.4
License: Proprietary
License URI: https://jvusa.org/

Changelog:
v2.1 production (October 23, 2026)
- Security hardening: removed hardcoded reCAPTCHA secret key; verification now fails hard if JV_RECAPTCHA_SECRET constant is missing
- Security: replaced curl_* with wp_remote_post() for reCAPTCHA verification
- Security: AJAX handler get_product_price now requires nonce (jv_get_product_price_nonce) and edit_posts capability
- Security: Turnstile no longer silently bypassed when secret is unconfigured; returns WP_Error (hard fail)
- Security: Turnstile local-env bypass now requires WP_DEBUG=true to prevent Host header spoofing
- Security: fixed 19 unescaped echo get_field() XSS sinks in admin columns (jv-custom-column.php)
- Security: fixed undefined $color variable and broken <br tag in prayogshala column
- Security: fixed XSS in dashboard.php, donation-template.php, archive.php, front-page.php
- Security: SQL queries in prayogshala calendar now use full wpdb::prepare() (no concatenated $where)
- Security: donations CSV export secured with nonce verification; capability upgraded to manage_woocommerce
- Security: save_post_view-order now verifies WordPress nonce before processing post_author_override
- Security: profile image upload validates MIME type via mime_content_type() before media_handle_upload()
- Security: added defined('ABSPATH') || exit guard to all template files missing it
- About page: fixed ACF image field handling (array vs URL return type) for section_1 and section_2
- About page: unified image border style (border-radius 12px, white border, box-shadow) across all sections
- About page: added title-decoration SVG to section_2 (Our Vision); consistent padding pt-90 pb-90
- About page: text column gracefully expands to col-lg-12 when no image is configured
v2.0 modular (June 2, 2026)
- Modular architecture: feature router with context-loaded inc/{feature}_functions.php files
- New blog page template (home.php) with hero banner, featured post, grid layout, numbered pagination
- Fixed Donate page: Turnstile before Pay Now, button disabled until verified, session cleanup on redirect
- Moved page-donate form processing to inc/page-donate_functions.php
- Fixed gettext filter OOM: static $order + $is_donation cache prevents repeated wc_get_order calls
- Cleaned up dead page templates (page-order-success, page-order-failed)
- Removed stage-tracing diagnostics, noise logs, and REFACTOR-CHANGELOG.md
v1.9 (June 13, 2026)
- Removed all membership code from theme (moved to jv-core plugin)
- Deleted duplicate root woocommerce.php (kept inc/woocommerce.php)
- Removed WooCommerce Membership endpoint + missing template reference
- Deleted membership ACF JSON files (plugin uses native meta, not ACF)
- Removed membership sections from dashboard templates
- Deleted 3 orphaned dashboard templates (templates/account/*.php)
- Cleaned up user roles (removed legacy member role)
- Various fixes: redirect URL, email headers, courses checkboxes
v1.8 (June 13, 2026)
- Fixed prayogshala registration form not submitting (init hook timing bug)
- Added admin columns + meta box for Prayogshala Requests
- Email notifications now sent to per-prayogshala contact emails + admin
- Added per-prayogshala email template customization (ACF fields)
- Cleaned up user roles: removed zombie caps, added proper prayogshala_request caps
- Registration form toggle: preview first fields, expand/hide remaining
v1.6 beta.0 (March 1, 2026)
- Unified event fee and age-discount calculations across request form, cart, and checkout using admin discount settings
- Fixed participant age parsing and source-of-truth alignment to prevent summary vs checkout total mismatch
- Improved event modal submit total synchronization to always use recalculated grand total
- Fixed logged-in user additional details persistence with robust profile/member resolution
- Restored and standardized Woo order item participant metadata (participant rows, under-18/18+ counts, totals, event identifiers)
*/

/* Footer Quick Links Alignment & Spacing Fix */
.footer-link {
	text-align: left !important;
}
.footer-link ul {
	list-style: none;
	padding: 0;
	margin: 0;
	text-align: left;
}
.footer-link ul li {
	margin-bottom: 10px;
	padding: 0;
	text-align: left;
}
.footer-link ul li:last-child {
	margin-bottom: 0;
}
.footer-link a {
	display: block;
	padding: 0;
	text-decoration: none;
	color: inherit;
	font-weight: 500;
	text-align: left;
}
/* Footer Quick Links Spacing Fix */
.footer-link ul {
	list-style: none;
	padding: 0;
	margin: 0;
}
.footer-link ul li {
	margin-bottom: 10px;
}
.footer-link ul li:last-child {
	margin-bottom: 0;
}
.footer-link a {
	display: block;
	padding: 4px 0;
	text-decoration: none;
}
/* === JV Checkout Terms Consent Sizing === */
.jv-terms-consent {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.jv-terms-consent .woocommerce-form__label {
	display: inline-flex;
	align-items: center;
	font-weight: 600;
	font-size: 1.05rem;
}
.jv-terms-consent .woocommerce-form__input-checkbox {
	width: 20px;
	height: 20px;
	margin-right: 10px;
}
.jv-terms-consent .woocommerce-terms-and-conditions-checkbox-text {
	font-size: 1.05rem;
	line-height: 1.6 beta;
}
.jv-terms-consent .woocommerce-terms-and-conditions-link {
	font-size: 1.05rem;
}

@media (max-width: 575.98px) {
	.jv-terms-consent .woocommerce-form__label {
		font-size: 1rem;
	}
	.jv-terms-consent .woocommerce-form__input-checkbox {
		width: 18px;
		height: 18px;
	}
}
- Reduced duplicate cart and checkout participant/discount detail rendering
- Added age-discount admin reporting for coupon giveaway totals
- Added Event Orders CSV export (event-specific) with participant columns, payment fields, billing/shipping details, and full order financial columns
- Fixed local subdirectory permalink/rewrite handling for /w
- Fixed donate page fatal error (HTTP 500) by resolving parse error in Turnstile block
- Updated donate page heading hierarchy for accessibility (h2/h3 structure)
- Refactored donate page visual styles to rely on theme/bootstrap classes instead of hardcoded overrides
- Hardened request/nonce sanitization and output escaping across active frontend/admin handlers for production readiness
- Removed unused legacy account/admin archive handlers to reduce attack surface
- Removed unused vendor utility script (`vendor/mpdf/mpdf/data/out.php`) and retained web-access deny rule for sensitive mPDF data path
- Removed unused PDF-generation vendor packages tied to legacy order/print flows (mPDF, Dompdf stack, FPDI, Browsershot) to reduce production footprint

v1.4.0 (February 24, 2026)
- Fixed homepage footer to match other pages
- Added full-width footer support
- Fixed z-index layering for footer overlay
- Closed missing section tag in events section

v1.3.0.1 (February 3, 2026)
- Added homepage YouTube video feeds integration with API v3
- Consolidated homepage settings (YouTube & Events) into post 251 editor
- Implemented 6-video responsive grid layout on homepage
- Added event time display with date formatting
- Optimized theme performance and caching
- Updated API endpoints for reliable video fetching via uploads playlist

Contact Information:
Email: contact@jvusa.org
Phone: +1-703-791-9357
Website: https://jvusa.org
Address: P.O. Box 1333, Manassas, VA 20108

Features:
- Event and course registration with PDF ticket generation
- Prayogshala program management
- Meditation and spiritual content library
- Volunteer and donation management
- Advanced admin dashboard with consolidated menus
- WooCommerce integration for payments
- Custom user roles and capabilities
- Email notification system
- Analytics and reporting
*/
.custom-logo {max-height:80px !important; max-width: 80px !important;}

/* Homepage header logo size alignment with production: use explicit height for homepage header */
body.home .header-two .logo img,
body.home .logo img,
/* Also ensure the front-page template which may use .home in body class displays same size */
.front-page .logo img {
    height: 100px !important;
    width: auto !important;
    max-height: none !important; /* override any conflicting rules */
}

/* Ensure consistent header logo sizing across all sites and headers (including subdomains)
   Some sites may not render body.home/front-page classes (e.g. subdomain landing pages).
   Target .logo img.custom-logo directly and common header variants to guarantee the size. */
.logo img.custom-logo,
.header-two .logo img.custom-logo,
.sticky-menu .logo img.custom-logo,
.site-header .logo img.custom-logo {
    height: 100px !important;
    width: auto !important;
    max-height: none !important;
}

/* Strong fallback: target direct image inside .logo anchor and general .logo img
   to ensure the logo is always displayed at the fixed height across desktop and mobile. */
.logo > a > img.custom-logo,
.logo > a > img,
.logo img.custom-logo,
.logo img {
    height: 100px !important;
    width: auto !important;
    max-height: none !important;
    display: block !important;
}
.details__content h2 { border-bottom: 1px solid #e6e6e6 !important; }
li.mini_cart_item {width: 100%;}
.privacy-policy h2 { font-size:22px !important;}
.privacy-policy h3 { font-size:20px !important;}


/* Footer enhancements */
.site-footer { position: relative; color: #f8fafd; }
.site-footer::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(1,164,211,0.72) 0%, rgba(52,64,51,0.78) 100%);
}
.site-footer .container, .site-footer .footer-top { position: relative; z-index: 1; }
.site-footer .footer-title { font-size: 1.1.6 betarem; font-weight: 600; color: #f8fafd; }
.site-footer .footer-text { color: #f8fafd; }
.site-footer .footer-link, .site-footer .footer-link:visited { color: #f0f8fc; text-decoration: underline; }
.site-footer .footer-link:hover, .site-footer .footer-link:focus { color: #ffffff; text-decoration: underline; }
.site-footer .footer-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; margin: 0 6px; color: #f8fafd; background: rgba(184,40,46,0.35); transition: background 0.2s ease, transform 0.2s ease; }
.site-footer .footer-icon:hover { background: #B8282E; transform: translateY(-1px); color: #fff; }
.site-footer .footer-menu li a { color: #f0f8fc; }
.site-footer .footer-menu li a:hover { color: #ffffff; }
.site-footer .footer-item { margin-bottom: 10px; }
.site-footer i { color: #f0f8fc; }
.site-footer .copyright-wrap { background: transparent; }
.site-footer .footer-link-accent, .site-footer .footer-link-accent:visited { color: #B8282E; font-weight: 600; }
.site-footer .footer-link-accent:hover, .site-footer .footer-link-accent:focus { color: #a52228; }

/* Global palette and typography overrides */
:root {
	--color-primary: #800000; /* maroon */
	--color-primary-dark: #660000;
	--color-accent-blue: #E3F9FF;
  /* legacy variables used across templates */
  --primary: #800000;
  --secondary: #E3F9FF;
  --tertiary: #21.6 beta29;

/* Header unified colors */
.second-header .header-icon,
.second-header .header-cta i { color: var(--color-primary); }
.second-header .header-text,
.second-header a { color: var(--color-primary); }
.second-header a:hover,
.second-header .header-text:hover { color: var(--color-primary-dark); }
