/*
 * HempGold Wiedza – content components (block patterns "HempGold"). Class names are fixed by the
 * HempGold Wiedza contract. Variables come from hgw-blog.css (:root). The block editor uses a copy of
 * this file scoped to .editor-styles-wrapper (hgw-edytor.css, generated by tools/edytor-css.js).
 */

/* Krótka odpowiedź */
.hgw-odpowiedz {
	margin: 32px 0;
	padding: 24px;
	background: var(--hgw-krem);
	border-left: 3px solid var(--hgw-zloto);
	border-radius: 0;
}
.hgw-odpowiedz > * {
	margin-top: 0;
	margin-bottom: 8px;
}
.hgw-odpowiedz > :last-child {
	margin-bottom: 0;
}
.hgw-odpowiedz p {
	font-size: 1.05em;
	line-height: 1.6;
}
p.hgw-odpowiedz__etykieta {
	margin-bottom: 8px;
	font-family: var(--hgw-font-etykiety);
	font-weight: 600;
	font-size: 14px;
	line-height: 1.3;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--hgw-zloto-tekst);
}

/* Ujawnienie interesu */
p.hgw-ujawnienie {
	padding-left: 16px;
	border-left: 1px solid var(--hgw-ramka-pola);
	font-size: 15px;
	line-height: 1.5;
	color: var(--hgw-szary);
}

/* Ramka informacyjna i „Zapytaj lekarza” */
aside.hgw-ramka {
	margin: 32px 0;
	padding: 24px;
	background: var(--hgw-krem);
	border: 1px solid var(--hgw-bez);
	border-radius: 4px;
	font-size: 0.95em;
	line-height: 1.65;
}
aside.hgw-ramka > * {
	margin-top: 0;
	margin-bottom: 8px;
}
aside.hgw-ramka > :last-child {
	margin-bottom: 0;
}
aside.hgw-ramka.hgw-ramka--lekarz {
	position: relative;
	padding-left: 72px;
	background: var(--hgw-bialy);
	border-top: 3px solid var(--hgw-zielen);
	border-radius: 0;
}
aside.hgw-ramka.hgw-ramka--lekarz::before,
aside.hgw-ramka.hgw-ramka--lekarz::after {
	content: "";
	position: absolute;
	background: var(--hgw-zielen);
}
aside.hgw-ramka.hgw-ramka--lekarz::before {
	left: 24px;
	top: 32px;
	width: 24px;
	height: 6px;
}
aside.hgw-ramka.hgw-ramka--lekarz::after {
	left: 33px;
	top: 23px;
	width: 6px;
	height: 24px;
}

/* Szeroki obraz */
figure.hgw-szeroki {
	margin: 48px 0;
}
figure.hgw-szeroki img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 4px;
}
figure.hgw-szeroki figcaption {
	margin-top: 8px;
	font-size: 14px;
	line-height: 1.5;
	color: var(--hgw-szary);
}

/* Kroki: karty z dużymi numerami */
ol.hgw-kroki {
	display: grid;
	gap: 16px;
	margin: 32px 0;
	padding: 0;
	list-style: none;
	counter-reset: hgw-krok;
}
ol.hgw-kroki > li {
	position: relative;
	margin: 0;
	padding: 20px 20px 20px 76px;
	min-height: 88px;
	background: var(--hgw-krem);
	border: 1px solid var(--hgw-bez);
	border-radius: 4px;
	counter-increment: hgw-krok;
	line-height: 1.6;
}
ol.hgw-kroki > li::before {
	content: counter(hgw-krok);
	position: absolute;
	left: 20px;
	top: 14px;
	width: 40px;
	font-family: var(--hgw-font-naglowki);
	font-weight: 500;
	font-size: 44px;
	line-height: 1;
	text-align: center;
	font-variant-numeric: lining-nums;
	color: var(--hgw-zloto-tekst);
}
ol.hgw-kroki > li::marker {
	content: none;
}
ol.hgw-kroki > li > strong:first-child {
	display: block;
	margin-bottom: 4px;
	font-size: 1.05em;
	line-height: 1.35;
	color: var(--hgw-tekst);
}
@media (min-width: 768px) {
	ol.hgw-kroki > li {
		padding: 24px 24px 24px 96px;
	}
	ol.hgw-kroki > li::before {
		left: 24px;
		top: 16px;
		width: 48px;
		font-size: 56px;
	}
}

/* Lista kontrolna */
ul.hgw-lista-kontrolna {
	margin: 24px 0;
	padding: 0;
	list-style: none;
}
ul.hgw-lista-kontrolna > li {
	position: relative;
	margin: 0 0 12px;
	padding-left: 40px;
	line-height: 1.6;
}
ul.hgw-lista-kontrolna > li::marker {
	content: none;
}
ul.hgw-lista-kontrolna > li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.15em;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--hgw-zielen);
}
ul.hgw-lista-kontrolna > li::after {
	content: "";
	position: absolute;
	left: 9px;
	top: calc(0.15em + 5px);
	width: 6px;
	height: 11px;
	border: solid var(--hgw-bialy);
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

/* Skala łagodne ↔ wyraziste: oś z kropkami w 6 pozycjach (data-poziom) */
.hgw-skala {
	display: grid;
	grid-template-columns: 1fr 1fr;
	grid-template-areas: "lewa prawa" "os os";
	gap: 8px 16px;
	margin: 40px 0;
	padding: 24px;
	background: var(--hgw-krem);
	border-radius: 4px;
}
.hgw-skala__lewa,
.hgw-skala__prawa {
	font-family: var(--hgw-font-etykiety);
	font-weight: 600;
	font-size: 13px;
	line-height: 1.3;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--hgw-szary);
}
.hgw-skala__lewa {
	grid-area: lewa;
}
.hgw-skala__prawa {
	grid-area: prawa;
	justify-self: end;
	color: var(--hgw-tekst);
}
.hgw-skala__os {
	grid-area: os;
	position: relative;
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	grid-auto-flow: row dense;
	gap: 4px 8px;
	padding-top: 32px;
}
.hgw-skala__os::before {
	content: "";
	position: absolute;
	top: 9px;
	left: calc(100% / 12);
	right: calc(100% / 12);
	height: 3px;
	border-radius: 2px;
	background: linear-gradient(90deg, #E2D3A4, var(--hgw-zloto-tekst));
	transform-origin: 0 50%;
}
.hgw-skala__punkt {
	--hgw-p: 1;
	--hgw-kolor: #EADFBC;
	grid-column: var(--hgw-p);
	display: flex;
	align-items: flex-start;
	justify-content: center;
	min-height: 44px;
	padding-top: 4px;
	font-size: 15px;
	line-height: 1.3;
	text-align: center;
	color: var(--hgw-tekst);
	overflow-wrap: anywhere;
}
.hgw-skala__punkt::before {
	content: "";
	position: absolute;
	top: 2px;
	left: calc((var(--hgw-p) - 0.5) * (100% / 6) - 8px);
	width: 16px;
	height: 16px;
	border: 2px solid var(--hgw-zloto-tekst);
	border-radius: 50%;
	background: var(--hgw-kolor);
	box-shadow: 0 0 0 3px var(--hgw-krem);
}
.hgw-skala__punkt[data-poziom="1"] { --hgw-p: 1; --hgw-kolor: #F3EBD2; }
.hgw-skala__punkt[data-poziom="2"] { --hgw-p: 2; --hgw-kolor: #E5D49F; }
.hgw-skala__punkt[data-poziom="3"] { --hgw-p: 3; --hgw-kolor: #D2B866; }
.hgw-skala__punkt[data-poziom="4"] { --hgw-p: 4; --hgw-kolor: #B8973A; }
.hgw-skala__punkt[data-poziom="5"] { --hgw-p: 5; --hgw-kolor: #886F2B; }
.hgw-skala__punkt[data-poziom="6"] { --hgw-p: 6; --hgw-kolor: #5A4A1D; }
a.hgw-skala__punkt {
	color: var(--hgw-tekst);
	text-decoration: underline;
	text-decoration-color: var(--hgw-zloto);
	text-underline-offset: 0.2em;
}
a.hgw-skala__punkt:hover {
	color: var(--hgw-zloto-tekst);
}
@media (max-width: 639.98px) {
	.hgw-skala {
		grid-template-columns: 1fr;
		grid-template-areas: "lewa" "os" "prawa";
		padding: 20px;
	}
	.hgw-skala__prawa {
		justify-self: start;
	}
	.hgw-skala__lewa,
	.hgw-skala__prawa {
		padding-left: 32px;
	}
	.hgw-skala__os {
		display: flex;
		flex-direction: column;
		gap: 0;
		padding: 4px 0;
	}
	.hgw-skala__os::before {
		top: 0;
		bottom: 0;
		left: 7px;
		right: auto;
		width: 3px;
		height: auto;
		background: linear-gradient(180deg, #E2D3A4, var(--hgw-zloto-tekst));
		transform-origin: 50% 0;
	}
	.hgw-skala__punkt {
		position: relative;
		justify-content: flex-start;
		align-items: center;
		padding: 0 0 0 32px;
		text-align: left;
	}
	.hgw-skala__punkt::before {
		top: calc(50% - 8px);
		left: 0;
	}
}

/* Schemat procesu: połączone etapy (pionowo na telefonie, poziomo od 768px) */
ol.hgw-proces {
	display: grid;
	margin: 40px 0;
	padding: 0;
	list-style: none;
	counter-reset: hgw-etap;
}
ol.hgw-proces > li {
	position: relative;
	margin: 0;
	padding: 0 0 24px 64px;
	counter-increment: hgw-etap;
	line-height: 1.55;
}
ol.hgw-proces > li::marker {
	content: none;
}
ol.hgw-proces > li::before {
	content: counter(hgw-etap);
	position: absolute;
	z-index: 1;
	left: 0;
	top: 0;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 1px solid var(--hgw-zloto);
	border-radius: 50%;
	background: var(--hgw-bialy);
	font-family: var(--hgw-font-naglowki);
	font-weight: 500;
	font-size: 24px;
	line-height: 1;
	font-variant-numeric: lining-nums;
	color: var(--hgw-zloto-tekst);
}
ol.hgw-proces > li::after {
	content: "";
	position: absolute;
	left: 21px;
	top: 44px;
	bottom: 0;
	width: 2px;
	background: var(--hgw-bez);
	transform-origin: 50% 0;
}
ol.hgw-proces > li:last-child {
	padding-bottom: 0;
}
ol.hgw-proces > li:last-child::after {
	display: none;
}
ol.hgw-proces > li > strong:first-child {
	display: block;
	padding-top: 10px;
	margin-bottom: 4px;
	font-family: var(--hgw-font-etykiety);
	font-weight: 600;
	font-size: 14px;
	line-height: 1.3;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--hgw-tekst);
}
@media (min-width: 768px) {
	ol.hgw-proces {
		grid-auto-flow: column;
		grid-auto-columns: minmax(0, 1fr);
	}
	ol.hgw-proces > li {
		padding: 60px 24px 0 0;
		font-size: 0.9em;
	}
	ol.hgw-proces > li::after {
		left: 44px;
		right: 0;
		top: 21px;
		bottom: auto;
		width: auto;
		height: 2px;
		transform-origin: 0 50%;
	}
	ol.hgw-proces > li > strong:first-child {
		padding-top: 0;
	}
}

/* Tabela porównawcza (karty na telefonie z data-label) */
figure.hgw-porownanie {
	margin: 40px 0;
	overflow-x: visible;
}
figure.hgw-porownanie table {
	width: 100%;
	border-collapse: collapse;
	border-spacing: 0;
	margin: 0;
	font-size: 16px;
	line-height: 1.5;
	background: var(--hgw-bialy);
}
figure.hgw-porownanie table tr > th,
figure.hgw-porownanie table tbody tr > td {
	padding: 12px 16px;
	border: 0;
	border-bottom: 1px solid var(--hgw-bez);
	text-align: left;
	vertical-align: top;
	background: transparent;
}
figure.hgw-porownanie thead th {
	background: var(--hgw-krem);
	border-bottom: 1px solid var(--hgw-zloto);
	font-family: var(--hgw-font-etykiety);
	font-weight: 600;
	font-size: 13px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--hgw-tekst);
}
figure.hgw-porownanie tbody td:first-child,
figure.hgw-porownanie tbody th {
	font-weight: 700;
}
figure.hgw-porownanie figcaption {
	margin-top: 8px;
	font-size: 14px;
	color: var(--hgw-szary);
}
@media (max-width: 639.98px) {
	figure.hgw-porownanie table,
	figure.hgw-porownanie tbody,
	figure.hgw-porownanie tr,
	figure.hgw-porownanie td {
		display: block;
		width: 100%;
	}
	figure.hgw-porownanie table {
		background: transparent;
	}
	figure.hgw-porownanie thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		clip-path: inset(50%);
		white-space: nowrap;
	}
	figure.hgw-porownanie tr {
		margin: 0 0 16px;
		padding: 16px;
		background: var(--hgw-bialy);
		border: 1px solid var(--hgw-bez);
		border-top: 2px solid var(--hgw-zloto);
		border-radius: 0 0 4px 4px;
	}
	figure.hgw-porownanie table tbody tr > td {
		display: grid;
		grid-template-columns: minmax(0, 40%) minmax(0, 1fr);
		gap: 12px;
		padding: 8px 0;
		border-bottom: 1px solid var(--hgw-bez);
	}
	figure.hgw-porownanie table tbody tr > td:last-child {
		border-bottom: 0;
	}
	figure.hgw-porownanie td::before {
		content: attr(data-label);
		font-family: var(--hgw-font-etykiety);
		font-weight: 600;
		font-size: 12px;
		line-height: 1.5;
		letter-spacing: 0.06em;
		text-transform: uppercase;
		color: var(--hgw-szary);
	}
	figure.hgw-porownanie table tbody tr > td:first-child {
		display: block;
		padding-top: 0;
		font-family: var(--hgw-font-naglowki);
		font-weight: 500;
		font-size: 22px;
		line-height: 1.2;
	}
	figure.hgw-porownanie tbody td:first-child::before {
		display: none;
	}
}

/* Produkt w treści (karta Vendofy) */
.hgw-produkt-w-tresci {
	max-width: 560px;
	margin: 32px 0;
}
.hgw-produkt-w-tresci:not(:has(*)) {
	display: none;
}

/* Kluczowy fakt */
.hgw-fakt {
	position: relative;
	margin: 48px 0;
	padding: 24px 0 0;
}
.hgw-fakt::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 64px;
	height: 2px;
	background: var(--hgw-zloto);
	transform-origin: 0 50%;
}
.hgw-fakt > * {
	margin: 0;
}
.hgw-fakt p {
	font-family: var(--hgw-font-naglowki);
	font-weight: 500;
	font-size: 28px;
	line-height: 1.25;
	color: var(--hgw-naglowek);
}
@media (min-width: 1024px) {
	.hgw-fakt p {
		font-size: 34px;
	}
}

/* Reveal-on-scroll: only for elements the script marked (.hgw-reveal) under html.hgw-js,
   and only without "reduce motion". Without JS every component is visible. */
@media (prefers-reduced-motion: no-preference) {
	.hgw-js .hgw-reveal:not(.hgw-kroki):not(.hgw-proces):not(.hgw-lista-kontrolna) {
		opacity: 0;
		transform: translateY(16px);
		transition: opacity 0.6s ease, transform 0.6s ease;
	}
	.hgw-js .hgw-reveal.is-visible:not(.hgw-kroki):not(.hgw-proces):not(.hgw-lista-kontrolna) {
		opacity: 1;
		transform: none;
	}
	.hgw-js .hgw-reveal.hgw-kroki > li,
	.hgw-js .hgw-reveal.hgw-proces > li,
	.hgw-js .hgw-reveal.hgw-lista-kontrolna > li {
		opacity: 0;
		transform: translateY(12px);
		transition: opacity 0.5s ease, transform 0.5s ease;
	}
	.hgw-js .hgw-reveal.is-visible > li {
		opacity: 1;
		transform: none;
	}
	.hgw-js .hgw-reveal.is-visible > li:nth-child(2) { transition-delay: 0.1s; }
	.hgw-js .hgw-reveal.is-visible > li:nth-child(3) { transition-delay: 0.2s; }
	.hgw-js .hgw-reveal.is-visible > li:nth-child(4) { transition-delay: 0.3s; }
	.hgw-js .hgw-reveal.is-visible > li:nth-child(5) { transition-delay: 0.4s; }
	.hgw-js .hgw-reveal.is-visible > li:nth-child(n+6) { transition-delay: 0.5s; }
	.hgw-js .hgw-reveal.hgw-proces > li::after {
		transform: scale(0);
		transition: transform 0.5s ease 0.3s;
	}
	.hgw-js .hgw-reveal.hgw-proces.is-visible > li::after {
		transform: none;
	}
	.hgw-js .hgw-reveal.hgw-skala .hgw-skala__os::before {
		transform: scaleX(0);
		transition: transform 0.8s ease 0.2s;
	}
	.hgw-js .hgw-reveal.hgw-skala.is-visible .hgw-skala__os::before {
		transform: none;
	}
	.hgw-js .hgw-reveal.hgw-fakt::before {
		transform: scaleX(0);
		transition: transform 0.6s ease 0.2s;
	}
	.hgw-js .hgw-reveal.hgw-fakt.is-visible::before {
		transform: none;
	}
}
