/* Messages: Season Archive (layout_msg_archive; CUSTOM-TEMPLATE.md D6). Restyle with the --cc-msg-archive-* variables. */
.cc-msg-archive {
	--cc-msg-archive-accent: var(--color-main);
	--cc-msg-archive-rule: currentColor;
	--cc-msg-archive-line: color-mix(in srgb, currentColor 16%, transparent);
	--cc-msg-archive-muted: color-mix(in srgb, currentColor 76%, transparent);
	--cc-msg-archive-heading-font: var(--font-titles);
	--cc-msg-archive-heading-size: clamp(28px, 3.2vw, 52px);
	--cc-msg-archive-num-font: var(--font-titles);
	--cc-msg-archive-radius: var(--img-radius, 0);
	--cc-msg-archive-top: calc(var(--ct-header-h, 100px) + 32px);
	min-width: 0;
}
.bg-main .cc-msg-archive, .bg-black .cc-msg-archive, .bg-image .cc-msg-archive { --cc-msg-archive-accent: currentColor; }
.cc-msg-archive .cc-msg-empty, .cc-msg-archive .cc-msg-note { margin: 0; color: var(--cc-msg-archive-muted); }
.cc-msg-archive .cc-msg-note { margin-top: .5em; }

.cc-msg-archive__group { border-top: 2px solid var(--cc-msg-archive-rule); padding-top: clamp(20px, 2vw, 32px); margin-top: clamp(40px, 4vw, 72px); min-width: 0; }
.cc-msg-archive__group:first-child { margin-top: 0; }
.cc-msg-archive__head { min-width: 0; }
.cc-msg-archive__heading {
	margin: 0; font-family: var(--cc-msg-archive-heading-font); font-size: var(--cc-msg-archive-heading-size); line-height: 1;
	letter-spacing: -.01em; text-transform: var(--title-transform, none); text-wrap: balance; overflow-wrap: anywhere;
}
.cc-msg-archive__sub, .cc-msg-archive__count { display: block; margin-top: .5rem; font-size: 16px; line-height: 1.3; letter-spacing: 0; text-transform: none; color: var(--cc-msg-archive-muted); }
.cc-msg-archive__heading .cc-msg-archive__sub { font-family: var(--font-body); font-weight: 400; }
.cc-msg-archive__cover { max-width: 180px; aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--cc-msg-archive-radius); margin-bottom: 1rem; background: color-mix(in srgb, currentColor 6%, transparent); }
.cc-msg-archive__cover img { display: block; width: 100%; height: 100%; object-fit: cover; }

.cc-msg-archive__list { list-style: none; margin: 1.25rem 0 0; padding: 0; min-width: 0; }
.cc-msg-archive__row {
	position: relative; display: grid; grid-template-columns: 4.5em minmax(0, 1fr) auto; align-items: center;
	gap: clamp(12px, 1.6vw, 24px); padding-block: 16px; margin: 0; border-bottom: 1px solid var(--cc-msg-archive-line);
}
.cc-msg-archive__row--full { grid-template-columns: 7.5em minmax(0, 1fr) auto; }
.cc-msg-archive__row:first-child { padding-top: 0; }
.cc-msg-archive__day { display: block; line-height: 1; }
.cc-msg-archive__num { display: block; font-family: var(--cc-msg-archive-num-font); font-size: clamp(24px, 2vw, 32px); line-height: 1; font-variant-numeric: tabular-nums; }
.cc-msg-archive__wd { display: block; margin-top: .3rem; font-size: 16px; line-height: 1.2; color: var(--cc-msg-archive-muted); }
.cc-msg-archive__day--full { font-size: 16px; line-height: 1.3; color: var(--cc-msg-archive-muted); }
.cc-msg-archive__text { display: block; min-width: 0; }
.cc-msg-archive__title {
	display: block; font-family: var(--font-titles); font-size: clamp(18px, 1.5vw, 24px); line-height: 1.2;
	text-wrap: balance; overflow-wrap: anywhere; color: inherit; text-decoration: none;
}
.cc-msg-archive__title::after { content: ''; position: absolute; inset: 0; }
.cc-msg-archive__meta { display: block; margin-top: .35em; font-size: 16px; line-height: 1.3; color: var(--cc-msg-archive-muted); overflow-wrap: anywhere; }
.cc-msg-archive__thumb { width: 64px; aspect-ratio: 1; overflow: hidden; border-radius: var(--cc-msg-archive-radius); background: color-mix(in srgb, currentColor 6%, transparent); }
.cc-msg-archive__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cc-msg-archive__title:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
@supports selector(:has(*)) {
	.cc-msg-archive__row:has(:focus-visible) { outline: 2px solid currentColor; outline-offset: 4px; }
	.cc-msg-archive__title:focus-visible { outline: none; }
}
.cc-msg-archive__row:hover .cc-msg-archive__title { color: var(--cc-msg-archive-accent); }
.bg-main .cc-msg-archive__row:hover .cc-msg-archive__title,
.bg-black .cc-msg-archive__row:hover .cc-msg-archive__title,
.bg-image .cc-msg-archive__row:hover .cc-msg-archive__title { text-decoration-line: var(--cc-link-hover-line, none); text-decoration-thickness: 1px; text-underline-offset: .2em; }

/* Wide screens: heading column stays in view while its rows scroll */
@media (min-width: 1001px) {
	.cc-msg-archive__group { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: clamp(24px, 3vw, 56px); align-items: start; }
	.cc-msg-archive__head { position: sticky; top: var(--cc-msg-archive-top); }
	.cc-msg-archive__list { margin-top: 0; }
	.cc-msg-archive__row:first-child { padding-top: 0; }
}
@media (max-width: 1000px) {
	.cc-msg-archive__head { position: static; }
	.cc-msg-archive__heading { font-size: clamp(26px, 7vw, 40px); }
}
@media (max-width: 480px) {
	.cc-msg-archive__row { grid-template-columns: 3.4em minmax(0, 1fr) auto; }
	/* By series: the full date sits above the title so the title keeps the width */
	.cc-msg-archive__row--full { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }
	.cc-msg-archive__row--full .cc-msg-archive__day--full { grid-column: 1; grid-row: 1; }
	.cc-msg-archive__row--full .cc-msg-archive__text { grid-column: 1; grid-row: 2; }
	.cc-msg-archive__row--full .cc-msg-archive__thumb { grid-column: 2; grid-row: 1 / span 2; }
	.cc-msg-archive__thumb { width: 48px; }
}

@media (prefers-reduced-motion: no-preference) {
	.cc-msg-archive__title { transition: color .2s; }
}
