/**
 * Portfolio / Gallery Page Styles
 *
 * Inspired by the Domik architecture portfolio layout:
 * — Header intro (eyebrow + title + copy)
 * — Filter tabs (All + project types)
 * — Full-bleed responsive image grid
 * — Hover overlay reveals a plus icon, title and category label
 *
 * @package One_Handyman
 */

/* ==========================================================================
   Portfolio Header
   ========================================================================== */

.oh-portfolio {
	background-color: var(--one-bg, #F9F9FB);
}

.oh-portfolio__header {
	text-align: center;
	/* #primary supplies fixed-nav clearance; this adds intro breathing room below the bar */
	padding-top: clamp(56px, 7vw, 96px);
	padding-bottom: clamp(32px, 6vw, 80px);
}

.oh-portfolio__title {
	font-family: var(--one-font-heading, 'Playfair Display', serif);
	font-size: clamp(2rem, 4.5vw, 3.5rem);
	font-weight: 500;
	line-height: 1.15;
	letter-spacing: -0.01em;
	color: var(--one-heading-color, #1C1C1E);
	margin: var(--one-spacing-xs, 4px) 0 var(--one-spacing-md, 16px);
}

.oh-portfolio__intro {
	max-width: 640px;
	margin: 0 auto;
	color: var(--one-text-muted, #6B6B72);
	font-size: clamp(1rem, 1.4vw, 1.125rem);
	line-height: 1.6;
}

.oh-portfolio__empty {
	text-align: center;
	color: var(--one-text-muted, #6B6B72);
	font-size: 1.125rem;
	padding: 64px 0;
}

/* ==========================================================================
   Filter Tabs
   ========================================================================== */

.oh-portfolio__filters {
	margin-bottom: clamp(24px, 4vw, 48px);
}

.oh-portfolio__filter-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px 24px;
}

/* Higher specificity than Elementor kit global `button` styles */
.oh-portfolio__filters button.oh-portfolio__filter {
	appearance: none;
	-webkit-appearance: none;
	display: inline-block;
	width: auto;
	min-height: 0;
	min-width: 0;
	margin: 0;
	box-shadow: none;
	border-radius: 0;
	line-height: 1.4;
	text-align: center;
	background: transparent;
	background-color: transparent;
	border: none;
	padding: 12px 0;
	font-family: var(--one-font-nav, 'JetBrains Mono', monospace);
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--one-text-muted, #6B6B72);
	cursor: pointer;
	position: relative;
	transition: color 200ms ease;
}

.oh-portfolio__filters button.oh-portfolio__filter::after {
	content: '';
	position: absolute;
	left: 50%;
	bottom: 4px;
	width: 0;
	height: 1px;
	background-color: var(--one-obsidian, #1C1C1E);
	transition: width 200ms ease, left 200ms ease;
}

.oh-portfolio__filters button.oh-portfolio__filter:hover,
.oh-portfolio__filters button.oh-portfolio__filter:focus,
.oh-portfolio__filters button.oh-portfolio__filter:focus-visible,
.oh-portfolio__filters button.oh-portfolio__filter:active {
	background: transparent;
	background-color: transparent;
	border: none;
	box-shadow: none;
	color: var(--one-obsidian, #1C1C1E);
	outline: none;
}

.oh-portfolio__filters button.oh-portfolio__filter--active,
.oh-portfolio__filters button.oh-portfolio__filter--active:hover,
.oh-portfolio__filters button.oh-portfolio__filter--active:focus,
.oh-portfolio__filters button.oh-portfolio__filter--active:focus-visible {
	color: var(--one-obsidian, #1C1C1E);
}

.oh-portfolio__filters button.oh-portfolio__filter--active::after,
.oh-portfolio__filters button.oh-portfolio__filter:hover::after {
	width: 100%;
	left: 0;
}

/* ==========================================================================
   Grid — full-bleed, edge-to-edge
   ========================================================================== */

.oh-portfolio__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0;
}

@media (min-width: 640px) {
	.oh-portfolio__grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 1024px) {
	.oh-portfolio__grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (min-width: 1440px) {
	.oh-portfolio__grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

/* ==========================================================================
   Portfolio Item
   ========================================================================== */

.oh-portfolio__item {
	position: relative;
	overflow: hidden;
	transition: opacity 300ms ease, transform 300ms ease;
}

.oh-portfolio__item.is-hidden {
	display: none;
}

.oh-portfolio__card {
	display: block;
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	text-decoration: none;
	color: inherit;
	overflow: hidden;
	background-color: var(--one-light-bg, #F1F1F4);
}

.oh-portfolio__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
}

.oh-portfolio__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 600ms ease;
	will-change: transform;
}

.oh-portfolio__image-placeholder {
	width: 100%;
	height: 100%;
	background:
		repeating-linear-gradient(
			45deg,
			var(--one-light-bg, #F1F1F4),
			var(--one-light-bg, #F1F1F4) 12px,
			#E9E9EC 12px,
			#E9E9EC 24px
		);
}

/* ==========================================================================
   Hover Overlay
   ========================================================================== */

.oh-portfolio__overlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 24px;
	text-align: center;
	background-color: rgba(28, 28, 30, 0.72);
	opacity: 0;
	transition: opacity 300ms ease;
	color: #fff;
}

.oh-portfolio__plus {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border: 1px solid rgba(255, 255, 255, 0.75);
	border-radius: 50%;
	font-size: 24px;
	font-weight: 300;
	line-height: 1;
	color: #fff;
	transform: scale(0.6);
	transition: transform 300ms ease 60ms;
}

.oh-portfolio__card-type {
	display: inline-block;
	font-family: var(--one-font-nav, 'JetBrains Mono', monospace);
	font-size: 10px;
	font-weight: 500;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--one-champagne, #E7D9BE);
	transform: translateY(8px);
	opacity: 0;
	transition: transform 300ms ease 120ms, opacity 300ms ease 120ms;
}

.oh-portfolio__card:hover .oh-portfolio__image img,
.oh-portfolio__card:focus-visible .oh-portfolio__image img {
	transform: scale(1.06);
}

.oh-portfolio__card:hover .oh-portfolio__overlay,
.oh-portfolio__card:focus-visible .oh-portfolio__overlay {
	opacity: 1;
}

.oh-portfolio__card:hover .oh-portfolio__plus,
.oh-portfolio__card:focus-visible .oh-portfolio__plus {
	transform: scale(1);
}

.oh-portfolio__card:hover .oh-portfolio__card-type,
.oh-portfolio__card:focus-visible .oh-portfolio__card-type {
	transform: translateY(0);
	opacity: 1;
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	.oh-portfolio__image img,
	.oh-portfolio__overlay,
	.oh-portfolio__plus,
	.oh-portfolio__card-type {
		transition: none;
	}
}


/* ==========================================================================
   Lightbox Modal
   ========================================================================== */

.oh-lightbox {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: none;
	align-items: center;
	justify-content: center;
	padding: clamp(16px, 4vw, 48px);
}

.oh-lightbox.is-open {
	display: flex;
	animation: ohLightboxIn 200ms ease-out;
}

@keyframes ohLightboxIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

.oh-lightbox__backdrop {
	position: absolute;
	inset: 0;
	background-color: rgba(15, 15, 18, 0.94);
	cursor: pointer;
}

.oh-lightbox__frame {
	position: relative;
	width: 100%;
	max-width: 1280px;
	height: 100%;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	z-index: 1;
}

.oh-lightbox__image-wrap {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	overflow: hidden;
	min-height: 0;
}

.oh-lightbox__image {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	display: block;
	object-fit: contain;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.oh-lightbox__meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	max-width: 720px;
	margin-top: var(--one-spacing-md, 16px);
	padding: 0 12px;
	color: rgba(255, 255, 255, 0.85);
	font-family: var(--one-font-nav, 'JetBrains Mono', monospace);
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.18em;
	text-transform: uppercase;
}

.oh-lightbox__caption {
	color: #fff;
}

.oh-lightbox__counter {
	color: var(--one-champagne, #E7D9BE);
	font-variant-numeric: tabular-nums;
}

/* Close + nav buttons */
.oh-lightbox__close,
.oh-lightbox__nav {
	position: absolute;
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.4);
	border-radius: 50%;
	color: #fff;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	padding: 0;
	transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
	-webkit-appearance: none;
	appearance: none;
	z-index: 2;
}

.oh-lightbox__close {
	top: 0;
	right: 0;
	width: 48px;
	height: 48px;
	font-size: 28px;
}

.oh-lightbox__nav {
	top: 50%;
	transform: translateY(-50%);
	width: 56px;
	height: 56px;
	font-size: 36px;
	font-weight: 300;
}

.oh-lightbox__nav--prev {
	left: 0;
}

.oh-lightbox__nav--next {
	right: 0;
}

.oh-lightbox__close:hover,
.oh-lightbox__close:focus,
.oh-lightbox__nav:hover,
.oh-lightbox__nav:focus {
	background-color: var(--one-bronze, #B08D57);
	border-color: var(--one-bronze, #B08D57);
	color: #000;
	outline: none;
}

.oh-lightbox__nav:hover,
.oh-lightbox__nav:focus {
	transform: translateY(-50%) scale(1.06);
}

/* Body scroll lock while lightbox is open */
body.lightbox-open {
	overflow: hidden;
}

/* Mobile tweaks */
@media (max-width: 640px) {
	.oh-lightbox__close {
		width: 40px;
		height: 40px;
		font-size: 24px;
	}

	.oh-lightbox__nav {
		width: 44px;
		height: 44px;
		font-size: 28px;
	}

	.oh-lightbox__meta {
		font-size: 10px;
		flex-direction: column;
		gap: 4px;
	}
}

