/**
 * TS Support Guides — front-end styles.
 * Article + archive + lightbox. CSS variables map to theme tokens
 * (--ts-primary, --ts-border, --ts-muted-fg) with sensible fallbacks.
 */

.tsg-main { display: block; }

/* ── Single article ── */
.tsg-article {
	max-width: 760px;
	margin: 0 auto;
	padding: 32px 24px 80px;
	line-height: 1.7;
	font-size: 16px;
}
.tsg-article__header {
	margin-bottom: 28px;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--ts-border, rgba(0,0,0,.08));
}
.tsg-article__back {
	display: inline-block;
	margin-bottom: 16px;
	font-size: 13px;
	color: var(--ts-primary, hsl(217,91%,60%));
	text-decoration: none;
}
.tsg-article__back:hover { text-decoration: underline; }
.tsg-article__title {
	font-size: clamp(26px, 4vw, 36px);
	font-weight: 800;
	line-height: 1.25;
	margin: 0 0 8px;
}
.tsg-article__subtitle {
	font-size: 17px;
	opacity: .75;
	margin: 0;
}
.tsg-article__body > * { margin: 0 0 1em; }
.tsg-article__body > *:last-child { margin-bottom: 0; }
.tsg-article__footer {
	margin-top: 40px;
	padding-top: 20px;
	border-top: 1px solid var(--ts-border, rgba(0,0,0,.08));
}

/* ── Block atoms ── */
.tsg-heading { font-weight: 700; line-height: 1.3; margin: 1.6em 0 .6em; }
.tsg-heading + .tsg-paragraph,
.tsg-heading + .tsg-bullets,
.tsg-heading + .tsg-steps { margin-top: 0; }
h2.tsg-heading { font-size: 24px; }
h3.tsg-heading { font-size: 19px; }
h4.tsg-heading { font-size: 17px; }

.tsg-paragraph p { margin: 0 0 .8em; }
.tsg-paragraph a { color: var(--ts-primary, hsl(217,91%,60%)); }

.tsg-bullets,
.tsg-steps { padding-inline-start: 1.5em; margin: 0 0 1em; }
.tsg-bullets li { margin: 0 0 .5em; }

.tsg-steps {
	counter-reset: tsg;
	list-style: none;
	padding: 0;
}
.tsg-steps li {
	position: relative;
	padding-inline-start: 44px;
	min-height: 32px;
	padding-top: 4px;
	counter-increment: tsg;
	margin-bottom: 14px;
}
.tsg-steps li::before {
	content: counter(tsg);
	position: absolute;
	inset-inline-start: 0;
	top: 0;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: rgba(59,130,246,.15);
	color: var(--ts-primary, hsl(217,91%,60%));
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 14px;
}

.tsg-callout {
	display: block;
	padding: 16px 20px;
	border-radius: 12px;
	margin: 1.5em 0;
	border-inline-start: 3px solid var(--ts-primary, hsl(217,91%,60%));
	background: rgba(59,130,246,.08);
}
.tsg-callout--warning {
	border-inline-start-color: #f59e0b;
	background: rgba(245,158,11,.1);
}
.tsg-callout--tip {
	border-inline-start-color: #10b981;
	background: rgba(16,185,129,.1);
}
.tsg-callout__title { display: block; margin-bottom: 4px; font-weight: 700; }
.tsg-callout__body { font-size: 14px; line-height: 1.6; opacity: .9; }
.tsg-callout__body p { margin: 0 0 .5em; }
.tsg-callout__body p:last-child { margin-bottom: 0; }
.tsg-callout__body a {
	display: inline-block;
	margin: 4px 8px 4px 0;
	padding: 8px 16px;
	background: var(--ts-primary, hsl(217,91%,60%));
	color: #fff;
	border-radius: 8px;
	text-decoration: none;
	font-weight: 600;
}
.tsg-callout__body a:hover { opacity: .9; }

.tsg-figure { margin: 1.5em 0; }
.tsg-figure img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 12px;
	border: 1px solid var(--ts-border, rgba(0,0,0,.08));
	cursor: zoom-in;
	transition: transform .2s;
}
.tsg-figure img:hover { transform: scale(1.005); }

.tsg-video { margin: 1.5em 0; }
.tsg-video__title { font-weight: 700; font-size: 16px; margin-bottom: 8px; }
.tsg-video__frame {
	position: relative;
	padding-bottom: 56.25%;
	background: #000;
	border-radius: 12px;
	overflow: hidden;
}
.tsg-video__frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* ── Archive ── */
.tsg-archive {
	max-width: 1100px;
	margin: 0 auto;
	padding: 48px 24px 80px;
}
.tsg-archive__header {
	text-align: center;
	margin-bottom: 32px;
}
.tsg-archive__title {
	font-size: clamp(28px, 4vw, 42px);
	font-weight: 800;
	margin: 0 0 8px;
}
.tsg-archive__subtitle {
	opacity: .75;
	margin: 0;
	font-size: 18px;
}
.tsg-archive__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 20px;
}
.tsg-card {
	display: block;
	text-decoration: none;
	color: inherit;
	border: 1px solid var(--ts-border, rgba(0,0,0,.08));
	border-radius: 16px;
	padding: 24px;
	background: var(--ts-secondary, rgba(0,0,0,.02));
	transition: border-color .25s, transform .25s;
}
.tsg-card:hover {
	border-color: var(--ts-primary, hsl(217,91%,60%));
	transform: translateY(-2px);
}
.tsg-card__title {
	font-weight: 700;
	font-size: 17px;
	margin: 0 0 8px;
	line-height: 1.4;
}
.tsg-card__excerpt {
	font-size: 13px;
	opacity: .7;
	line-height: 1.6;
	margin: 0;
}
.tsg-card__cta {
	display: inline-block;
	margin-top: 12px;
	color: var(--ts-primary, hsl(217,91%,60%));
	font-weight: 600;
	font-size: 13px;
}

/* ── Lightbox ── */
.tsg-lb {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,.92);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 99999;
	padding: 24px;
	cursor: zoom-out;
}
.tsg-lb.is-open { display: flex; }
.tsg-lb__img {
	max-width: 95vw;
	max-height: 92vh;
	width: auto;
	height: auto;
	border-radius: 8px;
	box-shadow: 0 24px 60px rgba(0,0,0,.6);
	cursor: default;
}
.tsg-lb__close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(255,255,255,.15);
	color: #fff;
	border: 0;
	font-size: 22px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}
.tsg-lb__close:hover { background: rgba(255,255,255,.25); }
.tsg-lb__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: rgba(255,255,255,.15);
	color: #fff;
	border: 0;
	font-size: 22px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}
.tsg-lb__nav:hover { background: rgba(255,255,255,.25); }
.tsg-lb__prev { right: 16px; }
.tsg-lb__next { left: 16px; }
.tsg-lb__counter {
	position: absolute;
	bottom: 16px;
	left: 50%;
	transform: translateX(-50%);
	color: rgba(255,255,255,.6);
	font-size: 13px;
}
