/* =================================================================
 * Original Wisdom — Galleries front-end
 * Scoped to .owtq-galleries and .owtq-gallery-single to avoid theme clashes.
 * Full-width layout. White centered headers. Pill-shaped centered search.
 * ================================================================= */

.owtq-galleries,
.owtq-gallery-single {
	--owtq-bg:        #fafaf7;
	--owtq-card:      #ffffff;
	--owtq-text:      #1a1a1a;
	--owtq-text-dim:  #6b6b6b;
	--owtq-accent:    #2a5d34;
	--owtq-accent-d:  #1c3f23;
	--owtq-border:    #e6e6df;
	--owtq-shadow:    0 1px 2px rgba(0,0,0,0.04), 0 6px 18px rgba(0,0,0,0.06);
	--owtq-shadow-h:  0 2px 4px rgba(0,0,0,0.06), 0 12px 32px rgba(0,0,0,0.12);
	--owtq-radius:    10px;
	--owtq-cols:      5;

	color: var(--owtq-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
	line-height: 1.55;
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 40px 24px 56px;
	box-sizing: border-box;
}

.owtq-galleries *,
.owtq-gallery-single *,
.owtq-lightbox * {
	box-sizing: border-box;
}

/* ==== Index header — white, centered, matching the site's hero look ==== */

.owtq-galleries__header {
	text-align: center;
	margin: 0 auto 36px;
	max-width: 700px;
}

.owtq-galleries__heading {
	font-size: 2.6rem;
	margin: 0 0 10px;
	font-weight: 400;
	color: #ffffff;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	text-align: center;
	line-height: 1.15;
}

.owtq-galleries__subheading {
	margin: 0 0 28px !important;
	color: #ffffff;
	font-size: 1.05rem;
	text-align: center;
	opacity: 0.9;
}

/* Rectangular white box with a beige square button on the right — matches
 * the existing NGG search bar. Centered via parent's text-align (no margin). */
.owtq-galleries__search {
	position: relative;
	width: 440px;
	max-width: 100%;
	margin: 0;
	display: inline-flex;
	align-items: stretch;
	vertical-align: middle;
	text-align: left;
	background: #ffffff;
	border: 1px solid #ffffff !important;
	border-radius: 3px;
	overflow: hidden;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.owtq-galleries__search-input {
	flex: 1;
	width: auto;
	padding: 12px 16px;
	font-size: 0.95rem;
	border: 0 !important;
	background: transparent;
	color: var(--owtq-text);
	font-family: inherit;
	min-width: 0;
	outline: none;
}

.owtq-galleries__search-input:focus {
	outline: none;
}

/* Beige rectangular icon button on the right — a solid square button matching
 * the existing NGG search widget, not a round pill. Houses a clean white SVG
 * magnifying glass that inherits color via stroke="currentColor". */
.owtq-galleries__search-icon {
	position: static;
	transform: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	flex: 0 0 48px;
	color: #ffffff;
	background: #b89468;
	border-radius: 0;
	border-left: 1px solid rgba(0, 0, 0, 0.08);
	pointer-events: none;
}

.owtq-galleries__search-icon svg {
	display: block;
	width: 20px;
	height: 20px;
	stroke: #ffffff;
}

.owtq-galleries__search-count {
	display: block;
	margin-top: 10px;
	font-size: 0.85rem;
	color: #ffffff;
	opacity: 0.85;
	min-height: 1.2em;
	text-align: center;
}

/* ==== Gallery grid — full width, 5-col default ==== */

.owtq-galleries__grid {
	display: grid;
	grid-template-columns: repeat(var(--owtq-cols), minmax(0, 1fr));
	gap: 22px;
}

@media (max-width: 1400px) {
	.owtq-galleries__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
	.owtq-galleries__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
	.owtq-galleries__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 500px) {
	.owtq-galleries__grid { grid-template-columns: 1fr; }
}

.owtq-gallery-card {
	display: flex;
	flex-direction: column;
	background: var(--owtq-card);
	border-radius: var(--owtq-radius);
	overflow: hidden;
	box-shadow: var(--owtq-shadow);
	text-decoration: none;
	color: inherit;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
	border: 1px solid var(--owtq-border);
}

.owtq-gallery-card:hover,
.owtq-gallery-card:focus-visible {
	transform: translateY(-3px);
	box-shadow: var(--owtq-shadow-h);
	text-decoration: none;
}

.owtq-gallery-card__image {
	position: relative;
	aspect-ratio: 4 / 3;
	background: #e8e8e2;
	overflow: hidden;
}

.owtq-gallery-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.5s ease;
}

.owtq-gallery-card:hover .owtq-gallery-card__image img {
	transform: scale(1.04);
}

.owtq-gallery-card__placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 3rem;
	opacity: 0.25;
}

.owtq-gallery-card__count {
	position: absolute;
	top: 10px;
	right: 10px;
	background: rgba(0, 0, 0, 0.72);
	color: #fff;
	font-size: 0.78rem;
	font-weight: 600;
	padding: 4px 10px;
	border-radius: 999px;
	letter-spacing: 0.02em;
	backdrop-filter: blur(6px);
}

.owtq-gallery-card__body {
	padding: 14px 16px 18px;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.owtq-gallery-card__title {
	font-size: 1.02rem;
	font-weight: 600;
	margin: 0;
	line-height: 1.35;
	color: var(--owtq-text);
}

.owtq-gallery-card__desc {
	margin: 0;
	font-size: 0.87rem;
	color: var(--owtq-text-dim);
	line-height: 1.45;
}

.owtq-galleries__empty {
	padding: 60px 20px;
	text-align: center;
	color: #ffffff;
	opacity: 0.85;
	grid-column: 1 / -1;
}

/* Inline breadcrumb back link — sits next to the subheading text with a
 * "|" divider between them. Only rendered when an album filter is active. */
.owtq-galleries__subheading-divider {
	display: inline-block;
	margin: 0 10px;
	color: #ffffff;
	opacity: 0.5;
}

.owtq-galleries__back {
	color: #ffffff !important;
	text-decoration: none;
	font-weight: 500;
	opacity: 0.85;
	transition: opacity 0.15s ease;
}

.owtq-galleries__back:hover {
	opacity: 1;
	text-decoration: underline;
	color: #ffffff !important;
}

/* ==== Single gallery (click-through) view ==== */

.owtq-gallery-single__back-wrap {
	text-align: center;
	margin: 0 0 32px;
}

.owtq-gallery-single__back {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: #ffffff !important;
	text-decoration: none;
	font-size: 0.92rem;
	font-weight: 500;
	transition: opacity 0.15s ease;
	opacity: 0.85;
}

.owtq-gallery-single__back:hover {
	opacity: 1;
	text-decoration: underline;
	color: #ffffff !important;
}

.owtq-gallery-single__title {
	font-size: 2.6rem;
	margin: 0 0 16px;
	font-weight: 400;
	color: #ffffff;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	line-height: 1.15;
	text-align: center;
}

.owtq-gallery-single__description {
	max-width: 760px;
	margin: 0 auto 16px;
	font-size: 1.05rem;
	color: #ffffff;
	opacity: 0.92;
	text-align: center;
	line-height: 1.55;
}

.owtq-gallery-single__description p {
	margin: 0 0 10px;
}

.owtq-gallery-single__description p:last-child {
	margin-bottom: 0;
}

/* Thumbnail grid for single view — full width, same responsive breakpoints as index */
.owtq-gallery-single__grid {
	display: grid;
	grid-template-columns: repeat(var(--owtq-cols, 5), minmax(0, 1fr));
	gap: 22px;
}

@media (max-width: 1400px) {
	.owtq-gallery-single__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
	.owtq-gallery-single__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
	.owtq-gallery-single__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 500px) {
	.owtq-gallery-single__grid { grid-template-columns: 1fr; }
}

.owtq-gallery-single__thumb {
	all: unset;
	display: flex;
	flex-direction: column;
	background: var(--owtq-card);
	border-radius: var(--owtq-radius);
	overflow: hidden;
	cursor: zoom-in;
	box-shadow: var(--owtq-shadow);
	border: 1px solid var(--owtq-border);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.owtq-gallery-single__thumb:hover,
.owtq-gallery-single__thumb:focus,
.owtq-gallery-single__thumb:focus-visible,
.owtq-gallery-single__thumb:active {
	transform: translateY(-2px);
	box-shadow: var(--owtq-shadow-h);
	/* Elementor's theme injects a button:hover background (the pink bleed under
	   the caption) — hold our own card colour on every interactive state. */
	background: var(--owtq-card) !important;
	background-color: var(--owtq-card) !important;
}

.owtq-gallery-single__thumb-image {
	position: relative;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #e8e8e2;
}

.owtq-gallery-single__thumb-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.5s ease;
}

.owtq-gallery-single__thumb:hover .owtq-gallery-single__thumb-image img {
	transform: scale(1.04);
}

.owtq-gallery-single__thumb-caption {
	display: block;
	padding: 12px 14px 14px;
	color: var(--owtq-text);
	font-size: 0.88rem;
	font-weight: 500;
	line-height: 1.4;
	text-align: center;
	min-height: 2.6em;
	background: var(--owtq-card);
}

/* ==== Lightbox ==== */

.owtq-lightbox {
	position: fixed;
	inset: 0;
	background: rgba(10, 10, 10, 0.94);
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 40px;
	opacity: 0;
	transition: opacity 0.22s ease;
}

.owtq-lightbox.is-open {
	display: flex;
	opacity: 1;
}

.owtq-lightbox__close,
.owtq-lightbox__prev,
.owtq-lightbox__next {
	position: absolute;
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.18);
	color: #fff;
	cursor: pointer;
	font-size: 2rem;
	line-height: 1;
	border-radius: 999px;
	width: 52px;
	height: 52px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease, transform 0.15s ease;
	backdrop-filter: blur(8px);
	z-index: 2;
}

.owtq-lightbox__close:hover,
.owtq-lightbox__prev:hover,
.owtq-lightbox__next:hover {
	background: rgba(255, 255, 255, 0.22);
	transform: scale(1.05);
}

.owtq-lightbox__close {
	top: 22px;
	right: 22px;
	font-size: 1.8rem;
}

.owtq-lightbox__prev { left: 22px; top: 50%; transform: translateY(-50%); }
.owtq-lightbox__next { right: 22px; top: 50%; transform: translateY(-50%); }

.owtq-lightbox__prev:hover { transform: translateY(-50%) scale(1.05); }
.owtq-lightbox__next:hover { transform: translateY(-50%) scale(1.05); }

.owtq-lightbox__stage {
	max-width: 1200px;
	max-height: calc(100vh - 80px);
	width: 100%;
	display: flex;
	flex-direction: column;
}

.owtq-lightbox__figure {
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 0;
	background: #181816;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
	max-height: calc(100vh - 80px);
}

.owtq-lightbox__image {
	display: block;
	max-width: 100%;
	max-height: 65vh;
	object-fit: contain;
	background: #000;
	margin: 0 auto;
}

.owtq-lightbox__meta {
	padding: 20px 24px 22px;
	color: #eaeaea;
	font-size: 0.95rem;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	background: #181816;
}

.owtq-lightbox__alt {
	margin: 0 0 6px;
	font-size: 1.15rem;
	font-weight: 600;
	color: #fff;
	line-height: 1.35;
}

.owtq-lightbox__desc {
	margin: 0 0 10px;
	color: #c8c8c2;
	line-height: 1.5;
}

.owtq-lightbox__desc:empty { display: none; }

.owtq-lightbox__meta-row {
	display: flex;
	gap: 20px;
	flex-wrap: wrap;
	font-size: 0.85rem;
	color: #a0a098;
	margin-bottom: 10px;
}

.owtq-lightbox__loc:empty,
.owtq-lightbox__phot:empty { display: none; }

.owtq-lightbox__loc::before { content: "📍 "; }
.owtq-lightbox__phot::before { content: "📷 "; }

.owtq-lightbox__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.owtq-lightbox__tags:empty { display: none; }

.owtq-lightbox__tag {
	background: rgba(255, 255, 255, 0.08);
	color: #d0d0ca;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 0.75rem;
	letter-spacing: 0.01em;
}

@media (max-width: 700px) {
	.owtq-lightbox {
		padding: 0;
	}
	.owtq-lightbox__close,
	.owtq-lightbox__prev,
	.owtq-lightbox__next {
		width: 42px;
		height: 42px;
		font-size: 1.5rem;
	}
	.owtq-lightbox__close { top: 12px; right: 12px; }
	.owtq-lightbox__prev { left: 10px; }
	.owtq-lightbox__next { right: 10px; }
	.owtq-lightbox__figure { border-radius: 0; }
	.owtq-lightbox__meta { padding: 16px 18px; }
}
