/**
 * Technologie Max – układ widoku artykułu.
 */

/* Pasek postępu czytania (pod nagłówkiem) */
.tm-progress {
	position: absolute;
	top: 100%;
	right: 0;
	left: 0;
	height: 4px;
	margin-top: 1px;
	background-color: var(--tm-border);
	pointer-events: none;
}

.tm-progress__bar {
	display: block;
	width: 0;
	height: 100%;
	background-color: var(--tm-blue);
	transition: width 0.1s linear;
}

.tm-article {
	padding-bottom: 64px;
}

/* --------------------------------------------------------------------------
 * Nagłówek artykułu
 * ----------------------------------------------------------------------- */

.tm-article__head {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	max-width: 880px;
	margin-inline: auto;
	padding-top: 44px;
}

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

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

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

.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-article__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 22px;
}

.tm-article__title {
	width: 100%;
	color: var(--tm-text);
	font-size: 52px;
	font-weight: 800;
	letter-spacing: -1.5px;
	line-height: 58px;
}

.tm-article__lead {
	width: 100%;
	margin-top: 19px;
	color: var(--tm-text-2);
	font-size: 22px;
	line-height: 34px;
}

.tm-article__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px 24px;
	width: 100%;
	margin-top: 20px;
	padding: 19px 0;
	border-top: 1px solid var(--tm-border);
	border-bottom: 1px solid var(--tm-border);
}

.tm-article__author {
	display: flex;
	align-items: center;
	gap: 16px;
	min-width: 0;
}

.tm-article__author .tm-avatar {
	width: 48px;
	height: 48px;
}

.tm-article__author-text {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.tm-article__author-name {
	color: var(--tm-text);
	font-size: 16px;
	font-weight: 600;
}

.tm-article__author-name:hover {
	color: var(--tm-blue);
}

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

.tm-article__share {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

.tm-article__share-label {
	color: var(--tm-text-2);
	font-size: 14px;
	font-weight: 600;
}

/* Przyciski udostępniania */
.tm-share {
	display: flex;
	gap: 8px;
}

.tm-share--rail {
	flex-direction: column;
}

.tm-share__btn {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 10px;
	background-color: var(--tm-surface);
	box-shadow: inset 0 0 0 1px var(--tm-border);
	color: var(--tm-text);
	transition: background-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.tm-share--rail .tm-share__btn {
	border-radius: 50%;
}

.tm-share__btn:hover {
	background-color: var(--tm-blue-soft);
	box-shadow: inset 0 0 0 1px var(--tm-blue);
	color: var(--tm-blue);
}

.tm-share__btn[aria-pressed="true"] {
	background-color: var(--tm-blue);
	box-shadow: none;
	color: #fff;
}

.tm-share__btn[aria-pressed="true"] .tm-icon path {
	fill: currentColor;
}

.tm-share__btn .tm-share__done,
.tm-share__btn.is-done .tm-icon--link {
	display: none;
}

.tm-share__btn.is-done .tm-share__done {
	display: block;
	color: var(--tm-blue);
}

/* --------------------------------------------------------------------------
 * Zdjęcie główne
 * ----------------------------------------------------------------------- */

.tm-article__hero {
	max-width: 1120px;
	margin: 40px auto 0;
}

.tm-article__hero-image {
	aspect-ratio: 2 / 1;
	overflow: hidden;
	border-radius: 16px;
	background-color: var(--tm-bg-soft);
}

.tm-article__hero-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.tm-article__hero figcaption {
	margin-top: 12px;
	color: var(--tm-muted);
	font-size: 13px;
	line-height: 16px;
}

/* --------------------------------------------------------------------------
 * Treść: pasek udostępniania | artykuł | spis treści
 * ----------------------------------------------------------------------- */

.tm-article__body {
	display: grid;
	grid-template-columns: 44px minmax(0, 720px) 284px;
	gap: 56px;
	align-items: start;
	justify-content: center;
	max-width: 1160px;
	margin: 56px auto 0;
}

.tm-article__body--no-toc {
	grid-template-columns: 44px minmax(0, 720px) 44px;
}

.tm-article__rail,
.tm-toc {
	position: sticky;
	top: 108px;
}

.admin-bar .tm-article__rail,
.admin-bar .tm-toc {
	top: 140px;
}

.tm-article__main {
	min-width: 0;
}

/* W skrócie */
.tm-summary {
	margin-bottom: 24px;
	padding: 28px;
	border-radius: 16px;
	background-color: var(--tm-blue-soft);
}

.tm-summary__title {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--tm-text);
	font-size: 18px;
	font-weight: 700;
	line-height: 22px;
}

.tm-summary__title .tm-icon,
.tm-summary__list .tm-icon {
	color: var(--tm-blue);
}

.tm-summary__list {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-top: 16px;
}

.tm-summary__list li {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	color: var(--tm-text);
	font-size: 16px;
	font-weight: 500;
	line-height: 26px;
}

.tm-summary__list .tm-icon {
	margin-top: 1px;
}

/* Spis treści */
.tm-toc {
	padding: 24px;
	border-radius: 16px;
	background-color: var(--tm-surface);
	box-shadow: inset 0 0 0 1px var(--tm-border);
}

.tm-toc__title {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--tm-text);
	font-size: 16px;
	font-weight: 700;
	line-height: 20px;
}

.tm-toc__list {
	margin-top: 16px;
	border-left: 1px solid var(--tm-border);
}

.tm-toc__list a {
	display: block;
	margin-left: -1px;
	padding: 11px 0 11px 14px;
	border-left: 3px solid transparent;
	color: var(--tm-text-2);
	font-size: 15px;
	line-height: 19px;
	transition: color 0.15s ease, border-color 0.15s ease;
}

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

.tm-toc__list a.is-active {
	border-left-color: var(--tm-blue);
	color: var(--tm-blue);
	font-weight: 600;
}

.tm-toc__progress {
	margin-top: 24px;
}

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

.tm-toc__progress-track {
	height: 4px;
	margin-top: 8px;
	overflow: hidden;
	border-radius: 2px;
	background-color: var(--tm-border);
}

.tm-toc__progress-bar {
	display: block;
	width: 0;
	height: 100%;
	border-radius: 2px;
	background-color: var(--tm-blue);
	transition: width 0.1s linear;
}

/* Tagi */
.tm-article__taglist {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-top: 56px;
}

.tm-article__taglist-label {
	color: var(--tm-muted);
	font-size: 15px;
	font-weight: 500;
}

/* Ocena artykułu */
.tm-feedback {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px 24px;
	min-height: 84px;
	margin-top: 32px;
	padding: 20px 24px;
	border-radius: 16px;
	background-color: var(--tm-bg-soft);
}

.tm-feedback__question {
	color: var(--tm-text);
	font-size: 17px;
	font-weight: 600;
}

.tm-feedback__buttons {
	display: flex;
	gap: 8px;
	flex-shrink: 0;
}

.tm-feedback .tm-btn {
	height: 44px;
	padding: 0 18px;
}

.tm-feedback__thanks {
	color: var(--tm-blue-text);
	font-size: 16px;
	font-weight: 600;
}

.tm-feedback [hidden] {
	display: none;
}

/* Autor */
.tm-authorbox {
	display: flex;
	align-items: flex-start;
	gap: 24px;
	margin-top: 32px;
	padding: 32px;
	border-radius: 20px;
	background-color: var(--tm-surface);
	box-shadow: inset 0 0 0 1px var(--tm-border);
}

.tm-authorbox .tm-avatar {
	width: 80px;
	height: 80px;
}

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

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

.tm-authorbox__name {
	margin-top: 8px;
	color: var(--tm-text);
	font-size: 22px;
	font-weight: 800;
	letter-spacing: -0.4px;
	line-height: 27px;
}

.tm-authorbox__role {
	margin-top: 6px;
	color: var(--tm-blue-text);
	font-size: 15px;
	font-weight: 500;
	line-height: 20px;
}

.tm-authorbox__bio {
	margin-top: 8px;
	color: var(--tm-text-2);
	font-size: 16px;
	line-height: 26px;
}

.tm-authorbox .tm-link-arrow {
	margin-top: 7px;
}

/* --------------------------------------------------------------------------
 * Przeczytaj także
 * ----------------------------------------------------------------------- */

.tm-readmore {
	padding-block: 72px;
	background-color: var(--tm-bg-soft);
}

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

.tm-newsletter--spaced {
	padding-top: 80px;
}

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

@media (max-width: 1360px) {
	.tm-article__body {
		grid-template-columns: 44px minmax(0, 1fr) 284px;
		gap: 40px;
	}

	.tm-article__body--no-toc {
		grid-template-columns: 44px minmax(0, 720px) 44px;
	}
}

@media (max-width: 1100px) {
	.tm-article__body,
	.tm-article__body--no-toc {
		grid-template-columns: minmax(0, 720px);
		gap: 0;
	}

	.tm-article__rail {
		display: none;
	}

	.tm-toc {
		position: static;
		order: -1;
		margin-bottom: 24px;
	}

	.tm-toc__progress {
		display: none;
	}

	.tm-readmore {
		padding-block: 56px;
	}
}

@media (max-width: 720px) {
	.tm-article {
		padding-bottom: 48px;
	}

	.tm-article__head {
		padding-top: 24px;
	}

	.tm-breadcrumbs {
		margin-bottom: 18px;
	}

	.tm-article__tags {
		gap: 8px;
		margin-bottom: 16px;
	}

	.tm-article__title {
		font-size: 32px;
		letter-spacing: -0.9px;
		line-height: 38px;
	}

	.tm-article__lead {
		margin-top: 14px;
		font-size: 18px;
		line-height: 28px;
	}

	.tm-article__bar {
		flex-direction: column;
		align-items: flex-start;
		padding: 16px 0;
	}

	.tm-article__share-label {
		display: none;
	}

	.tm-article__hero {
		margin-top: 24px;
	}

	.tm-article__hero-image {
		aspect-ratio: 16 / 10;
		border-radius: 12px;
	}

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

	.tm-summary {
		padding: 20px;
	}

	.tm-toc {
		padding: 20px;
	}

	.tm-article__taglist {
		margin-top: 40px;
	}

	.tm-feedback {
		flex-direction: column;
		align-items: flex-start;
	}

	.tm-authorbox {
		flex-direction: column;
		gap: 16px;
		padding: 24px 20px;
	}

	.tm-authorbox .tm-avatar {
		width: 64px;
		height: 64px;
	}

	.tm-readmore {
		padding-block: 48px;
	}

	.tm-readmore__head {
		flex-direction: column;
		align-items: flex-start;
		gap: 4px;
		margin-bottom: 24px;
	}

	.tm-newsletter--spaced {
		padding-top: 48px;
	}
}
