/*
Theme Name: Offbeat Tickets
Theme URI: https://github.com/doug86i/offbeat-platform
Author: Doug Hunt / Offbeat Tickets
Author URI: https://offbeattickets.com
Description: Theme-Builder-aware presentational shell for Offbeat Tickets multisite child sites. Elementor Site Settings (Global Colors / Fonts / Buttons / layout) is the single source of visual truth; the Theme Builder owns every screen. The theme itself ships only token wiring, accessibility primitives, and a tiny PHP-fallback baseline that engages when Elementor is deactivated.
Version: 0.13.4
Requires at least: 6.6
Tested up to: 6.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: offbeat-tickets
Tags: e-commerce, custom-menu, featured-images, full-width-template, threaded-comments, translation-ready, wide-blocks
*/

/* ——— Token wiring ———
 * Elementor Site Settings (`--e-global-*`) is the source of truth. theme.json
 * (`--wp--preset--*`) and literal hex are downstream fallbacks for non-Elementor
 * contexts (block editor, PHP fallbacks, plugin-emitted markup). Customers
 * editing Site Settings → Global Colors / Fonts cascade everywhere the theme
 * renders.
 */
:root {
	--obt-primary:   var(--e-global-color-primary,   var(--wp--preset--color--primary,   #4f46e5));
	--obt-secondary: var(--e-global-color-secondary, var(--wp--preset--color--secondary, #6b7280));
	--obt-text:      var(--e-global-color-text,      var(--wp--preset--color--text,      #0d0d12));
	--obt-accent:    var(--e-global-color-accent,    var(--wp--preset--color--accent,    #ff5b3a));
	--obt-surface:   var(--e-global-color-surface,   var(--wp--preset--color--surface,   #fafaf7));
	--obt-contrast:  var(--e-global-color-contrast,  var(--wp--preset--color--contrast,  #0d0d12));
	--obt-border:    var(--e-global-color-border,    rgba(13, 13, 18, 0.08));
	--obt-font:      var(--e-global-typography-text-font-family, "Inter"), system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	--obt-content-width: min(100% - 2rem, 1140px);
}

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

body {
	margin: 0;
	font-family: var(--obt-font);
	color: var(--obt-text);
	background: var(--obt-surface);
}

/* Layout primitive used by PHP fallbacks; Elementor sections set their own widths. */
.obt-container {
	width: var(--obt-content-width);
	margin-inline: auto;
}

/* Accessibility primitives. */
.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	position: absolute !important;
	height: 1px;
	width: 1px;
	overflow: hidden;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	clip: auto !important;
	position: static !important;
	height: auto;
	width: auto;
	overflow: visible;
}

:where(a:focus-visible),
:where(button:focus-visible),
:where([tabindex]:focus-visible) {
	outline: 2px solid var(--obt-primary);
	outline-offset: 2px;
}

/* Non-Elementor page baseline.
 *
 * Wraps the PHP fallback `<main class="obt-site-main">` AND any WP /
 * WooCommerce page that does not have `_elementor_data` (so its content
 * is rendered by `the_content()` rather than by an Elementor Theme
 * Builder template). Mirrors the boxed layout Elementor templates ship
 * with (1140px max-width, 32px horizontal gutters, generous vertical
 * rhythm) so the basket, checkout, my-account, and standard WP pages
 * read consistently with the bespoke Elementor surfaces.
 *
 * Targeting `body:not(.elementor-page)` keeps Elementor-built pages
 * untouched — they manage their own widths via container settings.
 */
.obt-site-main {
	width: 100%;
	min-height: 50vh;
	padding-block: 3rem 4rem;
}

body:not(.elementor-page) .obt-site-main > .obt-entry,
body:not(.elementor-page) .obt-site-main > .wp-block-woocommerce-cart,
body:not(.elementor-page) .obt-site-main > .wp-block-woocommerce-checkout,
body:not(.elementor-page) .obt-site-main > .woocommerce {
	max-width: 1140px;
	margin-inline: auto;
	padding-inline: 2rem;
}

@media (max-width: 600px) {
	body:not(.elementor-page) .obt-site-main > .obt-entry,
	body:not(.elementor-page) .obt-site-main > .wp-block-woocommerce-cart,
	body:not(.elementor-page) .obt-site-main > .wp-block-woocommerce-checkout,
	body:not(.elementor-page) .obt-site-main > .woocommerce {
		padding-inline: 1rem;
	}

	.obt-site-main {
		padding-block: 2rem 3rem;
	}
}

.obt-site-main > article + article {
	margin-top: 2rem;
}

/* Cart / Checkout / My Account: WooCommerce's blocks include their own
 * page-level headings (e.g. "Cart totals") so the PHP fallback's
 * <h1>Page title</h1> is redundant. Hide the entry header on these
 * specific pages without affecting standard posts/pages.
 */
body.page-template-default.woocommerce-cart .obt-entry-header,
body.page-template-default.woocommerce-checkout .obt-entry-header,
body.page-template-default.woocommerce-account .obt-entry-header {
	display: none;
}

/* Header brand: minimal safety rules for `the_custom_logo()` markup, which
 * Elementor cannot reach. Display sizing comes from the brand container's
 * Min Height in the Elementor header template (merchant-editable in Site
 * Settings / template editor). The img just respects whatever height the
 * surrounding flex item has. */
.offbeat-site-logo {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	min-width: 0;
	max-width: 100%;
	height: 100%;
}

.offbeat-site-logo .custom-logo-link,
.offbeat-site-logo__title {
	display: block;
	max-width: 100%;
}

/* Site Title fallback (when the merchant has no Custom Logo). Inherit
 * colour and typography from the surrounding Elementor brand container's
 * Style controls so the merchant edits the look in the editor, not in
 * theme CSS. */
.offbeat-site-logo__title {
	color: inherit;
	text-decoration: none;
}

.offbeat-site-logo img,
.offbeat-site-logo .custom-logo-link img {
	display: block;
	height: auto;
	width: auto;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	object-position: left center;
}

/* Excerpt baseline: only reset the browser <p> margin. Color and typography
 * cascade from Elementor Site Settings → Global Fonts → Body, so merchants
 * adjust the look in the kit, not by overriding theme CSS. */
.offbeat-loop-event-excerpt {
	margin: 0;
}
