/*!
 * Pijarzy Smart Navigation – widok wpisu (body.psn-article)
 * Ładowany wyłącznie na stronie pojedynczego wpisu, gdy moduł jest włączony
 * lub w podglądzie redaktora (?psn_podglad=1).
 */

/* 1. Błąd szablonu wpisów Divi: główny wiersz nie był wyśrodkowany. */
.psn-article .et-l--body .et_pb_row {
	margin-left: auto !important;
	margin-right: auto !important;
}

/* 2. Typografia treści */
.psn-article .et_pb_post_content {
	color: var(--psn-ink);
	font-size: 16px;
	line-height: 1.7;
	text-align: left;
	overflow-wrap: anywhere;
}
.psn-article .et_pb_post_content p,
.psn-article .et_pb_post_content li { text-align: left !important; }
.psn-article .et_pb_post_content .psn-article-meta + *, .psn-article .et_pb_post_content > *:first-child { margin-top: 0; }
.psn-article .et_pb_post_content p { padding-bottom: 0; margin: 0 0 1em; }
.psn-article .et_pb_post_content > p:first-of-type { font-size: 17px; color: var(--psn-navy); }

/* Puste akapity i bloki (częste przy wklejaniu z Facebooka / Worda) */
.psn-article .et_pb_post_content p:empty,
.psn-article .et_pb_post_content > div:empty,
.psn-article .et_pb_post_content p:has(> br:only-child) { display: none; }

/* H6 bywa używany jako zwykły tekst – bez „krzyczącego” wyglądu */
.psn-article .et_pb_post_content h6 { font-size: inherit; font-weight: inherit; line-height: inherit; padding: 0; margin: 0 0 1em; color: inherit; }
.psn-article .et_pb_post_content h2,
.psn-article .et_pb_post_content h3,
.psn-article .et_pb_post_content h4 { color: var(--psn-navy); font-weight: 700; line-height: 1.3; margin: 1.6em 0 .5em; padding: 0; }
.psn-article .et_pb_post_content h2 { font-size: 22px; }
.psn-article .et_pb_post_content h3 { font-size: 19px; }
.psn-article .et_pb_post_content h4 { font-size: 17px; }

.psn-article .et_pb_post_content a:not([class]) {
	color: var(--psn-navy);
	font-weight: 600;
	text-decoration: underline;
	text-decoration-color: var(--psn-gold);
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}
.psn-article .et_pb_post_content a:not([class]):hover { color: var(--psn-gold-ink); }
.psn-article .et_pb_post_content strong, .psn-article .et_pb_post_content b { color: var(--psn-navy); }
.psn-article .et_pb_post_content ul,
.psn-article .et_pb_post_content ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.psn-article .et_pb_post_content li { margin-bottom: .35em; }
.psn-article .et_pb_post_content blockquote {
	margin: 1.4em 0; padding: 14px 18px;
	border: 0; border-left: 3px solid var(--psn-gold);
	background: var(--psn-paper); border-radius: 0 12px 12px 0;
	font-style: italic; color: var(--psn-navy);
}

/* 3. Zdjęcia dowolnych rozmiarów */
.psn-article .et_pb_post_content img:not([class*="bwg"]):not(.emoji) {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 1.4em auto;
	border-radius: 12px;
}
/* Pionowe i bardzo wysokie zdjęcia nie zajmują kilku ekranów */
.psn-article .et_pb_post_content img:not([class*="bwg"]):not(.emoji) {
	max-height: min(80vh, 720px);
	width: auto;
	object-fit: contain;
}
.psn-article .et_pb_post_content img.alignleft,
.psn-article .et_pb_post_content img.alignright { max-width: 46%; margin-top: .3em; }
.psn-article .et_pb_post_content img.alignleft { float: left; margin: .3em 1.2em .8em 0; }
.psn-article .et_pb_post_content img.alignright { float: right; margin: .3em 0 .8em 1.2em; }
.psn-article .et_pb_post_content .wp-caption { max-width: 100% !important; margin: 1.4em auto; }
.psn-article .et_pb_post_content .wp-caption img { margin-bottom: .4em; }
.psn-article .et_pb_post_content .wp-caption-text { font-size: 13.5px; color: var(--psn-muted); text-align: center; }
.psn-article .et_pb_post_content::after { content: ""; display: block; clear: both; }

/* Filmy i osadzenia */
.psn-article .et_pb_post_content iframe { display: block; width: 100%; max-width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; margin: 1.4em 0; }

/* Tabele (np. listy, terminy) */
.psn-article .et_pb_post_content table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: 14.5px; display: block; overflow-x: auto; }
.psn-article .et_pb_post_content th,
.psn-article .et_pb_post_content td { padding: 8px 10px; border-bottom: 1px solid var(--psn-line); text-align: left; }
.psn-article .et_pb_post_content th { color: var(--psn-navy); background: var(--psn-sky); }

/* Linki do dokumentów jako „pliki” */
.psn-article .et_pb_post_content a[href$=".pdf"],
.psn-article .et_pb_post_content a[href$=".docx"],
.psn-article .et_pb_post_content a[href$=".doc"] {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 8px 12px; margin: 2px 0;
	border-radius: 10px; background: var(--psn-sky);
	text-decoration: none; color: var(--psn-navy); font-weight: 600;
}
.psn-article .et_pb_post_content a[href$=".pdf"]::before,
.psn-article .et_pb_post_content a[href$=".docx"]::before,
.psn-article .et_pb_post_content a[href$=".doc"]::before {
	content: ""; width: 18px; height: 18px; flex: none;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H6v18h12V7zM14 3v4h4M9 13h6M9 17h6'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H6v18h12V7zM14 3v4h4M9 13h6M9 17h6'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* 4. Galerie Photo Gallery (10Web) – spójna siatka kwadratowych kafelków */
.psn-article .et_pb_post_content .bwg_container { margin: 1.6em 0 !important; }
.psn-article .et_pb_post_content .bwg-container {
	display: grid !important;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
	width: 100% !important; max-width: 100% !important;
	padding: 0 !important; background: transparent !important;
}
.psn-article .et_pb_post_content .bwg-container > .bwg-item {
	display: block !important; width: auto !important; max-width: none !important;
	padding: 0 !important; margin: 0 !important; border: 0 !important;
}
.psn-article .et_pb_post_content .bwg-item0 {
	padding: 0 !important; margin: 0 !important; border: 0 !important;
	border-radius: 10px !important; overflow: hidden; background: var(--psn-sky) !important;
}
.psn-article .et_pb_post_content .bwg-item1 { padding-top: 100% !important; height: 0 !important; }
.psn-article .et_pb_post_content .bwg-item2 { inset: 0 !important; width: auto !important; height: auto !important; }
.psn-article .et_pb_post_content .bwg-item2 img {
	position: absolute !important; inset: 0 !important;
	width: 100% !important; height: 100% !important;
	max-width: none !important; max-height: none !important; margin: 0 !important;
	object-fit: cover !important; border-radius: 0 !important;
	transition: transform .4s var(--psn-ease);
}
.psn-article .et_pb_post_content .bwg-a:hover .bwg-item2 img { transform: scale(1.04); }
.psn-article .et_pb_post_content .bwg-a:focus-visible { outline: none; box-shadow: var(--psn-focus); border-radius: 10px; }

/* 5. Pasek meta i nawigacja */
.psn-article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 18px; padding-bottom: 14px; border-bottom: 1px solid var(--psn-line); font-size: 14px; color: var(--psn-muted); }
.psn-article-meta__date { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--psn-navy); }
.psn-article-meta svg.psn-ico { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; color: var(--psn-gold-ink); }
.psn-article-meta .psn-chip { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; background: var(--psn-sky); color: var(--psn-navy) !important; text-decoration: none; }

.psn-article-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px; margin: 32px 0 12px; padding-top: 20px; border-top: 1px solid var(--psn-line); }
.psn-article-nav__link { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--psn-line); text-decoration: none !important; transition: background-color .2s, box-shadow .2s; }
.psn-article-nav__link:hover { background: var(--psn-paper); box-shadow: inset 0 0 0 1px #d5dde7; }
.psn-article-nav__link--prev { text-align: right; }
.psn-article-nav__dir { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--psn-muted); }
.psn-article-nav__link--prev .psn-article-nav__dir { justify-content: flex-end; }
.psn-article-nav__title { font-size: 15px; font-weight: 700; line-height: 1.35; color: var(--psn-navy); }
.psn-article-nav svg.psn-ico, .psn-article-back svg.psn-ico { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.psn-article-nav .psn-flip { transform: scaleX(-1); }
.psn-article-back { margin: 0 0 8px !important; }
.psn-article-back a { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--psn-gold-ink) !important; text-decoration: none; }
.psn-article-back a:hover { text-decoration: underline; text-underline-offset: 3px; }
.psn-article :focus-visible { outline: 2px solid var(--psn-navy); outline-offset: 2px; }

/* 6. Tablet i telefon – marginesy boczne, tytuł, okruszki
   (zabezpieczenie: szablon wpisów Divi bywa bez pliku CSS z szerokością wierszy) */
@media (max-width: 980px) {
	.psn-article .et-l--body .et_pb_row {
		width: auto !important;
		max-width: 720px !important;
		padding-left: max(18px, env(safe-area-inset-left)) !important;
		padding-right: max(18px, env(safe-area-inset-right)) !important;
		box-sizing: border-box;
	}
	.psn-article .et-l--body .et_pb_section { padding-top: 0 !important; padding-bottom: 0 !important; }
	.psn-article .et_pb_post_title { padding: 22px 0 14px !important; }
	.psn-article .et_pb_post_title h1,
	.psn-article .et_pb_post_title .entry-title {
		font-size: clamp(22px, 6vw, 28px) !important;
		line-height: 1.25 !important;
		text-transform: none !important;
		letter-spacing: 0 !important;
		text-align: left !important;
		text-wrap: balance;
		color: var(--psn-navy) !important;
		padding: 0 !important;
	}
	.psn-article .et_pb_code_0_tb_body,
	.psn-article .et_pb_code_0_tb_body * { text-align: left !important; font-size: 13px !important; line-height: 1.5 !important; }
	.psn-article .et_pb_code_0_tb_body { padding: 10px 0 !important; color: var(--psn-muted); }
	.psn-article .et_pb_post_content { padding-top: 18px; }
	.psn-article .et_pb_column { margin-bottom: 0 !important; }
}

@media (max-width: 600px) {
	.psn-article .et_pb_post_content { font-size: 16px; }
	.psn-article .et_pb_post_content img.alignleft,
	.psn-article .et_pb_post_content img.alignright { float: none; max-width: 100%; margin: 1.2em auto; }
	.psn-article .et_pb_post_content .bwg-container { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
	.psn-article-nav__link--prev { text-align: left; }
	.psn-article-nav__link--prev .psn-article-nav__dir { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
	.psn-article .et_pb_post_content .bwg-item2 img { transition: none; }
	.psn-article .et_pb_post_content .bwg-a:hover .bwg-item2 img { transform: none; }
}
