/*
 * Media components (Phase 3A — docs/COMPONENT-LIBRARY.md): image container,
 * gallery thumbnails, product gallery controls. Product-card media has its
 * own rules in components/product-card.css — this file is for the
 * single-product gallery and general content images.
 */

/* --- Generic image container ---
   For content/marketing imagery (not product photography, which stays on
   plain white per docs/DESIGN-SYSTEM.md). Optional gradient overlay for text
   legibility when a caption/label sits over the image. */

.bholats-image-container {
	position: relative;
	overflow: hidden;
	border-radius: var(--radius-md);
	background: var(--color-surface-sunken);
}

.bholats-image-container img { width: 100%; height: 100%; object-fit: cover; }

.bholats-image-container--overlay::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(11, 31, 43, 0.65), rgba(11, 31, 43, 0) 55%);
	pointer-events: none;
}

.bholats-image-container__caption {
	position: absolute;
	left: var(--space-4);
	bottom: var(--space-4);
	right: var(--space-4);
	color: var(--color-text-on-brand);
	font-size: var(--text-sm);
	font-weight: var(--font-weight-medium);
	z-index: var(--z-raised);
}

/* --- Product gallery ---
   Main image + thumbnail strip. Thumbnail click swaps the main image
   (assets/js/gallery.js) — works without JS too, since thumbnails are real
   links to the full image (progressive enhancement). */

.bholats-gallery {
	display: flex;
	flex-direction: column;
	gap: var(--space-3);
}

.bholats-gallery__main {
	position: relative;
	aspect-ratio: 1;
	background: var(--color-surface);
	border: var(--border-width-sm) solid var(--color-border);
	border-radius: var(--radius-md);
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.bholats-gallery__main img { width: 100%; height: 100%; object-fit: contain; }

.bholats-gallery__zoom {
	position: absolute;
	bottom: var(--space-3);
	right: var(--space-3);
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--color-surface);
	border: var(--border-width-sm) solid var(--color-border);
	border-radius: var(--radius-full);
	box-shadow: var(--shadow-sm);
	cursor: pointer;
	color: var(--color-text-secondary);
}

.bholats-gallery__zoom:hover { color: var(--color-brand-blue); }
.bholats-gallery__zoom svg { width: var(--icon-md); height: var(--icon-md); }

.bholats-gallery__thumbs {
	display: flex;
	gap: var(--space-2);
	overflow-x: auto;
}

.bholats-gallery__thumb {
	flex-shrink: 0;
	width: 64px;
	height: 64px;
	padding: 0;
	background: var(--color-surface);
	border: var(--border-width-sm) solid var(--color-border);
	border-radius: var(--radius-sm);
	overflow: hidden;
	cursor: pointer;
	transition: border-color var(--duration-base) var(--ease-standard);
}

.bholats-gallery__thumb img { width: 100%; height: 100%; object-fit: contain; }

.bholats-gallery__thumb:hover { border-color: var(--color-border-strong); }

.bholats-gallery__thumb[aria-current="true"] {
	border-color: var(--color-brand-blue);
	border-width: var(--border-width-md);
}

/* --- Gallery thumbnail used standalone (e.g. recently-viewed rail, not
   inside the main product gallery) --- */

.bholats-thumb {
	display: block;
	aspect-ratio: 1;
	border-radius: var(--radius-sm);
	overflow: hidden;
	background: var(--color-surface-sunken);
}

.bholats-thumb img { width: 100%; height: 100%; object-fit: contain; }

@media (max-width: 767px) {
	.bholats-gallery__thumb { width: 56px; height: 56px; }
}
