/* Network-style post previews. Shared by wp-admin and the client portal. */
.kl-ico { display: inline-flex; width: 16px; height: 16px; flex: none; vertical-align: -3px; }
.kl-ico svg { width: 100%; height: 100%; display: block; }

.kl-pv {
	--pv-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Noto Sans Arabic", sans-serif;
	width: 100%;
	max-width: 470px;
	font-family: var(--pv-font);
	color: #050505;
	text-transform: none;
	letter-spacing: normal;
	text-align: start;
}
.kl-pv *, .kl-pv *::before, .kl-pv *::after { box-sizing: border-box; }

.kl-pv-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.kl-pv-tab {
	display: inline-flex; align-items: center; gap: 6px;
	margin: 0; padding: 6px 12px 6px 8px;
	font: 600 13px/1.2 var(--pv-font);
	color: #3c434a; background: #fff;
	border: 1px solid #d0d5db; border-radius: 999px;
	cursor: pointer;
}
.kl-pv-tab:hover { border-color: #8c8f94; }
.kl-pv-tab[aria-pressed="true"] { color: #fff; background: #1c1e21; border-color: #1c1e21; }
.kl-pv-tab:focus-visible { outline: 2px solid #2271b1; outline-offset: 2px; }

.kl-pv-net { background: #fff; border: 1px solid #dddfe2; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.kl-pv-net[hidden], .kl-pv [hidden] { display: none !important; }

.kl-av {
	display: grid; place-items: center; flex: none; overflow: hidden;
	width: 40px; height: 40px; border-radius: 50%;
	background: #241c1d; color: #fff;
	font: 700 16px/1 var(--pv-font);
}
/* Logos are shown whole (not cropped) on white, like a page picture. */
.kl-av img { width: 100%; height: 100%; object-fit: contain; background: #fff; }

.kl-pv-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.34; }
.kl-pv-text.is-empty::before { content: attr(data-empty); color: #8a8d91; font-style: italic; }
.kl-pv-tag { color: #385898; }

/* Image grid (Facebook, Telegram, X): 1 to 4 tiles, "+N" on the last */
.kl-pv-grid { display: grid; gap: 2px; grid-template-columns: 1fr 1fr; background: #fff; }
.kl-pv-grid.n1 { grid-template-columns: 1fr; }
.kl-pv-grid.n3 .kl-pv-cell:first-child { grid-row: span 2; }
.kl-pv-cell { position: relative; display: block; width: 100%; margin: 0; padding: 0; overflow: hidden; border: 0; border-radius: 0; background: #f0f2f5; font: inherit; color: inherit; cursor: zoom-in; }
.kl-pv-cell:hover img { filter: brightness(.94); }
.kl-pv-cell:focus-visible { outline: 3px solid #2271b1; outline-offset: -3px; }
.kl-pv-cell img, .kl-pv-cell video { display: block; width: 100%; height: 100%; object-fit: cover; }
.kl-pv-cell video { background: #000; pointer-events: none; }
.kl-pv-grid.n1 .kl-pv-cell img, .kl-pv-grid.n1 .kl-pv-cell video { height: auto; max-height: 588px; }
.kl-pv-cell .kl-ico-play { position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; transform: translate(-50%, -50%); pointer-events: none; }
.kl-pv-grid:not(.n1) .kl-ico-play { width: 44px; height: 44px; }
.kl-pv-grid:not(.n1) .kl-pv-cell { aspect-ratio: 1; }
.kl-pv-grid.n3 .kl-pv-cell:first-child { aspect-ratio: auto; }
.kl-pv-more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .45); color: #fff; font-size: 30px; font-weight: 700; }

/* Facebook */
.kl-fb-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px 0; }
.kl-fb-head > div { flex: 1; min-width: 0; }
.kl-fb-head b { display: block; font-size: 15px; line-height: 1.25; }
.kl-fb-head small { display: flex; align-items: center; gap: 4px; color: #65676b; font-size: 13px; }
.kl-fb-head small .kl-ico { width: 12px; height: 12px; vertical-align: 0; }
.kl-fb-head > .kl-ico, .kl-ig-head > .kl-ico { color: #65676b; width: 20px; height: 20px; }
.kl-fb .kl-pv-text { padding: 6px 16px 12px; }
.kl-fb-bar { display: flex; justify-content: space-around; margin: 0 16px; padding: 4px 0; border-top: 1px solid #ced0d4; color: #65676b; font-size: 15px; font-weight: 600; }
.kl-fb .kl-pv-grid + .kl-fb-bar { margin-top: 8px; }
.kl-fb-bar > span { display: flex; align-items: center; gap: 6px; padding: 6px 8px; }
.kl-fb-bar .kl-ico { width: 18px; height: 18px; }

/* Instagram */
.kl-ig-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.kl-ig-head .kl-av { width: 32px; height: 32px; font-size: 13px; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #d62976; margin: 3px; }
.kl-ig-head b { flex: 1; font-size: 14px; font-weight: 600; }
.kl-ig-media { position: relative; background: #efefef; }
.kl-ig-media.is-empty { display: grid; place-items: center; aspect-ratio: 16 / 9; }
.kl-ig-noimg { margin: 0; padding: 24px; color: #737373; font-size: 13px; text-align: center; }
/* Carousel: a horizontal scroll-snap track; swipe, or use the arrows (preview.js). */
.kl-ig-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; aspect-ratio: 1; }
.kl-ig-track::-webkit-scrollbar { display: none; }
.kl-ig-track img, .kl-ig-track video { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: start; }
.kl-ig-track video { background: #000; }
.kl-ig-count { position: absolute; top: 12px; inset-inline-end: 12px; padding: 3px 9px; border-radius: 999px; background: rgba(18, 18, 18, .7); color: #fff; font-size: 12px; font-weight: 600; }
.kl-ig-nav { position: absolute; top: 50%; display: block; width: 28px; height: 28px; margin-top: -14px; padding: 0; border: 0; border-radius: 50%; background: none; color: #262626; line-height: 0; cursor: pointer; -webkit-appearance: none; appearance: none; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .3)); }
.kl-ig-nav svg, .kl-viewer button svg { display: block; width: 100%; height: 100%; pointer-events: none; }
.kl-btn-ico { fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.kl-ig-nav .kl-btn-bg { fill: rgba(255, 255, 255, .88); }
.kl-ig-nav .kl-btn-ico { stroke-width: 2.2; }
.kl-ig-prev { left: 10px; }
.kl-ig-next { right: 10px; }
.kl-ig-actions { position: relative; display: flex; gap: 16px; padding: 10px 12px 6px; }
.kl-ig-dots { position: absolute; left: 50%; top: 18px; display: flex; gap: 4px; transform: translateX(-50%); }
.kl-ig-dots i { width: 6px; height: 6px; border-radius: 50%; background: #c7c7c7; }
.kl-ig-dots i.is-on { background: #0095f6; }
.kl-ig-actions .kl-ico { width: 24px; height: 24px; }
.kl-ig-end { margin-inline-start: auto; }
.kl-ig-cap { padding: 0 12px; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.kl-ig-cap b { font-weight: 600; }
.kl-ig .kl-pv-text { display: inline; font-size: 14px; line-height: 1.4; }
.kl-ig .kl-pv-tag { color: #00376b; }
.kl-ig-date { display: block; padding: 6px 12px 12px; color: #737373; font-size: 10px; letter-spacing: .02em; text-transform: uppercase; }

/* Telegram */
.kl-tg-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #fff; border-bottom: 1px solid #e7e7e7; }
.kl-tg-head .kl-av { width: 36px; height: 36px; font-size: 14px; background: #229ed9; }
.kl-tg-head b { display: block; font-size: 15px; line-height: 1.2; }
.kl-tg-head small { color: #8c9aa5; font-size: 13px; }
.kl-tg-chat { padding: 16px 12px; background: #c9d9b9 linear-gradient(160deg, #d6e3c0 0%, #b9d0a7 100%); }
.kl-tg-bubble { max-width: 92%; overflow: hidden; background: #fff; border-radius: 14px 14px 14px 4px; box-shadow: 0 1px 1px rgba(0, 0, 0, .14); }
.kl-tg .kl-pv-text { padding: 7px 12px 0; font-size: 15px; }
.kl-tg .kl-pv-tag { color: #168acd; }
.kl-tg-meta { display: flex; align-items: center; justify-content: flex-end; gap: 4px; padding: 2px 10px 6px; color: #8c9aa5; font-size: 12px; }
.kl-tg-meta .kl-ico { width: 14px; height: 14px; vertical-align: 0; }

/* X (Twitter) */
.kl-x { display: flex; gap: 10px; padding: 12px 16px 6px; }
.kl-x > .kl-av { width: 40px; height: 40px; }
.kl-x-body { flex: 1; min-width: 0; }
.kl-x-head { display: flex; align-items: baseline; gap: 4px; font-size: 15px; line-height: 1.3; }
.kl-x-head b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kl-x-head span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #536471; }
.kl-x-head .kl-ico { flex: none; width: 18px; height: 18px; color: #536471; }
.kl-x .kl-pv-text { margin-top: 2px; color: #0f1419; font-size: 15px; line-height: 1.35; }
.kl-x .kl-pv-tag { color: #1d9bf0; }
.kl-x .kl-pv-grid { margin-top: 12px; overflow: hidden; border: 1px solid #cfd9de; border-radius: 16px; }
.kl-x-actions { display: flex; justify-content: space-between; max-width: 425px; padding: 12px 0 6px; color: #536471; }
.kl-x-actions .kl-ico { width: 18px; height: 18px; }

/* Full-size image viewer, opened by clicking a photo in the Facebook, Telegram or X preview (preview.js).
   The arrows and the close button hang off the photo's frame, so they stay next to the photo at any size. */
.kl-viewer { width: 100vw; max-width: 100vw; height: 100vh; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(12, 12, 12, .94); color: #fff; overflow: hidden; }
.kl-viewer::backdrop { background: rgba(0, 0, 0, .5); }
.kl-viewer[open] { display: flex; align-items: center; justify-content: center; }
.kl-viewer-stage { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; width: 100%; height: 100%; margin: 0; padding: 0 72px; box-sizing: border-box; }
.kl-viewer-frame { position: relative; line-height: 0; }
/* Sized from the screen, leaving room for the arrows beside the photo and the close button above it. */
.kl-viewer-frame img, .kl-viewer-frame video { display: block; max-width: calc(100vw - 144px); max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px); object-fit: contain; user-select: none; -webkit-user-drag: none; }
.kl-viewer-frame video { background: #000; }
.kl-viewer-frame > img[hidden], .kl-viewer-frame > video[hidden] { display: none; }
.kl-viewer-count { min-height: 20px; font: 600 14px/20px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; letter-spacing: .02em; color: #e4e6eb; }
/* Each button is one SVG (circle + icon), so the icon is centred in every browser. */
.kl-viewer button { position: absolute; display: block; width: 44px; height: 44px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: none; color: #fff; line-height: 0; cursor: pointer; -webkit-appearance: none; appearance: none; }
.kl-viewer .kl-btn-bg { fill: rgba(255, 255, 255, .14); transition: fill .15s; }
.kl-viewer button:hover .kl-btn-bg { fill: rgba(255, 255, 255, .26); }
.kl-viewer button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.kl-viewer button[hidden] { visibility: hidden; display: block; }
.kl-viewer .kl-viewer-nav { top: 50%; transform: translateY(-50%); }
.kl-viewer-prev { right: calc(100% + 14px); }
.kl-viewer-next { left: calc(100% + 14px); }
.kl-viewer-close { right: 0; bottom: calc(100% + 10px); }
@media (max-width: 600px) {
	/* No room beside the photo: the arrows sit just inside its edges. */
	.kl-viewer-stage { padding: 0 12px; }
	.kl-viewer-frame img, .kl-viewer-frame video { max-width: calc(100vw - 24px); }
	.kl-viewer-prev { right: auto; left: 8px; }
	.kl-viewer-next { left: auto; right: 8px; }
	.kl-viewer-nav .kl-btn-bg { fill: rgba(0, 0, 0, .55); }
	.kl-viewer-nav:hover .kl-btn-bg { fill: rgba(0, 0, 0, .7); }
}
