/*
 * Skład — sygnatury wizualne.
 * Wszystko, czego theme.json nie umie: pseudo-elementy, stany, drobna mechanika.
 * Zero JS, zero bitmap. Kolory i wymiary wyłącznie przez zmienne presetów.
 */

/* ==== 1. Przycisk-klocek: dołożenie / wciśnięcie ==== */
.wp-element-button,
.wp-block-button__link {
	transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.wp-element-button:hover,
.wp-block-button__link:hover {
	transform: translate(2px, 2px);
	box-shadow: var(--wp--custom--shadow--przycisk-hover, 1px 1px 0 var(--wp--preset--color--contrast));
}
.wp-element-button:active,
.wp-block-button__link:active {
	transform: translate(3px, 3px);
	box-shadow: none;
}

/* Styl przycisku „Obrys": tło papieru, ta sama mechanika */
.is-style-obrys .wp-block-button__link {
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}
.is-style-obrys .wp-block-button__link:hover,
.is-style-obrys .wp-block-button__link:focus {
	background: var(--wp--preset--color--tint);
	color: var(--wp--preset--color--contrast);
}

/* Styl „Klocek" = domyślny wygląd; rejestrowany dla jawności wyboru */
.is-style-klocek .wp-block-button__link {
	box-shadow: var(--wp--custom--shadow--przycisk, 3px 3px 0 var(--wp--preset--color--contrast));
}

/* ==== 2. Mono-kicker: etykieta techniczna nad nagłówkiem ==== */
.sklad-kicker {
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--primary);
}
.has-inverse-background-color .sklad-kicker {
	color: var(--wp--preset--color--accent);
}

/* ==== 3. Separator „miarka": linia ze znacznikami ==== */
hr.wp-block-separator.is-style-miarka {
	border: 0;
	height: 11px;
	width: 100%;
	max-width: none;
	background-color: transparent;
	background-image:
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='11'%3E%3Cpath d='M0 5.5h160' stroke='%23D9DCE3' stroke-width='1'/%3E%3Cpath d='M80 1v9M75.5 5.5h9' stroke='%2346525F' stroke-width='1.2'/%3E%3C/svg%3E");
	background-repeat: repeat-x;
	background-position: center;
	opacity: 1;
}

/* ==== 4. Zakreślacz: mark + styl nagłówka ==== */
mark,
.wp-block-post-content mark {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--on-accent);
	padding: 0.02em 0.18em;
	border-radius: var(--wp--custom--radius--xs, 2px);
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
}
.is-style-zakreslenie {
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--accent);
	text-decoration-thickness: 0.28em;
	text-underline-offset: -0.08em;
	text-decoration-skip-ink: none;
}

/* ==== 5. Listy: kwadratowe punktory ==== */
ul.is-style-kwadraciki {
	list-style: none;
	padding-left: 0.25rem;
}
ul.is-style-kwadraciki > li {
	position: relative;
	padding-left: 1.4rem;
	margin-bottom: 0.5rem;
}
ul.is-style-kwadraciki > li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.5em;
	width: 8px;
	height: 8px;
	border-radius: 2px;
	background: var(--wp--preset--color--primary);
}
.has-inverse-background-color ul.is-style-kwadraciki > li::before,
.has-on-inverse-color ul.is-style-kwadraciki > li::before {
	background: var(--wp--preset--color--accent);
}

/* Numeracja w treści wpisów: mono, w kolorze klocka */
.wp-block-post-content ol > li::marker {
	font-family: var(--wp--preset--font-family--mono);
	font-weight: 700;
	color: var(--wp--preset--color--primary);
}

/* ==== 6. Cytat z wypustkami (nuby klocka) ==== */
.wp-block-quote.is-style-wypustki {
	position: relative;
	background: var(--wp--preset--color--tint-2);
	border: 1.5px solid var(--wp--preset--color--line);
	border-left: 1.5px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--md, 6px);
	padding: var(--wp--preset--spacing--40) var(--wp--preset--spacing--40);
	margin-top: 14px;
}
.wp-block-quote.is-style-wypustki::before,
.wp-block-quote.is-style-wypustki::after {
	content: "";
	position: absolute;
	top: -9px;
	width: 26px;
	height: 9px;
	background: inherit;
	border: 1.5px solid var(--wp--preset--color--line);
	border-bottom: 0;
	border-radius: 3px 3px 0 0;
}
.wp-block-quote.is-style-wypustki::before { left: 22px; }
.wp-block-quote.is-style-wypustki::after { left: 64px; }
.wp-block-quote.is-style-wypustki cite::before {
	content: "—— ";
	color: var(--wp--preset--color--primary);
	letter-spacing: -0.1em;
}

/* ==== 7. Karty ==== */
.is-style-karta {
	background: var(--wp--preset--color--card);
	border: 1.5px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--md, 6px);
}
.is-style-karta-cien {
	background: var(--wp--preset--color--card);
	border: 1.5px solid var(--wp--preset--color--contrast);
	border-radius: var(--wp--custom--radius--md, 6px);
	box-shadow: var(--wp--custom--shadow--karta, 4px 4px 0 rgba(27, 36, 49, 0.14));
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.is-style-karta-cien:hover {
	transform: translate(-2px, -2px);
	box-shadow: var(--wp--custom--shadow--karta-mocna, 6px 6px 0 rgba(27, 36, 49, 0.16));
}

/* ==== 8. Plansza: siatka plusików (tło hero) ==== */
.sklad-plansza {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath d='M24 20v8M20 24h8' stroke='%23D9DCE3' stroke-width='1.3'/%3E%3C/svg%3E");
	background-size: 48px 48px;
}
.has-inverse-background-color.sklad-plansza {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath d='M24 20v8M20 24h8' stroke='%2326313F' stroke-width='1.3'/%3E%3C/svg%3E");
}

/* Karta „upuść tutaj" — przerywany obrys */
.sklad-upusc {
	border: 1.5px dashed var(--wp--preset--color--primary) !important;
	background: color-mix(in srgb, var(--wp--preset--color--primary) 5%, transparent) !important;
	box-shadow: none !important;
}

/* ==== 9. Formularze ==== */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
textarea,
.wp-block-search__input {
	background: var(--wp--preset--color--card);
	color: var(--wp--preset--color--contrast);
	border: 1.5px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--xs, 2px);
	padding: 0.6em 0.8em;
	font: inherit;
}
input:focus,
textarea:focus,
.wp-block-search__input:focus {
	border-color: var(--wp--preset--color--primary);
	outline: none;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--wp--preset--color--primary) 18%, transparent);
}
.wp-block-search__button {
	margin-left: 8px;
}

/* ==== 10. Akordeon (details) ==== */
.wp-block-details {
	background: var(--wp--preset--color--card);
}
.wp-block-details summary {
	cursor: pointer;
	font-weight: 600;
	font-family: var(--wp--preset--font-family--heading);
	list-style: none;
	position: relative;
	padding-right: 2rem;
}
.wp-block-details summary::-webkit-details-marker { display: none; }
.wp-block-details summary::after {
	content: "+";
	position: absolute;
	right: 0.25rem;
	top: 50%;
	transform: translateY(-50%);
	font-family: var(--wp--preset--font-family--mono);
	font-size: 1.2em;
	font-weight: 400;
	color: var(--wp--preset--color--primary);
}
.wp-block-details[open] summary::after {
	content: "−";
}
.wp-block-details[open] summary {
	margin-bottom: 0.75rem;
}

/* ==== 11. Treść wpisów (poradniki, także stare wpisy z edytora klasycznego) ==== */
.wp-block-post-content img {
	border: 1.5px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--md, 6px);
	height: auto;
	max-width: 100%;
}
.wp-block-post-content pre {
	background: var(--wp--preset--color--inverse);
	color: var(--wp--preset--color--on-inverse);
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--small);
	padding: var(--wp--preset--spacing--40);
	border-radius: var(--wp--custom--radius--xs, 2px);
	overflow-x: auto;
	white-space: pre-wrap;
	word-break: break-word;
}
.wp-block-post-content h2 {
	margin-top: 2.2rem;
	scroll-margin-top: 5rem;
}
.wp-block-post-content a {
	text-underline-offset: 0.15em;
}

/* ==== 12. Nawigacja ==== */
.wp-block-navigation .current-menu-item > a {
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--primary);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.35em;
}

/* Paginacja: bieżąca strona w „kafelku" */
.wp-block-query-pagination-numbers .page-numbers.current {
	font-family: var(--wp--preset--font-family--mono);
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	padding: 0.15em 0.55em;
	border-radius: var(--wp--custom--radius--xs, 2px);
}

/* ==== 13. Dostępność ==== */
:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 2px;
}
.has-inverse-background-color :focus-visible {
	outline-color: var(--wp--preset--color--accent);
}

@media (prefers-reduced-motion: reduce) {
	.wp-element-button,
	.wp-block-button__link,
	.is-style-karta-cien {
		transition: none;
	}
	.wp-element-button:hover,
	.wp-block-button__link:hover,
	.is-style-karta-cien:hover {
		transform: none;
	}
}

/* ==== 14. Typografia drobna ==== */
h1, h2, h3 {
	text-wrap: balance;
}

/* ==== 14a. Układ: bez pasa tła między sekcjami a stopką/nagłówkiem ==== */
.wp-site-blocks > footer.wp-block-template-part,
.wp-site-blocks > main {
	margin-block-start: 0;
}

/* ==== 14b. Klasa pomocnicza dla ukrytych nagłówków (dostępność) ==== */
.screen-reader-text {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal;
}

/* ==== 14c. Pas statystyk hero: pionowe krawędzie tylko na desktopie ==== */
@media (min-width: 782px) {
	.sklad-pas-statystyk > .wp-block-column + .wp-block-column {
		border-left: 1.5px solid var(--wp--preset--color--line);
		padding-left: var(--wp--preset--spacing--60);
	}
}

/* ==== 14d. Naprzemienne rzędy: tekst pierwszy w DOM, obraz pierwszy na desktopie ==== */
@media (min-width: 782px) {
	.sklad-rzad-odwrocony {
		flex-direction: row-reverse;
	}
}

/* ==== 14e. Przyciski dosunięte w prawo wracają do lewej po złożeniu kolumn ==== */
@media (max-width: 781px) {
	.wp-block-column .wp-block-buttons.is-content-justification-right {
		justify-content: flex-start;
	}
}

/* Tabele: bez łamania wyrazów w środku */
.wp-block-table td,
.wp-block-table th {
	word-break: normal;
	overflow-wrap: normal;
}

/* ==== 15. Drobiazgi ==== */
::selection {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--on-accent);
}
.wp-block-image figcaption {
	text-align: center;
}
.wp-block-table td,
.wp-block-table th {
	border: 1px solid var(--wp--preset--color--line);
	padding: 0.5em 0.8em;
}
.wp-block-table thead th {
	background: var(--wp--preset--color--tint);
	font-family: var(--wp--preset--font-family--heading);
}
.wp-block-table code {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.95em;
	background: none;
	padding: 0;
}
