/*
 * TRIGUN.LIVE — design system
 * Tokens → base → layout → components → templates → utilities.
 * Light and dark themes share one token set; html[data-theme] selects the palette.
 */

@font-face {
	font-family: "Inter";
	font-style: normal;
	font-weight: 400 800;
	font-display: swap;
	src: url("../fonts/inter-latin-var.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */
:root {
	--tr-font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--tr-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

	--tr-bg: #ffffff;
	--tr-bg-alt: #f6f7fb;
	--tr-surface: #ffffff;
	--tr-surface-2: #f1f3f8;
	--tr-ink: #0b1220;
	--tr-ink-2: #2f3a4d;
	--tr-muted: #5f6b7e;
	--tr-line: #e3e7ef;
	--tr-line-strong: #cfd6e3;
	--tr-brand: #4f46e5;
	--tr-brand-ink: #4338ca;
	--tr-brand-soft: #eef0ff;
	--tr-accent: #0891b2;
	--tr-on-brand: #ffffff;
	--tr-success: #047857;
	--tr-danger: #b42318;
	--tr-code-bg: #0f172a;
	--tr-code-ink: #e2e8f0;
	--tr-shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
	--tr-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px -8px rgba(16, 24, 40, .12);
	--tr-shadow-lg: 0 24px 48px -16px rgba(16, 24, 40, .22);
	--tr-header-bg: rgba(255, 255, 255, .82);
	--tr-gradient: linear-gradient(100deg, #4f46e5 0%, #7c3aed 50%, #0891b2 100%);

	--tr-radius-sm: 8px;
	--tr-radius: 14px;
	--tr-radius-lg: 20px;
	--tr-container: 1200px;
	--tr-narrow: 760px;
	--tr-gutter: clamp(16px, 4vw, 32px);
	--tr-header-h: 64px;
	--tr-ease: cubic-bezier(.2, .7, .2, 1);

	color-scheme: light;
}

html[data-theme="dark"] {
	--tr-bg: #0a0d14;
	--tr-bg-alt: #0f131c;
	--tr-surface: #121723;
	--tr-surface-2: #182032;
	--tr-ink: #eef1f7;
	--tr-ink-2: #c5ccd9;
	--tr-muted: #8f99ad;
	--tr-line: #222a3a;
	--tr-line-strong: #2f3a4f;
	--tr-brand: #8b93ff;
	--tr-brand-ink: #a5abff;
	--tr-brand-soft: rgba(139, 147, 255, .12);
	--tr-accent: #22d3ee;
	--tr-on-brand: #0a0d14;
	--tr-success: #34d399;
	--tr-danger: #f97066;
	--tr-code-bg: #0b1020;
	--tr-shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
	--tr-shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 30px -10px rgba(0, 0, 0, .6);
	--tr-shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, .75);
	--tr-header-bg: rgba(10, 13, 20, .78);
	--tr-gradient: linear-gradient(100deg, #8b93ff 0%, #c084fc 50%, #22d3ee 100%);
	color-scheme: dark;
}

/* ---------- Base (scoped so Astra/plugin markup is not affected) ---------- */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--tr-header-h) + 16px); }
body {
	margin: 0;
	background: var(--tr-bg) !important;
	color: var(--tr-ink);
	font-family: var(--tr-font);
	font-size: 16px;
	line-height: 1.6;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: clip;
}

/* Astra renders its own header/footer around our templates; the Trigun header/footer replace them. */
#masthead, .site-header, #colophon, .site-footer, .ast-scroll-to-top-right, #ast-scroll-top { display: none !important; }
#page.site, #content.site-content { background: transparent; }
#content.site-content > .ast-container { display: block; max-width: none; width: 100%; padding: 0; margin: 0; }
.ast-separate-container #content, .ast-plain-container #content { padding: 0; }

.tr-site, .tr-site *, .tr-site *::before, .tr-site *::after { box-sizing: border-box; }
.tr-site { font-family: var(--tr-font); color: var(--tr-ink); background: var(--tr-bg); min-height: 100vh; display: flex; flex-direction: column; }
.tr-site img, .tr-site svg, .tr-site video { max-width: 100%; height: auto; display: block; }
.tr-site h1, .tr-site h2, .tr-site h3, .tr-site h4, .tr-site h5, .tr-site h6 { font-family: var(--tr-font); color: var(--tr-ink); margin: 0; line-height: 1.2; letter-spacing: -.02em; font-weight: 700; }
.tr-site p { margin: 0; }
.tr-site a { color: inherit; text-decoration: none; }
.tr-site ul, .tr-site ol { margin: 0; padding: 0; }
.tr-site ul[role="list"], .tr-site .tr-nav ul, .tr-site .tr-footer ul, .tr-site .tr-breadcrumbs ol, .tr-site .tr-drawer-nav { list-style: none; }
.tr-site button { font: inherit; color: inherit; }
.tr-site :focus-visible { outline: 2px solid var(--tr-brand); outline-offset: 3px; border-radius: 6px; }
.tr-main { flex: 1 0 auto; outline: none; }
.tr-icon { flex: none; display: inline-block; }

.screen-reader-text { border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute !important; width: 1px; word-wrap: normal !important; }
.tr-skip { position: absolute; left: 12px; top: -60px; z-index: 1000; background: var(--tr-brand); color: var(--tr-on-brand) !important; padding: 10px 16px; border-radius: 10px; font-weight: 600; transition: top .2s; }
.tr-skip:focus { top: 12px; }
.tr-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Layout ---------- */
.tr-container { width: 100%; max-width: calc(var(--tr-container) + var(--tr-gutter) * 2); margin-inline: auto; padding-inline: var(--tr-gutter); }
.tr-container--narrow { max-width: calc(var(--tr-narrow) + var(--tr-gutter) * 2); }
.tr-section { padding-block: clamp(48px, 7vw, 88px); }
.tr-section--alt { background: var(--tr-bg-alt); border-block: 1px solid var(--tr-line); }
.tr-center { text-align: center; }
.tr-center .tr-btn { margin-top: 24px; }
.tr-split { display: grid; gap: clamp(32px, 5vw, 64px); align-items: center; }
.tr-split--top { align-items: start; }
@media (min-width: 900px) { .tr-split { grid-template-columns: 1.1fr .9fr; } }
.tr-stack { display: grid; gap: 16px; align-content: start; }

/* ---------- Typography helpers ---------- */
.tr-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--tr-brand); margin-bottom: 10px !important; }
.tr-gradient-text { background: var(--tr-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tr-muted { color: var(--tr-muted); }
.tr-body-lg { font-size: clamp(17px, 1.6vw, 19px); line-height: 1.7; color: var(--tr-ink-2); margin: 16px 0 20px !important; }
.tr-section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: clamp(24px, 3vw, 36px); }
.tr-section-title { font-size: clamp(24px, 3vw, 34px); }
.tr-link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 15px; color: var(--tr-brand) !important; white-space: nowrap; }
.tr-link-arrow .tr-icon { transition: transform .2s var(--tr-ease); }
.tr-link-arrow:hover .tr-icon { transform: translateX(3px); }

/* ---------- Buttons, inputs, chips ---------- */
.tr-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 12px; border: 1px solid transparent; font-weight: 600; font-size: 15px; line-height: 1; cursor: pointer; transition: transform .15s var(--tr-ease), box-shadow .2s, background-color .2s, border-color .2s, color .2s; text-decoration: none !important; white-space: nowrap; }
.tr-btn--primary { background: var(--tr-brand); color: var(--tr-on-brand) !important; box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--tr-brand) 70%, transparent); }
.tr-btn--primary:hover { background: var(--tr-brand-ink); transform: translateY(-1px); }
.tr-btn--ghost { background: var(--tr-surface); color: var(--tr-ink) !important; border-color: var(--tr-line-strong); }
.tr-btn--ghost:hover { border-color: var(--tr-brand); color: var(--tr-brand) !important; }
.tr-btn--sm { min-height: 38px; padding: 0 16px; font-size: 14px; border-radius: 10px; }
.tr-btn--block { width: 100%; }
.tr-btn:disabled { opacity: .6; cursor: progress; transform: none; }

.tr-input { width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--tr-line-strong); background: var(--tr-surface); color: var(--tr-ink); font: inherit; font-size: 16px; transition: border-color .2s, box-shadow .2s; appearance: none; -webkit-appearance: none; }
.tr-input::placeholder { color: var(--tr-muted); opacity: .85; }
.tr-input:focus { outline: none; border-color: var(--tr-brand); box-shadow: 0 0 0 4px var(--tr-brand-soft); }
textarea.tr-input { resize: vertical; min-height: 150px; line-height: 1.55; }
.tr-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238f99ad' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }

.tr-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--tr-surface-2); border: 1px solid var(--tr-line); color: var(--tr-ink-2) !important; font-size: 12.5px; font-weight: 600; line-height: 1.3; transition: border-color .2s, color .2s, background-color .2s; }
.tr-chip:hover { border-color: var(--tr-brand); color: var(--tr-brand) !important; }
.tr-chip.is-active, .tr-chip--accent { background: var(--tr-brand-soft); border-color: transparent; color: var(--tr-brand) !important; }
.tr-chip.is-active { background: var(--tr-brand); color: var(--tr-on-brand) !important; }
.tr-chip-count { font-size: 12px; font-weight: 600; color: inherit; opacity: .7; }
.tr-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tr-chip-row--center { justify-content: center; }
.tr-kbd { font-family: var(--tr-mono); font-size: 11px; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--tr-line-strong); color: var(--tr-muted); line-height: 1.4; }

.tr-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; color: var(--tr-muted); }
.tr-meta-dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; }

/* ---------- Header ---------- */
.tr-header { position: sticky; top: 0; z-index: 100; background: var(--tr-header-bg); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--tr-line); }
.admin-bar .tr-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .tr-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .tr-header { top: 0; } }
.tr-header-inner { display: flex; align-items: center; gap: 24px; height: var(--tr-header-h); }
.tr-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--tr-ink) !important; flex: none; }
.tr-brand-mark { width: 32px; height: 32px; border-radius: 9px; }
.tr-brand-word { font-weight: 800; font-size: 18px; letter-spacing: -.01em; }
.tr-brand-tld { color: var(--tr-brand); }
.tr-nav { flex: 1; min-width: 0; display: none; }
.tr-nav ul { display: flex; align-items: center; gap: 2px; }
.tr-nav a { display: block; padding: 8px 12px; border-radius: 10px; font-size: 14.5px; font-weight: 550; color: var(--tr-ink-2) !important; white-space: nowrap; transition: color .2s, background-color .2s; }
.tr-nav a:hover { color: var(--tr-ink) !important; background: var(--tr-surface-2); }
.tr-nav a.is-active { color: var(--tr-brand) !important; background: var(--tr-brand-soft); }
.tr-header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.tr-icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 40px; height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--tr-line); background: var(--tr-surface); color: var(--tr-ink-2) !important; cursor: pointer; transition: border-color .2s, color .2s, background-color .2s; }
.tr-icon-btn:hover { border-color: var(--tr-line-strong); color: var(--tr-ink) !important; background: var(--tr-surface-2); }
.tr-search-trigger { min-width: 40px; }
.tr-search-trigger-label, .tr-search-trigger .tr-kbd { display: none; }
.tr-theme-icon { display: inline-flex; }
html[data-theme="dark"] .tr-theme-icon--moon, html:not([data-theme="dark"]) .tr-theme-icon--sun { display: none; }
.tr-header-cta { display: none; }
@media (min-width: 640px) {
	.tr-header-cta { display: inline-flex; }
	.tr-search-trigger { min-width: 180px; justify-content: flex-start; padding: 0 10px 0 12px; color: var(--tr-muted) !important; }
	.tr-search-trigger-label { display: inline; font-size: 14px; }
	.tr-search-trigger .tr-kbd { display: inline-block; margin-left: auto; }
}
@media (min-width: 1100px) {
	.tr-nav { display: block; }
	.tr-menu-btn { display: none !important; }
	.tr-search-trigger { min-width: 40px; }
	.tr-search-trigger-label, .tr-search-trigger .tr-kbd { display: none; }
}
@media (min-width: 1280px) {
	.tr-search-trigger { min-width: 170px; }
	.tr-search-trigger-label, .tr-search-trigger .tr-kbd { display: inline-block; }
}
@media (max-width: 380px) { .tr-brand-word { font-size: 16px; } .tr-header-inner { gap: 12px; } }

/* Mobile drawer */
.tr-drawer { position: fixed; inset: 0; z-index: 200; }
.tr-drawer[hidden] { display: none; }
.tr-drawer-backdrop { position: absolute; inset: 0; background: rgba(5, 8, 15, .5); animation: tr-fade .2s ease; }
.tr-drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(380px, 100%); background: var(--tr-bg); border-left: 1px solid var(--tr-line); padding: 16px 20px 24px; display: flex; flex-direction: column; gap: 18px; overflow-y: auto; overscroll-behavior: contain; animation: tr-slide .25s var(--tr-ease); }
.tr-drawer-head { display: flex; align-items: center; justify-content: space-between; }
.tr-drawer-search { position: relative; }
.tr-drawer-search .tr-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--tr-muted); }
.tr-drawer-search .tr-input { padding-left: 42px; }
.tr-drawer-label { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--tr-muted); margin: 6px 0 6px !important; }
.tr-drawer-nav a { display: flex; align-items: center; min-height: 48px; padding: 0 12px; border-radius: 12px; font-size: 17px; font-weight: 600; color: var(--tr-ink) !important; }
.tr-drawer-nav a:hover, .tr-drawer-nav a.is-active { background: var(--tr-brand-soft); color: var(--tr-brand) !important; }
.tr-drawer-nav--sub a { font-size: 15.5px; font-weight: 500; min-height: 44px; color: var(--tr-ink-2) !important; }
.tr-drawer-panel > .tr-btn { margin-top: auto; }
body.tr-lock { overflow: hidden; }

/* Search dialog */
.tr-search-dialog { width: min(680px, calc(100% - 24px)); max-height: min(78vh, 680px); margin: 10vh auto auto; padding: 0; border: 1px solid var(--tr-line); border-radius: var(--tr-radius-lg); background: var(--tr-bg); color: var(--tr-ink); box-shadow: var(--tr-shadow-lg); overflow: hidden; font-family: var(--tr-font); }
.tr-search-dialog[open] { display: flex; flex-direction: column; animation: tr-pop .18s var(--tr-ease); }
.tr-search-dialog::backdrop { background: rgba(5, 8, 15, .55); backdrop-filter: blur(4px); }
.tr-search-form { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--tr-line); color: var(--tr-muted); }
.tr-search-form input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--tr-ink); font: inherit; font-size: 18px; height: 44px; outline: none; }
.tr-search-form input::-webkit-search-cancel-button { display: none; }
.tr-search-results { padding: 14px 18px 18px; overflow-y: auto; }
.tr-search-hint { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--tr-muted); margin-bottom: 10px !important; }
.tr-search-list { list-style: none; display: grid; gap: 4px; }
.tr-search-item { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: 12px; color: var(--tr-ink) !important; }
.tr-search-item:hover, .tr-search-item.is-selected { background: var(--tr-surface-2); }
.tr-search-thumb { width: 56px; height: 40px; border-radius: 8px; overflow: hidden; background: var(--tr-surface-2); flex: none; }
.tr-search-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tr-search-item-title { font-weight: 600; font-size: 15px; line-height: 1.35; }
.tr-search-item-meta { font-size: 12.5px; color: var(--tr-muted); margin-top: 2px; }
.tr-search-item mark { background: var(--tr-brand-soft); color: var(--tr-brand); border-radius: 3px; padding: 0 2px; }
.tr-search-all { display: inline-flex; margin-top: 12px; font-weight: 600; color: var(--tr-brand) !important; }
.tr-search-empty { color: var(--tr-muted); padding: 8px 0 12px; }

/* ---------- Cards ---------- */
.tr-grid { display: grid; gap: clamp(20px, 2.5vw, 28px); grid-template-columns: 1fr; }
@media (min-width: 640px) { .tr-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .tr-grid { grid-template-columns: repeat(3, 1fr); } }
.tr-grid--archive { margin-block: 8px clamp(40px, 6vw, 64px); }

.tr-card { position: relative; display: flex; flex-direction: column; background: var(--tr-surface); border: 1px solid var(--tr-line); border-radius: var(--tr-radius); overflow: hidden; transition: transform .25s var(--tr-ease), box-shadow .25s var(--tr-ease), border-color .25s; }
.tr-card:hover { transform: translateY(-3px); box-shadow: var(--tr-shadow); border-color: var(--tr-line-strong); }
.tr-card-media { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--tr-surface-2); }
.tr-card-media img { width: 100%; height: 100% !important; object-fit: cover; transition: transform .5s var(--tr-ease); }
.tr-card:hover .tr-card-media img { transform: scale(1.035); }
.tr-card-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--tr-muted); background: linear-gradient(135deg, var(--tr-surface-2), var(--tr-brand-soft)); }
.tr-card-body { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 18px 20px 20px; flex: 1; }
.tr-card-title { font-size: 18.5px; line-height: 1.32; letter-spacing: -.015em; }
.tr-card-title a { color: var(--tr-ink) !important; background-image: linear-gradient(currentColor, currentColor); background-size: 0 1.5px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size .3s var(--tr-ease); }
.tr-card:hover .tr-card-title a, .tr-card-title a:focus-visible { background-size: 100% 1.5px; }
.tr-card-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.tr-card .tr-chip { position: relative; z-index: 2; }
.tr-card-excerpt { color: var(--tr-muted); font-size: 15px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tr-card .tr-meta { margin-top: auto; padding-top: 4px; }

.tr-card--lead { border-radius: var(--tr-radius-lg); box-shadow: var(--tr-shadow); }
.tr-card--lead .tr-card-body { padding: 22px 24px 24px; gap: 12px; }
.tr-card--lead .tr-card-title { font-size: clamp(21px, 2.3vw, 27px); line-height: 1.25; }
.tr-card--lead .tr-card-excerpt { -webkit-line-clamp: 3; font-size: 15.5px; }

.tr-card--row { flex-direction: row; align-items: stretch; }
.tr-card--row .tr-card-media { width: 132px; flex: none; aspect-ratio: auto; }
.tr-card--row .tr-card-body { padding: 14px 16px; gap: 8px; }
.tr-card--row .tr-card-title { font-size: 16px; }
.tr-row-list { display: grid; gap: 16px; }
@media (min-width: 900px) { .tr-row-list { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 400px) { .tr-card--row .tr-card-media { width: 96px; } }
.tr-card--page .tr-card-body { padding: 20px; }

/* ---------- Home ---------- */
.tr-hero { position: relative; padding-block: clamp(40px, 7vw, 88px) clamp(48px, 7vw, 88px); overflow: hidden; }
.tr-hero::before { content: ""; position: absolute; inset: -40% -10% auto; height: 720px; background: radial-gradient(closest-side, color-mix(in srgb, var(--tr-brand) 18%, transparent), transparent 70%), radial-gradient(closest-side at 80% 30%, color-mix(in srgb, var(--tr-accent) 14%, transparent), transparent 70%); pointer-events: none; z-index: 0; }
.tr-hero-grid { position: relative; z-index: 1; display: grid; gap: clamp(36px, 5vw, 64px); align-items: center; }
@media (min-width: 1024px) { .tr-hero-grid { grid-template-columns: 1fr 1fr; } }
.tr-hero-title { font-size: clamp(36px, 6vw, 64px) !important; line-height: 1.04 !important; letter-spacing: -.035em !important; font-weight: 800 !important; }
.tr-hero-lede { margin-top: 20px !important; font-size: clamp(17px, 1.7vw, 19.5px); line-height: 1.65; color: var(--tr-ink-2); max-width: 560px; }
.tr-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.tr-hero-actions--center { justify-content: center; }
.tr-hero-stats { display: flex; flex-wrap: wrap; gap: 12px 36px; margin: 36px 0 0; padding-top: 24px; border-top: 1px solid var(--tr-line); }
.tr-hero-stats div { display: flex; flex-direction: column-reverse; }
.tr-hero-stats dt { font-size: 13px; color: var(--tr-muted); }
.tr-hero-stats dd { margin: 0; font-size: 26px; font-weight: 750; letter-spacing: -.02em; }
.tr-feature-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--tr-muted); margin-bottom: 14px !important; }
.tr-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tr-success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--tr-success) 22%, transparent); }

.tr-topic-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .tr-topic-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .tr-topic-grid { grid-template-columns: repeat(3, 1fr); } }
.tr-topic { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: var(--tr-radius); background: var(--tr-surface); border: 1px solid var(--tr-line); transition: border-color .2s, box-shadow .25s, transform .25s var(--tr-ease); height: 100%; }
.tr-topic:hover { border-color: var(--tr-brand); box-shadow: var(--tr-shadow); transform: translateY(-2px); }
.tr-topic-media { width: 76px; height: 60px; border-radius: 10px; overflow: hidden; background: var(--tr-surface-2); flex: none; }
.tr-topic-media img { width: 100%; height: 100% !important; object-fit: cover; }
.tr-topic-grid--plain .tr-topic { padding: 18px 20px; }
.tr-topic-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.tr-topic-name { font-weight: 700; font-size: 16.5px; color: var(--tr-ink); }
.tr-topic-count { font-size: 13.5px; color: var(--tr-muted); }
.tr-topic-arrow { color: var(--tr-muted); transition: transform .2s var(--tr-ease), color .2s; }
.tr-topic:hover .tr-topic-arrow { color: var(--tr-brand); transform: translateX(3px); }

/* ---------- Page heroes, breadcrumbs, archive ---------- */
.tr-page-hero { padding-block: clamp(28px, 4vw, 44px) clamp(28px, 4vw, 40px); background: linear-gradient(180deg, var(--tr-bg-alt), var(--tr-bg)); border-bottom: 1px solid var(--tr-line); margin-bottom: clamp(24px, 3vw, 36px); }
.tr-page-hero--feature { padding-bottom: clamp(40px, 6vw, 72px); }
.tr-page-title { font-size: clamp(30px, 4.5vw, 48px) !important; line-height: 1.1 !important; letter-spacing: -.03em !important; font-weight: 800 !important; max-width: 920px; }
.tr-page-title--xl { font-size: clamp(36px, 5.5vw, 60px) !important; }
.tr-page-lede { margin-top: 14px !important; max-width: 720px; font-size: clamp(16.5px, 1.6vw, 18.5px); line-height: 1.65; color: var(--tr-ink-2); }
.tr-page-lede p { margin: 0; }
.tr-page-count { margin-top: 14px !important; font-size: 14px; color: var(--tr-muted); }

.tr-breadcrumbs { margin-bottom: 18px; font-size: 13.5px; color: var(--tr-muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tr-breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tr-breadcrumbs li { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.tr-breadcrumbs li + li::before { content: "/"; opacity: .5; }
.tr-breadcrumbs a { color: var(--tr-muted) !important; }
.tr-breadcrumbs a:hover { color: var(--tr-brand) !important; }
.tr-breadcrumbs [aria-current] span, .tr-breadcrumbs .tr-bc-current { color: var(--tr-ink-2); max-width: 42ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-breadcrumbs .tr-bc-sep { opacity: .5; }

.tr-filter { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 14px; margin-bottom: 8px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.tr-filter .tr-chip { flex: none; padding: 8px 14px; font-size: 14px; }

.tr-pagination { margin: 0 0 clamp(48px, 7vw, 80px); }
.tr-pagination ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; list-style: none; }
.tr-pagination .page-numbers { display: inline-flex; align-items: center; gap: 6px; min-width: 44px; height: 44px; padding: 0 14px; justify-content: center; border-radius: 12px; border: 1px solid var(--tr-line); background: var(--tr-surface); font-weight: 600; font-size: 14.5px; color: var(--tr-ink-2) !important; }
.tr-pagination a.page-numbers:hover { border-color: var(--tr-brand); color: var(--tr-brand) !important; }
.tr-pagination .page-numbers.current { background: var(--tr-brand); border-color: var(--tr-brand); color: var(--tr-on-brand) !important; }
.tr-pagination .page-numbers.dots { border: 0; background: none; }

.tr-empty { text-align: center; max-width: 560px; margin: 24px auto clamp(56px, 8vw, 96px); padding: clamp(32px, 5vw, 48px) 24px; border: 1px dashed var(--tr-line-strong); border-radius: var(--tr-radius-lg); background: var(--tr-bg-alt); }
.tr-empty-icon { display: inline-grid; place-items: center; width: 60px; height: 60px; border-radius: 16px; background: var(--tr-brand-soft); color: var(--tr-brand); margin-bottom: 16px; }
.tr-empty h2 { font-size: 22px; margin-bottom: 8px; }
.tr-empty p { color: var(--tr-muted); margin-bottom: 20px !important; }

.tr-search-inline { position: relative; display: flex; gap: 10px; max-width: 620px; margin-top: 22px; }
.tr-search-inline > .tr-icon { position: absolute; left: 15px; top: 15px; color: var(--tr-muted); pointer-events: none; }
.tr-search-inline .tr-input { padding-left: 44px; }
.tr-error { padding-block: clamp(48px, 8vw, 96px); text-align: center; }
.tr-error .tr-page-title, .tr-error .tr-page-lede { margin-inline: auto; }
.tr-error .tr-search-inline { margin-inline: auto; }
.tr-error-code { font-size: clamp(72px, 14vw, 140px); font-weight: 800; line-height: 1; letter-spacing: -.06em; background: var(--tr-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 8px !important; }

/* ---------- Article ---------- */
.tr-article-head { padding-block: clamp(24px, 4vw, 44px) clamp(20px, 3vw, 32px); }
.tr-article-head .tr-chip { margin-bottom: 16px; }
.tr-article-title { font-size: clamp(30px, 4.6vw, 50px) !important; line-height: 1.12 !important; letter-spacing: -.03em !important; font-weight: 800 !important; }
.tr-article-deck { margin-top: 16px !important; font-size: clamp(17.5px, 1.8vw, 20px); line-height: 1.6; color: var(--tr-ink-2); }
.tr-byline { display: flex; align-items: center; gap: 12px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--tr-line); }
.tr-byline-avatar, .tr-byline img { width: 44px; height: 44px; border-radius: 50%; flex: none; }
.tr-byline-text { display: flex; flex-direction: column; gap: 2px; }
.tr-byline-name a { font-weight: 650; color: var(--tr-ink) !important; text-transform: capitalize; }
.tr-article-figure { margin: 0 auto clamp(28px, 4vw, 44px); max-width: calc(1120px + var(--tr-gutter) * 2); }
.tr-article-figure img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--tr-radius-lg); border: 1px solid var(--tr-line); }
.tr-article-figure figcaption { margin-top: 10px; font-size: 13.5px; color: var(--tr-muted); text-align: center; }

.tr-article-layout { display: grid; gap: 48px; padding-bottom: clamp(48px, 7vw, 80px); }
.tr-article-main { min-width: 0; max-width: var(--tr-narrow); width: 100%; margin-inline: auto; }
.tr-article-aside { display: none; }
@media (min-width: 1100px) {
	.tr-article-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 64px; max-width: calc(1120px + var(--tr-gutter) * 2); }
	.tr-article-main { margin-inline: 0; }
	.tr-article-aside { display: block; }
	.tr-toc--inline { display: none !important; }
}
.tr-aside-sticky { position: sticky; top: calc(var(--tr-header-h) + 24px); display: grid; gap: 20px; }
.tr-aside-title { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--tr-muted); margin-bottom: 10px !important; }
.tr-aside-card { padding: 20px; border: 1px solid var(--tr-line); border-radius: var(--tr-radius); background: var(--tr-bg-alt); }
.tr-aside-card .tr-aside-title { color: var(--tr-ink); text-transform: none; letter-spacing: -.01em; font-size: 16px; margin-bottom: 4px !important; }
.tr-aside-text { font-size: 14px; color: var(--tr-muted); margin-bottom: 14px !important; }
.tr-aside-card .tr-nl-form { flex-direction: column; }

.tr-toc ol { list-style: none; display: grid; gap: 2px; counter-reset: toc; }
.tr-toc a { display: block; padding: 6px 10px; border-left: 2px solid var(--tr-line); font-size: 14px; line-height: 1.4; color: var(--tr-muted) !important; transition: color .2s, border-color .2s; }
.tr-toc a:hover { color: var(--tr-ink) !important; }
.tr-toc a.is-active { color: var(--tr-brand) !important; border-left-color: var(--tr-brand); font-weight: 600; }
.tr-toc .tr-toc-sub a { padding-left: 22px; font-size: 13.5px; }
.tr-toc--side ol { max-height: 52vh; overflow-y: auto; }
.tr-toc--inline { margin-bottom: 28px; border: 1px solid var(--tr-line); border-radius: var(--tr-radius); background: var(--tr-bg-alt); }
.tr-toc--inline summary { display: flex; align-items: center; gap: 8px; padding: 14px 16px; font-weight: 650; cursor: pointer; list-style: none; }
.tr-toc--inline summary::-webkit-details-marker { display: none; }
.tr-toc--inline summary::after { content: "+"; margin-left: auto; font-size: 20px; color: var(--tr-muted); }
.tr-toc--inline[open] summary::after { content: "–"; }
.tr-toc--inline ol { padding: 0 16px 16px; }

/* Prose */
.tr-prose { font-size: clamp(17px, 1.25vw, 18.5px); line-height: 1.78; color: var(--tr-ink-2); overflow-wrap: break-word; }
.tr-prose > * + * { margin-top: 1.25em; }
.tr-prose p, .tr-prose ul, .tr-prose ol, .tr-prose blockquote, .tr-prose figure, .tr-prose table, .tr-prose pre { margin-bottom: 0; }
.tr-prose h2 { font-size: clamp(24px, 2.6vw, 30px); line-height: 1.25; margin-top: 2em !important; margin-bottom: .2em; scroll-margin-top: calc(var(--tr-header-h) + 20px); }
.tr-prose h3 { font-size: clamp(19.5px, 2vw, 22px); line-height: 1.3; margin-top: 1.7em !important; scroll-margin-top: calc(var(--tr-header-h) + 20px); }
.tr-prose h4 { font-size: 18px; margin-top: 1.5em !important; }
.tr-prose strong { color: var(--tr-ink); font-weight: 650; }
.tr-prose a { color: var(--tr-brand) !important; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--tr-brand) 45%, transparent); transition: text-decoration-color .2s; }
.tr-prose a:hover { text-decoration-color: currentColor; }
.tr-prose ul, .tr-prose ol { padding-left: 1.4em; }
.tr-prose li + li { margin-top: .5em; }
.tr-prose li::marker { color: var(--tr-brand); }
.tr-prose blockquote { margin-inline: 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--tr-brand); font-size: 1.08em; color: var(--tr-ink); font-style: normal; }
.tr-prose hr { border: 0; height: 1px; background: var(--tr-line); margin-block: 2.4em; }
.tr-prose img { border-radius: var(--tr-radius); }
.tr-prose figure { margin-inline: 0; }
.tr-prose figcaption { font-size: 14px; color: var(--tr-muted); margin-top: 8px; text-align: center; }
.tr-prose code { font-family: var(--tr-mono); font-size: .86em; padding: .15em .4em; border-radius: 6px; background: var(--tr-surface-2); color: var(--tr-ink); border: 1px solid var(--tr-line); }
.tr-prose pre { background: var(--tr-code-bg); color: var(--tr-code-ink); padding: 18px 20px; border-radius: var(--tr-radius); overflow-x: auto; font-size: 14.5px; line-height: 1.65; border: 1px solid var(--tr-line); }
.tr-prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.tr-prose table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.tr-prose th, .tr-prose td { padding: 11px 14px; border-bottom: 1px solid var(--tr-line); text-align: left; vertical-align: top; min-width: 120px; }
.tr-prose thead th { background: var(--tr-surface-2); color: var(--tr-ink); font-weight: 650; border-bottom-color: var(--tr-line-strong); }
.tr-prose .wp-block-table { overflow-x: auto; }
/* Structure produced by the AI Blog Automation content engine */
.tr-prose .ai-article-intro p:first-child { font-size: 1.06em; color: var(--tr-ink); }
.tr-prose .ai-article-section, .tr-prose .ai-article-subsection, .tr-prose .ai-article-conclusion, .tr-prose .ai-article-faq, .tr-prose .ai-article-references { margin-top: 1.25em; }
.tr-prose .ai-section-body > * + *, .tr-prose .ai-subsection-body > * + *, .tr-prose .ai-conclusion-body > * + * { margin-top: 1.1em; }
.tr-prose .ai-article-conclusion { padding: 4px 24px 24px; border-radius: var(--tr-radius); background: var(--tr-bg-alt); border: 1px solid var(--tr-line); }
.tr-prose .ai-article-faq .ai-faq-item { padding: 16px 0; border-bottom: 1px solid var(--tr-line); }
.tr-prose .ai-article-faq .ai-faq-item h3 { font-size: 18px; margin-top: 0 !important; margin-bottom: 6px; }
.tr-prose .ai-article-references ul { list-style: none; padding: 0; }
.tr-prose .ai-article-references a { word-break: break-word; }

.tr-article-foot { margin-top: 44px; display: grid; gap: 28px; }
.tr-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tr-share { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-block: 20px; border-block: 1px solid var(--tr-line); }
.tr-share-label { font-weight: 650; margin-right: 6px; }
.tr-copy-status { font-size: 13.5px; color: var(--tr-success); }
.tr-author-box { display: flex; gap: 16px; padding: 22px; border-radius: var(--tr-radius); background: var(--tr-bg-alt); border: 1px solid var(--tr-line); }
.tr-author-box img { border-radius: 50%; width: 64px; height: 64px; flex: none; }
.tr-author-name { font-weight: 700; margin-bottom: 4px !important; }
.tr-author-box p:last-child { color: var(--tr-muted); font-size: 15px; }
.tr-post-nav { display: grid; gap: 14px; }
@media (min-width: 640px) { .tr-post-nav { grid-template-columns: 1fr 1fr; } }
.tr-post-nav-link { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border: 1px solid var(--tr-line); border-radius: var(--tr-radius); background: var(--tr-surface); transition: border-color .2s, box-shadow .25s; }
.tr-post-nav-link:hover { border-color: var(--tr-brand); box-shadow: var(--tr-shadow); }
.tr-post-nav-link--next { text-align: right; align-items: flex-end; }
@media (min-width: 640px) { .tr-post-nav-link--next:only-child { grid-column: 2; } }
.tr-post-nav-dir { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--tr-muted); }
.tr-post-nav-title { font-weight: 650; line-height: 1.4; color: var(--tr-ink); }

/* ---------- Panels, features, forms (About, Contact, Sitemap) ---------- */
.tr-panel { padding: clamp(20px, 3vw, 28px); border: 1px solid var(--tr-line); border-radius: var(--tr-radius-lg); background: var(--tr-surface); box-shadow: var(--tr-shadow-sm); }
.tr-panel p { color: var(--tr-ink-2); line-height: 1.65; }
.tr-panel--accent { background: linear-gradient(160deg, var(--tr-brand-soft), var(--tr-surface) 70%); border-color: color-mix(in srgb, var(--tr-brand) 30%, var(--tr-line)); }
.tr-panel-title { display: flex; align-items: center; gap: 10px; font-size: 18px; margin: 12px 0 8px !important; }
.tr-panel-title--lg { font-size: clamp(20px, 2.2vw, 24px); margin-top: 0 !important; }
.tr-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.tr-panel-head .tr-panel-title { margin: 0 !important; }
.tr-card-grid { display: grid; gap: 18px; }
@media (min-width: 640px) { .tr-card-grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .tr-card-grid--4 { grid-template-columns: repeat(4, 1fr); } }
.tr-feature-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--tr-brand-soft); color: var(--tr-brand); flex: none; }
.tr-feature-list { display: grid; gap: 14px; }
.tr-feature-list--grid { gap: 16px; }
@media (min-width: 640px) { .tr-feature-list--grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .tr-feature-list--grid { grid-template-columns: repeat(4, 1fr); } }
.tr-feature { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1px solid var(--tr-line); border-radius: var(--tr-radius); background: var(--tr-surface); }
.tr-feature > span:last-child { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tr-feature-title { font-weight: 650; color: var(--tr-ink); }
.tr-feature-text { font-size: 14.5px; color: var(--tr-muted); line-height: 1.55; }
.tr-feature a { color: var(--tr-brand) !important; font-weight: 600; font-size: 14.5px; word-break: break-all; }
.tr-panel .tr-feature { padding: 12px 0; border: 0; border-bottom: 1px solid var(--tr-line); border-radius: 0; background: none; }
.tr-panel .tr-feature:last-child { border-bottom: 0; padding-bottom: 0; }

.tr-contact-grid { display: grid; gap: 24px; padding-bottom: 8px; }
@media (min-width: 1024px) { .tr-contact-grid { grid-template-columns: 1.4fr 1fr; align-items: start; } }
.tr-form { display: grid; gap: 18px; margin-top: 22px; }
.tr-form-row { display: grid; gap: 18px; }
@media (min-width: 640px) { .tr-form-row { grid-template-columns: 1fr 1fr; } }
.tr-field { display: grid; gap: 7px; }
.tr-field label { font-size: 14px; font-weight: 600; color: var(--tr-ink); }
.tr-req { color: var(--tr-danger); }
.tr-field-hint { font-size: 13px; color: var(--tr-muted); }
.tr-field .tr-field-hint { justify-self: end; }
.tr-field-hint a { color: var(--tr-brand) !important; text-decoration: underline; }
.tr-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.tr-form-feedback { padding: 14px 16px; border-radius: 12px; font-size: 14.5px; border: 1px solid var(--tr-line); }
.tr-feedback-success { background: color-mix(in srgb, var(--tr-success) 12%, transparent); border-color: color-mix(in srgb, var(--tr-success) 40%, transparent); color: var(--tr-ink); }
.tr-feedback-error { background: color-mix(in srgb, var(--tr-danger) 10%, transparent); border-color: color-mix(in srgb, var(--tr-danger) 40%, transparent); color: var(--tr-ink); }
.tr-spin { animation: tr-spin 1s linear infinite; }

.tr-sitemap { display: grid; gap: 20px; padding-bottom: clamp(48px, 7vw, 80px); }
.tr-link-grid { display: grid; gap: 10px; margin-top: 16px; }
@media (min-width: 640px) { .tr-link-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .tr-link-grid { grid-template-columns: repeat(3, 1fr); } }
.tr-link-grid a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--tr-line); background: var(--tr-bg-alt); font-weight: 600; transition: border-color .2s, color .2s; }
.tr-link-grid a:hover { border-color: var(--tr-brand); color: var(--tr-brand) !important; }
.tr-link-grid code { font-family: var(--tr-mono); font-size: 12.5px; color: var(--tr-muted); font-weight: 400; }
.tr-sitemap-list li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--tr-line); }
.tr-sitemap-list li:last-child { border-bottom: 0; }
.tr-sitemap-list a { font-weight: 600; color: var(--tr-ink) !important; }
.tr-sitemap-list a:hover { color: var(--tr-brand) !important; }
.tr-sitemap-list time { flex: none; font-size: 13.5px; color: var(--tr-muted); }
@media (max-width: 480px) { .tr-sitemap-list li { flex-direction: column; gap: 2px; } }

/* Legal / document pages (legacy templates keep their markup and exact text) */
.tr-doc-page-wrap { padding-block: clamp(24px, 4vw, 44px) clamp(48px, 7vw, 80px); }
.tr-doc-page-wrap > .tr-container { max-width: calc(var(--tr-narrow) + var(--tr-gutter) * 2); }
.tr-doc-article { background: none; }
.tr-doc-header { padding-bottom: 24px; margin-bottom: 8px; border-bottom: 1px solid var(--tr-line); }
.tr-doc-title { font-size: clamp(30px, 4.5vw, 46px) !important; line-height: 1.1 !important; letter-spacing: -.03em !important; font-weight: 800 !important; }
.tr-doc-body { font-size: 17.5px; line-height: 1.78; color: var(--tr-ink-2); }
.tr-doc-body > * + * { margin-top: 1.1em !important; }
.tr-doc-body h2 { font-size: clamp(21px, 2.3vw, 25px); margin-top: 1.9em !important; color: var(--tr-ink); }
.tr-doc-body h3 { font-size: 19px; margin-top: 1.5em !important; }
.tr-doc-body ul, .tr-doc-body ol { padding-left: 1.4em; }
.tr-doc-body li + li { margin-top: .45em; }
.tr-doc-body a { color: var(--tr-brand) !important; text-decoration: underline; text-underline-offset: 3px; }
.tr-doc-body strong { color: var(--tr-ink); }
.tr-doc-divider { display: none; }
.tr-page-hero--doc { margin-bottom: 8px; }

/* ---------- Newsletter & footer ---------- */
.tr-newsletter { padding-block: clamp(48px, 7vw, 80px); }
.tr-newsletter-card { position: relative; overflow: hidden; display: grid; gap: 24px; align-items: center; padding: clamp(28px, 5vw, 52px); border-radius: var(--tr-radius-lg); background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--tr-brand) 22%, transparent), transparent 60%), radial-gradient(100% 120% at 100% 100%, color-mix(in srgb, var(--tr-accent) 16%, transparent), transparent 55%), var(--tr-surface); border: 1px solid var(--tr-line); box-shadow: var(--tr-shadow); }
@media (min-width: 960px) { .tr-newsletter-card { grid-template-columns: 1.2fr 1fr; gap: 48px; } }
.tr-newsletter-title { font-size: clamp(24px, 3vw, 32px) !important; line-height: 1.2 !important; }
.tr-newsletter-sub { margin-top: 10px !important; color: var(--tr-ink-2); }
.tr-nl-form { display: flex; gap: 10px; flex-wrap: wrap; }
.tr-nl-form .tr-input { flex: 1 1 220px; }
.tr-nl-form .tr-btn { flex: 0 0 auto; }
@media (max-width: 480px) { .tr-nl-form .tr-btn { flex: 1 1 100%; } }

.tr-footer { border-top: 1px solid var(--tr-line); background: var(--tr-bg-alt); padding-top: clamp(40px, 6vw, 64px); font-size: 15px; }
.tr-footer-grid { display: grid; gap: 32px 24px; grid-template-columns: 1fr 1fr; }
.tr-footer-brand { grid-column: 1 / -1; display: grid; gap: 14px; align-content: start; }
.tr-footer-brand p { color: var(--tr-muted); max-width: 380px; line-height: 1.65; }
@media (min-width: 900px) { .tr-footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; } .tr-footer-brand { grid-column: auto; } }
.tr-footer-rss { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--tr-ink-2) !important; width: max-content; }
.tr-footer-rss:hover { color: var(--tr-brand) !important; }
.tr-footer-heading { font-size: 13px !important; letter-spacing: .1em; text-transform: uppercase; color: var(--tr-ink) !important; margin-bottom: 14px !important; }
.tr-footer-col ul { display: grid; gap: 4px; }
.tr-footer-col a { display: inline-block; padding: 5px 0; color: var(--tr-muted) !important; transition: color .2s; }
.tr-footer-col a:hover { color: var(--tr-brand) !important; }
.tr-footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 40px; padding-block: 22px; border-top: 1px solid var(--tr-line); color: var(--tr-muted); font-size: 14px; }
.tr-back-top { background: none; border: 0; cursor: pointer; color: var(--tr-muted); font-size: 14px; padding: 8px 0; }
.tr-back-top:hover { color: var(--tr-brand); }

/* Toast from the Trigun Forms plugin */
.tr-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 300; max-width: calc(100% - 32px); padding: 14px 18px; border-radius: 12px; background: var(--tr-ink); color: var(--tr-bg); font-family: var(--tr-font); font-size: 15px; font-weight: 550; box-shadow: var(--tr-shadow-lg); opacity: 0; transition: opacity .25s, transform .25s var(--tr-ease); }
.tr-toast-show { opacity: 1; transform: translate(-50%, 0); }
.tr-toast-error { background: var(--tr-danger); color: #fff; }

/* ---------- Motion ---------- */
@keyframes tr-fade { from { opacity: 0; } }
@keyframes tr-slide { from { transform: translateX(100%); } }
@keyframes tr-pop { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
@keyframes tr-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
	.tr-site *, .tr-site *::before, .tr-site *::after, .tr-drawer *, .tr-search-dialog { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Print ---------- */
@media print {
	.tr-header, .tr-drawer, .tr-search-dialog, .tr-newsletter, .tr-footer, .tr-article-aside, .tr-share, .tr-post-nav, .tr-section--alt { display: none !important; }
	.tr-prose { color: #000; }
}

/* ---------- Astra compatibility overrides ---------- */
/* Astra styles .ast-article-single, form fields and tables globally; the design system owns these inside .tr-site. */
.tr-site article.tr-article, .tr-site article.tr-doc, .tr-site .ast-article-single { background: transparent !important; padding: 0 !important; margin: 0 !important; border: 0 !important; box-shadow: none !important; }
.tr-site .tr-input, .tr-site input.tr-input, .tr-site select.tr-input, .tr-site textarea.tr-input { background-color: var(--tr-surface) !important; color: var(--tr-ink) !important; border: 1px solid var(--tr-line-strong) !important; border-radius: 12px !important; box-shadow: none; font-family: var(--tr-font) !important; }
.tr-site .tr-input:focus { border-color: var(--tr-brand) !important; box-shadow: 0 0 0 4px var(--tr-brand-soft) !important; }
.tr-site select.tr-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238f99ad' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important; background-repeat: no-repeat !important; background-position: right 14px center !important; }
.tr-search-dialog input, .tr-search-dialog input:focus { background: transparent !important; border: 0 !important; box-shadow: none !important; color: var(--tr-ink) !important; padding: 0 !important; }
.tr-site .tr-kbd { background: transparent !important; box-shadow: none !important; }
.tr-site .tr-btn--primary, .tr-site button.tr-btn--primary { background: var(--tr-brand) !important; color: var(--tr-on-brand) !important; border-color: transparent !important; }
.tr-site .tr-btn--primary:hover { background: var(--tr-brand-ink) !important; }
.tr-site .tr-icon-btn { box-shadow: none !important; }
.tr-aside-card .tr-nl-form .tr-input, .tr-aside-card .tr-nl-form .tr-btn { flex: none; width: 100%; }
.tr-site .tr-prose table, .tr-site .tr-prose th, .tr-site .tr-prose td { border-color: var(--tr-line) !important; background: transparent; color: var(--tr-ink-2); }
.tr-site .tr-prose thead th, .tr-site .tr-prose table th { background: var(--tr-surface-2) !important; color: var(--tr-ink) !important; }
.tr-site .tr-prose table { border: 1px solid var(--tr-line) !important; border-radius: var(--tr-radius); }

/* Prose rhythm that also works when content is wrapped in nested divs/sections. */
.tr-site .tr-prose p, .tr-site .tr-prose ul, .tr-site .tr-prose ol, .tr-site .tr-prose blockquote, .tr-site .tr-prose figure, .tr-site .tr-prose pre, .tr-site .tr-prose table, .tr-site .tr-prose .wp-block-table, .tr-site .tr-prose dl { margin: 0 0 1.25em; }
.tr-site .tr-prose > * + *, .tr-site .tr-prose div > * + * { margin-top: 0; }
.tr-site .tr-prose h2 { margin: 2em 0 .6em !important; }
.tr-site .tr-prose h3 { margin: 1.7em 0 .5em !important; }
.tr-site .tr-prose h4 { margin: 1.5em 0 .4em !important; }
.tr-site .tr-prose > :first-child, .tr-site .tr-prose > div:first-child > :first-child { margin-top: 0 !important; }
.tr-site .tr-prose li > p { margin-bottom: .4em; }
.tr-site .tr-prose .ai-article-faq .ai-faq-item p { margin-bottom: 0; }
.tr-site .tr-doc-body p, .tr-site .tr-doc-body ul, .tr-site .tr-doc-body ol { margin: 0 0 1.1em; }
.tr-site .tr-doc-body > * + * { margin-top: 0 !important; }
.tr-site .tr-doc-body h2 { margin: 1.9em 0 .55em !important; }
.tr-search-item > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.tr-search-item-title, .tr-search-item-meta { display: block; }
.tr-breadcrumbs, .tr-breadcrumbs ol { max-width: 100%; }
.tr-breadcrumbs ol { flex-wrap: nowrap; min-width: 0; }
.tr-breadcrumbs li { flex: none; }
.tr-breadcrumbs li[aria-current] { flex: 1 1 0; min-width: 0; overflow: hidden; }
.tr-breadcrumbs [aria-current] span { display: block; max-width: 100%; }
