/* Ogallery Exhibition — front-end base styles.
   Kept deliberately minimal: colors, spacing and typography are expected to
   be finished off in Elementor (or the theme's own stylesheet) so the
   plugin never fights a site's design system. */

.oge-grid {
	display: grid;
	gap: 24px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.oge-grid-item {
	display: block;
	text-decoration: none;
	color: inherit;
}

/* The tile is a <div>; its thumbnail, artist name and title are individual
   links (an <a> can't contain another <a>). Give them the base look the old
   all-in-one link tile had: inherit the surrounding colour, no underline.
   Deliberately ONLY the base state, at low specificity: a rule like
   `.oge-grid-item a:hover { color: inherit }` would out-rank the widget's
   Normal-colour control and make a link snap back to the inherited colour on
   hover even when the admin set a Normal colour. The Normal / Hover / Active
   colour controls (Style > Content) are scoped to the widget and out-rank this. */
.oge-grid-item a {
	color: inherit;
	text-decoration: none;
}

.oge-grid-thumb-link {
	display: block;
}

.oge-grid-artist,
.oge-grid-title,
.oge-grid-dates {
	transition: color 0.2s ease;
}

.oge-grid-thumb {
	width: 100%;
	aspect-ratio: 3 / 4;
	overflow: hidden;
	background: #f0f0f0;
}

.oge-grid-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.35s ease;
}

.oge-grid-item:hover .oge-grid-thumb img {
	transform: scale(1.03);
}

.oge-grid-caption {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin-top: 10px;
	font-size: 13px;
	line-height: 1.4;
}

.oge-grid-artist {
	font-weight: 600;
}

.oge-empty {
	opacity: 0.7;
}

.oge-static-gallery {
	display: grid;
	list-style: none;
	margin: 0;
	padding: 0;
}

.oge-static-gallery-item {
	display: block;
	overflow: hidden;
}

.oge-static-gallery-item a,
.oge-static-gallery-item img {
	display: block;
	width: 100%;
	height: 100%;
}

.oge-static-gallery-item img {
	object-fit: cover;
	transition: transform 0.35s ease;
}

.oge-static-gallery-item:hover img {
	transform: scale(1.03);
}

.oge-field-value a {
	color: inherit;
	text-decoration: none;
}

.oge-field-value a:hover {
	text-decoration: underline;
}

/* Guarantees visible space between Press Release paragraphs even if the
   active theme's own global CSS resets <p> margins to zero - the content
   is correctly split into separate <p> tags either way, but a zeroed
   margin alone can make them look like one run-on paragraph. */
.oge-press-release p {
	margin: 0 0 1em;
}

.oge-press-release p:last-child {
	margin-bottom: 0;
}

/* Year tabs */
.oge-year-tabs {
	display: flex;
	flex-direction: column;
}

.oge-year-tabs-heading {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-start;
	gap: 8px;
	margin-bottom: 24px;
	order: 0;
}

.oge-year-panels {
	order: 1;
}

.oge-year-tab {
	background: transparent;
	border: 1px solid #ccc;
	color: inherit;
	border-radius: 999px;
	padding: 6px 18px;
	font-size: 13px;
	cursor: pointer;
	opacity: 0.7;
	transition: opacity 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.oge-year-tab:hover {
	opacity: 1;
}

.oge-year-tab.is-active {
	opacity: 1;
	background: #222;
	border-color: #222;
	color: #fff;
}

.oge-year-panel {
	display: none;
}

.oge-year-panel.is-active {
	display: block;
}

/* Carousel */
.oge-carousel {
	position: relative;
}

.oge-carousel-viewport {
	overflow: hidden;
	min-width: 0;
}

.oge-carousel-track {
	display: flex;
	transition: transform 0.4s ease;
	will-change: transform;
	min-width: 0;
}

.oge-carousel-slide {
	box-sizing: border-box;
	padding: 0 8px;
	/* Without this, a flex item's default min-width is "auto", which lets
	   its content's INTRINSIC size (a large/full-size image's native pixel
	   width) force the slide wider than its flex-basis — the browser
	   refuses to shrink it below that, so the whole carousel can bleed past
	   its own container. min-width: 0 removes that floor, letting
	   `img { width: 100% }` below actually govern the size as intended. */
	min-width: 0;
}

.oge-carousel-slide img {
	width: 100%;
	height: auto;
	max-width: 100%;
	display: block;
}

.oge-carousel-prev,
.oge-carousel-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(255, 255, 255, 0.85);
	border: none;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

/* Custom-image arrows scale proportionally within the button regardless of
   the "Size" style control (which sets the button's own width/height). */
.oge-carousel-prev img,
.oge-carousel-next img {
	width: 55%;
	height: 55%;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	display: block;
}

.oge-carousel-prev {
	left: 8px;
}

.oge-carousel-next {
	right: 8px;
}

.oge-carousel-dots {
	display: flex;
	justify-content: center;
	gap: 6px;
	margin-top: 12px;
}

.oge-carousel-dots button {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	border: none;
	background: #ccc;
	padding: 0;
	cursor: pointer;
}

.oge-carousel-dots button.is-active {
	background: #333;
}

@media (max-width: 480px) {
	.oge-grid {
		gap: 14px;
	}
}

/* The lightbox popup itself (close button, prev/next arrows, caption area)
   is rendered entirely by Elementor, not by this plugin - these rules only
   guard against a theme hiding/fading Elementor's own native arrow buttons
   on the Selected Works lightbox. If arrows still don't appear after this,
   the setting controlling them lives in Elementor itself (Elementor →
   Settings → Lightbox), not in this plugin. */
.elementor-lightbox .elementor-swiper-button {
	opacity: 1 !important;
	visibility: visible !important;
	display: flex !important;
}

/* Ogallery lightbox (Selected Works gallery). Colours, arrow icon/size/
   position come from Exhibitions -> Settings -> Lightbox and are applied by
   frontend-lightbox.js; these are only the structural rules. Specific
   selectors + "all: unset" on the buttons keep a theme's global button
   styles from leaking in. */
html.oge-lb-open {
	overflow: hidden;
}

.oge-lb {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: rgba(0, 0, 0, 0.9);
}

.oge-lb[hidden] {
	display: none;
}

.oge-lb .oge-lb-figure {
	margin: 0;
	padding: 0;
	max-width: 90vw;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.oge-lb .oge-lb-img {
	display: block;
	max-width: 90vw;
	max-height: 80vh;
	width: auto;
	height: auto;
	object-fit: contain;
}

.oge-lb .oge-lb-caption {
	margin: 12px 0 0;
	max-width: 90vw;
	text-align: center;
	color: #fff;
	font-size: 14px;
	line-height: 1.4;
}

.oge-lb .oge-lb-caption:empty {
	display: none;
}

.oge-lb button.oge-lb-close,
.oge-lb button.oge-lb-prev,
.oge-lb button.oge-lb-next {
	all: unset;
	box-sizing: border-box;
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

.oge-lb button[hidden] {
	display: none;
}

.oge-lb button.oge-lb-close {
	top: 16px;
	right: 16px;
	width: 44px;
	height: 44px;
	padding: 10px;
	color: #fff;
}

.oge-lb button.oge-lb-close svg {
	width: 100%;
	height: 100%;
}

.oge-lb button.oge-lb-prev,
.oge-lb button.oge-lb-next {
	transform: translateY(-50%);
	border-radius: 50%;
}

.oge-lb button.oge-lb-prev svg,
.oge-lb button.oge-lb-next svg {
	display: block;
}

.oge-lb button:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}
