.fooalbum-grid-wrap {
	padding: 0 32px;
	margin-top: 2rem;
}

@media (max-width: 600px) {
	.fooalbum-grid-wrap {
		padding: 0 16px;
	}
}

.fooalbum-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 28px;
	justify-content: center;
}

@media (max-width: 900px) {
	.fooalbum-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.fooalbum-grid {
		grid-template-columns: 1fr;
	}
}

.fooalbum-grid__item {
	margin: 0;
	padding: 0;
	list-style: none;
}

.fooalbum-grid__link {
	display: block;
	text-decoration: none;
	color: inherit;
}

.fooalbum-grid__thumb-wrap {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 1 / 1;
	background: #f0f0f0;
}

.fooalbum-grid__thumb {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 200ms ease;
}

.fooalbum-grid__thumb--placeholder {
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #e6e6e6 0%, #f5f5f5 100%);
}

.fooalbum-grid__overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.45);
	opacity: 0;
	transition: opacity 200ms ease;
	padding: 1rem;
	text-align: center;
}

.fooalbum-grid__link:hover .fooalbum-grid__overlay,
.fooalbum-grid__link:focus-visible .fooalbum-grid__overlay {
	opacity: 1;
}

.fooalbum-grid__title {
	color: #fff;
	font-size: 1.25rem;
	font-weight: 600;
	line-height: 1.3;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
	font-family: var(--fooalbum-thumb-font, inherit);
}

/* Mobile overlay: always visible, hide on tap. Inverts the default
 * hover-to-show behavior. Only kicks in at mobile breakpoint. */
@media (max-width: 600px) {
	.fooalbum-grid--mobile-overlay-always .fooalbum-grid__overlay {
		opacity: 1;
	}
	.fooalbum-grid--mobile-overlay-always .fooalbum-grid__link:hover .fooalbum-grid__overlay,
	.fooalbum-grid--mobile-overlay-always .fooalbum-grid__link:active .fooalbum-grid__overlay {
		opacity: 0;
	}
}

/* Gallery-view mobile 1-column override. Forces FooGallery's
 * absolutely-positioned masonry items into a simple vertical stack. */
@media (max-width: 600px) {
	body.fooalbum-mobile-1col .foogallery.fg-masonry {
		height: auto !important;
	}
	body.fooalbum-mobile-1col .foogallery.fg-masonry .fg-item {
		position: static !important;
		width: 100% !important;
		margin-bottom: 8px;
	}
}

.fooalbum-empty {
	color: #666;
	font-style: italic;
	margin-top: 2rem;
}

/*
 * Gallery-view content protection. FooGallery sets font-size:0 and
 * line-height:0 on .foogallery to collapse whitespace between items.
 * When FooGallery auto-renders its gallery inside the_content, editor
 * text can inherit those values and vanish. This wrapper (injected at
 * the_content priority 5) resets typography so the text stays readable.
 */
.fooalbum-gallery-content {
	font-size: inherit !important;
	line-height: inherit !important;
	font-family: inherit !important;
	margin-bottom: 1.5em;
}

/*
 * Force Astra to use standard single-post title styling on gallery
 * views even when ast-page-builder-template is present. Values match
 * Astra's defaults for single-post entry-title.
 */
body.fooalbum-gallery-view .entry-title {
	font-size: 2rem !important;
}
body.fooalbum-gallery-view .entry-header {
	margin-bottom: 1.2em;
}

/* Gallery page text alignment (configured per album). */
body.fooalbum-align-center .entry-header,
body.fooalbum-align-center .fooalbum-gallery-content {
	text-align: center;
}
body.fooalbum-align-right .entry-header,
body.fooalbum-align-right .fooalbum-gallery-content {
	text-align: right;
}

/* Hide broken prev/next post navigation on gallery views. FooGallery
 * posts aren't publicly queryable so their permalinks are wrong. */
body.fooalbum-gallery-view .post-navigation,
body.fooalbum-gallery-view .nav-links {
	display: none !important;
}

/*
 * Hide author/date/byline meta on album and gallery-view pages.
 * These aren't blog entries — author and publish date are noise.
 * Targeting common selectors from Astra, Twenty Twenty-*, and other
 * popular themes. !important outweighs theme specificity.
 */
body.single-fooalbum .entry-meta,
body.single-fooalbum .entry-footer .cat-links,
body.single-fooalbum .entry-footer .tags-links,
body.single-fooalbum .entry-author,
body.single-fooalbum .entry-byline,
body.single-fooalbum .byline,
body.single-fooalbum .posted-on,
body.single-fooalbum .posted-by,
body.single-fooalbum .post-meta,
body.single-fooalbum .post-author,
body.single-fooalbum .post-date,
body.single-fooalbum .author.vcard,
body.single-fooalbum .wp-block-post-date,
body.single-fooalbum .wp-block-post-author,
body.single-fooalbum .wp-block-post-author-name,
body.single-fooalbum .wp-block-post-author-biography,
body.fooalbum-gallery-view .entry-meta,
body.fooalbum-gallery-view .entry-footer .cat-links,
body.fooalbum-gallery-view .entry-footer .tags-links,
body.fooalbum-gallery-view .entry-author,
body.fooalbum-gallery-view .entry-byline,
body.fooalbum-gallery-view .byline,
body.fooalbum-gallery-view .posted-on,
body.fooalbum-gallery-view .posted-by,
body.fooalbum-gallery-view .post-meta,
body.fooalbum-gallery-view .post-author,
body.fooalbum-gallery-view .post-date,
body.fooalbum-gallery-view .author.vcard,
body.fooalbum-gallery-view .wp-block-post-date,
body.fooalbum-gallery-view .wp-block-post-author,
body.fooalbum-gallery-view .wp-block-post-author-name,
body.fooalbum-gallery-view .wp-block-post-author-biography {
	display: none !important;
}
