/* TenantREADY Base KB — Front-end Styles
   All colors/fonts via CSS vars injected from options.
   Zero hardcoded brand values here. */

:root {
	--trb-primary:     #ff6a00;
	--trb-secondary:   #1a2744;
	--trb-header-font: 'Outfit', sans-serif;
	--trb-body-font:   'Source Sans 3', sans-serif;
	--trb-radius:      6px;
	--trb-shadow:      0 2px 8px rgba(0,0,0,0.08);
}

/* ── Wrap ── */
.trb-kb-wrap,
.trb-single-wrap {
	max-width: 900px;
	margin: 0 auto;
	padding: 2rem 1rem;
	font-family: var(--trb-body-font);
}

/* ── KB Header / Hero ── */
.trb-kb-header {
	background-size: cover;
	background-position: center;
	border-radius: var(--trb-radius);
	padding: 3rem 2rem;
	margin-bottom: 2rem;
	text-align: center;
	background-color: var(--trb-secondary);
}

.trb-kb-logo {
	max-height: 60px;
	margin-bottom: 1rem;
}

.trb-kb-tagline {
	color: #fff;
	font-family: var(--trb-header-font);
	font-size: 1.25rem;
	margin: 0;
}

/* ── Search ── */
.trb-search-wrap {
	position: relative;
	margin-bottom: 1.5rem;
}

.trb-search-input {
	width: 100%;
	padding: 0.85rem 1.25rem;
	font-size: 1.1rem;
	font-family: var(--trb-body-font);
	border: 2px solid #ddd;
	border-radius: var(--trb-radius);
	box-shadow: var(--trb-shadow);
	transition: border-color 0.2s;
	box-sizing: border-box;
}

.trb-search-input:focus {
	outline: none;
	border-color: var(--trb-primary);
}

.trb-search-status {
	display: block;
	font-size: 0.85rem;
	color: #666;
	margin-top: 0.4rem;
	min-height: 1.2em;
}

/* ── Search Results ── */
.trb-search-results {
	background: #fff;
	border: 1px solid #eee;
	border-radius: var(--trb-radius);
	box-shadow: var(--trb-shadow);
	margin-bottom: 2rem;
	overflow: hidden;
}

.trb-result-item {
	padding: 1rem 1.25rem;
	border-bottom: 1px solid #f0f0f0;
	transition: background 0.15s;
}

.trb-result-item:last-child { border-bottom: none; }
.trb-result-item:hover { background: #fafafa; }

.trb-result-item a {
	font-family: var(--trb-header-font);
	font-size: 1.05rem;
	color: var(--trb-secondary);
	text-decoration: none;
	font-weight: 600;
}

.trb-result-item a:hover { color: var(--trb-primary); }

.trb-result-category {
	font-size: 0.75rem;
	color: var(--trb-primary);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-bottom: 0.25rem;
}

.trb-result-excerpt {
	font-size: 0.9rem;
	color: #555;
	margin: 0.25rem 0 0;
}

.trb-no-results {
	padding: 1.5rem;
	text-align: center;
	color: #888;
}

/* ── Language Toggle ── */
.trb-lang-toggle {
	display: flex;
	gap: 0.5rem;
	margin-bottom: 1.5rem;
}

.trb-lang-btn {
	padding: 0.4rem 1rem;
	border-radius: var(--trb-radius);
	border: 2px solid var(--trb-secondary);
	color: var(--trb-secondary);
	text-decoration: none;
	font-size: 0.9rem;
	font-family: var(--trb-body-font);
	transition: all 0.2s;
}

.trb-lang-btn.active,
.trb-lang-btn:hover {
	background: var(--trb-secondary);
	color: #fff;
}

/* ── Category Grid ── */
.trb-category-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1.5rem;
}

@media (max-width: 640px) {
	.trb-category-grid { grid-template-columns: 1fr; }
}

.trb-category-block {
	background: #fff;
	border: 1px solid #eee;
	border-top: 4px solid var(--trb-primary);
	border-radius: var(--trb-radius);
	padding: 1.25rem;
	box-shadow: var(--trb-shadow);
}

.trb-cat-title {
	font-family: var(--trb-header-font);
	color: var(--trb-secondary);
	font-size: 1.05rem;
	margin: 0 0 0.75rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid #eee;
}

.trb-guide-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.trb-guide-list li {
	padding: 0.35rem 0;
	border-bottom: 1px solid #f5f5f5;
}

.trb-guide-list li:last-child { border-bottom: none; }

.trb-guide-list a {
	color: var(--trb-secondary);
	text-decoration: none;
	font-size: 0.95rem;
	transition: color 0.15s;
}

.trb-guide-list a:hover { color: var(--trb-primary); }

/* ── Single Guide Header Bar ── */
.trb-single-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1.5rem;
	background: var(--trb-secondary);
	padding: 0.75rem 1.25rem;
	border-radius: var(--trb-radius);
}

.trb-single-logo { max-height: 48px; }

.trb-lang-switch {
	font-size: 0.9rem;
	color: #ffffff;
	text-decoration: none;
	border: 2px solid rgba(255,255,255,0.6);
	background: transparent;
	padding: 0.3rem 0.75rem;
	border-radius: var(--trb-radius);
	transition: all 0.2s;
}

.trb-lang-switch:hover {
	border-color: #ffffff;
	background: rgba(255,255,255,0.1);
	color: #ffffff;
}

.trb-breadcrumb {
	font-size: 0.85rem;
	color: #888;
	margin-bottom: 1.5rem;
}

.trb-breadcrumb a {
	color: var(--trb-primary);
	text-decoration: none;
}

.trb-guide-title {
	font-family: var(--trb-header-font);
	color: var(--trb-secondary);
	font-size: 2rem;
	margin-bottom: 1.5rem;
}

.trb-guide-content {
	font-family: var(--trb-body-font);
	font-size: 1.05rem;
	line-height: 1.75;
	color: #333;
}

.trb-guide-footer {
	margin-top: 3rem;
	padding-top: 1.5rem;
	border-top: 1px solid #eee;
}

.trb-back-link {
	color: var(--trb-secondary);
	text-decoration: none;
	font-size: 0.95rem;
}

.trb-back-link:hover { color: var(--trb-primary); }

/* ═══════════════════════════════════════════════════════════════════════════
   v3.0 ADDITIONS
   ═══════════════════════════════════════════════════════════════════════════ */

/* Each shortcode gets its own outer wrapper */
.trb-search-wrap,
.trb-cards-row,
.trb-category-grid,
.trb-lang-flip {
	font-family: var(--trb-body-font);
}

/* ── Language flip button ────────────────────────────────────────────────── */
.trb-lang-flip {
	margin: 0 0 1.25rem;
}
.trb-lang-flip-btn {
	display: inline-block;
	padding: 0.4rem 1.1rem;
	border-radius: var(--trb-radius);
	border: 2px solid var(--trb-secondary);
	color: var(--trb-secondary);
	text-decoration: none;
	font-size: 0.9rem;
	transition: all 0.2s;
}
.trb-lang-flip-btn:hover {
	background: var(--trb-secondary);
	color: #fff;
}

/* ── Quick-launch cards ──────────────────────────────────────────────────── */
.trb-cards-row {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 12px;
	margin-bottom: 2rem;
}
.trb-card {
	display: flex;
	align-items: center;
	gap: 12px;
	background: var(--trb-secondary);
	border-radius: var(--trb-radius);
	padding: 14px;
	text-decoration: none;
	border-left: 4px solid var(--trb-primary);
	transition: transform 0.15s, box-shadow 0.15s;
}
.trb-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(0,0,0,0.18);
}
.trb-card__icon  { font-size: 1.6rem; flex-shrink: 0; line-height: 1; }
.trb-card__body  { flex: 1; min-width: 0; }
.trb-card__title {
	display: block;
	font-family: var(--trb-header-font);
	font-size: 0.88rem;
	font-weight: 700;
	color: #fff;
	line-height: 1.3;
	margin-bottom: 3px;
}
.trb-card__sub   { display: block; font-size: 0.76rem; color: rgba(255,255,255,0.65); line-height: 1.4; }
.trb-card__arrow { flex-shrink: 0; color: var(--trb-primary); font-size: 1rem; margin-left: auto; transition: transform 0.15s; }
.trb-card:hover .trb-card__arrow { transform: translateX(3px); }

/* ── Category grid column classes ────────────────────────────────────────── */
.trb-cols-1 { grid-template-columns: 1fr !important; }
.trb-cols-2 { grid-template-columns: repeat(2, 1fr) !important; }
.trb-cols-3 { grid-template-columns: repeat(3, 1fr) !important; }
.trb-cols-4 { grid-template-columns: repeat(4, 1fr) !important; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
	.trb-cards-row            { grid-template-columns: repeat(2, 1fr); }
	.trb-cols-3, .trb-cols-4  { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 600px) {
	.trb-cards-row                          { grid-template-columns: 1fr; }
	.trb-cols-2,.trb-cols-3,.trb-cols-4    { grid-template-columns: 1fr !important; }
}

/* ── Hero [trb_hero] ─────────────────────────────────────────────────────── */
.trb-hero {
	position: relative;
	overflow: hidden;
	min-height: 280px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 2rem;
	background-color: var(--trb-secondary); /* fallback if no image */
}
.trb-hero__overlay {
	position: absolute;
	inset: 0;
	pointer-events: none;
}
.trb-hero__content {
	position: relative;
	z-index: 1;
	text-align: center;
	padding: 3rem 2rem;
	max-width: 760px;
	width: 100%;
}
.trb-hero__title {
	font-family: var(--trb-header-font);
	font-size: clamp(1.8rem, 5vw, 3rem);
	font-weight: 800;
	color: #fff;
	margin: 0 0 0.75rem;
	line-height: 1.15;
	text-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
.trb-hero__subtitle {
	font-family: var(--trb-body-font);
	font-size: clamp(1rem, 2.5vw, 1.2rem);
	color: rgba(255,255,255,0.88);
	font-style: italic;
	margin: 0;
	line-height: 1.5;
	text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
@media (max-width: 600px) {
	.trb-hero { min-height: 200px; }
	.trb-hero__content { padding: 2rem 1.25rem; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   v3.1.0 — HERO BLOCK  [trb_hero]
   ═══════════════════════════════════════════════════════════════════════════ */

.trb-hero {
	position: relative;
	width: 100%;
	/* Viewport-scaling height: whichever is larger — the setting or 40vh */
	min-height: max( var(--trb-hero-height, 420px), 40vh );
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	text-align: center;
	padding: 3rem 2rem;
	background-color: var(--trb-secondary);
	background-size: cover;
	background-position: center;
	overflow: hidden;
	box-sizing: border-box;
}

/* Dark overlay for legibility over any photo */
.trb-hero::before {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.48);
	z-index: 0;
}

/* All direct children float above overlay */
.trb-hero > * { position: relative; z-index: 1; }

.trb-hero-logo {
	max-height: 72px;
	margin-bottom: 1.25rem;
	filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}

.trb-hero-headline {
	font-family: var(--trb-header-font);
	color: var(--trb-hero-text, #ffffff);
	font-size: clamp(1.5rem, 3.5vw, 2.4rem);
	font-weight: 700;
	margin: 0 0 0.6rem;
	line-height: 1.25;
	text-shadow: 0 2px 8px rgba(0,0,0,0.5);
	max-width: 700px;
}

.trb-hero-sub {
	font-family: var(--trb-body-font);
	color: var(--trb-hero-text, #ffffff);
	font-size: clamp(1rem, 2vw, 1.2rem);
	margin: 0 0 1.75rem;
	opacity: 0.88;
	text-shadow: 0 1px 4px rgba(0,0,0,0.45);
	max-width: 580px;
}

/* Search bar embedded inside hero */
.trb-hero .trb-search-wrap {
	width: 100%;
	max-width: 580px;
	margin-bottom: 0;
}

.trb-hero .trb-search-input {
	background: rgba(255,255,255,0.96);
	border-color: transparent;
	box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.trb-hero .trb-search-status {
	color: rgba(255,255,255,0.8);
	text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* Results panel below hero when search is embedded */
@media (max-width: 600px) {
	.trb-hero { padding: 2rem 1rem; }
	.trb-hero-logo { max-height: 54px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   v3.2.0 — HERO BOTTOM-ANCHOR + LANG PILL
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Hero structural split ───────────────────────────────────────────────── */
.trb-hero {
	overflow: visible; /* allow results panel to escape hero bounds */
}

.trb-hero__body {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	text-align: center;
}

/* Extra bottom clearance when search bar is anchored */
.trb-hero--search {
	padding-bottom: calc( var(--trb-hero-search-pad, 24px) * 2 + 60px );
}

/* ── Bottom-anchored search band ─────────────────────────────────────────── */
.trb-hero__search {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 2;
	background: rgba(0, 0, 0, 0.28);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
	display: flex;
	padding: var(--trb-hero-search-pad, 24px) 2rem;
	box-sizing: border-box;
}

.trb-hero__search--left   { justify-content: flex-start; }
.trb-hero__search--center { justify-content: center; }
.trb-hero__search--right  { justify-content: flex-end; }

/* Search wrap stretches to fill available space in hero */
.trb-hero__search .trb-search-wrap {
	width: 100%;
	max-width: 580px;
	margin: 0;
}

/* Results anchor to .trb-search-wrap — base rule handles positioning */
.trb-hero__search .trb-search-results {
	border-radius: var(--trb-radius);
	box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

/* Input styling inside hero */
.trb-hero__search .trb-search-input {
	background: rgba(255, 255, 255, 0.97);
	border-color: transparent;
	box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.trb-hero__search .trb-search-status {
	color: rgba(255, 255, 255, 0.82);
	font-size: .8rem;
}

@media (max-width: 600px) {
	.trb-hero__search { padding: var(--trb-hero-search-pad, 24px) 1rem; }
	.trb-hero__search .trb-search-results { left: 1rem; right: 1rem; }
}

/* ── Lang pill (left of search input) ────────────────────────────────────── */
.trb-search-wrap--langpill .trb-search-bar-row {
	display: flex;
	align-items: stretch;
	gap: 0;
}

/* Pill + input share a seamless border */
.trb-search-wrap--langpill .trb-search-bar-row .trb-lang-pill {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	padding: 0;
	background: var(--trb-secondary);
	color: #fff;
	border: 2px solid var(--trb-secondary);
	border-right: none;
	border-radius: var(--trb-radius) 0 0 var(--trb-radius);
	font-family: var(--trb-body-font);
	font-size: .8rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-decoration: none;
	cursor: pointer;
	transition: background .18s, border-color .18s;
}

.trb-search-wrap--langpill .trb-search-bar-row .trb-lang-pill:hover {
	background: var(--trb-primary);
	border-color: var(--trb-primary);
}

/* Input loses left radius when pill is present */
.trb-search-wrap--langpill .trb-search-bar-row .trb-search-input {
	border-radius: 0 var(--trb-radius) var(--trb-radius) 0;
	border-left-color: #ddd;
}

/* Inside hero — pill gets a glassy look */
.trb-hero__search .trb-lang-pill {
	background: rgba(255, 255, 255, 0.18);
	border-color: rgba(255, 255, 255, 0.45);
	color: #fff;
}

.trb-hero__search .trb-lang-pill:hover {
	background: var(--trb-primary);
	border-color: var(--trb-primary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   v3.3.0 — FONT OVERRIDE + SEARCH RESULTS POSITION
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Font overrides — beat GeneratePress heading declarations ────────────── */
/* GP sets font-family directly on h1/h2/h3; !important needed inside our    */
/* components only — does not affect non-KB pages.                            */

.trb-hero-headline,
.trb-hero h1,
.trb-hero h2,
.trb-hero h3 {
	font-family: var(--trb-header-font) !important;
}

.trb-hero-sub,
.trb-hero p {
	font-family: var(--trb-body-font) !important;
}

.trb-cat-title,
.trb-category-block h2,
.trb-category-block h3 {
	font-family: var(--trb-header-font) !important;
}

.trb-guide-list a,
.trb-guide-list li {
	font-family: var(--trb-body-font) !important;
}

.trb-card__title {
	font-family: var(--trb-header-font) !important;
}

.trb-card__sub,
.trb-card__arrow {
	font-family: var(--trb-body-font) !important;
}

.trb-guide-title {
	font-family: var(--trb-header-font) !important;
}

.trb-guide-content,
.trb-guide-content p,
.trb-guide-content li {
	font-family: var(--trb-body-font) !important;
}

/* ── Search results: absolutely anchored below input ─────────────────────── */
/* Results div is now inside .trb-search-wrap (position:relative)             */

.trb-search-wrap {
	position: relative !important; /* ensure anchor even if overridden upstream */
}

.trb-search-results {
	position: absolute !important;
	top: calc(100% + 4px) !important;
	bottom: auto !important;
	left: 0 !important;
	right: 0 !important;
	z-index: 9999;
	margin: 0 !important; /* remove old margin-bottom */
	transform: none !important;
}

/* Hero search — results handled by base .trb-search-results rule (top: calc(100% + 4px)) */

/* ═══════════════════════════════════════════════════════════════════════════
   v3.2.9 — SEARCH STATUS ORDER + CANCEL BUTTON FIX
   ═══════════════════════════════════════════════════════════════════════════ */

/* Kill native browser clear/cancel button on search inputs */
.trb-search-input::-webkit-search-cancel-button,
.trb-search-input::-webkit-search-decoration {
	-webkit-appearance: none;
	appearance: none;
}

.trb-cards-row {
	margin-top:    var(--trb-cards-mt, 0px) !important;
	margin-bottom: var(--trb-cards-mb, 32px) !important;
}


/* ═══════════════════════════════════════════════════════════════════════════
   v3.4.0 — NOTICE BANNER + MOBILE WIDTH TUNING
   ═══════════════════════════════════════════════════════════════════════════ */

.trb-notice-banner {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin: 0 0 1rem;
	padding: 14px 16px;
	background: var(--trb-notice-bg, #fff7ef);
	color: var(--trb-notice-text, var(--trb-secondary));
	border-left: 4px solid var(--trb-primary);
	border-radius: var(--trb-radius);
	box-shadow: var(--trb-shadow);
}

.trb-notice-banner__body,
.trb-notice-banner__body p,
.trb-notice-banner__body li {
	color: inherit;
	font-family: var(--trb-body-font);
	margin: 0;
}

.trb-notice-banner__body p + p,
.trb-notice-banner__body ul,
.trb-notice-banner__body ol {
	margin-top: .55rem;
}

.trb-notice-banner__body a {
	color: inherit;
	text-decoration: underline;
}

.trb-notice-banner__link {
	flex-shrink: 0;
	align-self: center;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: .55rem .9rem;
	border: 1px solid currentColor;
	border-radius: var(--trb-radius);
	color: inherit;
	text-decoration: none;
	font-weight: 600;
}

.trb-notice-banner__link:hover {
	background: rgba(255,255,255,.35);
}

.trb-search-wrap,
.trb-cards-row,
.trb-category-grid,
.trb-lang-flip,
.trb-notice-banner {
	width: 100%;
	box-sizing: border-box;
}

@media (max-width: 768px) {
	.trb-kb-wrap,
	.trb-single-wrap {
		padding: 1rem .75rem;
	}

	.trb-search-wrap,
	.trb-cards-row,
	.trb-category-grid,
	.trb-lang-flip,
	.trb-notice-banner,
	.trb-hero {
		width: calc(100vw - 24px);
		max-width: calc(100vw - 24px);
		margin-left: calc(50% - 50vw + 12px);
		margin-right: calc(50% - 50vw + 12px);
	}

	.trb-hero {
		border-radius: 0;
	}

	.trb-hero__search {
		padding-left: 12px !important;
		padding-right: 12px !important;
	}

	.trb-notice-banner {
		flex-direction: column;
		align-items: stretch;
	}

	.trb-notice-banner__link {
		align-self: flex-start;
	}
}
