/*
 * Service pages: the week grid (VOY-996, Social Media Management's live
 * surface; spec KB-526 section 2).
 *
 * Three published pieces above, four platforms down the side, seven days
 * across, one button per post. A post is the 500 once it has gone out; the
 * posts from the hovered source are lit. svc-week.js builds it, sets a
 * readout ("Wed · Instagram · a photo from the inspection, from ...") and a
 * tally, and fills the week in over time. It is the page's only dither
 * surface. Labelled Illustration.
 */

.vy-svc-page .vy-svc-week {
	position: relative;
	isolation: isolate;
	padding: 24px;
	border: 1px solid var(--border-1);
	border-radius: 6px;
	background: var(--bg-panel);
}
.vy-svc-page .vy-svc-week > .vy-dither {
	position: absolute;
	inset: 0;
	z-index: -1;
	width: 100%;
	height: 100%;
	pointer-events: none;
	border-radius: inherit;
}

.vy-svc-page .vy-svc-week__sources {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
	margin: 0 0 18px;
	padding: 0;
	list-style: none;
	counter-reset: vy-src;
}
.vy-svc-page .vy-svc-week__sources > li:nth-child(n) {
	margin: 0;
	padding: 10px 12px;
	border: 1px solid var(--border-hair);
	border-radius: 4px;
	font-size: 13px;
	line-height: 1.35;
	color: var(--fg-2);
	transition: border-color 200ms var(--svc-ease), background-color 200ms var(--svc-ease);
}
.vy-svc-page .vy-svc-week__sources > li.is-lit {
	border-color: var(--um-500);
	background: color-mix(in oklab, var(--um-500) 10%, transparent);
	color: var(--fg-1);
}
.vy-svc-page .vy-svc-week__kind {
	display: block;
	margin-bottom: 4px;
	font-family: var(--font-mono);
	font-size: 10px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--um-500);
}

.vy-svc-page .vy-svc-week__grid {
	display: grid;
	grid-template-columns: minmax(0, 1.8fr) repeat(7, minmax(0, 1fr));
	gap: 5px;
	align-items: center;
	margin-bottom: 18px;
}
.vy-svc-page .vy-svc-week__day,
.vy-svc-page .vy-svc-week__platform {
	font-family: var(--font-mono);
	font-size: 10px;
	letter-spacing: 0.04em;
	color: var(--fg-3);
}
.vy-svc-page .vy-svc-week__day { text-align: center; text-transform: uppercase; }
.vy-svc-page .vy-svc-week__platform { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vy-svc-page .vy-svc-week__platform .is-short { display: none; }

.vy-svc-page .vy-svc-week__empty,
.vy-svc-page .vy-svc-week__grid button {
	height: 32px;
	min-width: 0;
	padding: 0;
	border: 1px solid var(--border-hair);
	border-radius: 3px;
	background: color-mix(in oklab, var(--bg-canvas) 70%, transparent);
}
.vy-svc-page .vy-svc-week__empty { opacity: 0.45; }
.vy-svc-page .vy-svc-week__grid button {
	border-style: dashed;
	border-color: color-mix(in oklab, var(--um-700) 70%, transparent);
	cursor: crosshair;
	transition: background-color 400ms var(--svc-ease), border-color 200ms var(--svc-ease);
}
.vy-svc-page .vy-svc-week__grid button.is-posted {
	border-style: solid;
	border-color: var(--um-700);
	background: color-mix(in oklab, var(--um-700) 45%, transparent);
}
.vy-svc-page .vy-svc-week__grid button.is-posted.is-lit {
	border-color: var(--um-500);
	background: color-mix(in oklab, var(--um-500) 60%, transparent);
}
.vy-svc-page .vy-svc-week__grid button:is(:hover, :focus-visible, .is-active) { border-color: var(--fg-1); }
.vy-svc-page .vy-svc-week__grid button:focus-visible { outline: 2px solid var(--um-500); outline-offset: 2px; }
.vy-svc-page .vy-svc-week__grid button.is-new { animation: vy-svc-posted 900ms var(--svc-ease); }
@keyframes vy-svc-posted {
	30% { box-shadow: 0 0 0 4px color-mix(in oklab, var(--um-500) 45%, transparent); }
}

.vy-svc-page .vy-svc-week__readout {
	min-height: 1.5em;
	font-family: var(--font-mono);
	font-size: 13px;
	letter-spacing: 0.02em;
	color: var(--fg-1);
}
.vy-svc-page .vy-svc-week__tally {
	margin-top: 6px;
	font-family: var(--font-mono);
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--um-500);
}

/* Mobile: the sources stack, platform labels shorten, posts become 44px
   tap targets. */
@media (max-width: 767px) {
	.vy-svc-page .vy-svc-week { padding: 16px; }
	.vy-svc-page .vy-svc-week__sources { grid-template-columns: 1fr; }
	.vy-svc-page .vy-svc-week__grid { grid-template-columns: 34px repeat(7, minmax(0, 1fr)); gap: 4px; }
	.vy-svc-page .vy-svc-week__platform .is-long { display: none; }
	.vy-svc-page .vy-svc-week__platform .is-short { display: inline; }
	.vy-svc-page .vy-svc-week__empty,
	.vy-svc-page .vy-svc-week__grid button { height: 44px; }
	.vy-svc-page .vy-svc-week__day { font-size: 9px; letter-spacing: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.vy-svc-page .vy-svc-week__grid button,
	.vy-svc-page .vy-svc-week__sources > li:nth-child(n) { transition: none; }
	.vy-svc-page .vy-svc-week__grid button.is-new { animation: none; }
}
