/*--------------------------------------------------------------
# Inner Circle Archive Preview
# Video card grid + popup modal with trailer + end-of-video CTA.
--------------------------------------------------------------*/

/* ── Section wrapper ── */
.m-archive {
	padding: 60px 0 100px;
	overflow: hidden;
}

/* ── Container ── */
.m-archive__container {
	width: 100%;
	max-width: 1140px;
	margin: 0 auto;
	padding: 0 var(--tpp-container-padding);

	/* Scroll-reveal */
	opacity: 0;
	transform: translateY(32px);
	transition:
		opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
		transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.m-archive__container.is-visible {
	opacity: 1;
	transform: translateY(0);
}


/* ──────────────────────────────────────────────
   Section header
   ────────────────────────────────────────────── */

.m-archive__header {
	text-align: center;
	margin-bottom: 40px;
}

.m-archive__heading {
	font-family: var(--tpp-font-heading);
	font-size: clamp(2rem, 4.5vw + 0.5rem, 3.5rem);
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -0.03em;
	color: var(--tpp-black);
	margin: 0 0 12px;
}

.m-archive__heading-accent {
	color: var(--tpp-text-light);
}

.m-archive__subtitle {
	font-family: var(--tpp-font-body);
	font-size: 0.9rem;
	font-weight: 400;
	color: var(--tpp-text-light);
	margin: 0 0 16px;
}

.m-archive__badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: var(--tpp-font-body);
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--tpp-white);
	background: var(--tpp-black);
	padding: 6px 14px;
	border-radius: var(--tpp-radius-pill);
}


/* ──────────────────────────────────────────────
   Session cards grid
   ────────────────────────────────────────────── */

.m-archive__grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 12px;
}

/* ── Card base ── */
.m-archive__card {
	display: flex;
	flex-direction: column;
	padding: 0;
	background: var(--tpp-off-white);
	border: 1px solid rgba(0, 0, 0, 0.05);
	border-radius: 14px;
	cursor: pointer;
	transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
	text-align: left;
	font-family: inherit;
	font-size: inherit;
	overflow: hidden;
}

.m-archive__card:hover {
	border-color: rgba(0, 0, 0, 0.12);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px);
}

/* ── Thumbnail ── */
.m-archive__card-thumb {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #111;
}

/* The card shows the thumbnail image when the slot has one, and falls
   back to the video's own first frame when it doesn't. Same look either way. */
.m-archive__card-video,
.m-archive__card-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	pointer-events: none;
	transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.m-archive__card:hover .m-archive__card-video,
.m-archive__card:hover .m-archive__card-img {
	transform: scale(1.05);
}

/* Dark overlay on thumb */
.m-archive__card-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.25);
	transition: background 0.3s ease;
}

.m-archive__card:hover .m-archive__card-overlay {
	background: rgba(0, 0, 0, 0.4);
}

/* Play button on thumb */
.m-archive__card-play {
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.95);
	color: var(--tpp-black);
	border-radius: 50%;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.m-archive__card:hover .m-archive__card-play {
	transform: scale(1.1);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Card title (overlaid on thumb) */
.m-archive__card-title {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 2;
	font-family: var(--tpp-font-body);
	font-size: 0.82rem;
	font-weight: 500;
	color: var(--tpp-white);
	line-height: 1.4;
	padding: 24px 14px 12px;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0) 100%);
}

/* ── Placeholder cards (no thumbnail) ── */
.m-archive__card--placeholder {
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
	padding: 18px 20px;
}

.m-archive__card--placeholder .m-archive__card-title {
	padding: 0;
}

.m-archive__card-play--inline {
	flex-shrink: 0;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--tpp-black);
	color: var(--tpp-white);
	border-radius: 50%;
	transition: transform 0.3s ease;
}

.m-archive__card--placeholder:hover .m-archive__card-play--inline {
	transform: scale(1.1);
}


/* ──────────────────────────────────────────────
   Footer CTA bar
   ────────────────────────────────────────────── */

.m-archive__footer {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 12px;
	padding: 16px 24px;
	background: var(--tpp-black);
	border-radius: 12px;
	font-family: var(--tpp-font-body);
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--tpp-white);
	text-decoration: none;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	cursor: pointer;
}

.m-archive__footer:hover {
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
	color: var(--tpp-white);
}

.m-archive__footer-lock {
	opacity: 0.5;
	color: var(--tpp-white);
}

/* Ensure animated text is white on the dark footer bar */
.m-archive__footer .text-reveal,
.m-archive__footer .text-reveal-primary,
.m-archive__footer .text-reveal-secondary,
.m-archive__footer span {
	color: var(--tpp-white) !important;
}


/* ══════════════════════════════════════════════
   Video Preview Modal
   ══════════════════════════════════════════════ */

.m-archive-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;

	/* Entry animation */
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

.m-archive-modal[hidden] {
	display: none;
}

.m-archive-modal.is-active {
	opacity: 1;
	pointer-events: auto;
}

/* Backdrop */
.m-archive-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

/* Dialog container */
.m-archive-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 640px;
	background: var(--tpp-black);
	border-radius: 20px;
	overflow: hidden;
	box-shadow: 0 32px 80px rgba(0, 0, 0, 0.4);

	/* Entry animation */
	transform: scale(0.92) translateY(16px);
	transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.m-archive-modal.is-active .m-archive-modal__dialog {
	transform: scale(1) translateY(0);
}

/* Close button */
.m-archive-modal__close {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 10;
	width: 52px;
	height: 52px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.7);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 50%;
	color: var(--tpp-white);
	cursor: pointer;
	transition: background 0.3s ease, border-color 0.3s ease;
}

.m-archive-modal__close svg {
	stroke: var(--tpp-white);
	stroke-width: 2.5;
}

.m-archive-modal__close:hover {
	background: rgba(0, 0, 0, 0.9);
	border-color: rgba(255, 255, 255, 0.4);
}

/* Video player */
.m-archive-modal__player {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
}

.m-archive-modal__video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* CTA overlay */
.m-archive-modal__cta {
	position: absolute;
	inset: 0;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.85);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);

	opacity: 0;
	transition: opacity 0.4s ease;
}

.m-archive-modal__cta[hidden] {
	display: none;
}

.m-archive-modal__cta.is-visible {
	opacity: 1;
}

.m-archive-modal__cta-inner {
	text-align: center;
	padding: 32px;
	max-width: 400px;
}

.m-archive-modal__cta-title {
	font-family: var(--tpp-font-heading);
	font-size: 1.5rem;
	font-weight: 600;
	color: var(--tpp-white);
	margin: 0 0 8px;
	letter-spacing: -0.02em;
}

.m-archive-modal__cta-desc {
	font-family: var(--tpp-font-body);
	font-size: 0.875rem;
	font-weight: 400;
	color: rgba(255, 255, 255, 0.6);
	line-height: 1.6;
	margin: 0 0 24px;
}

.m-archive-modal__cta-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 14px 28px;
	background: var(--tpp-accent); /* orange key button, white until 29 Nov 2026 */
	font-family: var(--tpp-font-body);
	font-size: 0.875rem;
	font-weight: 600;
	border-radius: var(--tpp-radius-pill);
	text-decoration: none;
	transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.m-archive-modal__cta-btn,
.m-archive-modal__cta-btn:visited,
.m-archive-modal__cta-btn:hover,
.m-archive-modal__cta-btn:focus,
.m-archive-modal__cta-btn:active {
	color: var(--tpp-black);
}

.m-archive-modal__cta-btn:hover {
	transform: translateY(-2px);
	background: var(--tpp-accent-dark);
	box-shadow: 0 8px 24px rgba(255, 153, 0, 0.25);
}

.m-archive-modal__cta-replay {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: 16px auto 0;
	background: none;
	border: none;
	color: rgba(255, 255, 255, 0.5);
	font-family: var(--tpp-font-body);
	font-size: 0.8125rem;
	font-weight: 400;
	cursor: pointer;
	transition: color 0.3s ease;
}

.m-archive-modal__cta-replay:hover {
	color: var(--tpp-white);
}


/* ──────────────────────────────────────────────
   Responsive
   ────────────────────────────────────────────── */

/* Tablet (≥768px) — 3 columns */
@media screen and (min-width: 768px) {
	.m-archive__grid {
		grid-template-columns: repeat(3, 1fr);
	}

	/* Four clips (28 Nov 2026): two by two here, one row of four from 992px
	   (below), instead of three plus one left on its own. Phones use the
	   swipe row below, whatever the count. */
	.m-archive__grid--count-4 {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media screen and (min-width: 992px) {
	.m-archive__grid--count-4 {
		grid-template-columns: repeat(4, 1fr);
	}
}

/* Tablet and below (≤991px) */
@media screen and (max-width: 991px) {
	.m-archive {
		padding: 40px 0 64px;
	}
}

/* Mobile (≤767px) */
@media screen and (max-width: 767px) {
	.m-archive {
		padding: 0 0 64px;
	}

	.m-archive__header {
		margin-bottom: 28px;
	}

	/* ── Swipe carousel ──
	   Native scroll-snap, so touch swipe and momentum come free and no JS is
	   involved — the same approach as the Inner Circle vault. Deliberately
	   no dots or arrows: there are up to six sessions, which would make a
	   dot row unusable.
	   The negative margins cancel .m-archive__container's padding so cards
	   can reach the screen edge; the padding puts the content edge back, and
	   scroll-padding-left makes a snapped card line up with the heading
	   above rather than with the screen. .m-archive has overflow: hidden, so
	   the bleed is clipped and no page-level horizontal scroll appears. */
	.m-archive__grid {
		display: flex;
		gap: 12px;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		margin-left: calc(var(--tpp-container-padding) * -1);
		margin-right: calc(var(--tpp-container-padding) * -1);
		padding: 2px var(--tpp-container-padding);
		scroll-padding-left: var(--tpp-container-padding);
	}

	.m-archive__grid::-webkit-scrollbar {
		display: none;
	}

	/* The cap stops cards stretching into letterboxes on wider phones; the
	   remainder is what leaves the next card peeking. Cards are <button>s, so
	   tabbing to an off-screen one scrolls it into view on its own.
	   Flex default align-items: stretch keeps the shorter placeholder cards
	   the same height as the ones with a 16:9 thumbnail. */
	.m-archive__card {
		flex: 0 0 min(76%, 300px);
		scroll-snap-align: start;
	}

	.m-archive__card-title {
		font-size: 0.75rem;
		padding: 20px 10px 10px;
	}

	.m-archive__card-play {
		width: 36px;
		height: 36px;
	}

	.m-archive__card--placeholder {
		padding: 14px 16px;
	}

	.m-archive-modal {
		padding: 16px;
	}

	.m-archive-modal__dialog {
		border-radius: 16px;
	}

	.m-archive-modal__cta-title {
		font-size: 1.25rem;
	}

	.m-archive-modal__cta-inner {
		padding: 24px;
	}
}

/* Small mobile (≤480px) */
@media screen and (max-width: 480px) {
	/* Was `grid-template-columns: 1fr`, which is inert now the grid is a
	   flex carousel. A slightly wider card here instead — on the narrowest
	   phones the peek matters less than the thumbnail being legible. */
	.m-archive__card {
		flex: 0 0 min(82%, 300px);
	}

	.m-archive__grid {
		gap: 10px;
	}
}
