/**
 * HunterExtreme - wyglad bloga (listing + pojedynczy wpis).
 *
 * Dotyczy wylacznie wpisow blogowych. Case study korzysta z szablonu Elementora
 * i nie jest objete tymi stylami.
 */

:root {
	/* Paleta HunterExtreme */
	--hx-accent: #cc0000;
	--hx-accent-dark: #a30000;
	--hx-ink: #141414;
	--hx-muted: #6b6b6b;
	--hx-muted-soft: #8a8a8a;
	--hx-border: #e7e7e7;
	--hx-surface: #ffffff;
	--hx-surface-alt: #f3f4f5;

	/* Karty */
	--hx-card-radius: 16px;
	--hx-card-shadow: 0 4px 24px rgba(0, 0, 0, .07);
	--hx-card-shadow-hover: 0 10px 34px rgba(0, 0, 0, .12);
	--hx-card-gap: 30px;
	--hx-badge-bg: var(--hx-accent);
	--hx-pill-bg: var(--hx-ink);

	/* Pojedynczy wpis */
	--hx-content-width: 1200px;
	--hx-sidebar-width: 320px;
	--hx-toc-top: 110px;
}

/* ==================================================
   1. Listing wpisow (shortcode [hunterextreme_blog])
   ================================================== */
.hx-blog {
	--hx-blog-columns: 3;
	width: 100%;
}

/* Liczba kolumn sterowana klasa (nie stylem inline) - inaczej wartosc
   z shortcode'a wygrywalaby z media queries i blokowala responsywnosc. */
.hx-blog--cols-1 { --hx-blog-columns: 1; }
.hx-blog--cols-2 { --hx-blog-columns: 2; }
.hx-blog--cols-3 { --hx-blog-columns: 3; }
.hx-blog--cols-4 { --hx-blog-columns: 4; }
.hx-blog--cols-5 { --hx-blog-columns: 5; }
.hx-blog--cols-6 { --hx-blog-columns: 6; }

.hx-blog__grid {
	display: grid;
	grid-template-columns: repeat(var(--hx-blog-columns), minmax(0, 1fr));
	gap: var(--hx-card-gap);
	align-items: stretch;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hx-card {
	display: flex;
	flex-direction: column;
	background: var(--hx-surface);
	border-radius: var(--hx-card-radius);
	box-shadow: var(--hx-card-shadow);
	padding: 16px;
	overflow: hidden;
	transition: box-shadow .25s ease, transform .25s ease;
}

.hx-card:hover,
.hx-card:focus-within {
	box-shadow: var(--hx-card-shadow-hover);
	transform: translateY(-3px);
}

/* --- Miniatura --- */
.hx-card__media {
	position: relative;
	display: block;
	border-radius: 10px;
	overflow: visible;
	margin-bottom: 34px;
}

.hx-card__thumb {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: 10px;
}

.hx-card__thumb--placeholder {
	background: var(--hx-surface-alt);
}

/* --- Data --- */
.hx-card__date {
	position: absolute;
	top: -8px;
	inset-inline-end: 12px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-width: 48px;
	padding: 7px 8px;
	border-radius: 8px;
	background: var(--hx-badge-bg);
	color: #fff;
	line-height: 1.05;
	text-align: center;
	box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
}

.hx-card__day {
	font-size: 17px;
	font-weight: 800;
}

.hx-card__month {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
}

/* --- Kategoria --- */
.hx-card__cat {
	position: absolute;
	inset-inline-start: 20px;
	bottom: 0;
	transform: translateY(50%);
	max-width: calc(100% - 40px);
	padding: 8px 14px;
	border-radius: 4px;
	background: var(--hx-pill-bg);
	color: #fff;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.3;
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

a.hx-card__cat:hover,
a.hx-card__cat:focus-visible {
	background: var(--hx-accent);
	color: #fff;
}

/* --- Tresc karty --- */
.hx-card__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	padding: 4px 6px 8px;
}

.hx-card__title {
	margin: 0 0 12px;
	font-size: 21px;
	font-weight: 700;
	line-height: 1.35;
	color: var(--hx-ink);
}

.hx-card__title a {
	color: inherit;
	text-decoration: none;
}

.hx-card__title a:hover,
.hx-card__title a:focus-visible {
	color: var(--hx-accent);
}

.hx-card__excerpt {
	margin: 0 0 20px;
	font-size: 15px;
	line-height: 1.65;
	color: var(--hx-muted);
}

.hx-card__more {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: auto;
	font-size: 15px;
	font-weight: 600;
	color: var(--hx-accent);
	text-decoration: none;
}

.hx-card__more svg {
	width: 16px;
	height: 16px;
	transition: transform .2s ease;
}

.hx-card__more:hover,
.hx-card__more:focus-visible {
	color: var(--hx-accent-dark);
}

.hx-card__more:hover svg,
.hx-card__more:focus-visible svg {
	transform: translateX(4px);
}

/* --- Paginacja --- */
.hx-blog__pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin-top: 42px;
}

.hx-blog__pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	height: 42px;
	padding: 0 12px;
	border: 1px solid var(--hx-border);
	border-radius: 6px;
	background: var(--hx-surface);
	color: var(--hx-ink);
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
}

.hx-blog__pagination .page-numbers:hover,
.hx-blog__pagination .page-numbers:focus-visible,
.hx-blog__pagination .page-numbers.current {
	border-color: var(--hx-accent);
	background: var(--hx-accent);
	color: #fff;
}

.hx-blog__empty {
	margin: 0;
	color: var(--hx-muted);
}

/* ==================================================
   2. Pojedynczy wpis blogowy
   ================================================== */
.hx-post {
	background: var(--hx-surface);
}

/* --- Naglowek (szara belka) --- */
.hx-post__hero {
	background: var(--hx-surface-alt);
	padding: 26px 0 44px;
}

.hx-post__hero-inner,
.hx-post__layout {
	max-width: var(--hx-content-width);
	margin-inline: auto;
	padding-inline: 20px;
}

/* Neutralizacja custom CSS z produkcji:
   .hx-breadcrumbs.hx-breadcrumbs--article { margin: auto auto -80px; max-width: 1100px !important }
   Ujemny margines byl hackiem pod poprzedni uklad - w nowym naglowku wciagal
   date i zajawke na okruszki. Stad !important. */
.hx-post__hero .hx-breadcrumbs {
	width: 100% !important;
	max-width: none !important;
	margin: 0 0 16px !important;
}

.hx-post__hero .hx-breadcrumbs__inner {
	max-width: none;
	padding: 0;
}

.hx-post__title {
	margin: 0;
	font-size: clamp(28px, 3.2vw, 42px);
	font-weight: 800;
	line-height: 1.18;
	color: var(--hx-ink);
}

.hx-post__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-top: 18px;
	font-size: 14px;
	color: var(--hx-muted);
}

.hx-post__meta-sep {
	color: var(--hx-muted-soft);
}

.hx-post__meta a {
	color: inherit;
	text-decoration: none;
}

.hx-post__meta a:hover {
	color: var(--hx-accent);
}

.hx-post__lead {
	max-width: 800px;
	margin: 22px 0 0;
	font-size: 17px;
	line-height: 1.7;
	color: #3f3f3f;
}

/* --- Uklad tresc + spis tresci --- */
.hx-post__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--hx-sidebar-width);
	gap: 52px;
	padding-block: 46px 64px;
	/* Bez align-items:start - kolumna boczna musi byc pelnej wysokosci,
	   inaczej position:sticky nie ma po czym "jechac". */
	align-items: stretch;
}

.hx-post__aside {
	min-width: 0;
	height: 100%;
}

.hx-post__layout--no-toc {
	grid-template-columns: minmax(0, 1fr);
}

.hx-post__content {
	min-width: 0;
}

.hx-post__figure {
	margin: 0 0 28px;
}

.hx-post__figure img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 12px;
}

.hx-post__figure figcaption {
	margin-top: 10px;
	font-size: 14px;
	color: var(--hx-muted-soft);
	text-align: center;
}

.hx-post__content h2 {
	margin: 42px 0 16px;
	font-size: clamp(22px, 2.2vw, 28px);
	font-weight: 700;
	line-height: 1.3;
	color: var(--hx-ink);
	scroll-margin-top: var(--hx-toc-top);
}

.hx-post__content h3 {
	margin: 32px 0 14px;
	font-size: 20px;
	font-weight: 700;
	color: var(--hx-ink);
	scroll-margin-top: var(--hx-toc-top);
}

.hx-post__content p {
	margin: 0 0 18px;
	line-height: 1.75;
}

.hx-post__content a:not(.elementor-button) {
	color: var(--hx-accent);
}

.hx-post__content img {
	max-width: 100%;
	height: auto;
}

/* --- Zgodnosc z trescia budowana w Elementorze ---
   Sekcje z wlaczonym "Stretch Section" dostaja od skryptu Elementora inline
   width/left liczone wzgledem <body> (np. width:1585px; left:-212px). W kolumnie
   z paskiem bocznym wychodzily poza swoja kolumne i nachodzily na spis tresci.
   Inline style nie ma !important, wiec ponizsze reguly wygrywaja - takze po
   przeliczeniu przy zmianie rozmiaru okna. */
.hx-post__content .elementor-section-stretched {
	width: 100% !important;
	left: 0 !important;
	right: auto !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

.hx-post__content .elementor-section.elementor-section-boxed > .elementor-container,
.hx-post__content .e-con > .e-con-inner {
	max-width: 100% !important;
}

.hx-post__content .elementor,
.hx-post__content .elementor-section,
.hx-post__content .e-con {
	max-width: 100%;
}

/* Po przeniesieniu tytulu do naglowka po widgecie H1 zostaje pusty kontener -
   chowamy go, zeby nie robil odstepu nad trescia. */
.hx-post__content .elementor-widget-container:empty {
	display: none;
}

.hx-post__content .elementor-widget:has(> .elementor-widget-container:empty) {
	display: none;
}

.hx-post__tags {
	margin-top: 34px;
	font-size: 14px;
	color: var(--hx-muted);
}

.hx-post__tags a {
	color: var(--hx-accent);
	text-decoration: none;
}

/* --- Spis tresci --- */
.hx-toc {
	position: sticky;
	top: var(--hx-toc-top);
	max-height: calc(100vh - var(--hx-toc-top) - 30px);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 4px 4px 4px 0;
}

.hx-toc__label {
	display: block;
	margin-bottom: 14px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .09em;
	text-transform: uppercase;
	color: var(--hx-muted-soft);
	cursor: default;
	list-style: none;
}

.hx-toc__label::-webkit-details-marker {
	display: none;
}

.hx-toc__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.hx-toc__item a {
	display: block;
	padding: 9px 0 9px 16px;
	border-inline-start: 2px solid transparent;
	font-size: 15px;
	line-height: 1.45;
	color: #4a4a4a;
	text-decoration: none;
	transition: color .18s ease, border-color .18s ease;
}

.hx-toc__item a:hover,
.hx-toc__item a:focus-visible {
	color: var(--hx-ink);
	border-inline-start-color: var(--hx-border);
}

.hx-toc__item--h3 a {
	padding-inline-start: 30px;
	font-size: 14px;
}

.hx-toc__item.is-active > a {
	color: var(--hx-ink);
	font-weight: 700;
	border-inline-start-color: var(--hx-accent);
}

.hx-toc::-webkit-scrollbar {
	width: 4px;
}

.hx-toc::-webkit-scrollbar-thumb {
	background: var(--hx-border);
	border-radius: 4px;
}

/* ==================================================
   3. Responsywnosc
   ================================================== */
@media (max-width: 1024px) {
	.hx-blog--cols-3,
	.hx-blog--cols-4,
	.hx-blog--cols-5,
	.hx-blog--cols-6 {
		--hx-blog-columns: 2;
	}

	.hx-post__layout {
		grid-template-columns: minmax(0, 1fr);
		gap: 30px;
	}

	.hx-post__aside {
		order: -1;
	}

	.hx-toc {
		position: static;
		max-height: none;
		padding: 18px 20px;
		border: 1px solid var(--hx-border);
		border-radius: 12px;
		background: var(--hx-surface-alt);
	}

	.hx-toc__label {
		margin-bottom: 0;
		cursor: pointer;
	}

	.hx-toc[open] .hx-toc__label {
		margin-bottom: 12px;
	}
}

@media (max-width: 767px) {
	.hx-blog--cols-2,
	.hx-blog--cols-3,
	.hx-blog--cols-4,
	.hx-blog--cols-5,
	.hx-blog--cols-6 {
		--hx-blog-columns: 1;
	}

	.hx-post__hero {
		padding: 20px 0 32px;
	}

	.hx-post__layout {
		padding-block: 28px 44px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hx-card,
	.hx-card__more svg {
		transition: none;
	}

	.hx-card:hover {
		transform: none;
	}
}
