/* TuServerMu - Top Sites on the home page (Phase 8, 2026-12-03).
   Template: Themes/default/TopSitesHome.template.php, data: Sources/TopSitesHome.php. Classes start with tsh-.
   Block "Top MU Servers this month" above the boards (bar like the category bars: #334f7f, Tahoma bold) and the
   sidebar box "Opening soon" (uses the theme's .modern-widget). Pictures: images/topsites (Phase 7; new file name
   whenever a picture changes, Cloudflare keeps pictures 7 days). */

.tsh {
	--tsh-navy: #23406e;
	--tsh-line: #dce5f0;
	--tsh-muted: #5b6b82;
	color: #1e293b;
	font-size: 13.5px;
	line-height: 1.45;
}
.tsh *,
.tsh *::before,
.tsh *::after { box-sizing: border-box; min-width: 0; }

/* Bar */
.tsh-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-right: 14px; border-radius: 6px 6px 0 0; background: #334f7f; }
.tsh-bar h3 { margin: 0; padding: 14px 12px 12px; overflow: hidden; font-family: Tahoma, sans-serif; font-size: 1.1em; font-weight: 700; color: #fff; white-space: nowrap; text-overflow: ellipsis; }
.tsh-bar h3 a,
.tsh-bar h3 a:hover { color: #fff; text-decoration: none; }
.tsh-bar h3 i { margin-right: 3px; color: #ffd36b; }
.tsh-month { margin-left: 6px; padding: 2px 9px; border-radius: 999px; background: rgba(255, 255, 255, .14); font-size: 11.5px; font-weight: 700; vertical-align: 1px; }
.tsh-all { flex: 0 0 auto; color: #dbe7f7 !important; font-size: 12.5px; font-weight: 700; text-decoration: none !important; white-space: nowrap; }
.tsh-all:hover { color: #fff !important; }

.tsh-body { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--tsh-line); border-top: 0; border-radius: 0 0 12px 12px; background: #fff; box-shadow: 0 4px 20px rgba(0, 0, 0, .04); }
.tsh-note { display: flex; gap: 8px; align-items: center; margin: 0; padding: 8px 12px; border: 1px solid #f5c86b; border-radius: 8px; background: #fff7e6; color: #5c3a00; font-size: 12.5px; }
.tsh-note i { color: #b45309; }
.tsh-empty { display: flex; gap: 12px; align-items: center; padding: 14px; border: 1px dashed #c6d4e6; border-radius: 10px; background: #f7faff; }
.tsh-empty i { font-size: 26px; color: var(--tsh-navy); }
.tsh-empty p { margin: 0; }

.tsh-grid { display: grid; gap: 14px; }
@media (min-width: 860px) {
	.tsh-grid { grid-template-columns: minmax(0, 500px) minmax(0, 1fr); align-items: stretch; }
}

/* Showcase: the banners of the top 5 take turns on the navy mist (jpg line, then webp through image-set) */
.tsh-show {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 10px;
	padding: 16px 16px 12px;
	overflow: hidden;
	border-radius: 10px;
	color: #fff;
	background: linear-gradient(180deg, rgba(9, 24, 48, .3), rgba(9, 24, 48, .78)), #10264a url("../images/topsites/banner-bg-v1.jpg") center / cover no-repeat;
	background-image: linear-gradient(180deg, rgba(9, 24, 48, .3), rgba(9, 24, 48, .78)), image-set(url("../images/topsites/banner-bg-v1.webp") type("image/webp"), url("../images/topsites/banner-bg-v1.jpg") type("image/jpeg"));
}
.tsh-slides { display: grid; }
.tsh-slide { grid-area: 1 / 1; display: grid; justify-items: center; gap: 9px; opacity: 0; visibility: hidden; transition: opacity .5s ease, visibility .5s; color: #fff !important; text-decoration: none !important; }
.tsh-slide.is-on { opacity: 1; visibility: visible; }
@media (prefers-reduced-motion: reduce) {
	.tsh-slide,
	.tsh .tsh-dot { transition: none; }
}
.tsh-slide:focus-visible { outline: 2px solid #ffd36b; outline-offset: 3px; border-radius: 6px; }
.tsh-banner { display: block; width: 100%; max-width: 468px; height: auto; aspect-ratio: 468 / 60; object-fit: cover; border-radius: 6px; box-shadow: 0 6px 18px rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 214, 120, .35); }
.tsh-noban { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 1px; padding: 0 16px; overflow: hidden; }
.tsh-noban b { overflow: hidden; font-family: Georgia, "Times New Roman", serif; font-size: 19px; line-height: 1.15; letter-spacing: .03em; white-space: nowrap; text-overflow: ellipsis; text-shadow: 0 2px 10px rgba(0, 0, 0, .45); }
.tsh-noban small { overflow: hidden; color: #ffd36b; font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; text-overflow: ellipsis; }
.tsh-bn-0 { background: radial-gradient(circle at 88% 15%, rgba(255, 211, 107, .5), transparent 42%), linear-gradient(110deg, #0f2347 0%, #2f5c9e 100%); }
.tsh-bn-1 { background: radial-gradient(circle at 88% 15%, rgba(255, 190, 120, .45), transparent 42%), linear-gradient(110deg, #33060f 0%, #a3243b 100%); }
.tsh-bn-2 { background: radial-gradient(circle at 88% 15%, rgba(214, 170, 255, .45), transparent 42%), linear-gradient(110deg, #1d0f3d 0%, #6a3fb5 100%); }
.tsh-bn-3 { background: radial-gradient(circle at 88% 15%, rgba(140, 240, 230, .4), transparent 42%), linear-gradient(110deg, #052a30 0%, #13808a 100%); }
.tsh-bn-4 { background: radial-gradient(circle at 88% 15%, rgba(190, 240, 150, .4), transparent 42%), linear-gradient(110deg, #0b2615 0%, #2f8a4b 100%); }
.tsh-bn-5 { background: radial-gradient(circle at 88% 15%, rgba(255, 214, 150, .5), transparent 42%), linear-gradient(110deg, #2a1405 0%, #b0642a 100%); }
.tsh-cap { max-width: 100%; overflow: hidden; font-size: 13px; text-align: center; white-space: nowrap; text-overflow: ellipsis; text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }
.tsh-cap-place { display: inline-block; padding: 1px 7px; border-radius: 999px; background: linear-gradient(160deg, #ffe28a, #f5a623); color: #3b2a00; font-size: 11.5px; font-weight: 800; text-shadow: none; }
.tsh-cap-votes { color: #cfe0f7; }
.tsh-dots { display: flex; justify-content: center; gap: 6px; }
.tsh .tsh-dot { width: 9px; height: 9px; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .4); line-height: 0; cursor: pointer; transition: width .2s ease, background-color .2s ease; }
.tsh .tsh-dot.is-on { width: 22px; background: #ffd36b; }
.tsh .tsh-dot:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* The top 5 */
.tsh-list { display: grid; gap: 3px; align-content: center; margin: 0; padding: 0; list-style: none; }
.tsh-row { position: relative; display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 5px 8px 5px 10px; border: 1px solid transparent; border-radius: 9px; transition: background-color .2s ease, border-color .2s ease; }
.tsh-row.is-on { border-color: #dce6f4; background: #f3f7fd; }
.tsh-row.is-on::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: #f5a623; }
.tsh-place { flex: 0 0 auto; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: #eef3fa; color: var(--tsh-navy); font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tsh-row.is-top .tsh-place { border-radius: 50%; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12), 0 2px 6px rgba(0, 0, 0, .12); }
.tsh-row.is-p1 .tsh-place { background: linear-gradient(160deg, #ffe28a, #f5a623); color: #3b2a00; }
.tsh-row.is-p2 .tsh-place { background: linear-gradient(160deg, #f4f7fb, #a9b6c8); color: #25313f; }
.tsh-row.is-p3 .tsh-place { background: linear-gradient(160deg, #f6c39b, #c26b2f); color: #3a1b05; }
.tsh-logo { flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 34px; overflow: hidden; border-radius: 50%; background: radial-gradient(circle at 30% 25%, #5b8ad1, #23406e 70%); color: #ffd36b; font-size: 12px; font-weight: 800; box-shadow: 0 0 0 2px #e3ecf9; }
.tsh-logo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tsh-logo.is-sm { width: 32px; height: 32px; font-size: 11.5px; }
.tsh-main { flex: 1 1 auto; display: grid; line-height: 1.25; }
.tsh-name { overflow: hidden; color: var(--tsh-navy) !important; font-size: 13.5px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; text-decoration: none !important; }
.tsh-name:hover { color: #2563c9 !important; text-decoration: underline !important; }
.tsh-tags { overflow: hidden; color: var(--tsh-muted); font-size: 11.5px; white-space: nowrap; text-overflow: ellipsis; }
.tsh-votes { flex: 0 0 auto; color: var(--tsh-muted); font-size: 11px; line-height: 1.15; text-align: right; }
.tsh-votes b { display: block; color: var(--tsh-navy); font-size: 14px; font-variant-numeric: tabular-nums; }
.tsh-vote { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 8px; background: linear-gradient(180deg, #ffc94f, #f59e0b); color: #3a2500 !important; font-size: 12.5px; font-weight: 800; line-height: 1.2; text-decoration: none !important; box-shadow: 0 2px 6px rgba(245, 158, 11, .3); }
.tsh-vote:hover { box-shadow: 0 3px 12px rgba(245, 158, 11, .5); }

/* Buttons under the block and in the sidebar box (the box is outside .tsh, so plain colours) */
.tsh-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid #edf2f8; }
.tsh-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid #cbd8ea; border-radius: 8px; background: #fff; color: #23406e !important; font-size: 12.5px; font-weight: 700; line-height: 1.2; text-decoration: none !important; white-space: nowrap; }
.tsh-btn:hover { border-color: #9fb6d6; background: #f5f8fd; }
.tsh-btn-gold { border-color: transparent; background: linear-gradient(180deg, #ffc94f, #f59e0b); color: #3a2500 !important; box-shadow: 0 2px 8px rgba(245, 158, 11, .3); }
.tsh-btn-gold:hover { border-color: transparent; background: linear-gradient(180deg, #ffd263, #f7a51c); }
.tsh-meta { margin-left: auto; color: var(--tsh-muted); font-size: 12px; }

@media (max-width: 640px) {
	.tsh-bar h3 { padding: 13px 10px 11px; }
	.tsh-month { display: none; }
	.tsh-body { padding: 10px; }
	.tsh-show { padding: 12px 10px 10px; }
	.tsh-row { gap: 8px; padding-left: 8px; }
	.tsh-tags { display: none; }
	.tsh-vote { padding: 8px 10px; }
	.tsh-vote span { display: none; }
	.tsh-foot .tsh-btn { flex: 1 1 auto; justify-content: center; }
	.tsh-meta { width: 100%; margin-left: 0; text-align: center; }
}

/* Sidebar box "Opening soon" */
.tsh-soon { padding-top: 4px; }
.tsh-soon-list { margin: 0; padding: 0; list-style: none; }
.tsh-soon-row { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid #f1f5f9; text-decoration: none !important; }
.tsh-soon-row:hover { background: #f8fafc; }
.tsh-soon-main { display: grid; min-width: 0; line-height: 1.3; }
.tsh-soon-main b { overflow: hidden; color: #334155; font-size: 13.5px; white-space: nowrap; text-overflow: ellipsis; }
.tsh-soon-row:hover .tsh-soon-main b { color: #3b82f6; }
.tsh-soon-main small { color: #64748b; font-size: 12px; font-weight: 600; }
.tsh-soon-main small i { color: #f59e0b; }
.tsh-soon-more { display: block; padding: 8px 14px 0; font-size: 12.5px; font-weight: 700; }
.tsh-soon-empty { margin: 0; padding: 12px 14px 2px; color: #475569; font-size: 13px; line-height: 1.5; }
.tsh-soon-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 10px; padding: 12px 14px 14px; }
.tsh-soon-foot .tsh-btn { flex: 1 1 auto; justify-content: center; }
.tsh-soon-cal { font-size: 12.5px; font-weight: 700; text-decoration: none; white-space: nowrap; }
