/* Grid layout for image galleries embedded in post content (classic [gallery]
   shortcode markup). Applies to every post, regardless of how it was created —
   block editor Gallery block markup (.wp-block-gallery) is styled the same way
   for visual consistency. Click-to-expand lightbox is handled separately by
   the theme's own ow-lightbox.js, which auto-binds to this markup. */

.entry-content .gallery,
.entry-content .wp-block-gallery {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
	margin: 20px 0;
	list-style: none;
	padding: 0;
}

.entry-content .gallery-item {
	width: auto !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

.entry-content .gallery-icon,
.entry-content .wp-block-gallery .block-editor-block-list__block,
.entry-content .wp-block-gallery figure {
	margin: 0 !important;
}

.entry-content .gallery-icon a,
.entry-content .wp-block-gallery .gallery-icon a,
.entry-content .wp-block-gallery figure a {
	display: block;
	border-radius: 10px;
	overflow: hidden;
	aspect-ratio: 1 / 1;
	transition: opacity 0.2s ease;
}

.entry-content .gallery-icon a:hover,
.entry-content .wp-block-gallery figure a:hover {
	opacity: 0.85;
}

.entry-content .gallery-icon img,
.entry-content .wp-block-gallery img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 10px;
}

.entry-content .gallery-caption {
	display: none;
}

/* A single photo or video: no grid needed, just one large contained tile
   instead of a cropped square (matches the featured-thumbnail treatment). */
.entry-content .gallery:has(> :only-child) {
	grid-template-columns: 1fr;
}

.entry-content .gallery:has(> :only-child) .gallery-icon a {
	aspect-ratio: auto;
	max-height: 520px;
}

/* Video tile: badge + play button. The theme styles these elsewhere too, but
   only scoped to specific parent contexts (#related-posts, .ro-single-video-preview,
   etc.) that don't match our gallery markup — so style them fully ourselves
   here rather than depend on incidentally matching a foreign selector. */
.entry-content .gallery-icon a.ro-card-video-preview {
	position: relative;
}

.entry-content .gallery-icon .ro-card-video-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	min-height: 24px;
	padding: 0 9px;
	border-radius: 999px;
	background: rgba(32, 37, 43, 0.78);
	color: #fff;
	font-size: 10px;
	font-weight: 800;
	line-height: 1;
	text-transform: uppercase;
	backdrop-filter: blur(8px);
}

.entry-content .gallery-icon .ro-card-video-play {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 3;
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	border: 3px solid rgba(255, 255, 255, 0.76);
	border-radius: 50%;
	background: rgba(32, 37, 43, 0.24);
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.26);
	transform: translate(-50%, -50%);
}

.entry-content .gallery-icon .ro-card-video-play::before {
	content: "";
	width: 0;
	height: 0;
	margin-left: 4px;
	border-top: 11px solid transparent;
	border-bottom: 11px solid transparent;
	border-left: 17px solid #fff;
}

@media (max-width: 900px) {
	.entry-content .gallery,
	.entry-content .wp-block-gallery {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 480px) {
	.entry-content .gallery,
	.entry-content .wp-block-gallery {
		grid-template-columns: repeat(1, 1fr);
		gap: 8px;
	}

	.entry-content .gallery-icon a,
	.entry-content .wp-block-gallery figure a {
		aspect-ratio: 16 / 10;
	}
}

/* Featured image above the post title — give it the same "contained, clickable"
   treatment as gallery/content images instead of an unbounded raw <img>. */
.thumbnail {
	border-radius: 12px;
	overflow: hidden;
	margin-bottom: 20px;
}

.thumbnail .ro-post-thumbnail-link {
	display: block;
	max-height: 520px;
	overflow: hidden;
	cursor: zoom-in;
}

.thumbnail .ro-post-thumbnail-link img {
	width: 100%;
	height: 100%;
	max-height: 520px;
	object-fit: cover;
	display: block;
}

