/* Carver Journal Core: video stories. */

.cjv-tile { margin: 0; min-width: 0; }
.cjv-frame { position: relative; display: block; background: #1d1c1a; overflow: hidden; aspect-ratio: var(--a, 1.7778); }
.cjv-open { display: block; width: 100%; height: 100%; color: #fff; }
.cjv-frame img, .cjv-frame video { display: block; width: 100%; height: 100%; object-fit: cover; }
.cjv-frame.is-playing video { object-fit: contain; background: #000; }
.cjv-play {
	position: absolute; left: 0; bottom: 0;
	display: flex; align-items: center; gap: 8px;
	padding: 9px 12px; background: var(--cran, #83001f); color: #fff;
	font: 600 .8125rem/1 var(--sans, system-ui, sans-serif); font-variant-numeric: tabular-nums;
}
.cjv-play::before { content: ""; border-left: 10px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.cjv-open:hover .cjv-play, .cjv-open:focus-visible .cjv-play { background: var(--cran-deep, #5a0015); }
.cjv-open:focus-visible { outline: 3px solid var(--cran, #83001f); outline-offset: 2px; }

.cjv-cap .cjv-kicker { margin: 12px 0 6px; }
.cjv-title { margin: 10px 0 0; font: 700 1.25rem/1.2 var(--serif, Georgia, serif); letter-spacing: -.005em; text-wrap: balance; }
.cjv-kicker + .cjv-title { margin-top: 0; }
.cjv-title a { color: inherit; text-decoration: none; }
.cjv-title a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .14em; text-decoration-color: var(--cran, #83001f); }
.cjv-deck { margin: 8px 0 0; font: 400 1.0625rem/1.45 var(--serif, Georgia, serif); color: var(--ink-soft, #3a3632); }
.cjv-meta { margin: 8px 0 0; font: 400 .875rem/1.4 var(--sans, system-ui, sans-serif); color: var(--stone, #5d5852); }
.cjv-names { color: var(--ink, #1c1a17); font-weight: 650; }
.cjv-names a { color: inherit; text-decoration: none; }
.cjv-names a:hover { color: var(--cran, #83001f); text-decoration: underline; }
.cjv-names .cjc-byline-sep { font-weight: 400; color: var(--stone, #5d5852); white-space: pre-wrap; }
.cjv-by + .cjv-date::before { content: "\00b7"; margin: 0 .45em 0 .1em; }
/* Small tiles: the date goes on its own line, with no dot. */
.cjv-row.is-justified.n3 .cjv-date, .cjv-row.is-justified.n2 .is-vertical .cjv-date, .cjv-row.is-beside .cjv-date, .cjv-strip .cjv-date { display: block; }
.cjv-row.is-justified.n3 .cjv-date::before, .cjv-row.is-justified.n2 .is-vertical .cjv-date::before, .cjv-row.is-beside .cjv-date::before, .cjv-strip .cjv-date::before { content: none; }

/* Right column: the newest vertical video, above the newsletter box. */
.cjv-rail { margin: 0 0 28px !important; }
.cjv-rail .cjv-title { font-size: 1.375rem; }

/* Main column: every video in a row shares one height and the row fills the width. */
.cjv-section { margin-top: 44px !important; }
.cjv-row { display: flex; gap: 24px; margin-top: 16px; }
.cjv-row + .cjv-row { margin-top: 28px; }
.cjv-row.is-justified { max-width: calc(470px * var(--sum) + 24px * (var(--n) - 1)); }
.cjv-row.is-justified .cjv-tile { flex: var(--a) 1 0px; }
.cjv-row.is-justified.n3 .cjv-title, .cjv-row.is-justified.n2 .cjv-tile.is-vertical .cjv-title { font-size: 1.0625rem; }

/* Two horizontals and one vertical: the horizontals stack, the vertical runs the full height beside them. */
.cjv-row.is-mosaic { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; }
.cjv-row.is-mosaic .cjv-tile.is-vertical { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; }
.cjv-row.is-mosaic .cjv-tile.is-vertical .cjv-frame { flex: 1 1 auto; aspect-ratio: auto; min-height: 0; }
.cjv-row.is-mosaic .cjv-tile.is-horizontal { grid-column: 1; }

/* One or two vertical videos: the headline sits beside each one. */
.cjv-row.is-beside .cjv-tile { flex: 1 1 0px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: start; }
.cjv-row.is-beside .cjv-frame { height: 356px; }
.cjv-row.is-beside.n1 .cjv-frame { height: 460px; }
.cjv-row.is-beside .cjv-title { margin-top: 0; font-size: 1.5rem; }
.cjv-row.is-beside.n1 .cjv-title { font-size: 1.75rem; }
.cjv-row.is-beside .cjv-tile + .cjv-tile { border-left: 1px solid var(--rule, #d5cdbf); padding-left: 24px; }

@media (max-width: 1180px) {
	.cjv-row.is-beside.n2 .cjv-frame { height: 300px; }
	.cjv-row.is-beside.n2 .cjv-title { font-size: 1.25rem; }
}

/* Narrow screens: one section under the top story holds every video. */
.cjv-narrow { display: none; }
@media (max-width: 960px) {
	.cjv-rail, .cjv-section { display: none !important; }
	.cjv-narrow { display: block; order: 2; margin-top: 28px !important; border-top: 3px solid var(--ink, #1c1a17); padding-top: 12px; }
	.cjv-narrow h2 { margin: 0 0 14px; font: 700 1.5rem/1.15 var(--serif, Georgia, serif); }
	.cjv-narrow .cjv-row { margin-top: 0; }
	.cjv-narrow .cjv-row.is-beside.n1 .cjv-frame { height: min(460px, 78vw); }
	.cjv-narrow .cjv-row.is-beside.n1 .cjv-title { font-size: 1.375rem; }
	.cjv-narrow .cjv-row.is-beside .cjv-tile { gap: 16px; }
	.cjv-strip { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x proximity; margin-right: calc(var(--gutter, 16px) * -1); padding-right: var(--gutter, 16px); padding-bottom: 4px; }
	.cjv-strip .cjv-tile { flex: 0 0 auto; width: calc(300px * var(--a)); scroll-snap-align: start; }
	.cjv-strip .cjv-frame { height: 300px; }
	.cjv-strip .cjv-title { font-size: 1.0625rem; }
	.cjv-stack { max-width: calc(520px * var(--a, 1.7778)); }
	.cjv-narrow > * + .cjv-stack, .cjv-narrow > .cjv-stack + * { margin-top: 24px; }
}

/* Story page: the video takes the featured image's place. */
.cjv-story .cjv-player { display: block; width: 100%; height: auto; aspect-ratio: var(--a, 1.7778); background: #000; object-fit: cover; }
.cjv-story.is-vertical .cjv-player { width: auto; max-width: 100%; height: min(78vh, 720px); margin: 0 auto; }

@media print { .cjv-rail, .cjv-section, .cjv-narrow { display: none !important; } }
