/* ═══════════════════════════════════════════════════════════════
   cinepi-page-styling.css
   Uses site root colour vars + Circular Spotify font.
   Only cp-* classes — no overlap with existing stylesheets.
═══════════════════════════════════════════════════════════════ */

/* ── Page wrapper ────────────────────────────────────────────── */
.cp-page {
	max-width: 1240px;
	margin: 0 auto;
	padding: 32px 32px 80px;
	box-sizing: border-box;
	font-family: "Circular Spotify", sans-serif;
	color: var(--color-text-1);
}

/* ── Header ──────────────────────────────────────────────────── */
.cp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 32px;
    margin-bottom: 40px;
}

.cp-eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-primary-a30);
    margin: 0 0 12px;
}

.cp-title {
    font-size: clamp(2.6rem, 6vw, 4.2rem);
    font-weight: 800;
    line-height: 1.04;
    margin: 0 0 14px;
    letter-spacing: -0.03em;
    color: var(--color-text-1);
}

.cp-subtitle {
    font-size: 1rem;
    color: var(--color-text-2);
    line-height: 1.65;
    margin: 0;
}

.cp-header img {
    height: clamp(180px, 32vw, 250px);
    width: auto;
    object-fit: cover;
    flex-shrink: 0;
	aspect-ratio: 1/1;
	border-radius: 16px;
}

/* Mobile */
@media (max-width: 720px) {
    .cp-header {
        flex-direction: column;
        gap: 24px;
    }

    .cp-header img {
        width: 100%;
        height: auto;
        align-self: center;
		aspect-ratio: auto;
    }
}

/* ── Desktop grid — left stack | right timeline ───────────────── */
.cp-layout {
	display: grid;
	grid-template-columns: 1fr 420px;
	gap: 32px;
	align-items: start;
}

/* ── Left column ─────────────────────────────────────────────── */
.cp-left-stack {
	display: flex;
	flex-direction: column;
	gap: 20px;
	position: sticky;
	top: 32px;
}

/* Shared box shell */
.cp-box {
	border: 1.5px solid var(--color-primary-a20);
	border-radius: 16px;
	overflow: hidden;
	background: var(--color-primary-a10);
}

.cp-box-header {
	padding: 13px 22px;
	border-bottom: 1.5px solid var(--color-primary-a20);
	font-size: 0.68rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--color-primary-a30);
	display: flex;
	align-items: center;
	gap: 8px;
}

.cp-box-header::before {
	content: "";
	display: inline-block;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--color-selected-2);
	flex-shrink: 0;
}

/* ── Parts / Specs box ───────────────────────────────────────── */
.cp-parts-grid {
	padding: 18px 22px 20px;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0;
}

.cp-part-row {
	padding: 9px 0;
	border-bottom: 1px solid var(--color-primary-a20);
	display: flex;
	flex-direction: column;
	gap: 2px;
    justify-content: center;
    text-decoration: none;
    transition: background-color 0.15s ease-in-out;
}

.cp-part-row:hover{
    background-color: var(--color-selected-1);
}

.cp-part-row:nth-child(odd) {
	padding-right: 16px;
	border-right: 1px solid var(--color-primary-a20);
}

.cp-part-row:nth-child(even) {
	padding-left: 16px;
}

/* Remove bottom border from the last two rows */
.cp-part-row:nth-last-child(1),
.cp-part-row:nth-last-child(2) {
	border-bottom: none;
}

.cp-part-label {
	font-size: 0.62rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--color-primary-a30);
	line-height: 1;
}

.cp-part-value {
	font-size: 0.87rem;
	font-weight: 600;
	color: var(--color-text-1);
	line-height: 1.3;
}

.cp-part-note {
	font-size: 0.72rem;
	color: var(--color-text-2);
	line-height: 1.3;
}

/* Status badge */
.cp-status-row {
	padding: 12px 22px;
	border-top: 1.5px solid var(--color-primary-a20);
	display: flex;
	align-items: center;
	gap: 8px;
}

.cp-status-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--color-selected-2);
	flex-shrink: 0;
	animation: cp-pulse 2.4s ease-in-out infinite;
}

@keyframes cp-pulse {
	0%,
	100% {
		opacity: 1;
	}
	50% {
		opacity: 0.35;
	}
}

.cp-status-text {
	font-size: 0.72rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--color-text-2);
}

/* ── Test footage box ────────────────────────────────────────── */
.cp-footage-body {
	padding: 0;
}

.cp-footage-wrap {
	aspect-ratio: 16 / 9;
	background: var(--color-primary-a20);
	position: relative;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cp-footage-wrap video,
.cp-footage-wrap iframe {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border: none;
}

/* Placeholder state */
.cp-footage-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	height: 100%;
	background: var(--color-primary-a20);
}

.cp-footage-placeholder-icon {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 1.5px solid var(--color-primary-a30);
	display: flex;
	align-items: center;
	justify-content: center;
}

.cp-footage-placeholder-icon svg {
	width: 16px;
	height: 16px;
	fill: var(--color-primary-a30);
	margin-left: 2px; /* optical centering for play icon */
}

.cp-footage-placeholder-label {
	font-size: 0.66rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--color-primary-a30);
}

.cp-footage-caption {
	padding: 10px 22px 14px;
	font-size: 0.75rem;
	color: var(--color-text-2);
	line-height: 1.5;
}

/* ── Right: Timeline ─────────────────────────────────────────── */
.cp-timeline {
	position: relative;
}

/* Vertical rule */
.cp-tl-line {
	position: absolute;
	left: 21px;
	top: 0;
	bottom: 36px;
	width: 2px;
	transform: translateX(-50%);
	background: var(--color-primary-a20);
	pointer-events: none;
}

/* ── Node ────────────────────────────────────────────────────── */
.cp-node {
	position: relative;
}

.cp-node-row {
	display: grid;
	grid-template-columns: 44px 1fr;
	align-items: center;
	padding: 14px 0;
	position: relative;
	z-index: 2;
}

/* Dot button — interactive trigger */
.cp-dot-btn {
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	font: inherit;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	position: relative;
	z-index: 3;
	outline: none;
	-webkit-tap-highlight-color: transparent;
	flex-shrink: 0;
	background-color: var(--color-primary-a0);
}

/* Ring */
.cp-dot-btn::before {
	content: "";
	position: absolute;
	inset: 6px;
	border-radius: 50%;
	border: 2px solid var(--color-primary-a30);
	transition:
		border-color 0.2s,
		transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
		box-shadow 0.2s;
}

/* Fill */
.cp-dot-btn::after {
	content: "";
	position: absolute;
	inset: 6px;
	border-radius: 50%;
	background: var(--color-selected-1);
	opacity: 0;
	transform: scale(0.5);
	transition:
		opacity 0.2s,
		transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Plus icon bars */
.cp-dot-icon {
	position: relative;
	width: 12px;
	height: 12px;
	z-index: 1;
	flex-shrink: 0;
}
.cp-dot-icon::before,
.cp-dot-icon::after {
	content: "";
	position: absolute;
	background: var(--color-primary-a30);
	border-radius: 2px;
	transition:
		transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
		background 0.2s;
}
.cp-dot-icon::before {
	width: 12px;
	height: 2px;
	top: 5px;
	left: 0;
}
.cp-dot-icon::after {
	width: 2px;
	height: 12px;
	top: 0;
	left: 5px;
}

/* Hover */
.cp-dot-btn:hover::before {
	border-color: var(--color-selected-2);
	transform: scale(1.12);
}
.cp-dot-btn:hover::after {
	opacity: 0.25;
	transform: scale(1.12);
}
.cp-dot-btn:hover .cp-dot-icon::before,
.cp-dot-btn:hover .cp-dot-icon::after {
	background: var(--color-selected-3);
}

/* Focus ring */
.cp-dot-btn:focus-visible::before {
	border-color: var(--color-selected-3);
	box-shadow: 0 0 0 3px var(--color-selected-glow-1);
}

/* Open state */
.cp-node.cp-open .cp-dot-btn::before {
	border-color: var(--color-selected-3);
	transform: scale(1.12);
	box-shadow: 0 0 0 3px var(--color-selected-glow-1);
}
.cp-node.cp-open .cp-dot-btn::after {
	opacity: 0.3;
	transform: scale(1.12);
}
.cp-node.cp-open .cp-dot-icon::before,
.cp-node.cp-open .cp-dot-icon::after {
	background: var(--color-selected-3);
}
.cp-node.cp-open .cp-dot-icon::before {
	transform: rotate(45deg);
}
.cp-node.cp-open .cp-dot-icon::after {
	transform: rotate(45deg);
}

/* Preview text beside the dot */
.cp-node-preview {
	padding-left: 14px;
	display: flex;
	flex-direction: column;
	gap: 2px;
	pointer-events: none;
}

.cp-date-label {
	font-size: 0.68rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--color-primary-a30);
	line-height: 1;
}

.cp-title-preview {
	font-size: 0.93rem;
	font-weight: 600;
	color: var(--color-text-2);
	line-height: 1.2;
	transition: color 0.18s;
}

.cp-node.cp-open .cp-title-preview,
.cp-node-row:hover .cp-title-preview {
	color: var(--color-text-1);
}

/* ── Accordion panel ─────────────────────────────────────────── */
.cp-panel-wrap {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	position: relative;
	z-index: 1;
	padding-left: 56px; /* indent past line + dot */
}
.cp-node.cp-open .cp-panel-wrap {
	grid-template-rows: 1fr;
}

.cp-panel-overflow {
	overflow: hidden;
	opacity: 0;
	transition: opacity 0.25s 0.08s;
}
.cp-node.cp-open .cp-panel-overflow {
	opacity: 1;
}

.cp-panel {
	padding: 0 0 20px;
}

.cp-panel-inner {
	border: 1.5px solid var(--color-primary-a20);
	border-radius: 12px;
	overflow: hidden;
	background: var(--color-primary-a10);
}

.cp-panel-text {
	padding: 18px 20px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.cp-panel-date {
	font-size: 0.66rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--color-primary-a30);
	margin: 0;
}

.cp-panel-title {
	font-size: 1.1rem;
	font-weight: 700;
	line-height: 1.2;
	margin: 0;
	color: var(--color-text-1);
}

.cp-panel-desc {
	font-size: 0.86rem;
	line-height: 1.7;
	color: var(--color-text-2);
	margin: 2px 0 0;
}

/* Tag chips */
.cp-panel-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 6px;
}
.cp-tag {
	font-size: 0.62rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	border: 1px solid var(--color-primary-a20);
	border-radius: 999px;
	padding: 3px 10px;
	color: var(--color-primary-a30);
	background: var(--color-primary-a20);
	transition:
		border-color 0.15s,
		color 0.15s;
}
.cp-tag:hover {
	border-color: var(--color-selected-1);
	color: var(--color-selected-3);
}

/* Image inside a panel */
.cp-panel-image {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	display: block;
	border-bottom: 1.5px solid var(--color-primary-a20);
}

/* ── Timeline end cap ────────────────────────────────────────── */
.cp-end-cap {
	display: flex;
	align-items: center;
	padding: 20px 0 0 0;
	padding-left: 0;
	z-index: 2;
}

.cp-end-cap-inner {
	display: flex;
	align-items: center;
	gap: 12px;
}

.cp-end-dot {
	width: 42px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	z-index: 2;
}

.cp-end-dot::after {
	content: "";
	display: block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--color-selected-2);
	box-shadow: 0 0 0 3px var(--color-selected-glow-1);
}

.cp-end-cap span {
	font-size: 0.68rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--color-text-1);
	border: 1.5px solid var(--color-selected-2);
	border-radius: 999px;
	padding: 4px 14px;
	background-color: var(--color-selected-1);
}

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 720px) {
	.cp-page {
		padding: 20px 16px 100px;
	}

	.cp-header {
		margin-bottom: 28px;
	}

	.cp-subtitle {
		max-width: none;
	}

	/* Stack layout: left boxes come first, then timeline below */
	.cp-layout {
		grid-template-columns: 1fr;
		gap: 24px;
	}

	/* Left stack is no longer sticky on mobile */
	.cp-left-stack {
		position: static;
	}

	/* Parts grid: one column on very small screens */
	.cp-parts-grid {
		grid-template-columns: 1fr 1fr;
	}

	/* Timeline stays full-width, line on left */
	.cp-tl-line {
		left: 21px;
	}
}

@media (max-width: 400px) {
	.cp-parts-grid {
		grid-template-columns: 1fr;
	}

	.cp-part-row:nth-child(odd) {
		padding-right: 0;
		border-right: none;
	}

	.cp-part-row:nth-child(even) {
		padding-left: 0;
	}

	.cp-part-row:nth-last-child(2) {
		border-bottom: 1px solid var(--color-primary-a20);
	}
}

/* Collage grid — 1 big clip across the top + 2 clips side by side beneath.
   Rows are left as "auto": each cell carries its own 16:9 aspect-ratio, so
   its height is derived from its own column width rather than a shared
   container ratio — matching the footage's native ratio, so nothing crops. */
.cp-footage-collage {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1px;
	background: var(--color-primary-a20); /* gap colour */
	overflow: hidden;
}

/* Individual clip cell */
.cp-clip {
	position: relative;
	overflow: hidden;
	background: var(--color-primary-a10);
	cursor: pointer;
	aspect-ratio: 16 / 9;
}

/* Clip A spans both columns, full width across the top */
.cp-clip:first-child {
	grid-column: 1 / 3;
}

.cp-clip video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: filter 0.5s ease-in-out;
}

.cp-clip video[data-finished="true"] {
    opacity: 1.0;
    filter: grayscale(1.0);
}

/* Placeholder state (shown when no video src is set) */
.cp-clip-placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 7px;
}

.cp-clip-placeholder-icon {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 1.5px solid var(--color-primary-a30);
	display: flex;
	align-items: center;
	justify-content: center;
}

.cp-clip-placeholder-icon svg {
	width: 13px;
	height: 13px;
	fill: var(--color-primary-a30);
	margin-left: 2px;
}

.cp-clip-placeholder-text {
	font-size: 0.6rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--color-primary-a30);
}

/* Clip label chip — bottom-left overlay */
.cp-clip-label {
	position: absolute;
	bottom: 8px;
	left: 8px;
	font-size: 0.58rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.75);
	background: rgba(0, 0, 0, 0.42);
	backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);
	border-radius: 999px;
	padding: 3px 9px;
	pointer-events: none;
	line-height: 1;
}

/* Mute button — bottom-right overlay */
.cp-clip-mute {
	position: absolute;
	bottom: 8px;
	right: 8px;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: none;
	cursor: pointer;
	background: rgba(0, 0, 0, 0.45);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	transition:
		background 0.2s,
		transform 0.15s;
	padding: 0;
}

.cp-clip-mute:hover {
	background: rgba(0, 0, 0, 0.78);
	transform: scale(1.1);
}

.cp-clip-mute svg {
	width: 14px;
	height: 14px;
	fill: #fff;
	display: block;
	flex-shrink: 0;
}

/* Toggle visibility based on muted state */
.cp-clip-mute .icon-muted {
	display: none;
}
.cp-clip-mute .icon-unmuted {
	display: block;
}

.cp-clip-mute[data-muted="true"] .icon-muted {
	display: block;
}
.cp-clip-mute[data-muted="true"] .icon-unmuted {
	display: none;
}

/* Fullscreen button */
.cp-clip-fullscreen {
    position: absolute;
    bottom: 8px;
    right: calc(28px + 10px); /* Position it next to the mute button with some margin */
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition:
        background 0.2s,
        transform 0.15s;
    padding: 0;
}

.cp-clip-fullscreen:hover {
    background: rgba(0, 0, 0, 0.78);
    transform: scale(1.1);
}

.cp-clip-fullscreen svg {
    width: 14px;
    height: 14px;
    fill: #fff;
    display: block;
    flex-shrink: 0;
}

/* Caption below the collage */
.cp-footage-caption {
	padding: 10px 22px 14px;
	font-size: 0.75rem;
	color: var(--color-text-2);
	line-height: 1.5;
	margin: 0;
}

/* ── Mobile: stack clips vertically ─────────────────────────── */
@media (max-width: 720px) {
	.cp-footage-collage {
		grid-template-columns: 1fr;
	}

	.cp-clip:first-child {
		grid-column: unset;
	}
}
