/**
 * Door Gallery + Finish Gallery (page-templates/template-door-gallery.php,
 * page-templates/template-finish-gallery.php) — ONE combined stylesheet
 * for both, per chat ("just about everything, except the image size, is
 * pretty much the same — from a style perspective"). The layout, toolbar,
 * card chrome, badges, and pagination are all identical between the two;
 * the only real difference is the card photo's aspect ratio (Door Styles
 * are a portrait cabinet-door profile shot, Finishes are a square swatch)
 * — that lives in the two small `--door` / `--finish` modifier rules near
 * the bottom, everything else is unmodified shared CSS.
 *
 * The filter sidebar itself (toggle, panel, checkboxes) is the separate,
 * even-more-reusable assets/css/gallery-filter.css (inc/gallery-filter.php)
 * that Room Gallery also uses — this file only owns what's specific to
 * these two templates: the two-column layout wrapper, the results
 * toolbar (Showing X of Y / Results Per Page / Sort By / Selected chips),
 * the card grid itself, and pagination. Deliberately its own self-contained
 * token set (like gallery-filter.css) rather than reusing Room Gallery's
 * --room-* tokens in style.css, so this file has no dependency on that
 * template's CSS existing/loading.
 */

:root {
	--product-gallery-ink: #1a1a1a;
	--product-gallery-muted: #6b6b6b;
	--product-gallery-line: #e2e2e2;
	--product-gallery-bp: 900px; /* Match gallery-filter.css's own --gallery-filter-bp. */
}

/* ---- Layout: filter sidebar + results column ---- */

.product-gallery-layout {
	max-width: 75rem;
	margin: 0 auto;
	padding: 3rem 2rem 5rem;
	display: flex;
	flex-direction: column;
	gap: 2rem;
	color: var(--product-gallery-ink);
}

@media (min-width: 900px) {
	.product-gallery-layout {
		flex-direction: row;
		align-items: flex-start;
		gap: 3rem;
		padding: 3.5rem 3rem 6rem;
	}
}

.product-gallery-results {
	flex: 1;
	min-width: 0;
}

/* ---- Toolbar: Showing X of Y / Results Per Page / Sort By / Selected ---- */

.gallery-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem 1.5rem;
	padding-bottom: 1.5rem;
	margin-bottom: 2rem;
	border-bottom: 1px solid var(--product-gallery-line);
	font-family: var(--font-primary);
	font-size: 0.85rem;
}

.gallery-toolbar-count {
	margin: 0;
	margin-right: auto;
	color: var(--product-gallery-muted);
}

.gallery-toolbar-field {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
}

.gallery-toolbar-field label {
	font-weight: var(--font-weight-normal);
	white-space: nowrap;
}

.gallery-toolbar-field select {
	border: 1px solid var(--product-gallery-line);
	border-radius: 3px;
	padding: 0.4rem 0.6rem;
	font-family: var(--font-primary);
	font-size: 0.85rem;
	background: #ffffff;
	color: var(--product-gallery-ink);
	cursor: pointer;
}

.gallery-selected {
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.gallery-selected-label {
	color: var(--product-gallery-muted);
	white-space: nowrap;
}

.gallery-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	background: #f0f0f0;
	color: var(--product-gallery-ink);
	padding: 0.35rem 0.75rem;
	border-radius: 2px;
	font-size: 0.8rem;
	text-decoration: none;
	transition: background 0.2s ease;
}

.gallery-chip:hover {
	background: #e2e2e2;
}

.gallery-chip span {
	font-size: 1rem;
	line-height: 1;
}

/* ---- Results grid ---- */

.product-gallery-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2.5rem 1.75rem;
}

@media (min-width: 600px) {
	.product-gallery-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 1100px) {
	.product-gallery-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

.product-gallery-card {
	display: block;
	color: inherit;
	text-decoration: none;
}

.product-gallery-card-media {
	position: relative;
	overflow: hidden;
	background: var(--product-gallery-line);
	border-radius: 2px;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Standardized card/image hover across the theme: lift 3px + a shadow — no
   zoom. Lands on the shared .product-gallery-card-media base class (not
   the --door/--finish modifier, and not the <img>) so it's one rule
   covering both the Door Styles and Door Finishes card variants
   identically, and the shadow isn't clipped by this element's own
   overflow:hidden (that only clips its CONTENTS, not its own shadow). */
.product-gallery-card:hover .product-gallery-card-media {
  transform: translateY(-3px);
  box-shadow: 0px 4px 10px rgba(0,0,0,0.25);
}

/* The only real difference between the two galleries — see this file's
   own doc comment above. */

.product-gallery-card-media--door {
	aspect-ratio: 120 / 191 /* 4 / 5 */;
}

.product-gallery-card-media--finish {
	aspect-ratio: 1 / 1;
}

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

.product-gallery-badge {
	position: absolute;
	top: 0.75rem;
	left: 0.75rem;
	z-index: 1;
	padding: 0.3rem 0.65rem;
	font-family: var(--font-primary);
	font-weight: var(--font-weight-bold);
	font-style: normal;
	font-size: 0.75rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.product-gallery-badge--new {
	background: var(--goldHex);
	color: #000000;
  border: 1px solid rgba(255,255,255,0.25);
}

.product-gallery-badge--coming-soon {
	background: #1a1a1a;
	color: #ffffff;
}

.product-gallery-card-caption {
	margin: 1rem 0 0;
	font-family: var(--font-primary);
	font-weight: var(--font-weight-normal);
	font-style: normal;
	font-size: 0.875rem;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	text-align: left;
}

.product-gallery-empty {
	color: var(--product-gallery-muted);
	font-size: 1rem;
}

/* ---- Pagination ---- */

.product-gallery-pagination {
	margin-top: 3.5rem;
	display: flex;
	justify-content: center;
}

.product-gallery-pagination ul {
	list-style: none;
	margin: 0;
	display: flex;
	align-items: center;
	gap: 0.625rem;
	padding: 0.5rem;
	border: 1px solid lightgray;
	border-radius: 999rem;
}

.product-gallery-pagination a,
.product-gallery-pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2rem;
	height: 2rem;
	padding: 0;
	border-radius: 50%;
	font-family: var(--font-primary);
	font-weight: var(--font-weight-regular);
	font-style: normal;
	font-size: 0.95rem;
	color: var(--product-gallery-ink);
	text-decoration: none;
}

.product-gallery-pagination a:hover {
	background: var(--product-gallery-line);
}

.product-gallery-pagination .current {
	background: var(--goldHex);
	color: #ffffff;
	font-weight: var(--font-weight-bold);
}

.product-gallery-pagination .dots {
	color: var(--product-gallery-muted);
}