/*
 * /templates and /templates/<id> (src/app/templates).
 *
 * Page layout in the site's 2026 tokens (--st-*). The phone previews take
 * their COLOURS, fonts, radii and effects from BC_THEME_CSS
 * (src/lib/businessCardThemes.tsx), the same rules the real card uses; this
 * file only sizes and spaces them, so it never sets a colour on a bc-* part.
 */

.st-tpl { padding: clamp(2rem, 5vw, 4rem) 0 clamp(3rem, 6vw, 5rem); background: var(--st-ground); }

/* ---- hero ---- */
.st-tpl-hero { display: flex; flex-direction: column; align-items: center; gap: .75rem; text-align: center; max-width: 760px; margin: 0 auto clamp(2rem, 5vw, 3.5rem); }
.st-tpl-lede { margin: 0; font-size: clamp(1rem, 1.6vw, 1.15rem); line-height: 1.6; color: var(--st-ink-soft); }
.st-tpl-lede--left { max-width: 34rem; }

/* ---- sidebar + grid ---- */
.st-tpl-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.st-tpl-cats { position: sticky; top: 110px; display: flex; flex-direction: column; gap: .5rem; }
.st-tpl-cats__label { font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--st-ink-mute); margin-bottom: .35rem; }
.st-tpl-cat {
	display: block;
	padding: .65rem 1.1rem;
	border: 1px solid var(--st-line-firm);
	border-radius: var(--st-r-pill);
	background: var(--st-surface);
	font-size: .95rem;
	font-weight: 500;
	color: var(--st-ink);
	text-decoration: none;
	transition: border-color .15s ease, background-color .15s ease;
}
.st-tpl-cat:hover { border-color: var(--st-brand-edge); color: var(--st-brand); }
.st-tpl-cat.is-on { background: var(--st-ink); border-color: var(--st-ink); color: #fff; }

.st-tpl-count { margin: 0 0 1rem; font-size: .9rem; color: var(--st-ink-mute); }
.st-tpl-grid { list-style: none; margin: 0 !important; padding: 0 !important; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: clamp(1.25rem, 3vw, 2rem); }
.st-tpl-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.st-tpl-card { display: flex; flex-direction: column; gap: .35rem; text-decoration: none; color: var(--st-ink); }
.st-tpl-card .st-tpl-phone { transition: transform .3s cubic-bezier(.2,.7,.3,1), box-shadow .3s ease; }
.st-tpl-card:hover .st-tpl-phone { transform: translateY(-6px); box-shadow: var(--st-shadow-lift); }
.st-tpl-card__name { margin-top: .65rem; font-family: var(--st-display); font-size: 1.3rem; line-height: 1.2; color: var(--st-ink); }
.st-tpl-card__desc { font-size: .875rem; line-height: 1.45; color: var(--st-ink-mute); }
.st-tpl-card:hover .st-tpl-card__name { color: var(--st-brand); }

/* ---- the phone ---- */
/* The theme fills SVG paths; these icons are outlines. */
.st-tpl-phone svg, .st-tpl-phone svg * { fill: none !important; }

.st-tpl-phone {
	position: relative;
	width: 100%;
	aspect-ratio: 9 / 16;
	border-radius: 34px;
	overflow: hidden;
	box-shadow: var(--st-shadow);
	border: 1px solid rgba(26, 32, 44, .08);
	background-attachment: local;
}
.st-tpl-phone--lg { max-width: 360px; margin: 0 auto; border-radius: 44px; box-shadow: var(--st-shadow-lift); }
.st-tpl-screen {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 13% 7.5% 7%;
	font-size: 12px;
	overflow: hidden;
}
.st-tpl-phone--lg .st-tpl-screen { font-size: 14px; }

.st-tpl-avatar {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 4.6em;
	height: 4.6em;
	flex: none;
	border-radius: 50%;
	font-weight: 700;
	font-size: 1.15em;
	margin-bottom: .8em;
}
.st-tpl-name { font-size: 1.45em; font-weight: 700; line-height: 1.2; text-align: center; }
.st-tpl-sub { font-size: .95em; line-height: 1.4; text-align: center; }

.st-tpl-socials { display: flex; gap: .55em; margin: .9em 0 1em; }
.st-tpl-social { display: flex; align-items: center; justify-content: center; width: 2.3em; height: 2.3em; border-radius: 50%; }
.st-tpl-social svg { width: 1.1em; height: 1.1em; }

.st-tpl-rows { display: flex; flex-direction: column; gap: .6em; width: 100%; }
.st-tpl-row {
	display: flex;
	align-items: center;
	gap: .75em;
	padding: .6em .75em;
	border-width: 1px;
	border-style: solid;
	width: 100%;
}
.st-tpl-chip { display: flex; align-items: center; justify-content: center; width: 2.3em; height: 2.3em; flex: none; }
.st-tpl-chip svg { width: 1.15em; height: 1.15em; }
.st-tpl-rowtext { font-weight: 600; font-size: 1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.st-tpl-about { margin-top: 1em; font-size: .9em; line-height: 1.5; text-align: center; }
.st-tpl-cta {
	margin-top: auto;
	width: 100%;
	padding: .8em;
	border-width: 2px;
	border-style: solid;
	text-align: center;
	font-weight: 700;
	font-size: .95em;
}

/* ---- detail page ---- */
.st-tpl-crumbs { display: flex; flex-wrap: wrap; gap: .5rem; font-size: .9rem; color: var(--st-ink-mute); margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.st-tpl-crumbs a { color: var(--st-ink-soft); text-decoration: none; }
.st-tpl-crumbs a:hover { color: var(--st-brand); text-decoration: underline; }
.st-tpl-crumbs [aria-current] { color: var(--st-ink); }

.st-tpl-detail { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.st-tpl-detail__copy { display: flex; flex-direction: column; gap: 1.1rem; }
.st-tpl-detail__more { margin: 0; font-size: .95rem; line-height: 1.6; color: var(--st-ink-mute); max-width: 34rem; }
.st-tpl-tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.st-tpl-tag { padding: .45rem 1rem; border: 1px solid var(--st-line-firm); border-radius: var(--st-r-pill); background: var(--st-surface); font-size: .875rem; color: var(--st-ink); text-decoration: none; }
.st-tpl-tag:hover { border-color: var(--st-brand-edge); color: var(--st-brand); }
.st-tpl-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .5rem; }
.st-tpl-fine { margin: 0; font-size: .85rem; color: var(--st-ink-mute); }

.st-tpl-more { margin-top: clamp(3rem, 8vw, 6rem); }
.st-tpl-more__title { display: block; font-family: var(--st-display); font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 1.5rem; color: var(--st-ink); }
.st-tpl-all { display: inline-block; margin-top: 1.75rem; font-weight: 600; color: var(--st-brand); }

/* ---- bottom band ---- */
.st-tpl-band {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem 2rem;
	margin-top: clamp(3rem, 7vw, 5rem);
	padding: clamp(1.5rem, 4vw, 2.25rem);
	border-radius: var(--st-r-card);
	background: var(--st-surface);
	border: 1px solid var(--st-line);
}
.st-tpl-band__title { display: block; font-family: var(--st-display); font-size: 1.5rem; color: var(--st-ink); }
.st-tpl-band p { margin: .35rem 0 0; color: var(--st-ink-soft); max-width: 36rem; }

/* ---- narrow screens ---- */
@media (max-width: 991px) {
	.st-tpl-layout { grid-template-columns: minmax(0, 1fr); }
	.st-tpl-cats { position: static; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: none; }
	.st-tpl-cats::-webkit-scrollbar { display: none; }
	.st-tpl-cats__label { display: none; }
	.st-tpl-cat { white-space: nowrap; flex: none; }
	.st-tpl-detail { grid-template-columns: minmax(0, 1fr); }
	.st-tpl-detail__preview { order: -1; }
	.st-tpl-grid--three { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
@media (max-width: 575px) {
	.st-tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
	.st-tpl-screen { font-size: 8.5px; }
	.st-tpl-card__desc { display: none; }
	.st-tpl-phone { border-radius: 24px; }
	.st-tpl-phone--lg { max-width: 300px; }
	.st-tpl-phone--lg .st-tpl-screen { font-size: 12px; }
}
