/**
 * Blue Frame Films: portfolio.css
 *
 * Purpose:  Portfolio section (#portfolio): filter buttons, client-work cards (.wc),
 *           the music link card, and the Originals block (#originals, .oc cards).
 * Used by:  template-parts/work/portfolio.php, work/originals.php, components/work-card.php,
 *           components/card-media.php. Video-specific styles are in video-player.css.
 * To edit:  Grid columns: .wgrid / .ogrid. Card image ratio: .media (16:10 desktop, 16:9 phones).
 */

/* ==========================================================================
   Filter buttons (assets/js/portfolio-filter.js toggles .on and .hide)
   ========================================================================== */
.filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 28px;
}

.filters a {
	padding: 8px 14px;
	border-radius: 999px;
	border: 1px solid var(--line);
	font-size: .85rem;
	color: var(--muted);
}

.filters button {
	font: inherit;
	background: transparent;
	cursor: pointer;
	padding: 8px 14px;
	border-radius: 999px;
	border: 1px solid var(--line);
	font-size: .85rem;
	color: var(--muted);
}

.filters button.on {
	background: var(--elec);
	border-color: var(--elec);
	color: #fff;
}

/* ==========================================================================
   Card grid and cards
   ========================================================================== */
.wgrid {
	--cols: 3;
	display: flex;
	flex-wrap: wrap;
	justify-content: center; /* v2.7.2: a short last row is centred, never a lone card on the left */
	gap: 18px;
}

.wgrid > .wc {
	flex: 0 0 calc((100% - (var(--cols) - 1) * 18px) / var(--cols));
	min-width: 0;
}

.wgrid > .wc.more-hidden {
	display: none;
}

.show-more-wrap {
	text-align: center;
	margin: 24px 0 8px;
}

.wc,
.oc {
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--r);
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.wc.hide {
	display: none;
}

.wb {
	padding: 16px 18px 20px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
}

.wb h3 {
	font-size: 1.05rem;
}

.wb p {
	color: var(--muted);
	font-size: .87rem;
}

.wb p b {
	color: #c9d6f5;
	font-weight: 600;
}

/* Card media: still image */
.media {
	position: relative;
	aspect-ratio: 16/10;
	overflow: hidden;
	border-bottom: 1px solid var(--line);
	background-color: #0d1a36;
}

.media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Card media: placeholder box when there is no still yet */
.video.sm {
	border-radius: 0;
	border: 0;
	border-bottom: 1px solid var(--line);
	gap: 8px;
}

.video.sm .play {
	width: 46px;
	height: 46px;
}

.video.sm .play::before {
	border-left-width: 13px;
	border-top-width: 8px;
	border-bottom-width: 8px;
}

.video.sm .lbl {
	font-size: .7rem;
}

/* "Music videos" link card */
.linkcard {
	justify-content: center;
	border-style: dashed;
	background: linear-gradient(160deg,rgba(30,123,255,.12),transparent);
}

/* v2.7.0: the music link card has a real frame on top, like its row-mates. */
.linkcard.has-media {
	justify-content: flex-start;
	border-style: solid;
}

.linkcard-media {
	display: block;
	aspect-ratio: 16/10;
	overflow: hidden;
	border-bottom: 1px solid var(--line);
}

.linkcard-media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Text-only card: its row-mates have media, so centre its text in the full row height
   (no empty block under it). */
.linkcard .wb {
	justify-content: center;
}

.linkcard .btn {
	align-self: flex-start;
	margin-top: 6px;
}

/* ==========================================================================
   Originals
   ========================================================================== */
.orig {
	margin-top: 72px;
	padding-top: 56px;
	border-top: 1px dashed var(--line);
}

.orig .head {
	margin-bottom: 28px;
}

.ogrid {
	display: grid;
	grid-template-columns: repeat(3,minmax(0,1fr));
	gap: 18px;
}

.oc.big {
	grid-column: span 2;
	flex-direction: row;
}

.oc.big .media {
	width: 48%;
	flex: none;
	aspect-ratio: auto;
	border-bottom: 0;
	border-right: 1px solid var(--line);
}

.songs {
	padding-left: 20px;
	color: #c9d6f5;
	font-size: .92rem;
	display: grid;
	gap: 4px;
}

.oc.textonly {
	justify-content: center;
	border-style: dashed;
	background: repeating-linear-gradient(135deg,rgba(255,122,138,.04) 0 12px,transparent 12px 24px),var(--panel);
}

.oc.textonly .wb {
	justify-content: center;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width:1000px) {
	.wgrid {
		--cols: 2;
	}

	.wgrid,
	.ogrid {
		grid-template-columns: repeat(2,minmax(0,1fr));
	}

	.oc.big {
		grid-column: span 2;
		grid-row: auto;
	}
}
@media (max-width:760px) {
	.wgrid {
		--cols: 1;
	}

	.wgrid,
	.ogrid {
		grid-template-columns: 1fr;
	}

	.oc.big {
		grid-column: auto;
		flex-direction: column;
	}

	.oc.big .media {
		width: auto;
		aspect-ratio: 16/9;
		border-right: 0;
		border-bottom: 1px solid var(--line);
	}

	.media {
		aspect-ratio: 16/9;
	}

	.wc .video.sm {
		aspect-ratio: 16/7;
	}

	.filters {
		flex-wrap: nowrap;
		overflow-x: auto;
		padding-bottom: 6px;
		margin-right: -24px;
		padding-right: 24px;
	}

	.filters>* {
		flex: none;
	}

	.orig {
		margin-top: 48px;
		padding-top: 40px;
	}
}
