/* ==================================================
   Kolorowanki — pojedyncza kolorowanka
   Plik: assets/css/kolorowanki/kolorowanki-single.css
================================================== */


/* ==================================================
   Główny układ pojedynczej kolorowanki

   WAŻNE:
   Nie ustawiamy tutaj padding-top ani column-gap
   dla zewnętrznego układu strony.
   Lewa kolumna | środek | prawa kolumna biorą ustawienia
   ze wspólnego pliku dzialy-layout.css.
================================================== */

.single-kolorowanka-layout {
	align-items: start;
}

.single-kolorowanka-content {
	width: 100%;
	max-width: 100%;
	min-width: 0;
}


/* ==================================================
   Wnętrze środkowej kolumny
   Tytuł + belka social + obrazek + boczne akcje + opis
================================================== */

.single-kolorowanka {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 124px;
	column-gap: 16px;
	row-gap: 0;
	align-items: start;

	width: 100%;
	max-width: 100%;
	min-width: 0;

	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

.single-kolorowanka-title {
	grid-column: 1 / -1;
	grid-row: 1;

	margin: 0 0 18px;
	padding: 0;

	color: var(--wcmw-text);
	font-size: clamp(1.55rem, 2vw, 2rem);
	line-height: 1.2;
	font-weight: 700;
	letter-spacing: 0;
	text-align: left;
}


/* ==================================================
   Belka "Zapisz i udostępnij"

   Ten plik ustawia tylko pozycję belki w single kolorowanki.
   Wygląd małych przycisków jest w:
   assets/css/components/single-social-actions.css
================================================== */

.single-kolorowanka > .wcmw-single-social-actions {
	grid-column: 1 / -1;
	grid-row: 2;

	justify-self: start;
	align-self: start;

	width: auto;
	max-width: 100%;

	margin: 0;
	padding: 0;
}


/* ==================================================
   Karta obrazka
   Obsługuje oba warianty HTML:
   1. obrazek w .single-kolorowanka-card
   2. obrazek jako bezpośredni figure
================================================== */

.single-kolorowanka-card,
.single-kolorowanka > .single-kolorowanka-image {
	grid-column: 1;
	grid-row: 3;

	display: flex;
	align-items: center;
	justify-content: center;

	width: 100%;
	max-width: 100%;
	min-width: 0;

	aspect-ratio: 1 / 1;

	margin: 0;
	padding: 14px;
	box-sizing: border-box;

	background: rgba(255, 255, 255, 0.94);
	border: 1px solid var(--wcmw-border-light);
	border-radius: 24px;
	box-shadow: var(--wcmw-shadow);

	overflow: hidden;
	line-height: 0;
}

.single-kolorowanka-card .single-kolorowanka-image {
	display: flex;
	align-items: center;
	justify-content: center;

	width: 100%;
	height: 100%;
	max-width: 100%;
	max-height: 100%;

	aspect-ratio: auto;

	margin: 0;
	padding: 0;

	background: #ffffff;
	border: 0;
	border-radius: 18px;
	box-shadow: none;

	overflow: hidden;
	line-height: 0;
}

.single-kolorowanka-image img {
	display: block;

	width: 100%;
	height: 100%;
	max-width: 100%;
	max-height: 100%;

	margin: 0 auto;

	background: #ffffff;
	border-radius: 16px;

	object-fit: contain;
	object-position: center;
}

.single-kolorowanka-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;

	width: 100%;
	height: 100%;
	aspect-ratio: 1 / 1;

	border-radius: 18px;
	background:
		linear-gradient(
			135deg,
			rgba(223, 243, 220, 0.75),
			rgba(255, 242, 189, 0.75)
		);

	font-size: 64px;
	line-height: 1;
}


/* ==================================================
   Przyciski po prawej stronie obrazka na dużym ekranie
================================================== */

.kolorowanka-bottom-actions,
.single-kolorowanka-actions {
	grid-column: 2;
	grid-row: 3;

	display: flex;
	flex-direction: column;
	flex-wrap: nowrap;
	align-items: stretch;
	justify-content: center;

	gap: 10px;

	width: 100%;
	max-width: 100%;
	min-width: 0;

	height: 100%;
	align-self: stretch;

	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

.kolorowanka-action-btn,
.kolorowanka-bottom-actions .wp-block-button__link,
.kolorowanka-bottom-actions a,
.single-kolorowanka-actions .wp-block-button__link,
.single-kolorowanka-actions a {
	display: inline-flex;
	align-items: center;
	justify-content: center;

	width: 100%;
	min-height: 40px;

	padding: 9px 12px;
	box-sizing: border-box;

	border: 1px solid rgba(45, 39, 51, 0.10);
	border-radius: 999px;

	background:
		linear-gradient(
			135deg,
			rgba(255, 255, 255, 0.96),
			rgba(250, 247, 240, 0.92)
		);

	color: var(--wcmw-text);

	box-shadow: 0 9px 22px rgba(58, 45, 84, 0.10);

	font-size: 0.84rem;
	line-height: 1.15;
	font-weight: 800;
	text-align: center;
	text-decoration: none;
	white-space: nowrap;

	cursor: pointer;

	transition:
		transform 0.18s ease,
		box-shadow 0.18s ease,
		background-color 0.18s ease,
		border-color 0.18s ease;
}

.kolorowanka-action-btn:hover,
.kolorowanka-action-btn:focus,
.kolorowanka-bottom-actions .wp-block-button__link:hover,
.kolorowanka-bottom-actions .wp-block-button__link:focus,
.kolorowanka-bottom-actions a:hover,
.kolorowanka-bottom-actions a:focus,
.single-kolorowanka-actions .wp-block-button__link:hover,
.single-kolorowanka-actions .wp-block-button__link:focus,
.single-kolorowanka-actions a:hover,
.single-kolorowanka-actions a:focus {
	transform: translateY(-2px);
	background: var(--wcmw-yellow-soft);
	border-color: rgba(45, 39, 51, 0.14);
	box-shadow: var(--wcmw-shadow-hover);
	color: var(--wcmw-text);
	text-decoration: none;
}

.kolorowanka-pdf-btn,
.kolorowanka-print-btn {
	background:
		linear-gradient(
			135deg,
			rgba(223, 243, 220, 0.98),
			rgba(255, 242, 189, 0.94)
		);
}


/* ==================================================
   Opis pod kolorowanką
================================================== */

.single-kolorowanka-description {
	grid-column: 1 / -1;
	grid-row: 4;

	width: 100%;
	max-width: 100%;

	margin: 8px 0 0;
	padding: 18px;
	box-sizing: border-box;

	background: var(--wcmw-card);
	border: 1px solid var(--wcmw-border-light);
	border-radius: 22px;
	box-shadow: var(--wcmw-shadow);

	color: var(--wcmw-text);
	font-size: 1rem;
	line-height: 1.65;
}

.single-kolorowanka-description > *:first-child {
	margin-top: 0;
}

.single-kolorowanka-description > *:last-child {
	margin-bottom: 0;
}


/* ==================================================
   Sidebar — aktywne elementy
================================================== */

.kolorowanki-sidebar .sidebar-list .is-active > a,
.kolorowanki-sidebar .sidebar-list .current-cat > a,
.kolorowanki-sidebar .kolorowanki-sidebar-list .is-active > a,
.kolorowanki-sidebar .kolorowanki-sidebar-list .current-cat > a {
	background: var(--wcmw-active-gradient-warm);
	font-weight: 900;
}


/* ==================================================
   Prawa kolumna — polecane
================================================== */

.single-kolorowanka-ads .promo-title {
	margin-top: 0;
}


/* ==================================================
   Tablet
   Przyciski spadają pod obrazek
================================================== */

@media (max-width: 980px) {
	.single-kolorowanka {
		grid-template-columns: 1fr;
		column-gap: 0;
		row-gap: 0;
		max-width: 680px;
	}

	.single-kolorowanka-title {
		grid-column: 1;
		grid-row: auto;

		margin: 0 0 14px;
		font-size: clamp(1.5rem, 3vw, 1.9rem);
		line-height: 1.2;
	}

	.single-kolorowanka > .wcmw-single-social-actions {
		grid-column: 1;
		grid-row: auto;

		width: auto;
		max-width: 100%;

		margin: 0;
		padding: 0;
	}

	.single-kolorowanka-card,
	.single-kolorowanka > .single-kolorowanka-image {
		grid-column: 1;
		grid-row: auto;

		padding: 12px;
		border-radius: 22px;
	}

	.single-kolorowanka-card .single-kolorowanka-image {
		border-radius: 16px;
	}

	.single-kolorowanka-image img {
		border-radius: 12px;
	}

	.kolorowanka-bottom-actions,
	.single-kolorowanka-actions {
		grid-column: 1;
		grid-row: auto;

		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;

		width: 100%;
		margin: 12px 0 0;
	}

	.kolorowanka-action-btn,
	.kolorowanka-bottom-actions .wp-block-button__link,
	.kolorowanka-bottom-actions a,
	.single-kolorowanka-actions .wp-block-button__link,
	.single-kolorowanka-actions a {
		width: 100%;
		min-height: 38px;
		padding: 8px 10px;
		font-size: 0.82rem;
		white-space: normal;
	}

	.single-kolorowanka-description {
		grid-column: 1;
		grid-row: auto;
	}
}


/* ==================================================
   Mobile
================================================== */

@media (max-width: 620px) {
	.single-kolorowanka {
		max-width: 100%;
	}

	.single-kolorowanka-title {
		margin: 0 0 12px;
		font-size: 1.55rem;
		line-height: 1.2;
	}

	.single-kolorowanka > .wcmw-single-social-actions {
		margin: 0;
		padding: 0;
	}

	.single-kolorowanka-card,
	.single-kolorowanka > .single-kolorowanka-image {
		padding: 10px;
		border-radius: 20px;
	}

	.kolorowanka-bottom-actions,
	.single-kolorowanka-actions {
		gap: 8px;
		margin-top: 10px;
	}

	.kolorowanka-action-btn,
	.kolorowanka-bottom-actions .wp-block-button__link,
	.kolorowanka-bottom-actions a,
	.single-kolorowanka-actions .wp-block-button__link,
	.single-kolorowanka-actions a {
		min-height: 36px;
		padding: 8px 9px;
		font-size: 0.78rem;
	}

	.single-kolorowanka-description {
		margin-top: 6px;
		padding: 16px;
		font-size: 0.96rem;
		line-height: 1.58;
	}
}


/* ==================================================
   Bardzo wąsko:
   przyciski jeden pod drugim
================================================== */

@media (max-width: 430px) {
	.kolorowanka-bottom-actions,
	.single-kolorowanka-actions {
		grid-template-columns: 1fr;
	}

	.kolorowanka-action-btn,
	.kolorowanka-bottom-actions .wp-block-button__link,
	.kolorowanka-bottom-actions a,
	.single-kolorowanka-actions .wp-block-button__link,
	.single-kolorowanka-actions a {
		width: 100%;
		min-height: 36px;
		white-space: normal;
	}
}


/* ==================================================
   Druk
================================================== */

@media print {
	.wcmw-topbar,
	.site-header,
	.dzial-sidebar,
	.dzial-ads,
	.wcmw-single-social-actions,
	.kolorowanka-bottom-actions,
	.single-kolorowanka-actions,
	.single-kolorowanka-description,
	.wcmw-footer,
	#wpadminbar {
		display: none !important;
	}

	html,
	body {
		margin: 0 !important;
		padding: 0 !important;
		background: #ffffff !important;
	}

	.site,
	.site-content,
	.site-main,
	.dzial-layout,
	.dzial-content,
	.single-kolorowanka-content,
	.single-kolorowanka,
	.single-kolorowanka-card,
	.single-kolorowanka-image {
		display: block !important;

		width: 100% !important;
		max-width: 100% !important;
		height: auto !important;

		aspect-ratio: auto !important;

		margin: 0 !important;
		padding: 0 !important;

		background: #ffffff !important;
		border: 0 !important;
		border-radius: 0 !important;
		box-shadow: none !important;

		overflow: visible !important;
	}

	.single-kolorowanka-title {
		display: none !important;
	}

	.single-kolorowanka-image img {
		display: block !important;

		width: 100% !important;
		height: auto !important;
		max-width: 100% !important;
		max-height: none !important;

		margin: 0 auto !important;

		border-radius: 0 !important;
		object-fit: contain !important;
	}
}
