/*
Theme Name: TG Blog
Theme URI: https://tg-app.pl/blog/
Author: Turniej Generator
Description: Lekki motyw bloga w stylu aplikacji Turniej Generator (tg-app.pl). Lista wpisów w kartach, czerwony akcent, czcionka Poppins hostowana lokalnie.
Version: 1.2.2
Requires at least: 6.4
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: tg-blog
*/

/* ---------- Czcionki ---------- */
@font-face { font-family: "Poppins"; font-weight: 400; font-style: normal; font-display: swap; src: url("assets/fonts/poppins-regular.woff") format("woff"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-style: normal; font-display: swap; src: url("assets/fonts/poppins-medium.woff") format("woff"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-style: normal; font-display: swap; src: url("assets/fonts/poppins-semibold.woff") format("woff"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-style: normal; font-display: swap; src: url("assets/fonts/poppins-bold.woff") format("woff"); }

/* ---------- Zmienne ---------- */
:root {
	--tg-red: #e53238;
	--tg-red-dark: #c8232a;
	--tg-red-soft: #fdecec;
	--tg-dark: #17171c;
	--tg-dark-2: #23232b;
	--tg-text: #1d1e24;
	--tg-muted: #5b5d66;
	--tg-line: #e7e7ec;
	--tg-bg: #f5f5f7;
	--tg-white: #fff;
	--tg-radius: 10px;
	--tg-radius-lg: 14px;
	--tg-shadow: 0 1px 2px rgba(23, 23, 28, .04), 0 6px 24px rgba(23, 23, 28, .06);
	--tg-shadow-hover: 0 2px 4px rgba(23, 23, 28, .05), 0 14px 36px rgba(23, 23, 28, .10);
	--tg-font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	--tg-container: 1180px;
}

/* ---------- Reset / baza ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	font-family: var(--tg-font);
	font-size: 16px;
	line-height: 1.65;
	color: var(--tg-text);
	background: var(--tg-bg);
	-webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--tg-red); text-decoration: none; }
a:hover { color: var(--tg-red-dark); }
h1, h2, h3, h4 { font-weight: 700; line-height: 1.25; color: var(--tg-text); margin: 0 0 .5em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid rgba(229, 50, 56, .45); outline-offset: 2px; border-radius: 4px; }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link:focus {
	clip: auto; width: auto; height: auto; padding: 10px 16px; z-index: 1000;
	top: 8px; left: 8px; background: var(--tg-white); color: var(--tg-text); border-radius: 6px;
}

.tg-container { width: 100%; max-width: var(--tg-container); margin: 0 auto; padding: 0 16px; }
.tg-container--narrow { max-width: 792px; }
.tg-container--wide { max-width: 1012px; }

/* ---------- Przyciski ---------- */
.tg-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	font: 600 14px/1 var(--tg-font);
	padding: 13px 22px; border-radius: 6px; border: 1.5px solid transparent;
	cursor: pointer; transition: background .15s, color .15s, border-color .15s, transform .15s;
	white-space: nowrap;
}
.tg-btn--sm { padding: 9px 14px; font-size: 13px; }
.tg-btn--red { background: var(--tg-red); color: #fff; box-shadow: 0 4px 14px rgba(229, 50, 56, .28); }
.tg-btn--red:hover { background: var(--tg-red-dark); color: #fff; transform: translateY(-1px); }
.tg-btn--outline { background: #fff; color: var(--tg-text); border-color: var(--tg-line); }
.tg-btn--outline:hover { border-color: var(--tg-text); color: var(--tg-text); }
.tg-btn--outline-light { color: #fff; border-color: #fff; background: transparent; }
.tg-btn--outline-light:hover { background: #fff; color: var(--tg-red); }

/* ---------- Nagłówek ---------- */
.tg-header {
	position: sticky; top: 0; z-index: 50;
	background: var(--tg-dark);
	border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.admin-bar .tg-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .tg-header { top: 46px; } }

.tg-header__inner { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 16px; }

.tg-brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; }
.tg-brand:hover { color: #fff; }
.tg-brand__mark {
	display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px;
	background: var(--tg-red); color: #fff; font-weight: 700; font-size: 14px; font-style: italic; letter-spacing: -.02em;
}
.tg-brand__name { font-weight: 700; font-style: italic; font-size: 17px; letter-spacing: -.01em; }
.tg-brand__tag {
	font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
	padding: 3px 7px; border-radius: 4px; background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .8);
}
.tg-brand__logo { height: 40px; width: auto; }
.tg-footer .tg-brand__logo { height: 44px; }
@media (max-width: 480px) { .tg-brand__logo { height: 34px; } .tg-brand__tag { display: none; } }
.custom-logo-link img { max-height: 40px; width: auto; }

.tg-nav { display: flex; align-items: center; gap: 20px; }
.tg-nav__list, .tg-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.tg-nav__list a, .tg-nav ul a {
	display: block; padding: 8px 12px; border-radius: 6px;
	color: rgba(255, 255, 255, .78); font-size: 14px; font-weight: 500; white-space: nowrap;
}
.tg-nav__list a:hover, .tg-nav ul a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.tg-nav .current-menu-item > a, .tg-nav .current_page_item > a { color: #fff; }

/* Przełącznik języka */
.tg-lang { list-style: none; display: flex; gap: 2px; margin: 0; padding: 3px; border-radius: 7px; background: rgba(255, 255, 255, .07); }
.tg-lang a { display: block; padding: 5px 9px; border-radius: 5px; font-size: 12px; font-weight: 600; letter-spacing: .04em; color: rgba(255, 255, 255, .65); }
.tg-lang a:hover { color: #fff; }
.tg-lang a.is-current { background: rgba(255, 255, 255, .14); color: #fff; }
@media (max-width: 1100px) { .tg-nav .tg-lang { flex-direction: row; align-self: flex-start; } .tg-nav .tg-lang a { padding: 8px 16px; font-size: 13px; } }

.tg-nav-toggle {
	display: none; width: 42px; height: 42px; border: 0; border-radius: 8px;
	background: var(--tg-red); cursor: pointer; position: relative;
}
.tg-nav-toggle__bar, .tg-nav-toggle__bar::before, .tg-nav-toggle__bar::after {
	position: absolute; left: 12px; width: 18px; height: 2px; background: #fff; border-radius: 2px; content: ""; transition: transform .2s, opacity .2s;
}
.tg-nav-toggle__bar { top: 20px; }
.tg-nav-toggle__bar::before { left: 0; top: -6px; }
.tg-nav-toggle__bar::after { left: 0; top: 6px; }
.tg-nav-toggle[aria-expanded="true"] .tg-nav-toggle__bar { background: transparent; }
.tg-nav-toggle[aria-expanded="true"] .tg-nav-toggle__bar::before { transform: translateY(6px) rotate(45deg); }
.tg-nav-toggle[aria-expanded="true"] .tg-nav-toggle__bar::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1100px) {
	.tg-nav-toggle { display: block; }
	.tg-nav {
		display: none; position: absolute; top: 100%; left: 0; right: 0;
		flex-direction: column; align-items: stretch; gap: 12px;
		padding: 12px 16px 20px; background: var(--tg-dark); border-top: 1px solid rgba(255, 255, 255, .06);
		box-shadow: 0 20px 30px rgba(0, 0, 0, .25);
	}
	.tg-nav.is-open { display: flex; }
	.tg-nav__list, .tg-nav ul { flex-direction: column; }
	.tg-nav__list a, .tg-nav ul a { padding: 12px; font-size: 15px; }
	.tg-nav .tg-btn { justify-content: center; padding: 13px; }
}

/* ---------- Hero / nagłówek listy ---------- */
.tg-hero { position: relative; padding: 40px 0 8px; overflow: hidden; }
.tg-hero::before {
	content: ""; position: absolute; inset: 0 0 auto 0; height: 220px; z-index: -1;
	background:
		linear-gradient(115deg, transparent 0 58%, rgba(229, 50, 56, .10) 58% 61%, transparent 61% 64%, rgba(23, 23, 28, .05) 64% 66%, transparent 66%),
		linear-gradient(180deg, #fff 0%, var(--tg-bg) 100%);
}
.tg-hero__card {
	display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 40px;
	background: #fff; border-radius: var(--tg-radius-lg); box-shadow: var(--tg-shadow);
	padding: 36px 40px;
}
.tg-eyebrow {
	margin: 0 0 12px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--tg-red);
}
.tg-hero__title { font-size: clamp(26px, 3.4vw, 36px); margin-bottom: 12px; }
.tg-hero__desc { color: var(--tg-muted); font-size: 15px; max-width: 620px; margin-bottom: 22px; }
.tg-aside-title { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin: 6px 0 14px; }

.tg-search { display: flex; gap: 8px; max-width: 560px; }
.tg-search input {
	flex: 1; min-width: 0; font: 400 14px var(--tg-font); padding: 12px 14px;
	border: 1.5px solid var(--tg-line); border-radius: 6px; background: var(--tg-bg); color: var(--tg-text);
}
.tg-search input:focus { outline: none; border-color: var(--tg-red); background: #fff; }
.tg-search button {
	font: 600 14px var(--tg-font); padding: 0 18px; border: 0; border-radius: 6px;
	background: var(--tg-dark); color: #fff; cursor: pointer;
}
.tg-search button:hover { background: #000; }

.tg-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.tg-chip {
	display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
	background: var(--tg-bg); border: 1px solid var(--tg-line); color: var(--tg-text); font-size: 13px; font-weight: 500;
}
.tg-chip small { color: var(--tg-muted); font-size: 11px; }
.tg-chip:hover { border-color: var(--tg-red); color: var(--tg-red); }
.tg-chip.is-active { background: var(--tg-red); border-color: var(--tg-red); color: #fff; }
.tg-chip.is-active small { color: rgba(255, 255, 255, .8); }

@media (max-width: 900px) {
	.tg-hero { padding-top: 20px; }
	.tg-hero__card { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 24px 20px; }
	.tg-search button { padding: 0 14px; }
}

/* ---------- Sekcje ---------- */
.tg-section { padding: 32px 0 56px; }
.tg-section__title { font-size: 22px; margin-bottom: 20px; }

/* ---------- Karty ---------- */
.tg-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 1000px) { .tg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .tg-grid { grid-template-columns: 1fr; gap: 16px; } }

.tg-card {
	display: flex; flex-direction: column; background: #fff; border-radius: var(--tg-radius);
	box-shadow: var(--tg-shadow); overflow: hidden; transition: box-shadow .2s, transform .2s;
}
.tg-card:hover { box-shadow: var(--tg-shadow-hover); transform: translateY(-3px); }
.tg-card__media { aspect-ratio: 16 / 9; background: var(--tg-dark); overflow: hidden; }
.tg-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.tg-card:hover .tg-card__media img { transform: scale(1.04); }

.tg-card__placeholder {
	position: relative; width: 100%; height: 100%; display: grid; place-items: center;
	background: linear-gradient(135deg, #f4f4f6 0%, #f3e9ea 55%, #eedcdd 100%);
}
.tg-card__placeholder img {
	width: auto; height: 46%; max-height: 120px; opacity: .38;
	filter: saturate(.85); transition: opacity .3s, transform .4s;
}
.tg-card:hover .tg-card__placeholder img { opacity: .5; transform: scale(1.04); }
/* Tarcza w grafice zastępczej: zawsze w proporcjach, nigdy rozciągnięta */
.tg-card__media .tg-card__placeholder img,
.tg-featured .tg-card__media .tg-card__placeholder img {
	width: auto; height: 46%; max-height: 120px; max-width: 60%;
	object-fit: contain; opacity: .38;
}
.tg-featured .tg-card__media .tg-card__placeholder img { height: 40%; max-height: 170px; }
.tg-card:hover .tg-card__media .tg-card__placeholder img,
.tg-featured:hover .tg-card__media .tg-card__placeholder img { opacity: .5; transform: scale(1.04); }

.tg-card__body { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 18px; }
.tg-card__top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 20px; margin-bottom: 8px; }
.tg-label {
	font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--tg-red);
}
.tg-badge {
	font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
	padding: 3px 8px; border-radius: 4px; background: var(--tg-red-soft); color: var(--tg-red);
}
.tg-card__title { font-size: 17px; line-height: 1.35; margin-bottom: 8px; }
.tg-card__title a, .tg-featured__title a { color: var(--tg-text); }
.tg-card__title a:hover, .tg-featured__title a:hover { color: var(--tg-red); }
.tg-card__excerpt { color: var(--tg-muted); font-size: 14px; line-height: 1.6; margin-bottom: 16px; }
.tg-card__foot {
	margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding-top: 14px; border-top: 1px solid var(--tg-line);
}
.tg-meta { display: flex; flex-wrap: wrap; gap: 6px; color: var(--tg-muted); font-size: 12.5px; }
.tg-more { font-size: 13px; font-weight: 600; white-space: nowrap; }

/* Wyróżniony (najnowszy) wpis */
.tg-featured {
	display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); margin-bottom: 28px;
	background: #fff; border-radius: var(--tg-radius-lg); box-shadow: var(--tg-shadow); overflow: hidden;
}
.tg-featured .tg-card__media { aspect-ratio: auto; height: 100%; min-height: 300px; }
.tg-featured .tg-card__media img { width: 100%; height: 100%; object-fit: cover; }
.tg-featured__media { display: block; }
.tg-featured__body { padding: 36px 40px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.tg-featured__title { font-size: clamp(22px, 2.4vw, 28px); margin-bottom: 12px; }
.tg-featured__excerpt { color: var(--tg-muted); font-size: 15px; }
.tg-featured .tg-meta { margin-bottom: 22px; }
@media (max-width: 860px) {
	.tg-featured { grid-template-columns: 1fr; }
	.tg-featured .tg-card__media { aspect-ratio: 16 / 9; min-height: 0; }
	.tg-featured__body { padding: 24px 20px; }
}

/* ---------- Paginacja ---------- */
.tg-pagination, .navigation.pagination { margin-top: 40px; }
.nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.page-numbers {
	display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 12px;
	border-radius: 6px; background: #fff; border: 1px solid var(--tg-line); color: var(--tg-text); font-weight: 600; font-size: 14px;
}
.page-numbers:hover { border-color: var(--tg-red); color: var(--tg-red); }
.page-numbers.current { background: var(--tg-red); border-color: var(--tg-red); color: #fff; }
.page-numbers.dots { background: transparent; border: 0; }

.tg-empty {
	text-align: center; background: #fff; border-radius: var(--tg-radius-lg); box-shadow: var(--tg-shadow); padding: 56px 24px;
}
.tg-empty p { color: var(--tg-muted); }
.tg-empty .tg-search { margin: 20px auto; }

/* ---------- Pojedynczy wpis ---------- */
.tg-article__header { padding: 36px 0 28px; background: linear-gradient(180deg, #fff 0%, var(--tg-bg) 100%); }
.tg-breadcrumbs { font-size: 13px; color: var(--tg-muted); margin-bottom: 18px; }
.tg-breadcrumbs a { color: var(--tg-muted); }
.tg-breadcrumbs a:hover { color: var(--tg-red); }
.tg-breadcrumbs .separator { margin: 0 8px; opacity: .6; }
.tg-breadcrumbs .last { color: var(--tg-text); }
.tg-article__title { font-size: clamp(28px, 4.2vw, 42px); line-height: 1.2; margin-bottom: 14px; }
.tg-article__lead { font-size: 18px; color: var(--tg-muted); }
.tg-article__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 18px; font-size: 14px; }
.tg-author { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.tg-author img { border-radius: 50%; }
.tg-article__meta .tg-meta { font-size: 13.5px; }

.tg-article__image { margin: 0 0 24px; }
.tg-article__image img { width: 100%; border-radius: var(--tg-radius-lg); box-shadow: var(--tg-shadow); }
.tg-article__image figcaption { font-size: 13px; color: var(--tg-muted); text-align: center; margin-top: 10px; }

/* Typografia treści */
.tg-content {
	background: #fff; border-radius: var(--tg-radius-lg); box-shadow: var(--tg-shadow);
	padding: 44px 56px; font-size: 17px; line-height: 1.8;
}
@media (max-width: 640px) { .tg-content { padding: 24px 20px; font-size: 16px; } }
.tg-content > *:first-child { margin-top: 0; }
.tg-content > *:last-child { margin-bottom: 0; }
.tg-content h2 { scroll-margin-top: 84px; font-size: 26px; margin: 1.8em 0 .6em; padding-left: 14px; border-left: 4px solid var(--tg-red); }
.tg-content h3 { font-size: 21px; margin: 1.6em 0 .5em; }
.tg-content h4 { font-size: 18px; margin: 1.4em 0 .5em; }
.tg-content p, .tg-content ul, .tg-content ol { margin: 0 0 1.25em; }
.tg-content ul, .tg-content ol { padding-left: 1.4em; }
.tg-content li { margin-bottom: .4em; }
.tg-content ul li::marker { color: var(--tg-red); }
.tg-content ol li::marker { color: var(--tg-red); font-weight: 700; }
.tg-content a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.tg-content strong { font-weight: 600; }
.tg-content img { border-radius: var(--tg-radius); }
.tg-content figure { margin: 1.8em 0; }
.tg-content figcaption, .tg-content .wp-element-caption { font-size: 13px; color: var(--tg-muted); text-align: center; margin-top: 8px; }
.tg-content blockquote, .tg-content .wp-block-quote {
	margin: 1.8em 0; padding: 18px 24px; border-left: 4px solid var(--tg-red);
	background: var(--tg-red-soft); border-radius: 0 var(--tg-radius) var(--tg-radius) 0; font-size: 18px;
}
.tg-content blockquote p:last-child { margin-bottom: 0; }
.tg-content hr { border: 0; border-top: 1px solid var(--tg-line); margin: 2.2em 0; }
.tg-content code { font-size: .9em; background: var(--tg-bg); padding: 2px 6px; border-radius: 4px; }
.tg-content pre { background: var(--tg-dark); color: #f3f3f5; padding: 18px 20px; border-radius: var(--tg-radius); overflow-x: auto; font-size: 14px; }
.tg-content pre code { background: none; padding: 0; }
.tg-content table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 1.6em 0; }
.tg-content th, .tg-content td { padding: 10px 12px; border-bottom: 1px solid var(--tg-line); text-align: left; }
.tg-content th { background: var(--tg-bg); font-weight: 600; }
.tg-content .wp-block-table { overflow-x: auto; margin: 1.6em 0; }
.tg-content .wp-block-table table { margin: 0; border: 1px solid var(--tg-line); border-radius: var(--tg-radius); border-collapse: separate; border-spacing: 0; overflow: hidden; }
.tg-content .wp-block-table th, .tg-content .wp-block-table td { border: 0; border-bottom: 1px solid var(--tg-line); }
.tg-content .wp-block-table tr:last-child td { border-bottom: 0; }
.tg-content .wp-block-table thead { border: 0; }
.tg-content .wp-block-button__link { background: var(--tg-red); color: #fff; border-radius: 6px; font-weight: 600; font-size: 15px; padding: 12px 22px; text-decoration: none; }
.tg-content .wp-block-button__link:hover { background: var(--tg-red-dark); }
.tg-content .alignwide { margin-left: -56px; margin-right: -56px; max-width: none; }
@media (max-width: 640px) { .tg-content .alignwide { margin-left: 0; margin-right: 0; } }
.tg-content .rank-math-block, .tg-content .wp-block-rank-math-toc-block {
	background: var(--tg-bg); border-radius: var(--tg-radius); padding: 18px 22px; margin: 1.6em 0;
}

.tg-chips--tags { margin-top: 24px; }

/* Ramka CTA pod wpisem */
.tg-cta-box {
	display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px;
	margin: 32px 0 8px; padding: 28px 32px; border-radius: var(--tg-radius-lg);
	background:
		linear-gradient(115deg, transparent 0 70%, rgba(229, 50, 56, .35) 70% 76%, transparent 76% 79%, rgba(255, 255, 255, .05) 79% 83%, transparent 83%),
		var(--tg-dark);
	color: #fff; box-shadow: var(--tg-shadow);
}
.tg-cta-box .tg-eyebrow { color: #ff8a8e; margin-bottom: 6px; }
.tg-cta-box__title { font-size: 22px; font-weight: 700; margin-bottom: 6px; color: #fff; }
.tg-cta-box__text { color: rgba(255, 255, 255, .72); font-size: 14.5px; margin: 0; }
.tg-cta-box__actions { display: flex; flex-direction: column; gap: 10px; }
.tg-cta-box .tg-btn--outline { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.tg-cta-box .tg-btn--outline:hover { border-color: #fff; }
@media (max-width: 700px) {
	.tg-cta-box { grid-template-columns: 1fr; padding: 24px 20px; }
	.tg-cta-box__actions { flex-direction: row; flex-wrap: wrap; }
}

.tg-related { padding-top: 48px; }

/* Układ wpisu: treść + panel boczny */
.tg-article__intro { max-width: 880px; }
.tg-article__layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
.tg-article__layout--single { grid-template-columns: minmax(0, 1fr); max-width: 900px; }
.tg-article__side { align-self: stretch; }
.tg-side-sticky { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 16px; }
.admin-bar .tg-side-sticky { top: 116px; }

.tg-toc { background: #fff; border-radius: var(--tg-radius-lg); box-shadow: var(--tg-shadow); padding: 22px 22px 18px; }
.tg-toc .tg-aside-title { margin: 0 0 12px; }
.tg-toc__list { list-style: none; counter-reset: toc; margin: 0; padding: 0; font-size: 14px; line-height: 1.45; }
.tg-toc__list li { counter-increment: toc; }
.tg-toc__list a {
	display: grid; grid-template-columns: 22px 1fr; gap: 4px; padding: 7px 8px; margin: 0 -8px;
	border-radius: 6px; color: var(--tg-muted);
}
.tg-toc__list a::before { content: counter(toc) "."; color: var(--tg-red); font-weight: 600; }
.tg-toc__list a:hover { background: var(--tg-bg); color: var(--tg-text); }
.tg-toc__list a.is-active { background: var(--tg-red-soft); color: var(--tg-text); font-weight: 500; }

.tg-side-cta {
	border-radius: var(--tg-radius-lg); padding: 22px; color: #fff; box-shadow: var(--tg-shadow);
	background:
		linear-gradient(115deg, transparent 0 62%, rgba(229, 50, 56, .45) 62% 72%, transparent 72% 76%, rgba(255, 255, 255, .05) 76% 82%, transparent 82%),
		var(--tg-dark);
}
.tg-side-cta img { height: 38px; width: auto; margin-bottom: 14px; }
.tg-side-cta p { font-weight: 600; font-size: 16px; line-height: 1.4; margin-bottom: 16px; }
.tg-side-cta .tg-btn { width: 100%; }

.tg-toc--mobile { display: none; margin-bottom: 16px; padding: 0; }
.tg-toc--mobile summary { cursor: pointer; padding: 16px 20px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
.tg-toc--mobile summary::after { content: "+"; color: var(--tg-red); font-size: 20px; line-height: 1; }
.tg-toc--mobile[open] summary::after { content: "−"; }
.tg-toc--mobile .tg-toc__list { padding: 0 20px 16px; }
.tg-toc--mobile .tg-toc__list a { margin: 0; }

@media (max-width: 1040px) {
	.tg-article__layout { grid-template-columns: minmax(0, 1fr); max-width: 900px; }
	.tg-article__side { display: none; }
	.tg-toc--mobile { display: block; }
}

/* Komentarze */
.tg-comments { margin-top: 32px; background: #fff; border-radius: var(--tg-radius-lg); box-shadow: var(--tg-shadow); padding: 28px 32px; }
.tg-comments__list { list-style: none; padding: 0; }
.tg-comments__list .comment-body { padding: 16px 0; border-bottom: 1px solid var(--tg-line); font-size: 15px; }
.tg-comments__list .avatar { border-radius: 50%; float: left; margin-right: 12px; }
.tg-comments__list .children { list-style: none; padding-left: 28px; }
.comment-form label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; font: 400 15px var(--tg-font); padding: 11px 13px; border: 1.5px solid var(--tg-line); border-radius: 6px; background: var(--tg-bg);
}
.comment-form textarea:focus, .comment-form input:focus { outline: none; border-color: var(--tg-red); background: #fff; }

/* ---------- Stopka ---------- */
.tg-footer { margin-top: 24px; background: var(--tg-dark); color: rgba(255, 255, 255, .65); font-size: 14px; }
.tg-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; padding-top: 40px; padding-bottom: 28px; }
.tg-footer__brand { max-width: 380px; }
.tg-footer__brand p { margin-top: 14px; }
.tg-footer__nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 0; margin: 0; }
.tg-footer__nav a { color: rgba(255, 255, 255, .8); }
.tg-footer__nav a:hover { color: #fff; }
.tg-footer__bottom { border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 18px; padding-bottom: 22px; font-size: 13px; }

/* ---------- Bloki WP ---------- */
.alignleft { float: left; margin: .3em 1.5em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.5em; }
.aligncenter { margin-left: auto; margin-right: auto; }
.has-tg-red-color { color: var(--tg-red) !important; }
.has-tg-red-background-color { background-color: var(--tg-red) !important; }
.has-tg-dark-color { color: var(--tg-dark) !important; }
.has-tg-dark-background-color { background-color: var(--tg-dark) !important; }
.has-tg-muted-color { color: var(--tg-muted) !important; }
.has-tg-light-background-color { background-color: var(--tg-bg) !important; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
