/* ==========================================================
   Portfolio Tabs - Grid, Glass Play Button, Popup, A+ Content
   ========================================================== */

.portfolio-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
}

@media (max-width: 900px) {
	.portfolio-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 600px) {
	.portfolio-grid {
		grid-template-columns: 1fr;
	}
}

.portfolio-empty {
	color: #999;
	text-align: center;
	padding: 40px 0;
}

/* ---------- Video cards ---------- */

.portfolio-card {
	position: relative;
	border-radius: 10px;
	overflow: hidden;
	background: #0d0d0d;
	aspect-ratio: 16 / 10;
	cursor: pointer;
}

.portfolio-thumb {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Glassmorphic play button, overlaid, lightly visible */
.portfolio-play-btn {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 56px;
	height: 56px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.35);
	background: rgba(255, 255, 255, 0.12);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	opacity: 0.85;
	transition: opacity 0.25s ease, transform 0.25s ease, background 0.25s ease;
}

.portfolio-play-btn svg {
	margin-left: 3px; /* optical centering for the triangle */
}

.portfolio-card:hover .portfolio-play-btn {
	opacity: 1;
	background: rgba(255, 255, 255, 0.22);
	transform: translate(-50%, -50%) scale(1.08);
}

/* ---------- Popup / modal ---------- */

.portfolio-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 9999;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease;
	padding: 20px;
}

.portfolio-modal-overlay.is-open {
	opacity: 1;
	visibility: visible;
}

.portfolio-modal-box {
	position: relative;
	width: 100%;
	max-width: 960px;
	background: #000;
	border-radius: 10px;
	overflow: hidden;
	aspect-ratio: 16 / 9;
}

.portfolio-modal-box video,
.portfolio-modal-box iframe {
	width: 100%;
	height: 100%;
	display: block;
	border: 0;
}

.portfolio-modal-close {
	position: absolute;
	top: -44px;
	right: 0;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.35);
	background: rgba(255, 255, 255, 0.12);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

/* ---------- A Plus Content ---------- */

.portfolio-grid-images {
	align-items: start;
}

.portfolio-aplus-card {
	border-radius: 10px;
	overflow: hidden;
	background: #111;
}

.portfolio-aplus-frame {
	position: relative;
	height: 420px; /* uniform card height, adjust to taste */
	overflow: hidden;
	cursor: pointer;
}

.portfolio-aplus-img {
	width: 100%;
	height: auto;
	display: block;
	transform: translateY(0);
	transition: transform 6s ease; /* slow scroll reveal on hover */
}

/* On hover, slide the tall image upward inside the fixed-height frame */
.portfolio-aplus-frame:hover .portfolio-aplus-img {
	transform: translateY(calc(-1 * (var(--scroll-distance, 0px))));
}

/* ---------- A Plus lightbox (full size, scrollable) ---------- */

.portfolio-lightbox-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.92);
	z-index: 9999;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease;
	padding: 50px 20px 70px;
	overflow-y: auto;
	overflow-x: hidden;
	/* Avoid the flex-centering + overflow clipping bug: use block layout
	   with a centered wrapper instead of display:flex + align-items:center. */
}

.portfolio-lightbox-overlay.is-open {
	opacity: 1;
	visibility: visible;
}

.portfolio-lightbox-inner {
	max-width: 900px;
	margin: 0 auto;
}

.portfolio-lightbox-img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 6px;
}

/* Visible scrollbar so it's obvious the image can be scrolled */
.portfolio-lightbox-overlay {
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.4) rgba(255, 255, 255, 0.08);
}

.portfolio-lightbox-overlay::-webkit-scrollbar {
	width: 10px;
}

.portfolio-lightbox-overlay::-webkit-scrollbar-track {
	background: rgba(255, 255, 255, 0.08);
}

.portfolio-lightbox-overlay::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.4);
	border-radius: 6px;
}

.portfolio-lightbox-overlay::-webkit-scrollbar-thumb:hover {
	background: rgba(255, 255, 255, 0.6);
}

.portfolio-lightbox-close {
	position: fixed;
	top: 20px;
	right: 30px;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.35);
	background: rgba(255, 255, 255, 0.12);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	z-index: 10000;
}

/* ==========================================================
   Portfolio Tabs Widget - tab nav (horizontal / vertical)
   ========================================================== */

.portfolio-tabs-widget {
	width: 100%;
}

.portfolio-tabs-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 24px;
	margin-bottom: 24px;
}

.portfolio-tabs-nav-btn {
	background: transparent;
	border: none;
	border-bottom: 2px solid transparent;
	padding: 8px 2px;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.3px;
	text-transform: uppercase;
	color: inherit;
	opacity: 0.55;
	cursor: pointer;
	transition: opacity 0.2s ease, border-color 0.2s ease, color 0.2s ease;
	white-space: nowrap;
}

.portfolio-tabs-nav-btn.is-active {
	opacity: 1;
	border-bottom-color: currentColor;
}

.portfolio-tabs-panel {
	display: none;
}

.portfolio-tabs-panel.is-active {
	display: block;
}

/* Vertical orientation: nav becomes a sidebar next to the panels */
.portfolio-tabs-orientation-vertical {
	display: flex;
	align-items: flex-start;
	gap: 32px;
}

.portfolio-tabs-orientation-vertical .portfolio-tabs-nav {
	flex-direction: column;
	flex: 0 0 220px;
	margin-bottom: 0;
}

.portfolio-tabs-orientation-vertical .portfolio-tabs-nav-btn {
	border-bottom: none;
	border-left: 2px solid transparent;
	text-align: left;
	padding: 10px 14px;
}

.portfolio-tabs-orientation-vertical .portfolio-tabs-panels {
	flex: 1;
	min-width: 0; /* allow grid to shrink properly inside flex */
}

@media (max-width: 768px) {
	.portfolio-tabs-orientation-vertical {
		flex-direction: column;
	}
	.portfolio-tabs-orientation-vertical .portfolio-tabs-nav {
		flex-direction: row;
		flex: none;
		width: 100%;
		overflow-x: auto;
	}
	.portfolio-tabs-orientation-vertical .portfolio-tabs-nav-btn {
		border-left: none;
		border-bottom: 2px solid transparent;
	}
}
