/**
 * tobalt-renginiai foundation — typography + color isolation from host theme.
 *
 * Every shortcode wraps its output in `<div class="tr-root tr-root--<skin>">`.
 * This file sets explicit font + size + line-height + color on `.tr-root` so
 * descendant elements stop inheriting the host theme's typography. Variables
 * are exposed for per-site overrides (filter `tr_foundation_vars` or admin
 * setting `tr_color_primary`, `tr_color_heading`).
 *
 * Default font is a system-UI stack — zero bytes, fast paint, distinct from
 * whatever the host theme uses (so the plugin's "own" identity shows through).
 * Sites that want a brand font can override `--tr-font-family` per-skin or
 * via theme CSS.
 *
 * @package Tobalt_Renginiai
 * @author  Tobalt — https://tobalt.lt
 */

.tr-root {
	/* Plugin-owned tokens. Override these per-skin or site-wide. */
	--tr-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--tr-font-family-heading: var(--tr-font-family);
	--tr-font-size-base: 1rem;  /* Inherit from html root, NOT force 16px — keeps the
	                               plugin sized like the host theme expects. */
	--tr-line-height: 1.55;
	--tr-color-text: #0f172a;       /* matches the existing card text-primary across new shortcodes */
	--tr-color-muted: rgba(15, 23, 42, 0.62);
	--tr-color-bg: #ffffff;
	--tr-color-bg-elevated: #ffffff; /* card background */
	--tr-color-link: #2563eb;
	--tr-color-border: rgba(15, 23, 42, 0.08);
	--tr-color-accent: #272D2D;     /* day-box / primary CTA red — matches existing tl-date-bg */
	--tr-color-accent-fg: #ffffff;
	--tr-shadow-card: 0 2px 12px rgba(15, 23, 42, 0.08);
	--tr-radius: 12px;

	/* Reset host-theme typography. Font-size INHERITED from host (was forced
	 * to 16px in v2.12.0 — broke proportions on Frisk-class themes that run
	 * 14px body baseline). Cards/headings still get explicit sizes below. */
	font-family: var(--tr-font-family);
	font-size: inherit;
	line-height: var(--tr-line-height);
	color: var(--tr-color-text);
	font-feature-settings: "kern", "liga", "calt";
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Re-assert font inheritance on every common descendant.
 * Many host themes set `h1-h6, p, a, button` to a specific family via
 * cascade — without these resets, those rules still win inside .tr-root. */
.tr-root h1, .tr-root h2, .tr-root h3, .tr-root h4, .tr-root h5, .tr-root h6,
.tr-root p, .tr-root span, .tr-root a, .tr-root button, .tr-root input,
.tr-root select, .tr-root textarea, .tr-root label, .tr-root li, .tr-root th, .tr-root td {
	font-family: inherit;
	color: inherit;
}

.tr-root h1, .tr-root h2, .tr-root h3 {
	font-family: var(--tr-font-family-heading);
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.01em;
}
.tr-root h4, .tr-root h5, .tr-root h6 {
	font-family: var(--tr-font-family-heading);
	font-weight: 600;
	line-height: 1.35;
}

.tr-root a {
	color: var(--tr-color-link);
	text-decoration: none;
}
.tr-root a:hover,
.tr-root a:focus-visible {
	text-decoration: underline;
}

/* Buttons inside .tr-root — strip host-theme button background gradients
 * etc. Per-shortcode CSS opts back in via its own .tcv-* / .tb-* / .tcs-*
 * selectors. */
.tr-root button:not([class*="elementor"]):not([class*="wp-"]) {
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
}

/* Box-sizing — host themes sometimes set `*{box-sizing:content-box}` on
 * legacy templates. Force border-box inside our scope. */
.tr-root,
.tr-root *,
.tr-root *::before,
.tr-root *::after {
	box-sizing: border-box;
}
