/* =====================================================
   TIKTOK GALLERY — loaded only by page-tiktok.php
   Uses the theme variables from style.css, so changing
   a colour there changes it here too.
   Design: "A3 Neon cards", 3 columns.
   ===================================================== */

/* ---- Heading row (same as the Micro-Blog page) ---- */
.tt-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: nowrap;            /* keep the Follow button on the right, beside the text */
	gap: 14px 20px;
	padding-bottom: 18px;
	border-bottom: 1px solid var(--color-border-line);
}

.tt-head-text {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.tt-follow {
	flex: 0 0 auto;
	white-space: nowrap;
}

.tt-title {
	margin: 0;
	font-size: 20px;
	font-weight: 700;
	color: var(--color-text-primary);
}

.tt-sub {
	font-size: 13px;
	color: var(--color-text-meta);
}

.tt-dot {
	color: var(--color-nav-sep);
}

/* TikTok bio: "Metal Head from Perak, Malaysia ▪ myBlog - www.meshra.net ▪ …" */
.tt-bio {
	margin-top: 4px;
	font-size: 13px;
	font-weight: 300;
	line-height: 1.5;
	color: var(--color-text-body);
	overflow-wrap: anywhere;
}

.tt-bio a,
.tt-bio a:visited {
	color: var(--color-text-body);
	border-bottom: 1px dotted var(--color-border-input);
}

.tt-bio a:hover {
	color: var(--color-link-hover);
	border-bottom-color: var(--color-link-hover);
	text-decoration: none;
}

/* "Follow on TikTok" and "Watch more on TikTok" — same look as "Follow on Bluesky" */
.tt-follow,
.tt-follow:visited,
.tt-watch,
.tt-watch:visited {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	box-sizing: border-box;
	min-height: 40px;
	padding: 0 14px;
	border: 1px solid var(--color-border-input);
	border-radius: 8px;
	background-color: var(--color-bg-inset);
	font-size: 13px;
	color: var(--color-text-primary);
}

.tt-follow:hover,
.tt-watch:hover {
	border-color: var(--color-link-hover);
	color: var(--color-link-hover);
	text-decoration: none;
}

/* ---- Grid of neon cards ---- */
.tt-grid {
	display: grid;
	padding-top: 22px;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 18px 14px;
}

.tt-card,
.tt-card:visited {
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-width: 0;
	padding: 8px 8px 12px;
	border: 1px solid var(--color-border-line);
	border-radius: 14px;
	background-color: var(--color-bg-inset);
	color: var(--color-text-body);
	transition: border-color .15s, box-shadow .15s, transform .15s;
}

.tt-card:hover {
	border-color: var(--color-link-hover);
	box-shadow: 0 10px 28px rgba(255, 140, 66, 0.18);   /* orange glow — matches --color-link-hover */
	transform: translateY(-3px);
	color: var(--color-text-body);
	text-decoration: none;
}

/* cover: 9:16, placeholder colour shows if the picture is missing */
.tt-cover {
	position: relative;
	display: block;
	aspect-ratio: 9 / 16;
	border-radius: 10px;
	overflow: hidden;
	background-color: #2f3b4a;
}

.tt-c1 { background-color: #4a3f35; }
.tt-c2 { background-color: #2f4a45; }
.tt-c3 { background-color: #463a4f; }
.tt-c4 { background-color: #3d4a2f; }
.tt-c5 { background-color: #4f3a3a; }

.tt-cover img {
	position: absolute;
	top: 0;
	left: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border: 0;
}

/* corner badges: ▶ 0:27 / photo 1/3, and Pinned */
.tt-badge,
.tt-pin {
	position: absolute;
	top: 10px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 8px;
	border-radius: 4px;
	font-size: 12px;
	pointer-events: none;
}

.tt-badge {
	right: 10px;
	background-color: rgba(0, 0, 0, 0.78);
	font-family: var(--theme-font-code);
	font-size: 11px;
	color: #ffffff;
}

.tt-pin {
	left: 10px;
	background-color: var(--color-link-hover);
	font-weight: 700;
	color: #111111;
}

/* description, cut at MESH_TT_CAPTION characters with [... more] */
.tt-cap {
	padding: 0 4px;
	font-size: 14px;
	line-height: 1.45;
	color: var(--color-text-primary);
	overflow-wrap: anywhere;
}

.tt-card:hover .tt-cap {
	color: var(--color-link-hover);
}

.tt-more {
	color: var(--color-text-meta);
	white-space: nowrap;
}

.tt-card:hover .tt-more {
	color: var(--color-text-primary);
}

/* views / comments pills */
.tt-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: auto;
	padding: 0 4px;
}

.tt-pill {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 4px 10px;
	border-radius: 999px;
	background-color: #1b1b1b;
	font-size: 12px;
	color: var(--color-text-primary);
}

.tt-pill svg {
	color: var(--color-link-hover);
}

/* ---- End of the page ---- */
.tt-end {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	padding-top: 30px;
}

.tt-watch,
.tt-watch:visited {
	min-height: 44px;
	padding: 0 22px;
	font-size: 14px;
}

.tt-updated {
	font-size: 12px;
	color: var(--color-text-meta);
}

/* ---- Admin box (only when you are logged in as admin) ---- */
.tt-admin {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 14px;
	margin-top: 26px;
	padding: 12px 14px;
	border: 1px dashed var(--color-border-input);
	border-radius: 8px;
	font-size: 12px;
	color: var(--color-text-meta);
}

.tt-admin strong {
	color: var(--color-text-primary);
	font-weight: 500;
}

.tt-admin-msg {
	color: var(--color-link-hover);
}

.tt-admin-err {
	color: #ff7b7b;
}

.tt-admin-btns {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-left: auto;
}

.tt-admin-btns a,
.tt-admin-btns a:visited {
	padding: 6px 10px;
	border: 1px solid var(--color-border-input);
	border-radius: 6px;
	color: var(--color-text-primary);
}

.tt-admin-btns a:hover {
	border-color: var(--color-link-hover);
	color: var(--color-link-hover);
	text-decoration: none;
}

/* ---- Hover preview (mouse only): bigger cover + full description in the middle of the screen ---- */
.tt-pop {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background-color: rgba(0, 0, 0, 0.55);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;         /* never blocks the card underneath — click still opens TikTok */
	transition: opacity .15s, visibility .15s;
}

.tt-pop.is-on {
	opacity: 1;
	visibility: visible;
}

.tt-pop-box {
	display: flex;
	gap: 22px;
	width: 100%;
	max-width: 780px;
	max-height: calc(100vh - 48px);
	padding: 16px;
	border: 1px solid var(--color-link-hover);
	border-radius: 16px;
	background-color: var(--color-bg-inset);
	box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 140, 66, 0.15);
	transform: scale(.97);
	transition: transform .15s;
}

.tt-pop.is-on .tt-pop-box {
	transform: scale(1);
}

.tt-pop-cover {
	position: relative;
	flex: 0 0 auto;
	height: min(560px, calc(100vh - 80px));
	aspect-ratio: 9 / 16;
	border-radius: 12px;
	overflow: hidden;
	background-color: #2f3b4a;
}

.tt-pop-cover img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.tt-pop-body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 6px 4px;
	overflow-y: auto;
}

.tt-pop-body p {
	margin: 0;
}

.tt-pop-line {
	font-size: 15px;
	font-weight: 500;
	color: var(--color-text-primary);
}

.tt-pop-m {
	font-weight: 400;
	color: var(--color-text-meta);
}

.tt-pop-text {
	font-size: 15px;
	font-weight: 300;
	line-height: 1.65;
	color: var(--color-text-body);
	white-space: pre-line;
	overflow-wrap: anywhere;
}

.tt-pop-tag {
	color: var(--color-link-hover);
}

.tt-pop-stats {
	margin-top: auto !important;
	padding: 0;
}

.tt-pop-stats .tt-pill {
	padding: 6px 12px;
	font-size: 13px;
}

.tt-pop-hint {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: var(--color-text-meta);
}

/* ---- Smaller screens ---- */
@media (max-width: 760px) {
	.tt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
	.tt-head { flex-wrap: wrap; }
	.tt-grid { gap: 12px 10px; }
	.tt-card { padding: 6px 6px 10px; border-radius: 12px; }
	.tt-cap { font-size: 13px; }
	.tt-pill { padding: 3px 8px; font-size: 11px; }
}
