/**
 * MHB Trip Gallery — grid styles.
 *
 * The container reuses the theme's .is-style-travel-card panel. Only
 * the inner grid + image treatment lives here.
 */

.mhb-on-trip-gallery__grid {
	display: grid;
	gap: var(--wp--preset--spacing--20, 1rem);
	margin-top: var(--wp--preset--spacing--20, 1rem);
}

.mhb-on-trip-gallery--cols-1 .mhb-on-trip-gallery__grid { grid-template-columns: 1fr; }
.mhb-on-trip-gallery--cols-2 .mhb-on-trip-gallery__grid { grid-template-columns: repeat(2, 1fr); }
.mhb-on-trip-gallery--cols-3 .mhb-on-trip-gallery__grid { grid-template-columns: repeat(3, 1fr); }
.mhb-on-trip-gallery--cols-4 .mhb-on-trip-gallery__grid { grid-template-columns: repeat(4, 1fr); }

.mhb-on-trip-gallery__item {
	margin: 0;
	overflow: hidden;
	border-radius: 8px;
	aspect-ratio: 1 / 1;
}

.mhb-on-trip-gallery__item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.mhb-on-trip-gallery__empty {
	font-family: var(--wp--preset--font-family--sans, system-ui, sans-serif);
	font-size: var(--wp--preset--font-size--sm, 0.95rem);
	color: var(--wp--preset--color--ink-muted, #6F675D);
	font-style: italic;
}

.mhb-on-trip-gallery__item img {
	transition: transform 320ms ease, filter 320ms ease;
}
.mhb-on-trip-gallery__item:hover img,
.mhb-on-trip-gallery__item img:focus-visible {
	transform: scale(1.02);
	filter: brightness(1.05);
	outline: none;
}

/* Desktop + tablet: landscape ratio so images don't stretch
   too tall in the narrow right column. */
@media (min-width: 782px) {
	.mhb-on-trip-gallery__item {
		aspect-ratio: 4 / 3;
	}
}

/**
 * Lightbox — single shared <dialog> built by lightbox.js.
 */
.mhb-lightbox[open] {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 0;
	margin: 0;
	width: 100vw;
	max-width: 100vw;
	height: 100vh;
	max-height: 100vh;
	background: transparent;
	border: 0;
	color: var(--wp--preset--color--cream, #FFFDF8);
}
.mhb-lightbox::backdrop {
	background: rgba(37, 33, 29, 0.92);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}

.mhb-lightbox__stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1 1 auto;
	width: 100%;
	max-width: min(1200px, 100vw - 7rem);
	margin: 1.5rem 0 1rem;
	min-height: 0;
}
.mhb-lightbox__media {
	display: block;
	max-width: 100%;
	max-height: calc(100vh - 7rem);
	width: auto;
	height: auto;
	border-radius: 4px;
	box-shadow: 0 16px 60px rgba(0, 0, 0, 0.5);
	background: rgba(0, 0, 0, 0.25);
}
.mhb-lightbox video.mhb-lightbox__media {
	background: #000;
}

.mhb-lightbox__close,
.mhb-lightbox__arrow {
	position: absolute;
	background: rgba(255, 253, 248, 0.12);
	color: var(--wp--preset--color--cream, #FFFDF8);
	border: 1px solid rgba(255, 253, 248, 0.18);
	border-radius: 9999px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: var(--wp--preset--font-family--sans, system-ui, sans-serif);
	line-height: 1;
	transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
	padding: 0;
}
.mhb-lightbox__close:hover,
.mhb-lightbox__close:focus-visible,
.mhb-lightbox__arrow:hover,
.mhb-lightbox__arrow:focus-visible {
	background: rgba(255, 253, 248, 0.24);
	border-color: rgba(255, 253, 248, 0.4);
	outline: none;
}

.mhb-lightbox__close {
	top: 1rem;
	right: 1rem;
	width: 2.5rem;
	height: 2.5rem;
	font-size: 1.5rem;
}

.mhb-lightbox__arrow {
	top: 50%;
	transform: translateY(-50%);
	width: 2.75rem;
	height: 2.75rem;
	font-size: 1.5rem;
}
.mhb-lightbox__arrow--prev { left: 1rem; }
.mhb-lightbox__arrow--next { right: 1rem; }
.mhb-lightbox__arrow:hover,
.mhb-lightbox__arrow:focus-visible {
	transform: translateY(-50%) scale(1.06);
}

.mhb-lightbox__meta {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.6rem;
	padding: 0 1rem 1.5rem;
	max-width: min(1200px, 100vw - 4rem);
	text-align: center;
}
.mhb-lightbox__counter {
	font-family: var(--wp--preset--font-family--sans, system-ui, sans-serif);
	font-size: 0.75rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	opacity: 0.6;
}

.mhb-lightbox__cta {
	position: relative;
	display: inline-flex;
	align-items: baseline;
	gap: 0.5rem;
	padding: 0.65rem 1.2rem 0.7rem;
	background: var(--wp--preset--color--red, #C9291C);
	border-radius: 9999px;
	color: var(--wp--preset--color--cream, #FFFDF8);
	text-decoration: none;
	font-family: var(--wp--preset--font-family--sans, system-ui, sans-serif);
	font-size: 0.95rem;
	line-height: 1;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
	transition: background 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}
/* Gold outline ring — animated on hover/focus using inset → spread expansion. */
.mhb-lightbox__cta::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	border: 1px solid var(--wp--preset--color--gold, #BFA36B);
	opacity: 0;
	transform: scale(0.94);
	transition: opacity 220ms ease, transform 220ms ease;
	pointer-events: none;
}
.mhb-lightbox__cta::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	border: 1px solid var(--wp--preset--color--gold, #BFA36B);
	opacity: 0;
	transform: scale(1);
	transition: opacity 600ms ease, transform 600ms ease;
	pointer-events: none;
}
.mhb-lightbox__cta:hover,
.mhb-lightbox__cta:focus-visible {
	background: var(--wp--preset--color--red-hover, #A91F15);
	transform: translateY(-1px);
	box-shadow: 0 10px 28px rgba(201, 41, 28, 0.35);
	outline: none;
}
.mhb-lightbox__cta:hover::before,
.mhb-lightbox__cta:focus-visible::before {
	opacity: 1;
	transform: scale(1);
}
.mhb-lightbox__cta:hover::after,
.mhb-lightbox__cta:focus-visible::after {
	opacity: 0;
	transform: scale(1.18);
}
.mhb-lightbox__cta-lead {
	font-family: var(--wp--preset--font-family--serif, Georgia, serif);
	font-style: italic;
	font-size: 1rem;
	color: var(--wp--preset--color--gold, #BFA36B);
	transition: color 180ms ease;
}
.mhb-lightbox__cta:hover .mhb-lightbox__cta-lead,
.mhb-lightbox__cta:focus-visible .mhb-lightbox__cta-lead {
	color: var(--wp--preset--color--cream, #FFFDF8);
}
.mhb-lightbox__cta-link {
	letter-spacing: 0.02em;
}
.mhb-lightbox__cta-arrow {
	font-size: 1.05rem;
	line-height: 1;
	transition: transform 180ms ease;
}
.mhb-lightbox__cta:hover .mhb-lightbox__cta-arrow,
.mhb-lightbox__cta:focus-visible .mhb-lightbox__cta-arrow {
	transform: translateX(3px);
}
@media (prefers-reduced-motion: reduce) {
	.mhb-lightbox__cta,
	.mhb-lightbox__cta::before,
	.mhb-lightbox__cta::after,
	.mhb-lightbox__cta-lead,
	.mhb-lightbox__cta-arrow {
		transition: none;
	}
}

/* Mobile portrait — image edge-to-edge, arrows overlay. */
@media (max-width: 600px) {
	.mhb-lightbox__stage {
		max-width: 100vw;
		margin: 0;
	}
	.mhb-lightbox__media {
		width: 100%;
		max-width: 100vw;
		max-height: calc(100vh - 4rem);
		border-radius: 0;
	}
	.mhb-lightbox__arrow {
		width: 2.25rem;
		height: 2.25rem;
		background: rgba(0, 0, 0, 0.45);
	}
	.mhb-lightbox__arrow--prev { left: 0.5rem; }
	.mhb-lightbox__arrow--next { right: 0.5rem; }
	.mhb-lightbox__close {
		top: 0.5rem;
		right: 0.5rem;
		background: rgba(0, 0, 0, 0.45);
	}
	.mhb-lightbox__meta {
		padding: 0 0.5rem 0.5rem;
	}
}

/* Landscape (phones/small) — give the image essentially the whole screen. */
@media (orientation: landscape) and (max-height: 600px) {
	.mhb-lightbox__stage {
		max-width: 100vw;
		margin: 0;
		height: 100vh;
	}
	.mhb-lightbox__media {
		max-width: 100vw;
		max-height: 100vh;
		width: auto;
		height: auto;
		border-radius: 0;
	}
	.mhb-lightbox__close {
		top: 0.5rem;
		right: 0.5rem;
		width: 2rem;
		height: 2rem;
		font-size: 1.25rem;
		background: rgba(0, 0, 0, 0.45);
	}
	.mhb-lightbox__arrow {
		width: 2.25rem;
		height: 2.25rem;
		background: rgba(0, 0, 0, 0.45);
	}
	.mhb-lightbox__arrow--prev { left: 0.5rem; }
	.mhb-lightbox__arrow--next { right: 0.5rem; }
	.mhb-lightbox__meta {
		position: absolute;
		bottom: 0.5rem;
		left: 50%;
		transform: translateX(-50%);
		flex-direction: row;
		align-items: center;
		gap: 0.6rem;
		padding: 0;
		background: transparent;
		max-width: none;
	}
	.mhb-lightbox__counter {
		padding: 0.2rem 0.55rem;
		background: rgba(0, 0, 0, 0.45);
		border-radius: 9999px;
	}
	.mhb-lightbox__cta {
		padding: 0.35rem 0.8rem 0.4rem;
		font-size: 0.85rem;
	}
	.mhb-lightbox__cta-lead {
		font-size: 0.9rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mhb-lightbox__close,
	.mhb-lightbox__arrow,
	.mhb-on-trip-gallery__item img {
		transition: none;
	}
}
