/**
 * TPO Gallery Archive — album listing page. Breadcrumb, page head and pager
 * come from tpo-article-archive.css (.tpo-aa shell, shared with every listing
 * page); this file only styles the album cards.
 */

.elementor-widget-tpo-gallery-archive {
	width: 100%;
	max-width: 100%;
	align-self: stretch;
}

/* Beat tpo-base's `.tpo-root { font-family: system-ui; max-width: 1200px }`. */
.elementor-widget-tpo-gallery-archive .tpo-root.tpo-aa {
	max-width: none;
	font-family: var(--tpo-aa-font);
}

.tpo-ga__grid {
	--tpo-ga-cols: 4;
	--tpo-ga-ratio: 75%;
	--tpo-ga-lift: 4px;
	--tpo-ga-zoom: 1.06;
	display: grid;
	grid-template-columns: repeat(var(--tpo-ga-cols), minmax(0, 1fr));
	gap: 24px;
}

.tpo-root.tpo-aa a.tpo-ga__card {
	position: relative;
	display: flex;
	flex-direction: column;
	width: auto;
	margin: 0;
	overflow: hidden;
	isolation: isolate;
	border: 1px solid var(--tpo-aa-line);
	border-radius: 20px;
	background: #fff;
	color: inherit;
	text-decoration: none;
	box-shadow: 0 1px 2px color-mix(in srgb, var(--tpo-aa-ink) 6%, transparent);
	transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.tpo-root.tpo-aa a.tpo-ga__card:hover {
	transform: translateY(calc(var(--tpo-ga-lift) * -1));
	box-shadow: 0 14px 32px color-mix(in srgb, var(--tpo-aa-ink) 14%, transparent);
}
.tpo-root.tpo-aa a.tpo-ga__card:focus-visible {
	outline: 2px solid var(--tpo-aa-accent);
	outline-offset: 3px;
}

.tpo-ga__media {
	position: relative;
	display: block;
	height: 0;
	padding-top: var(--tpo-ga-ratio);
	overflow: hidden;
	background: var(--tpo-aa-soft);
}
.tpo-root.tpo-aa .tpo-ga__img,
.tpo-ga__noimg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform 0.5s ease, filter 0.3s ease;
}
.tpo-ga__card:hover .tpo-ga__img {
	transform: scale(var(--tpo-ga-zoom));
}

.tpo-ga__body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 16px 18px 18px;
}
.tpo-ga__date {
	font-family: var(--tpo-aa-font-ui);
	font-size: 0.8125rem;
	color: var(--tpo-aa-muted);
}
.tpo-ga__title {
	font-family: var(--tpo-aa-font-head);
	font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
	font-weight: 700;
	line-height: 1.35;
	color: var(--tpo-aa-ink);
	transition: color 0.2s ease;
}
.tpo-ga__cta {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 4px;
	font-family: var(--tpo-aa-font-ui);
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--tpo-aa-accent);
}
.tpo-ga__cta svg {
	transition: transform 0.2s ease;
}
.tpo-ga__card:hover .tpo-ga__cta svg {
	transform: translateX(3px);
}

/* Template 1 — title on the image. */
.tpo-ga__grid--overlay .tpo-ga__card {
	border: 0;
}
.tpo-ga__grid--overlay .tpo-ga__media::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(180deg, transparent 40%, rgba(10, 20, 40, 0.78));
	transition: opacity 0.3s ease;
	pointer-events: none;
}
.tpo-ga__grid--overlay .tpo-ga__body {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 2;
}
.tpo-ga__grid--overlay .tpo-ga__title,
.tpo-ga__grid--overlay .tpo-ga__date,
.tpo-ga__grid--overlay .tpo-ga__cta {
	color: #fff;
}
.tpo-ga__grid--overlay .tpo-ga__date {
	opacity: 0.85;
}

/* Template 2 — title below; hover colours the title. */
.tpo-ga__grid--boxed .tpo-ga__card:hover .tpo-ga__title {
	color: var(--tpo-aa-accent);
}

@media (max-width: 767px) {
	/* Narrow 2-column cards: taller image so the title doesn't cover half of it. */
	.tpo-ga__grid {
		--tpo-ga-ratio: 110%;
		gap: 12px;
	}
	.tpo-root.tpo-aa a.tpo-ga__card {
		border-radius: 14px;
	}
	.tpo-ga__body {
		padding: 12px;
	}
	.tpo-ga__cta {
		font-size: 0.8125rem;
	}
}

@media (hover: none) {
	.tpo-root.tpo-aa a.tpo-ga__card:hover {
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tpo-root.tpo-aa a.tpo-ga__card,
	.tpo-ga__img,
	.tpo-ga__cta svg {
		transition: none;
	}
}
