/* =========================================================================
 * Gallery shortcode — [pcc_gallery]
 *
 * Filterable photo grid. Reuses .pcc-blog__tab styling for the filter tabs
 * so the tab appearance stays consistent across product filter, blog filter,
 * and photo filter. Grid uses data-cols pattern so media queries can override.
 * ========================================================================= */

.pcc-gallery {
	--pcc-navy: #01225f;
	--pcc-red: #fe4b45;
	--pcc-ink: #3a4049;
	--pcc-muted: #6b7280;
	--pcc-line: #e4e7ec;
	--pcc-surface: #f7f8fa;
	--pcc-radius: 12px;
	--pcc-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
	/* Explicit block display so the section stacks its bar and grid vertically.
	 * !important overrides any older .pcc-gallery grid rule that may still live
	 * in front.css from an earlier iteration. Without this, an inherited grid
	 * would lay the filter bar and photo grid out side-by-side. */
	display: block !important;
	margin: 0 0 48px;
	color: var(--pcc-ink);
}

/* Bar --------------------------------------------------------------------- */

.pcc-gallery__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	padding: 0 0 24px;
	margin-bottom: 32px;
	border-bottom: 1px solid var(--pcc-line);
}

.pcc-gallery__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

/* Tabs reuse .pcc-blog__tab from blog-styles.css — no duplicate rules here. */

.pcc-gallery__count {
	color: var(--pcc-muted);
	font-family: var(--pcc-mono);
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	white-space: nowrap;
}

.pcc-gallery__count strong {
	color: var(--pcc-red);
	font-weight: 700;
}

/* Grid + cards ------------------------------------------------------------ */

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

.pcc-gallery__grid[data-cols="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pcc-gallery__grid[data-cols="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pcc-gallery__grid[data-cols="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.pcc-gallery__card {
	background: #fff;
	border: 1px solid var(--pcc-line);
	border-radius: var(--pcc-radius);
	overflow: hidden;
	transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.pcc-gallery__card[data-hidden] {
	display: none;
}

.pcc-gallery__card:hover {
	border-color: var(--pcc-navy);
	transform: translateY(-2px);
	box-shadow: 0 6px 20px -10px rgba(1, 34, 95, 0.2);
}

.pcc-gallery__media {
	position: relative;
	display: block;
	aspect-ratio: 4 / 3;
	background: #fff;
	overflow: hidden;
	text-decoration: none;
}

.pcc-gallery__media img {
	display: block;
	width: 100%;
	height: 100% !important;
	object-fit: contain;
	transition: transform 0.4s ease;
}

.pcc-gallery__card:hover .pcc-gallery__media img {
	transform: scale(1.04);
}

.pcc-gallery__meta {
	padding: 16px 20px 18px;
}

.pcc-gallery__eyebrow {
	display: inline-block;
	margin-bottom: 6px;
	color: var(--pcc-red);
	font-family: var(--pcc-mono);
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.pcc-gallery__title {
	margin: 0;
	color: var(--pcc-navy);
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.3;
}

/* Responsive -------------------------------------------------------------- */

@media (max-width: 1024px) {
	.pcc-gallery__grid,
	.pcc-gallery__grid[data-cols] {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.pcc-gallery__grid,
	.pcc-gallery__grid[data-cols] {
		grid-template-columns: 1fr;
		gap: 14px;
	}

	.pcc-gallery__bar {
		flex-direction: column;
		align-items: stretch;
	}

	.pcc-gallery__tabs {
		overflow-x: auto;
		flex-wrap: nowrap;
		margin: 0 -20px;
		padding: 4px 20px;
		-ms-overflow-style: none;
		scrollbar-width: none;
	}

	.pcc-gallery__tabs::-webkit-scrollbar {
		display: none;
	}

	.pcc-gallery__tabs .pcc-blog__tab {
		flex: 0 0 auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pcc-gallery__card,
	.pcc-gallery__media img {
		transition: none;
	}

	.pcc-gallery__card:hover {
		transform: none;
	}

	.pcc-gallery__card:hover .pcc-gallery__media img {
		transform: none;
	}
}