/* ==========================================================
   STARGATEDEV: bezpieczny układ wszystkich stron WordPressa
   ========================================================== */

body.page {
	overflow-x: hidden;
}

body.page #page,
body.page .site-content,
body.page .content-area,
body.page .site-main,
body.page article,
body.page .inside-article,
body.page .entry-content {
	box-sizing: border-box;
	min-width: 0;
	max-width: 100%;
}

/* Strony mają jedną kolumnę. Wpisy blogowe zachowują ustawienia motywu. */
body.page .content-area {
	float: none;
	width: 100%;
}

body.page .site-main {
	margin-left: 0 !important;
	margin-right: 0 !important;
}

body.page #left-sidebar,
body.page #right-sidebar,
body.page .widget-area.sidebar {
	display: none !important;
}

body.page .inside-article {
	overflow: hidden;
}

/* Każdy element treści może się zmniejszyć wewnątrz Grid/Flex. */
body.page .entry-content,
body.page .entry-content *,
body.page .entry-content *::before,
body.page .entry-content *::after {
	box-sizing: border-box;
	min-width: 0;
	max-width: 100%;
}

/* Zawijanie tekstu, również w niestandardowym HTML. */
body.page .entry-content :where(
	p, li, div, section, article, aside, header, footer,
	h1, h2, h3, h4, h5, h6,
	span, strong, b, em, i, label, summary, figcaption,
	blockquote, dd, dt, address
) {
	white-space: normal !important;
	overflow-wrap: anywhere !important;
	word-wrap: break-word !important;
	word-break: normal;
	hyphens: auto;
}

/* Długie adresy URL, kody i adresy e-mail. */
body.page .entry-content :where(a, code, kbd, samp) {
	white-space: normal !important;
	overflow-wrap: anywhere !important;
	word-break: break-word !important;
}

body.page .entry-content pre {
	max-width: 100%;
	overflow-x: auto;
	white-space: pre-wrap;
	word-break: break-word;
}

/* Bloki szerokie nie wychodzą poza ramkę strony. */
body.page .entry-content :where(.alignwide, .alignfull) {
	width: 100% !important;
	max-width: 100% !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

/* Elementy multimedialne. */
body.page .entry-content :where(img, picture, video, canvas, svg) {
	height: auto;
	max-width: 100%;
}

body.page .entry-content :where(iframe, embed, object) {
	width: 100%;
	max-width: 100%;
}

/* Tabele pozostają w ramce i mogą być przewijane na małym ekranie. */
body.page .entry-content .wp-block-table,
body.page .entry-content .table-responsive {
	max-width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

body.page .entry-content table {
	width: 100%;
	max-width: 100%;
	table-layout: fixed;
}

body.page .entry-content :where(th, td) {
	overflow-wrap: anywhere;
	word-break: break-word;
}

/* Kolumny i grupy Gutenberga. */
body.page .entry-content :where(.wp-block-columns, .wp-block-group, .wp-block-cover, .wp-block-media-text) {
	min-width: 0;
	max-width: 100%;
}

body.page .entry-content .wp-block-column {
	min-width: 0;
}

/* Rozwijane sekcje regulaminów. */
body.page .entry-content details {
	width: 100%;
	max-width: 100%;
	overflow: hidden;
}

body.page .entry-content summary {
	max-width: 100%;
	white-space: normal !important;
	overflow-wrap: anywhere !important;
}

/* Rozsądny odstęp i czytelność tekstu. */
body.page .entry-content p {
	margin-bottom: 0.85em;
	line-height: 1.65;
}

body.page .entry-content li {
	margin-bottom: 0.35em;
	line-height: 1.55;
}

@media (max-width: 768px) {
	body.page #page,
	body.page .site-content {
		width: 100%;
		max-width: 100%;
	}

	body.page .inside-article {
		padding-left: 16px;
		padding-right: 16px;
	}

	body.page .entry-content {
		font-size: 16px;
	}

	body.page .entry-content .wp-block-columns {
		gap: 1rem;
	}
}
