/* Agmer - wygląd strony wpisu (tylko pojedynczy wpis). */

/* H1 w nagłówku wpisu: 32-48 px zamiast 36-56 px (preset 5xl zostaje bez zmian dla innych elementów). */
body.single-post h1.wp-block-post-title {
	font-size: clamp(2rem, 1.6rem + 1.8vw, 3rem) !important;
	line-height: 1.12;
}

/* Spis treści: bieżąca sekcja (klasę agmer-toc-current nadaje assets/toc.js). */
.agmer-toc__list a {
	transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

/* Wyłączamy słabo widoczne zaznaczenie ze skryptu motywu, żeby nie dublowało naszego. */
.agmer-toc--spy .agmer-toc__list a.is-active:not(:hover):not(:focus-visible) {
	background: transparent;
}

.agmer-toc__list a.agmer-toc-current,
.agmer-toc--spy .agmer-toc__list a.agmer-toc-current.is-active {
	background: var(--color-accent-100, #FFE8D9);
	box-shadow: inset 3px 0 0 var(--wp--preset--color--accent-600, #FF5E1E);
	color: var(--wp--preset--color--primary-800, #0A1837);
}

/* Boks CTA w treści (agmer-artykul-cta) i baner „Gotowy, żeby skupić się…” w treści wpisu:
 * nagłówek 22-34 px zamiast 36-56 px (pytania w boksach zajmowały 3 linie na komputerze i 4-5 na telefonie). */
body.single-post .wp-block-post-content .agmer-artykul-cta h3.wp-block-heading,
body.single-post .wp-block-post-content > .wp-block-group.alignfull h2.has-5-xl-font-size {
	font-size: clamp(1.375rem, 1.1rem + 1.1vw, 2.125rem) !important;
	line-height: 1.15 !important;
}

/* Spis treści: przycisk rozwijania (tylko na telefonie i tablecie, tworzy go assets/toc.js). */
.agmer-toc__toggle {
	display: none;
}

@media (max-width: 61.9375em) {
	/* Mniejszy odstęp między okruszkami a kategorią i datą (było 80 px, jest 40 px)
	 * oraz między nagłówkiem wpisu (autor, zdjęcie) a początkiem treści. */
	body.single-post .agmer-article-hero {
		padding-top: 1.5rem !important;
		padding-bottom: 2.5rem !important;
	}

	body.single-post .agmer-article-hero + .wp-block-group {
		margin-block-start: 0 !important;
		padding-top: 2rem !important;
	}

	/* Spis treści nad treścią wpisu; formularz kontaktowy i udostępnianie zostają pod treścią. */
	body.single-post .agmer-article-sidebar {
		display: contents;
	}

	body.single-post .agmer-article-sidebar > * {
		order: 2;
	}

	body.single-post .agmer-article-sidebar > .agmer-toc {
		order: 0;
	}

	body.single-post .agmer-article-content {
		order: 1;
	}

	/* Spis treści zwinięty do jednego wiersza, rozwijany kliknięciem. */
	.agmer-toc.has-toggle {
		align-self: stretch;
		box-sizing: border-box;
		width: 100%;
		padding: 0 1rem;
		background: var(--wp--preset--color--base-white, #fff);
		border: 1px solid var(--wp--preset--color--neutral-200, #E3E1DB);
		border-radius: var(--radius-card, 10px);
		box-shadow: var(--shadow-card, 0 4px 20px 0 rgba(10, 24, 55, 0.06));
	}

	.agmer-toc.has-toggle .agmer-toc__title {
		display: none;
	}

	.agmer-toc.has-toggle .agmer-toc__toggle {
		display: flex;
		justify-content: space-between;
		align-items: center;
		gap: 1rem;
		width: 100%;
		margin: 0;
		padding: 0.875rem 0;
		background: none;
		border: 0;
		font-family: var(--wp--preset--font-family--display, "Space Grotesk", sans-serif);
		font-size: 1.125rem;
		font-weight: 500;
		line-height: 1.3;
		text-align: left;
		color: var(--wp--preset--color--primary-800, #0A1837);
		cursor: pointer;
	}

	.agmer-toc.has-toggle .agmer-toc__toggle::after {
		content: "";
		flex: 0 0 2rem;
		height: 2rem;
		border-radius: 0.5rem;
		background: var(--color-accent-100, #FFE8D9) center / 1.5rem 1.5rem no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9L12 15L18 9' stroke='%23FF5E1E' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	}

	.agmer-toc.has-toggle.is-open .agmer-toc__toggle::after {
		background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M18 15L12 9L6 15' stroke='%23FF5E1E' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	}

	.agmer-toc.has-toggle .agmer-toc__toggle:focus-visible {
		outline: 2px solid var(--wp--preset--color--accent-600, #FF5E1E);
		outline-offset: 2px;
		border-radius: 4px;
	}

	.agmer-toc.has-toggle:not(.is-open) .agmer-toc__list {
		display: none;
	}

	.agmer-toc.has-toggle .agmer-toc__list {
		padding-bottom: 0.75rem;
	}
}
