/* NX Company Feed – style frontowe. Zmienne ustawiane są w panelu (Wygląd). */

.nxlf-feed {
	--nxlf-bg: #fff;
	--nxlf-text: #1d2226;
	--nxlf-muted: #666;
	--nxlf-accent: #0a66c2;
	--nxlf-border: #e0e0e0;
	--nxlf-bw: 1px;
	--nxlf-radius: 12px;
	--nxlf-pad: 20px;
	--nxlf-gap: 24px;
	--nxlf-fs: 15px;
	--nxlf-font: inherit;
	--nxlf-shadow: none;
	--nxlf-embed-h: 570px;
	font-family: var(--nxlf-font);
	font-size: var(--nxlf-fs);
	line-height: 1.5;
	color: var(--nxlf-text);
	width: 100%;
	box-sizing: border-box;
}
.nxlf-feed *,
.nxlf-feed *::before,
.nxlf-feed *::after { box-sizing: border-box; }

.nxlf-shadow-soft   { --nxlf-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.06); }
.nxlf-shadow-strong { --nxlf-shadow: 0 4px 10px rgba(0,0,0,.08), 0 14px 34px rgba(0,0,0,.12); }

/* ---------- Nagłówek ---------- */
.nxlf-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px 20px;
	margin-bottom: var(--nxlf-gap);
}
.nxlf-header__brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.nxlf-header__logo { width: 48px; height: 48px; border-radius: 8px; object-fit: contain; background: var(--nxlf-bg); flex: none; }
.nxlf-header__name { font-weight: 700; font-size: 1.2em; }

.nxlf-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 18px;
	border-radius: 999px;
	background: var(--nxlf-accent);
	color: #fff !important;
	font-weight: 600;
	font-size: .93em;
	text-decoration: none !important;
	transition: filter .2s, transform .2s;
}
.nxlf-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* ---------- Układy ---------- */
.nxlf-items { display: grid; gap: var(--nxlf-gap); grid-template-columns: repeat(var(--nxlf-cols, 3), minmax(0, 1fr)); align-items: start; }
.nxlf-layout-list .nxlf-items { grid-template-columns: minmax(0, 1fr); }
.nxlf-layout-list .nxlf-card { max-width: 760px; margin-inline: auto; width: 100%; }

.nxlf-layout-masonry .nxlf-items { display: block; column-count: var(--nxlf-cols, 3); column-gap: var(--nxlf-gap); }
.nxlf-layout-masonry .nxlf-card { break-inside: avoid; margin-bottom: var(--nxlf-gap); }

@media (max-width: 1024px) {
	.nxlf-cols-3 .nxlf-items, .nxlf-cols-4 .nxlf-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.nxlf-layout-masonry.nxlf-cols-3 .nxlf-items, .nxlf-layout-masonry.nxlf-cols-4 .nxlf-items { column-count: 2; }
}
@media (max-width: 640px) {
	.nxlf-feed .nxlf-items { grid-template-columns: minmax(0, 1fr); }
	.nxlf-feed.nxlf-layout-masonry .nxlf-items { column-count: 1; }
}

/* Karuzela */
/* Strzałki w bocznym marginesie karuzeli – nie zasłaniają treści kart. */
.nxlf-slider { position: relative; padding: 0 50px; }
.nxlf-layout-slider .nxlf-track {
	display: grid;
	grid-auto-flow: column;
	grid-template-columns: none;
	grid-auto-columns: calc((100% - (var(--nxlf-cols, 3) - 1) * var(--nxlf-gap)) / var(--nxlf-cols, 3));
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	padding: 4px 2px 12px;
	scroll-padding-inline: 2px;
	outline: none;
}
.nxlf-layout-slider .nxlf-track::-webkit-scrollbar { display: none; }
.nxlf-layout-slider .nxlf-card { scroll-snap-align: start; }

/* Siatka i karuzela: karty w rzędzie mają równą wysokość, wolne miejsce trafia między tekst
   a obraz – obrazy i linki „View on LinkedIn” leżą w jednej linii. Gdy któraś karta jest
   rozwinięta („…more”), wyrównanie jest wyłączane, żeby nie rozciągać pozostałych kart. */
.nxlf-layout-grid .nxlf-items,
.nxlf-layout-slider .nxlf-track { align-items: stretch; }
.nxlf-layout-grid .nxlf-card > .nxlf-card__media:not(:first-child),
.nxlf-layout-slider .nxlf-card > .nxlf-card__media:not(:first-child) { margin-top: auto; }
.nxlf-layout-grid .nxlf-card > .nxlf-card__media:not(:first-child) ~ .nxlf-card__footer,
.nxlf-layout-slider .nxlf-card > .nxlf-card__media:not(:first-child) ~ .nxlf-card__footer { margin-top: 0; }
/* Rozwinięta treść w siatce/karuzeli: przewijana nakładka w obrębie karty (karta nie rośnie). */
.nxlf-card { position: relative; }
.nxlf-full.nxlf-overlay {
	position: absolute; left: 0; right: 0; z-index: 3;
	overflow-y: auto; overscroll-behavior: contain;
	padding: 0 var(--nxlf-pad) 16px;
	background: var(--nxlf-bg);
	scrollbar-width: thin;
}
.nxlf-full.nxlf-overlay .nxlf-toggle {
	position: sticky; bottom: -16px; display: block;
	width: 100%; text-align: left; margin-top: 8px !important;
	padding: 10px 0 !important;
	background: var(--nxlf-bg) !important;
	box-shadow: 0 -10px 12px -6px var(--nxlf-bg) !important;
}
.nxlf-card--open .nxlf-card__short-hide { visibility: hidden; }
@media (max-width: 1024px) {
	.nxlf-layout-slider.nxlf-cols-3 .nxlf-track, .nxlf-layout-slider.nxlf-cols-4 .nxlf-track { grid-auto-columns: calc((100% - var(--nxlf-gap)) / 2); }
}
@media (max-width: 640px) {
	.nxlf-feed.nxlf-layout-slider .nxlf-track { grid-auto-columns: 86%; }
}
.nxlf-nav {
	position: absolute;
	top: 50%;
	z-index: 2;
	width: 42px;
	height: 42px;
	margin-top: -21px;
	border: 0;
	border-radius: 50%;
	background: var(--nxlf-bg);
	color: var(--nxlf-text);
	box-shadow: 0 2px 10px rgba(0,0,0,.18);
	font-size: 28px;
	font-family: Arial, sans-serif;
	line-height: 40px;
	padding: 0 !important;
	min-height: 0 !important;
	text-transform: none !important;
	cursor: pointer;
	transition: opacity .2s, transform .2s;
}
.nxlf-nav:hover { transform: scale(1.06); background: var(--nxlf-bg) !important; color: var(--nxlf-accent) !important; }
.nxlf-nav[disabled] { opacity: 0 !important; visibility: hidden; pointer-events: none; }
.nxlf-nav--prev { left: 0; }
.nxlf-nav--next { right: 0; }
@media (max-width: 640px) { .nxlf-nav { display: none; } .nxlf-slider { padding: 0; } }

/* ---------- Karta ---------- */
.nxlf-card {
	display: flex;
	flex-direction: column;
	gap: 14px;
	background: var(--nxlf-bg);
	border: var(--nxlf-bw) solid var(--nxlf-border);
	border-radius: var(--nxlf-radius);
	box-shadow: var(--nxlf-shadow);
	padding: var(--nxlf-pad);
	overflow: hidden;
	min-width: 0;
	transition: transform .25s ease, box-shadow .25s ease;
}
.nxlf-hover .nxlf-card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,.08), 0 18px 40px rgba(0,0,0,.10); }

.nxlf-card__head { display: flex; align-items: center; gap: 10px; }
.nxlf-card__avatar { width: 40px; height: 40px; border-radius: 6px; object-fit: contain; flex: none; }
.nxlf-card__meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.nxlf-card__author { font-weight: 600; line-height: 1.25; }
.nxlf-card__date { color: var(--nxlf-muted); font-size: .85em; }
/* Logo LinkedIn wyłącznie w oficjalnym kolorze (LinkedIn Brand Guidelines), bez zmian kształtu. */
.nxlf-card__li { margin-left: auto; color: #0a66c2 !important; line-height: 0; flex: none; }
.nxlf-card__li .nxlf-icon { width: 21px; height: 21px; }
.nxlf-btn .nxlf-icon { width: 21px; height: 21px; color: #fff; flex: none; }

.nxlf-card__text { word-wrap: break-word; overflow-wrap: anywhere; }
.nxlf-card__text a { color: var(--nxlf-accent); text-decoration: none; font-weight: 500; }
.nxlf-card__text a:hover { text-decoration: underline; }
.nxlf-toggle {
	background: none !important;
	border: 0 !important;
	padding: 0 !important;
	margin: 0;
	color: var(--nxlf-muted) !important;
	font: inherit;
	font-weight: 600;
	text-transform: none !important;
	letter-spacing: normal !important;
	min-height: 0 !important;
	line-height: inherit !important;
	cursor: pointer;
	box-shadow: none !important;
}
.nxlf-toggle:hover { color: var(--nxlf-accent) !important; text-decoration: underline; }

/* Media */
.nxlf-card__media {
	position: relative;
	display: grid;
	gap: 3px;
	margin-inline: calc(var(--nxlf-pad) * -1);
	overflow: hidden;
	line-height: 0;
}
.nxlf-card > .nxlf-card__media:first-child { margin-top: calc(var(--nxlf-pad) * -1); }
.nxlf-card > .nxlf-card__media:last-child { margin-bottom: calc(var(--nxlf-pad) * -1); }
.nxlf-img-wrap { position: relative; display: block; overflow: hidden; min-height: 0; }
.nxlf-card__media .nxlf-img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.nxlf-hover .nxlf-card:hover .nxlf-img { transform: scale(1.03); }

.nxlf-ratio-fixed .nxlf-media-1 .nxlf-img { aspect-ratio: var(--nxlf-ratio); height: auto; }
.nxlf-ratio-auto .nxlf-media-1 .nxlf-img { height: auto; max-height: 640px; }

.nxlf-media-2 { grid-template-columns: 1fr 1fr; aspect-ratio: 2 / 1.2; }
.nxlf-media-3 { grid-template-columns: 1fr 1fr; grid-template-rows: 2fr 1fr; aspect-ratio: 1 / 1; }
.nxlf-media-3 .nxlf-img-wrap:first-child { grid-column: 1 / -1; }
.nxlf-media-4 { grid-template-columns: repeat(3, 1fr); grid-template-rows: 2fr 1fr; aspect-ratio: 1 / 1; }
.nxlf-media-4 .nxlf-img-wrap:first-child { grid-column: 1 / -1; }
.nxlf-more-imgs {
	position: absolute; inset: 0;
	display: flex; align-items: center; justify-content: center;
	background: rgba(0,0,0,.5); color: #fff;
	font-size: 1.6em; font-weight: 600; line-height: 1;
}
.nxlf-play {
	position: absolute; top: 50%; left: 50%;
	width: 64px; height: 64px; margin: -32px 0 0 -32px;
	border-radius: 50%; background: rgba(0,0,0,.6);
	pointer-events: none;
}
.nxlf-play::after {
	content: ""; position: absolute; top: 50%; left: 50%;
	margin: -12px 0 0 -7px;
	border-style: solid; border-width: 12px 0 12px 20px;
	border-color: transparent transparent transparent #fff;
}

/* Pasek „Dokument” pod miniaturą karuzeli PDF (nie zasłania grafiki) */
.nxlf-doc-caption {
	grid-column: 1 / -1;
	display: flex; align-items: center; gap: 8px;
	padding: 10px var(--nxlf-pad);
	background: rgba(127,127,127,.08);
	color: var(--nxlf-muted);
	font-size: .85em; font-weight: 600; line-height: 1.3;
}
.nxlf-doc-caption svg { flex: none; }
.nxlf-doc-caption__cta { margin-left: auto; color: var(--nxlf-accent); }
.nxlf-card__media:hover .nxlf-doc-caption__cta { text-decoration: underline; }

/* Kafelek dokumentu / wideo bez miniatury */
.nxlf-card__media.nxlf-doc {
	display: flex; align-items: center; gap: 16px;
	min-height: 150px; padding: 24px var(--nxlf-pad);
	background: linear-gradient(135deg, rgba(127,127,127,.06), rgba(127,127,127,.14));
	color: var(--nxlf-text) !important; text-decoration: none !important; line-height: 1.35;
}
.nxlf-doc__icon { flex: none; width: 64px; height: 64px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--nxlf-accent); color: #fff; }
.nxlf-doc__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.nxlf-doc__label { font-size: .78em; text-transform: uppercase; letter-spacing: .06em; color: var(--nxlf-muted); }
.nxlf-doc__title { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nxlf-doc__cta { color: var(--nxlf-accent); font-weight: 600; font-size: .92em; }
.nxlf-card__media.nxlf-doc:hover .nxlf-doc__cta { text-decoration: underline; }

/* Podgląd artykułu */
.nxlf-card__article {
	display: flex; flex-direction: column; gap: 2px;
	padding: 12px 14px;
	border-radius: calc(var(--nxlf-radius) * .6);
	background: rgba(127,127,127,.08);
	color: var(--nxlf-text) !important;
	text-decoration: none !important;
	transition: background .2s;
}
.nxlf-card__article:hover { background: rgba(127,127,127,.14); }
.nxlf-article__title { font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nxlf-article__host { color: var(--nxlf-muted); font-size: .82em; }

/* Stopka */
.nxlf-card__footer { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--nxlf-border); }
.nxlf-card > .nxlf-card__media:last-child + .nxlf-card__footer,
.nxlf-card__footer:only-child { border-top: 0; }
.nxlf-card__footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nxlf-card__type { display: inline-flex; align-items: center; gap: 6px; color: var(--nxlf-muted); font-size: .82em; font-weight: 600; }
.nxlf-card__link { color: var(--nxlf-accent) !important; font-weight: 600; font-size: .92em; text-decoration: none !important; }
.nxlf-card__link:hover { text-decoration: underline !important; }

/* Embed */
.nxlf-card--embed { padding: 0; gap: 0; }
.nxlf-card--embed iframe { display: block; width: 100%; height: var(--nxlf-embed-h); border: 0; }

.nxlf-empty { color: var(--nxlf-muted); text-align: center; padding: 24px 0; }

@media (prefers-reduced-motion: reduce) {
	.nxlf-card, .nxlf-img, .nxlf-btn, .nxlf-track { transition: none !important; scroll-behavior: auto !important; }
}
