/**
 * Technologie Max – widok kategorii.
 */

/* --------------------------------------------------------------------------
 * Nagłówek kategorii
 * ----------------------------------------------------------------------- */

.tm-cathero {
	padding-block: 32px 40px;
	border-bottom: 1px solid var(--tm-border);
	background-color: var(--tm-bg-soft);
}

.tm-breadcrumbs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 10px;
	font-size: 14px;
	line-height: 18px;
}

.tm-breadcrumbs li {
	display: flex;
	align-items: center;
	gap: 10px;
}

.tm-breadcrumbs a {
	color: var(--tm-blue);
}

.tm-breadcrumbs a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.tm-breadcrumbs .tm-icon {
	color: var(--tm-muted);
}

.tm-breadcrumbs [aria-current] {
	color: var(--tm-text);
	font-weight: 600;
}

.tm-cathero__row {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px 48px;
	margin-top: 32px;
}

.tm-cathero__main {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	min-width: 0;
}

.tm-cathero__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	border-radius: 14px;
	background-color: #0055ff;
	color: #fff;
}

.tm-cathero__icon .tm-icon {
	width: 30px;
	height: 30px;
}

.tm-cathero .tm-eyebrow {
	margin-top: 16px;
	color: var(--tm-blue-text);
	line-height: 16px;
}

.tm-cathero__title {
	margin-top: 12px;
	color: var(--tm-text);
	font-size: 56px;
	font-weight: 800;
	letter-spacing: -1.8px;
	line-height: 64px;
}

.tm-cathero__desc {
	max-width: 710px;
	margin-top: 12px;
	color: var(--tm-text-2);
	font-size: 18px;
	line-height: 29px;
}

.tm-cathero__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 24px;
	margin-top: 24px;
}

.tm-cathero__meta li {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--tm-text-2);
	font-size: 15px;
	line-height: 20px;
	white-space: nowrap;
}

.tm-cathero__meta .tm-icon {
	color: var(--tm-muted);
}

.tm-cathero__actions {
	display: flex;
	gap: 12px;
	flex-shrink: 0;
}

.tm-btn--square {
	width: 48px;
	padding: 0;
}

.tm-cathero__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 32px;
}

.tm-chip {
	display: inline-flex;
	align-items: center;
	height: 44px;
	padding: 0 16px;
	border-radius: 22px;
	background-color: var(--tm-surface);
	box-shadow: inset 0 0 0 1px var(--tm-border);
	color: var(--tm-text);
	font-size: 15px;
	font-weight: 500;
	white-space: nowrap;
	transition: background-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.tm-chip:hover {
	box-shadow: inset 0 0 0 1px var(--tm-border-strong);
}

.tm-chip.is-active {
	background-color: #111827;
	box-shadow: none;
	color: #fff;
	font-weight: 600;
}

:root[data-theme="dark"] .tm-chip.is-active {
	background-color: #f3f5f9;
	color: #0f1623;
}

/* --------------------------------------------------------------------------
 * Lista artykułów + panel boczny
 * ----------------------------------------------------------------------- */

.tm-catbody {
	padding-block: 48px 80px;
}

.tm-catbody__inner {
	display: grid;
	grid-template-columns: minmax(0, 848fr) minmax(0, 384fr);
	gap: 48px;
	align-items: start;
}

.tm-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 24px;
	margin-bottom: 32px;
}

.tm-toolbar__count,
.tm-toolbar__label {
	color: var(--tm-text-2);
	font-size: 15px;
}

.tm-toolbar__controls {
	display: flex;
	align-items: center;
	gap: 12px;
}

.tm-select {
	position: relative;
	display: flex;
	align-items: center;
}

.tm-select select {
	height: 44px;
	padding: 0 42px 0 15px;
	border: 0;
	border-radius: 10px;
	background-color: var(--tm-surface);
	box-shadow: inset 0 0 0 1.5px var(--tm-border-strong);
	color: var(--tm-text);
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.tm-select .tm-icon {
	position: absolute;
	right: 14px;
	color: var(--tm-text);
	pointer-events: none;
}

.tm-viewtoggle {
	display: flex;
	gap: 4px;
	height: 44px;
	padding: 4px;
	border-radius: 10px;
	background-color: var(--tm-bg-soft);
}

.tm-viewtoggle__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 8px;
	color: var(--tm-muted);
	transition: background-color 0.2s ease, color 0.2s ease;
}

.tm-viewtoggle__btn:hover {
	color: var(--tm-text);
}

.tm-viewtoggle__btn[aria-pressed="true"] {
	background-color: var(--tm-toggle-active);
	box-shadow: 0 1px 3px var(--tm-shadow-color);
	color: var(--tm-text);
}

/* Duża karta na górze listy */
.tm-lead {
	position: relative;
	display: flex;
	align-items: center;
	gap: 28px;
	padding: 16px;
	border-radius: 16px;
	background-color: var(--tm-surface);
	box-shadow: inset 0 0 0 1px var(--tm-border);
	transition: box-shadow 0.25s ease;
}

.tm-lead:hover {
	box-shadow: inset 0 0 0 1px var(--tm-border-strong), 0 16px 40px var(--tm-shadow-color);
}

.tm-lead__thumb {
	width: 400px;
	max-width: 48%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: 12px;
	background-color: var(--tm-bg-soft);
	flex-shrink: 0;
	align-self: center;
}

.tm-lead__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.tm-lead:hover .tm-lead__thumb img {
	transform: scale(1.03);
}

.tm-lead__text {
	display: flex;
	flex: 1 1 0;
	flex-direction: column;
	align-items: flex-start;
	gap: 14px;
	min-width: 0;
	align-self: flex-start;
	padding-right: 12px;
}

.tm-lead--noimage .tm-lead__text {
	padding: 8px 12px;
}

.tm-lead__tags {
	display: flex;
	align-items: center;
	gap: 12px;
}

.tm-lead__tags .tm-tag {
	position: relative;
	z-index: 2;
}

.tm-lead__title {
	color: var(--tm-text);
	font-size: 26px;
	font-weight: 800;
	letter-spacing: -0.6px;
	line-height: 33px;
}

.tm-lead__title a {
	transition: color 0.2s ease;
}

.tm-lead__title a::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.tm-lead:hover .tm-lead__title a {
	color: var(--tm-blue);
}

.tm-lead__excerpt {
	color: var(--tm-text-2);
	font-size: 16px;
	line-height: 24px;
}

.tm-lead__meta {
	color: var(--tm-muted);
	font-size: 14px;
}

.tm-catgrid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 24px;
	margin-top: 32px;
}

.tm-catgrid:empty {
	display: none;
}

.tm-catgrid .tm-card__thumb {
	height: auto;
	aspect-ratio: 16 / 9;
}

/* Układ listy */
.tm-catlist.is-list .tm-catgrid {
	grid-template-columns: minmax(0, 1fr);
	gap: 16px;
	margin-top: 16px;
}

.tm-catlist.is-list .tm-card {
	flex-direction: row;
	align-items: stretch;
}

.tm-catlist.is-list .tm-card__thumb {
	width: 280px;
	max-width: 38%;
	aspect-ratio: auto;
	min-height: 168px;
}

.tm-catlist.is-list .tm-card__body {
	padding: 20px 24px;
}

/* Panel boczny */
.tm-catside {
	display: flex;
	flex-direction: column;
	gap: 40px;
	min-width: 0;
}

.tm-catside__title {
	color: var(--tm-text);
	font-size: 20px;
	font-weight: 800;
	letter-spacing: -0.4px;
	line-height: 24px;
}

.tm-rank {
	margin-top: 8px;
}

.tm-rank__item {
	display: flex;
	align-items: flex-start;
	gap: 0;
	padding: 16px 0;
	border-bottom: 1px solid var(--tm-border);
}

.tm-rank__item:last-child {
	padding-bottom: 0;
	border-bottom: 0;
}

.tm-rank__num {
	width: 52px;
	color: var(--tm-blue);
	font-size: 24px;
	font-weight: 800;
	letter-spacing: -0.8px;
	line-height: 26px;
	flex-shrink: 0;
}

.tm-rank__text {
	display: flex;
	flex: 1 1 0;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.tm-rank__title {
	color: var(--tm-text);
	font-size: 16px;
	font-weight: 600;
	line-height: 22px;
}

.tm-rank__title a {
	transition: color 0.2s ease;
}

.tm-rank__title a:hover {
	color: var(--tm-blue);
}

.tm-rank__meta {
	color: var(--tm-muted);
	font-size: 13px;
	line-height: 16px;
}

.tm-sidenl {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	padding: 28px;
	border-radius: 20px;
	background-color: var(--tm-blue-soft);
}

.tm-sidenl__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 10px;
	background-color: #0055ff;
	color: #fff;
}

.tm-sidenl__title {
	margin-top: 16px;
	color: var(--tm-text);
	font-size: 20px;
	font-weight: 800;
	letter-spacing: -0.4px;
	line-height: 24px;
}

.tm-sidenl__text {
	margin-top: 16px;
	color: var(--tm-text-2);
	font-size: 15px;
	line-height: 24px;
}

.tm-sidenl__form {
	display: flex;
	flex-direction: column;
	width: 100%;
	margin-top: 16px;
}

.tm-sidenl__form > label {
	color: var(--tm-text);
	font-size: 14px;
	font-weight: 600;
	line-height: 17px;
}

.tm-sidenl__form .tm-field {
	flex: none;
	margin-top: 8px;
}

.tm-sidenl__form .tm-btn {
	margin-top: 16px;
}

.tm-sidenl__note {
	margin-top: 12px;
	color: var(--tm-text-2);
	font-size: 12px;
	line-height: 18px;
}

.tm-sidenl__note a {
	text-decoration: underline;
	text-underline-offset: 2px;
}

.tm-sidenl .tm-form-msg {
	margin-top: 12px;
}

.tm-sidenl .tm-form-msg.is-success {
	background-color: rgba(22, 163, 74, 0.12);
	color: #15803d;
}

.tm-sidenl .tm-form-msg.is-error {
	background-color: rgba(220, 38, 38, 0.1);
	color: #b91c1c;
}

:root[data-theme="dark"] .tm-sidenl .tm-field {
	background-color: var(--tm-surface);
	color: var(--tm-muted);
}

:root[data-theme="dark"] .tm-sidenl .tm-field input {
	color: var(--tm-text);
}

:root[data-theme="dark"] .tm-sidenl .tm-form-msg.is-success {
	color: #86efac;
}

:root[data-theme="dark"] .tm-sidenl .tm-form-msg.is-error {
	color: #fca5a5;
}

.tm-catside__pills {
	display: flex;
	flex-wrap: wrap;
	gap: 16px 10px;
	margin-top: 16px;
}

/* --------------------------------------------------------------------------
 * Responsywność
 * ----------------------------------------------------------------------- */

@media (max-width: 1180px) {
	.tm-catbody__inner {
		grid-template-columns: minmax(0, 1fr) 320px;
		gap: 32px;
	}

	.tm-lead__thumb {
		width: 300px;
	}
}

@media (max-width: 1024px) {
	.tm-catbody__inner {
		grid-template-columns: minmax(0, 1fr);
		gap: 56px;
	}

	.tm-lead__thumb {
		width: 400px;
	}
}

@media (max-width: 720px) {
	.tm-cathero {
		padding-block: 24px 28px;
	}

	.tm-cathero__row {
		flex-direction: column;
		align-items: flex-start;
		margin-top: 24px;
	}

	.tm-cathero__icon {
		width: 52px;
		height: 52px;
		border-radius: 12px;
	}

	.tm-cathero__icon .tm-icon {
		width: 26px;
		height: 26px;
	}

	.tm-cathero__title {
		font-size: 36px;
		letter-spacing: -1px;
		line-height: 42px;
	}

	.tm-cathero__desc {
		font-size: 16px;
		line-height: 26px;
	}

	.tm-cathero__filters {
		flex-wrap: nowrap;
		margin-inline: calc(var(--tm-gutter) * -1);
		padding-inline: var(--tm-gutter);
		overflow-x: auto;
		scrollbar-width: none;
	}

	.tm-cathero__filters::-webkit-scrollbar {
		display: none;
	}

	.tm-catbody {
		padding-block: 32px 56px;
	}

	.tm-toolbar {
		margin-bottom: 24px;
	}

	.tm-viewtoggle {
		display: none;
	}

	.tm-lead {
		flex-direction: column;
		align-items: stretch;
		gap: 16px;
	}

	.tm-lead__thumb {
		width: 100%;
		max-width: none;
	}

	.tm-lead__text {
		padding: 0 4px 8px;
	}

	.tm-lead__title {
		font-size: 22px;
		line-height: 28px;
	}

	.tm-catgrid,
	.tm-catlist.is-list .tm-catgrid {
		grid-template-columns: minmax(0, 1fr);
		gap: 24px;
		margin-top: 24px;
	}

	.tm-catlist.is-list .tm-card {
		flex-direction: column;
	}

	.tm-catlist.is-list .tm-card__thumb {
		width: auto;
		max-width: none;
		aspect-ratio: 16 / 9;
	}

	.tm-pagination .page-numbers,
	.tm-pagination__nav {
		padding: 0 12px;
	}
}

/* --------------------------------------------------------------------------
 * Podstrona „Kategorie”
 * ----------------------------------------------------------------------- */

.tm-catindex {
	padding-block: 48px 80px;
}

.tm-catindex__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
}

.tm-catcard {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 24px;
	border-radius: 16px;
	background-color: var(--tm-surface);
	box-shadow: inset 0 0 0 1px var(--tm-border);
	transition: box-shadow 0.25s ease;
}

.tm-catcard:hover {
	box-shadow: inset 0 0 0 1px var(--tm-border-strong), 0 16px 40px var(--tm-shadow-color);
}

.tm-catcard__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.tm-catcard:hover .tm-tile__arrow {
	color: var(--tm-blue);
	transform: translate(2px, -2px);
}

.tm-catcard__text {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.tm-catcard__name {
	color: var(--tm-text);
	font-size: 20px;
	font-weight: 700;
	letter-spacing: -0.3px;
	line-height: 26px;
}

.tm-catcard__name a {
	transition: color 0.2s ease;
}

/* Cała karta klikalna – link nazwy rozciągnięty na kartę. */
.tm-catcard__name a::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.tm-catcard:hover .tm-catcard__name a {
	color: var(--tm-blue);
}

.tm-catcard__count {
	color: var(--tm-text-2);
	font-size: 14px;
}

.tm-catcard__desc {
	color: var(--tm-text-2);
	font-size: 16px;
	line-height: 24px;
}

.tm-catcard__subs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.tm-catcard__subs .tm-tag,
.tm-catcard__latest a {
	position: relative;
	z-index: 2;
}

.tm-catcard__latest {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-top: auto;
	padding-top: 16px;
	border-top: 1px solid var(--tm-border);
}

.tm-catcard__latest span {
	color: var(--tm-muted);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 1.2px;
	text-transform: uppercase;
}

.tm-catcard__latest a {
	color: var(--tm-text);
	font-size: 15px;
	font-weight: 600;
	line-height: 22px;
	transition: color 0.2s ease;
}

.tm-catcard__latest a:hover {
	color: var(--tm-blue);
}

.tm-catindex__tags {
	margin-top: 48px;
}

.tm-catindex + .tm-newsletter {
	padding-top: 0;
}

@media (max-width: 1100px) {
	.tm-catindex__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 720px) {
	.tm-catindex {
		padding-block: 32px 48px;
	}

	.tm-catindex__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 16px;
	}

	.tm-catcard {
		padding: 20px;
	}

	.tm-catindex__tags {
		margin-top: 32px;
	}
}
