/**
 * BCSV Virtual Museum 2.0
 *
 * Scoped entirely under .vm / .vm-* so it can never leak into the theme.
 * Colours and fonts read the BCSV 2026 theme's custom properties where they
 * exist and fall back to the same values, so the plugin looks right on any
 * theme and matches exactly on ours.
 */

.vm {
	/* Local tokens — inherit the theme's when present. */
	--vm-green:      var(--green, #1d4034);
	--vm-green-deep: var(--green-deep, #0e241f);
	--vm-brass:      var(--brass, #b0842f);
	--vm-amber:      var(--amber, #f4b12b);
	--vm-maroon:     var(--maroon, #7c2b3a);
	--vm-paper:      var(--paper, #fffdf8);
	--vm-surface-2:  var(--surface-2, #e9e0cd);
	--vm-line:       var(--line, #ddd2ba);
	--vm-ink:        var(--ink, #241f18);
	--vm-ink-body:   var(--ink-body, #3c352c);
	--vm-muted:      var(--muted, #857b6b);
	--vm-display:    var(--display, "Fraunces", Georgia, "Times New Roman", serif);
	--vm-signage:    var(--signage, "Oswald", "Arial Narrow", Arial, sans-serif);
	--vm-body:       var(--body, "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
	--vm-radius:     var(--radius-sm, 6px);
	--vm-shadow:     var(--shadow-sm, 0 1px 2px rgba(36, 31, 24, .05), 0 2px 8px rgba(36, 31, 24, .05));
	--vm-shadow-lg:  var(--shadow, 0 2px 4px rgba(36, 31, 24, .05), 0 10px 28px rgba(36, 31, 24, .09));
	--vm-ease:       var(--ease, cubic-bezier(.2, .7, .3, 1));
	--vm-columns:    3;
	--vm-gap:        clamp(1rem, 2.2vw, 1.75rem);

	display: block;
	margin: 0 0 2.5rem;
	font-family: var(--vm-body);
	color: var(--vm-ink-body);
}

.vm *,
.vm *::before,
.vm *::after {
	box-sizing: border-box;
}

/* Featured sets sit on a tinted panel (the old featured="yes" grey). */
.vm--featured {
	background: var(--vm-surface-2);
	border: 1px solid var(--vm-line);
	border-radius: var(--radius, 10px);
	padding: clamp(1.25rem, 3vw, 2.25rem);
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.vm__header {
	margin: 0 0 1.5rem;
}

.vm__title {
	font-family: var(--vm-display);
	font-size: clamp(1.45rem, 1.2rem + 1vw, 2.1rem);
	line-height: 1.15;
	color: var(--vm-green);
	margin: 0 0 .5rem;
	padding: 0 0 .6rem;
	border-bottom: 2px solid var(--vm-brass);
	text-wrap: balance;
}

.vm__intro {
	max-width: 68ch;
	font-size: 1.02rem;
	line-height: 1.6;
	color: var(--vm-ink-body);
}

.vm__intro > :last-child {
	margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Category chips
   -------------------------------------------------------------------------- */

.vm__filter ul {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	list-style: none;
	margin: 0 0 1.5rem;
	padding: 0;
}

.vm__filter li {
	margin: 0;
}

.vm-chip {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	padding: .35rem .8rem;
	border: 1px solid var(--vm-line);
	border-radius: 999px;
	background: var(--vm-paper);
	font-family: var(--vm-signage);
	font-size: .82rem;
	letter-spacing: .04em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--vm-green);
	transition: background .2s var(--vm-ease), color .2s var(--vm-ease), border-color .2s var(--vm-ease);
}

.vm-chip:hover,
.vm-chip:focus-visible {
	background: var(--vm-green);
	border-color: var(--vm-green);
	color: #fff;
}

.vm-chip.is-current {
	background: var(--vm-green);
	border-color: var(--vm-green);
	color: var(--vm-amber);
}

.vm-chip__count {
	font-size: .74rem;
	opacity: .7;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.vm__items {
	display: grid;
	gap: var(--vm-gap);
	list-style: none;
	margin: 0;
	padding: 0;
}

.vm--grid .vm__items {
	/* --vm-track is set inline from the `columns` attribute so mid-size screens
	   step down sensibly instead of always packing 260px tracks. */
	grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--vm-track, 260px)), 1fr));
}

/* Never exceed the requested column count on wide screens. */
@media (min-width: 1100px) {
	.vm--grid .vm__items {
		grid-template-columns: repeat(var(--vm-columns), minmax(0, 1fr));
	}
}

.vm__item {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
}

.vm__item::before {
	content: none;
}

/* --------------------------------------------------------------------------
   Card
   -------------------------------------------------------------------------- */

.vm-card {
	display: flex;
	flex-direction: column;
	width: 100%;
	overflow: hidden;
	background: var(--vm-paper);
	border: 1px solid var(--vm-line);
	border-radius: var(--vm-radius);
	box-shadow: var(--vm-shadow);
	transition: transform .25s var(--vm-ease), box-shadow .25s var(--vm-ease), border-color .25s var(--vm-ease);
}

.vm-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--vm-shadow-lg);
	border-color: var(--vm-brass);
}

.vm-card:focus-within {
	border-color: var(--vm-brass);
	box-shadow: var(--vm-shadow-lg);
}

.vm-card__media {
	display: block;
	position: relative;
	overflow: hidden;
	background: var(--vm-surface-2);
	aspect-ratio: 10 / 7;
	line-height: 0;
	border-bottom: 1px solid var(--vm-line);
}

.vm-card__media img,
.vm-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .5s var(--vm-ease), filter .4s var(--vm-ease);
	filter: saturate(.92) sepia(.06);
}

.vm-card:hover .vm-card__image {
	transform: scale(1.04);
	filter: none;
}

.vm-card__placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background:
		repeating-linear-gradient(
			45deg,
			transparent 0 10px,
			rgba(176, 132, 47, .10) 10px 20px
		),
		var(--vm-surface-2);
}

.vm-card__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	gap: .5rem;
	padding: 1.1rem 1.15rem 1.25rem;
}

.vm-card__title {
	font-family: var(--vm-display);
	font-size: 1.16rem;
	line-height: 1.25;
	margin: 0;
	color: var(--vm-green);
	text-wrap: balance;
}

.vm-card__title a {
	color: inherit;
	text-decoration: none;
	background-image: linear-gradient(currentColor, currentColor);
	background-size: 0 1px;
	background-position: 0 100%;
	background-repeat: no-repeat;
	transition: background-size .3s var(--vm-ease);
}

.vm-card__title a:hover,
.vm-card__title a:focus-visible {
	background-size: 100% 1px;
}

.vm-card__meta {
	font-family: var(--vm-signage);
	font-size: .78rem;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--vm-brass);
	margin: 0;
}

.vm-card__excerpt {
	font-size: .95rem;
	line-height: 1.55;
	margin: 0;
	color: var(--vm-ink-body);
}

.vm-card__price {
	font-family: var(--vm-signage);
	font-size: .95rem;
	font-weight: 600;
	color: var(--vm-maroon);
	margin: 0;
}

.vm-card__actions {
	margin: auto 0 0;
	padding-top: .5rem;
}

/* --------------------------------------------------------------------------
   Button
   -------------------------------------------------------------------------- */

.vm-btn {
	display: inline-flex;
	align-items: center;
	gap: .45rem;
	padding: .5rem .95rem;
	background: var(--vm-green);
	color: #fff;
	border: 1px solid var(--vm-green);
	border-radius: var(--vm-radius);
	font-family: var(--vm-signage);
	font-size: .82rem;
	font-weight: 500;
	letter-spacing: .07em;
	text-transform: uppercase;
	text-decoration: none;
	transition: background .2s var(--vm-ease), color .2s var(--vm-ease), border-color .2s var(--vm-ease);
}

.vm-btn:hover,
.vm-btn:focus-visible {
	background: var(--vm-amber);
	border-color: var(--vm-amber);
	color: var(--vm-green-deep);
}

.vm-btn__arrow {
	transition: transform .2s var(--vm-ease);
}

.vm-btn:hover .vm-btn__arrow {
	transform: translateX(3px);
}

.vm a:focus-visible {
	outline: 2px solid var(--vm-amber);
	outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   List view
   -------------------------------------------------------------------------- */

.vm--list .vm__items {
	grid-template-columns: 1fr;
	gap: 1.25rem;
}

.vm--list .vm-card {
	flex-direction: row;
	align-items: stretch;
}

.vm--list .vm-card__media {
	flex: 0 0 clamp(180px, 32%, 340px);
	aspect-ratio: auto;
	border-bottom: 0;
	border-right: 1px solid var(--vm-line);
}

.vm--list .vm-card__body {
	padding: 1.25rem 1.5rem;
}

.vm--list .vm-card__title {
	font-size: 1.3rem;
}

@media (max-width: 600px) {
	.vm--list .vm-card {
		flex-direction: column;
	}

	.vm--list .vm-card__media {
		flex: 0 0 auto;
		aspect-ratio: 10 / 7;
		border-right: 0;
		border-bottom: 1px solid var(--vm-line);
	}
}

/* --------------------------------------------------------------------------
   Grouped view (group="yes") — one block per category
   -------------------------------------------------------------------------- */

.vm-group + .vm-group {
	margin-top: clamp(2.5rem, 5vw, 4rem);
	padding-top: clamp(1.75rem, 3vw, 2.5rem);
	border-top: 1px solid var(--vm-line);
}

.vm-group .vm__title a {
	color: inherit;
	text-decoration: none;
}

.vm-group .vm__title a:hover,
.vm-group .vm__title a:focus-visible {
	color: var(--vm-brass);
}

.vm-group__more {
	margin: 1.5rem 0 0;
}

/* --------------------------------------------------------------------------
   Category index ([vm_categories])
   -------------------------------------------------------------------------- */

.vm-card--category .vm-card__media {
	aspect-ratio: 3 / 2;
}

.vm-card--category .vm-card__title {
	font-size: 1.25rem;
}

.vm-card--category .vm-card__meta {
	color: var(--vm-green);
	opacity: .75;
}

.vm--categories .vm-card {
	border-top: 3px solid var(--vm-brass);
}

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

.vm__pagination {
	margin: 2rem 0 0;
}

.vm__pagination .page-numbers {
	display: flex;
	flex-wrap: wrap;
	gap: .4rem;
	justify-content: center;
	list-style: none;
	margin: 0;
	padding: 0;
}

.vm__pagination li {
	margin: 0;
}

.vm__pagination a,
.vm__pagination span {
	display: inline-block;
	min-width: 2.4rem;
	padding: .4rem .7rem;
	text-align: center;
	border: 1px solid var(--vm-line);
	border-radius: var(--vm-radius);
	background: var(--vm-paper);
	font-family: var(--vm-signage);
	font-size: .85rem;
	color: var(--vm-green);
	text-decoration: none;
}

.vm__pagination a:hover {
	background: var(--vm-green);
	border-color: var(--vm-green);
	color: #fff;
}

.vm__pagination .current {
	background: var(--vm-green);
	border-color: var(--vm-green);
	color: var(--vm-amber);
}

/* --------------------------------------------------------------------------
   Single exhibit details + empty state
   -------------------------------------------------------------------------- */

.vm-details {
	display: grid;
	gap: 0;
	margin: 2rem 0 0;
	padding: 0;
	border: 1px solid var(--line, #ddd2ba);
	border-radius: var(--radius-sm, 6px);
	overflow: hidden;
	font-family: var(--body, "Inter", Helvetica, Arial, sans-serif);
	background: var(--paper, #fffdf8);
}

.vm-details__row {
	display: grid;
	grid-template-columns: minmax(9rem, 30%) 1fr;
	gap: 1rem;
	padding: .7rem 1rem;
	border-bottom: 1px solid var(--line-soft, #ebe3d2);
}

.vm-details__row:last-child {
	border-bottom: 0;
}

.vm-details__label {
	margin: 0;
	font-family: var(--signage, "Oswald", Arial, sans-serif);
	font-size: .78rem;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--brass, #b0842f);
}

.vm-details__value {
	margin: 0;
	color: var(--ink, #241f18);
}

@media (max-width: 480px) {
	.vm-details__row {
		grid-template-columns: 1fr;
		gap: .15rem;
	}
}

.vm-empty {
	margin: 1.5rem 0;
	padding: 1.1rem 1.25rem;
	border: 1px dashed var(--line, #ddd2ba);
	border-left: 4px solid var(--brass, #b0842f);
	border-radius: var(--radius-sm, 6px);
	background: var(--surface-2, #e9e0cd);
	color: var(--ink-body, #3c352c);
}

/* --------------------------------------------------------------------------
   Accessibility & print
   -------------------------------------------------------------------------- */

.vm .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (prefers-reduced-motion: reduce) {
	.vm *,
	.vm *::before,
	.vm *::after {
		transition-duration: .01ms !important;
		animation-duration: .01ms !important;
	}

	.vm-card:hover {
		transform: none;
	}

	.vm-card:hover .vm-card__image {
		transform: none;
	}
}

@media print {
	.vm-card {
		break-inside: avoid;
		box-shadow: none;
	}

	.vm__filter,
	.vm__pagination,
	.vm-card__actions {
		display: none;
	}
}
