/*
 * Telkom Sales Hub — front-end styles.
 *
 * Colours come from CSS custom properties set in Settings → Sales Hub
 * (printed in <head> as #tsh-brand). Fonts inherit from the theme / Elementor
 * Global Fonts so typography stays editable in Elementor.
 */

:where(:root) {
	--tsh-primary: #1081C8;
	--tsh-light: #E8F3FB;
	--tsh-navy: #0B1F3A;
	--tsh-accent: #2E9E5B;
}
.tsh {
	--tsh-text: var(--tsh-navy);
	--tsh-muted: #5A6B80;
	--tsh-line: #D5E2EE;
	--tsh-bg: #FFFFFF;
	--tsh-warn: #9A5B00;
	--tsh-warn-bg: #FFF4E0;
	--tsh-radius: 12px;
	--tsh-cols: 3;
	--tsh-shadow: 0 1px 2px rgba(11, 31, 58, .06), 0 6px 18px -8px rgba(11, 31, 58, .18);
	color: var(--tsh-text);
	box-sizing: border-box;
}
.tsh *, .tsh *::before, .tsh *::after { box-sizing: inherit; }

.tsh-icon { width: 1.1em; height: 1.1em; flex: none; vertical-align: -0.15em; }
.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Default page wrapper (plugin templates) */
.tsh-main { background: #fff; }
.tsh-container { max-width: 1200px; margin: 0 auto; padding: 32px 16px 64px; }
.tsh-pagehead { margin-bottom: 24px; }
.tsh-pagehead__title { margin: 8px 0 6px; font-size: clamp(1.75rem, 3vw, 2.25rem); line-height: 1.15; color: var(--tsh-navy); }
.tsh-pagehead__desc { color: var(--tsh-muted); max-width: 70ch; }

/* ---------- Buttons ---------- */
.tsh-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .5em;
	min-height: 44px; padding: .6em 1.1em; border-radius: 999px;
	font: inherit; font-weight: 600; font-size: .95rem; line-height: 1.2;
	text-decoration: none !important; cursor: pointer; border: 1.5px solid transparent;
	transition: background-color .15s, color .15s, border-color .15s;
}
.tsh-btn--lg { min-height: 50px; padding: .75em 1.4em; font-size: 1rem; }
.tsh-btn--primary, .tsh .tsh-btn--primary { background: var(--tsh-primary); color: #fff !important; }
.tsh-btn--primary:hover { background: var(--tsh-navy); }
.tsh-btn--ghost { background: transparent; color: var(--tsh-primary) !important; border-color: var(--tsh-line); }
.tsh-btn--ghost:hover { border-color: var(--tsh-primary); background: var(--tsh-light); }
.tsh-btn--disabled { background: #F1F4F7; color: var(--tsh-muted); font-weight: 500; cursor: default; }
.tsh a:focus-visible, .tsh button:focus-visible, .tsh input:focus-visible, .tsh select:focus-visible, .tsh-btn:focus-visible {
	outline: 3px solid var(--tsh-primary); outline-offset: 2px;
}

/* ---------- Badges ---------- */
.tsh-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tsh-badge {
	display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
	font-size: .75rem; font-weight: 600; line-height: 1.3;
}
.tsh-badge--cat { background: var(--tsh-light); color: var(--tsh-navy); }
.tsh-badge--new { background: color-mix(in srgb, var(--tsh-accent) 14%, #fff); color: color-mix(in srgb, var(--tsh-accent) 75%, #000); }
.tsh-badge--hot { background: var(--tsh-navy); color: #fff; }
.tsh-badge--old { background: var(--tsh-warn-bg); color: var(--tsh-warn); }

/* ---------- Hero search ---------- */
.tsh-hero-search { text-align: center; color: #fff; max-width: 820px; margin: 0 auto; }
.tsh-hero-search__title {
	margin: 0 0 12px; color: inherit; font-weight: 700; letter-spacing: -0.01em;
	font-size: clamp(1.9rem, 4.5vw, 3rem); line-height: 1.08;
}
.tsh-hero-search__sub { margin: 0 auto 28px; max-width: 52ch; font-size: 1.1rem; line-height: 1.5; color: inherit; opacity: .9; }
/* When placed on a white background, use navy text. */
.elementor-section:not(.tsh-hero) .tsh-hero-search, .tsh-main .tsh-hero-search { color: var(--tsh-navy); }

.tsh-searchform {
	position: relative; display: flex; align-items: center; gap: 8px;
	background: #fff; border-radius: 999px; padding: 6px 6px 6px 18px;
	box-shadow: 0 10px 30px -10px rgba(11, 31, 58, .45);
	text-align: left;
}
.tsh-searchform__icon { color: var(--tsh-muted); display: flex; }
.tsh-searchform input[type="search"] {
	flex: 1; min-width: 0; border: 0 !important; outline: 0; background: transparent !important;
	font: inherit; font-size: 1.1rem; color: var(--tsh-navy); padding: 12px 4px !important; box-shadow: none !important;
}
.tsh-searchform input[type="search"]::placeholder { color: #7D8DA0; }
.tsh-searchform:focus-within { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--tsh-navy), 0 10px 30px -10px rgba(11, 31, 58, .45); }
.tsh .tsh-searchform .tsh-btn { min-height: 48px; padding: 0 1.5em; background: var(--tsh-navy); color: #fff; border: 0; }
.tsh .tsh-searchform .tsh-btn:hover { background: var(--tsh-primary); }

.tsh-suggest {
	position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 50;
	list-style: none; margin: 0; padding: 6px; background: #fff; border-radius: 16px;
	box-shadow: 0 18px 40px -12px rgba(11, 31, 58, .35); border: 1px solid var(--tsh-line);
	max-height: 60vh; overflow: auto;
}
.tsh-suggest li a, .tsh-suggest li span.tsh-suggest__none {
	display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px;
	text-decoration: none; color: var(--tsh-navy);
}
.tsh-suggest li a[aria-selected="true"], .tsh-suggest li a:hover { background: var(--tsh-light); }
.tsh-suggest__t { font-weight: 600; }
.tsh-suggest__m { font-size: .82rem; color: var(--tsh-muted); }
.tsh-suggest__all { border-top: 1px solid var(--tsh-line); margin-top: 4px; }
.tsh-suggest__all a { color: var(--tsh-primary) !important; font-weight: 600; }

.tsh-hero-links { margin: 18px 0 0; display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }
.tsh-hero-links a { color: #fff !important; opacity: .9; text-decoration: underline; text-underline-offset: 3px; font-size: .95rem; }
.tsh-hero-links a:hover { opacity: 1; }

/* ---------- Category cards ---------- */
.tsh-cats { display: grid; grid-template-columns: repeat(var(--tsh-cols), minmax(0, 1fr)); gap: 12px; }
.tsh-cat {
	display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
	padding: 14px 16px; border-radius: var(--tsh-radius); background: #fff; border: 1px solid var(--tsh-line);
	text-decoration: none !important; color: var(--tsh-navy);
	transition: border-color .15s, background-color .15s;
}
.tsh-cat:hover { border-color: var(--tsh-primary); background: var(--tsh-light); }
.tsh-cat__icon {
	grid-row: span 2; width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center;
	background: var(--tsh-light); color: var(--tsh-primary); overflow: hidden;
}
.tsh-cat:hover .tsh-cat__icon { background: #fff; }
.tsh-cat__icon .tsh-icon { width: 22px; height: 22px; }
.tsh-cat__icon img { width: 100%; height: 100%; object-fit: cover; }
.tsh-cat__name { font-weight: 650; font-size: 1rem; line-height: 1.25; }
.tsh-cat__count { font-size: .82rem; color: var(--tsh-muted); }
.tsh-cat--empty .tsh-cat__icon { background: #F1F4F7; color: #8C9AAB; }
.tsh-cat--empty .tsh-cat__count { font-style: italic; }

/* ---------- Document cards ---------- */
.tsh-results--grid { display: grid; grid-template-columns: repeat(var(--tsh-cols), minmax(0, 1fr)); gap: 20px; }
.tsh-card {
	position: relative; display: flex; flex-direction: column; background: #fff;
	border: 1px solid var(--tsh-line); border-radius: var(--tsh-radius); overflow: hidden;
}
.tsh-card:hover { border-color: color-mix(in srgb, var(--tsh-primary) 45%, var(--tsh-line)); }
.tsh-card__thumb { display: block; aspect-ratio: 16 / 5; background: var(--tsh-light); text-decoration: none !important; }
.tsh-card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Placeholder: a document sheet with a folded corner showing the file type. */
.tsh-card__ph { height: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--tsh-primary); font-weight: 700; font-size: .85rem; }
.tsh-card__ph .tsh-icon { width: 34px; height: 34px; stroke-width: 1.5; }
.tsh-card__body { padding: 16px 18px 8px; flex: 1; }
.tsh-card__title { margin: 0 0 6px; font-size: 1.08rem; line-height: 1.3; font-weight: 700; }
.tsh-card__title a { color: var(--tsh-navy) !important; text-decoration: none; }
.tsh-card__title a:hover { color: var(--tsh-primary) !important; text-decoration: underline; text-underline-offset: 3px; }
.tsh-card__excerpt { margin: 0 0 12px; color: var(--tsh-muted); font-size: .92rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tsh-card__actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 18px 18px; }
.tsh-card__actions .tsh-btn { flex: 1 1 auto; font-size: .88rem; min-height: 40px; }

.tsh .tsh-meta { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; padding: 0; font-size: .82rem; line-height: 1.35; text-align: left; }
.tsh .tsh-meta > div { margin: 0; padding: 0; min-width: 0; }
.tsh .tsh-meta dt { display: block; color: var(--tsh-muted); font-weight: 500; margin: 0; padding: 0; float: none; width: auto; }
.tsh .tsh-meta dd { display: block; margin: 0; padding: 0; font-weight: 600; color: var(--tsh-navy); text-align: left; }
.tsh .tsh-meta dd.tsh-muted { color: #8C9AAB; font-weight: 500; font-style: italic; }

/* List view */
.tsh-results--list { display: flex; flex-direction: column; gap: 10px; }
.tsh-results--list .tsh-card { flex-direction: row; align-items: center; }
.tsh-results--list .tsh-card__thumb { flex: 0 0 96px; aspect-ratio: auto; align-self: stretch; }
.tsh-results--list .tsh-card__ph span { display: none; }
.tsh-results--list .tsh-card__body { padding: 14px 16px; }
.tsh-results--list .tsh-card__excerpt { -webkit-line-clamp: 1; margin-bottom: 8px; }
.tsh-results--list .tsh-card__actions { flex-direction: column; padding: 14px 16px; flex: 0 0 200px; }

/* ---------- Compact list (recent / popular) ---------- */
.tsh-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tsh-list__item {
	display: flex; align-items: center; gap: 12px; padding: 12px 14px;
	background: #fff; border: 1px solid var(--tsh-line); border-radius: 10px;
}
.tsh-list__icon { color: var(--tsh-primary); display: flex; }
.tsh-list__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tsh-list__title { color: var(--tsh-navy) !important; font-weight: 650; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tsh-list__title:hover { color: var(--tsh-primary) !important; text-decoration: underline; }
.tsh-list__meta { font-size: .82rem; color: var(--tsh-muted); display: flex; flex-wrap: wrap; gap: 0 12px; }
.tsh-iconbtn {
	display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%;
	color: var(--tsh-primary) !important; background: var(--tsh-light);
}
.tsh-iconbtn:hover { background: var(--tsh-primary); color: #fff !important; }

.tsh-empty-note { padding: 16px; border: 1px dashed var(--tsh-line); border-radius: 10px; color: var(--tsh-muted); font-size: .92rem; background: #fff; }

/* ---------- News ---------- */
.tsh-news { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.tsh-news__item { padding: 0 0 14px; border-bottom: 1px solid var(--tsh-line); }
.tsh-news__item time { display: block; font-size: .8rem; color: var(--tsh-muted); }
.tsh-news__item a { font-weight: 650; color: var(--tsh-navy) !important; text-decoration: none; }
.tsh-news__item a:hover { color: var(--tsh-primary) !important; text-decoration: underline; }
.tsh-news__item p { margin: 4px 0 0; font-size: .9rem; color: var(--tsh-muted); }

/* ---------- Library ---------- */
.tsh-filters {
	display: grid; grid-template-columns: minmax(240px, 2fr) repeat(4, minmax(0, 1fr)); gap: 10px;
	padding: 12px; background: var(--tsh-light); border-radius: 16px; margin-bottom: 18px;
	position: sticky; top: 0; z-index: 20;
}
.admin-bar .tsh-filters { top: 32px; }
.tsh-filters__search { position: relative; display: flex; align-items: center; background: #fff; border-radius: 10px; padding-left: 12px; border: 1px solid var(--tsh-line); }
.tsh-filters__search input { flex: 1; min-width: 0; border: 0 !important; background: transparent !important; font: inherit; padding: 11px 10px !important; color: var(--tsh-navy); box-shadow: none !important; outline: 0; }
.tsh-filters__search:focus-within { border-color: var(--tsh-primary); box-shadow: 0 0 0 2px var(--tsh-primary); }
.tsh-filters select {
	width: 100%; height: 100%; min-height: 44px; border-radius: 10px; border: 1px solid var(--tsh-line) !important;
	background-color: #fff; font: inherit; font-size: .92rem; color: var(--tsh-navy); padding: 0 10px;
}
.tsh-library__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.tsh-library__count { margin: 0; color: var(--tsh-muted); font-size: .95rem; }
.tsh-library__count a { color: var(--tsh-primary); }
.tsh-viewtoggle { display: inline-flex; border: 1px solid var(--tsh-line); border-radius: 10px; overflow: hidden; }
.tsh-viewtoggle button { background: #fff; border: 0; padding: 8px 10px; color: var(--tsh-muted); cursor: pointer; min-width: 40px; min-height: 40px; }
.tsh-viewtoggle button[aria-pressed="true"] { background: var(--tsh-navy); color: #fff; }
.tsh-library__out { transition: opacity .15s; }
.tsh-library__out.is-loading { opacity: .45; }

.tsh-empty { text-align: center; padding: 48px 16px; border: 1px dashed var(--tsh-line); border-radius: 16px; color: var(--tsh-muted); background: #fff; }
.tsh-empty > .tsh-icon { width: 36px; height: 36px; color: var(--tsh-primary); }
.tsh-empty h3 { margin: 10px 0 6px; color: var(--tsh-navy); font-size: 1.2rem; }
.tsh-empty p { margin: 0 auto 16px; max-width: 52ch; }

.tsh-pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 28px; }
.tsh-pager a, .tsh-pager span {
	min-width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px;
	border: 1px solid var(--tsh-line); text-decoration: none; color: var(--tsh-navy); font-weight: 600;
}
.tsh-pager a:hover { border-color: var(--tsh-primary); color: var(--tsh-primary); }
.tsh-pager__cur { background: var(--tsh-navy); color: #fff !important; border-color: var(--tsh-navy) !important; }

/* ---------- Single broadsheet ---------- */
.tsh-crumbs { font-size: .88rem; color: var(--tsh-muted); display: flex; flex-wrap: wrap; gap: 6px; }
.tsh-crumbs a { color: var(--tsh-primary); text-decoration: none; }
.tsh-crumbs a:hover { text-decoration: underline; }
.tsh-single__head { margin: 14px 0 24px; padding-bottom: 24px; border-bottom: 1px solid var(--tsh-line); }
.tsh-single__title { margin: 4px 0 14px; font-size: clamp(1.75rem, 3.5vw, 2.5rem); line-height: 1.12; color: var(--tsh-navy); }
.tsh-single .tsh-meta { font-size: .95rem; margin-bottom: 20px !important; gap: 6px 32px; margin-bottom: 20px; }
.tsh-single__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.tsh-single__desc { max-width: 72ch; line-height: 1.65; margin-bottom: 28px; }
.tsh-single__desc ul { padding-left: 1.2em; }
.tsh-preview { background: var(--tsh-light); border-radius: 16px; padding: 12px; }
.tsh-preview__frame { display: block; width: 100%; height: min(80vh, 1000px); border: 0; border-radius: 10px; background: #fff; }
.tsh-preview__fallback { padding: 24px; }
.tsh-preview .tsh-empty { border: 0; }
.tsh-related { margin-top: 40px; }
.tsh-related h2 { font-size: 1.35rem; margin: 0 0 14px; color: var(--tsh-navy); }
.tsh-back { margin-top: 32px; }
.tsh-back a { color: var(--tsh-primary); font-weight: 600; text-decoration: none; }

.tsh-alert {
	display: flex; gap: 12px; align-items: flex-start; margin: 16px 0 8px; padding: 16px 18px;
	background: var(--tsh-warn-bg); color: var(--tsh-warn); border-radius: 12px; border-left: 4px solid var(--tsh-warn);
}
.tsh-alert .tsh-icon { width: 22px; height: 22px; margin-top: 2px; }
.tsh-alert strong { display: block; margin-bottom: 10px; color: #6B3F00; }
.tsh-alert a:not(.tsh-btn) { color: #6B3F00; font-weight: 600; }

/* ---------- Elementor hero section helpers ---------- */
.tsh-hero .elementor-widget-heading .elementor-heading-title { color: #fff; }
.tsh-h .elementor-heading-title { font-size: clamp(1.3rem, 2.2vw, 1.6rem); margin-bottom: 4px; }
.tsh-el-btn .elementor-button { border-radius: 999px; background: var(--tsh-primary); }
.tsh-el-btn .elementor-button:hover { background: var(--tsh-navy); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
	.tsh-results--grid, .tsh-cats { grid-template-columns: repeat(min(var(--tsh-cols), 2), minmax(0, 1fr)); }
	.tsh-filters { grid-template-columns: 1fr 1fr; }
	.tsh-filters__search { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
	.tsh-results--grid { grid-template-columns: 1fr; }
	.tsh-cats { grid-template-columns: 1fr 1fr; gap: 8px; }
	.tsh-cat { grid-template-columns: 1fr; padding: 12px; row-gap: 6px; }
	.tsh-cat__icon { grid-row: auto; width: 32px; height: 32px; }
	.tsh-cat__icon .tsh-icon { width: 18px; height: 18px; }
	.tsh-cat__name { font-size: .92rem; }
	.tsh-filters { position: static; }
	.tsh-searchform { padding-left: 14px; }
	.tsh-searchform .tsh-btn { padding: 0 1em; }
	.tsh-searchform__icon { display: none; }
	.tsh-results--list .tsh-card { flex-wrap: wrap; }
	.tsh-results--list .tsh-card__thumb { display: none; }
	.tsh-results--list .tsh-card__actions { flex: 1 1 100%; flex-direction: row; padding-top: 0; }
	.tsh-viewtoggle { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	.tsh *, .tsh-btn { transition: none !important; }
}
