/* Layout */

.single-post__columns {
	display: flex;
	flex-direction: column;
	gap: var(--space-lg);
}

.single-post__main {
	flex: 1 1 auto;
	min-width: 0;
}

.single-post__hero {
	width: 100%;
	line-height: 0;
}

.single-post__hero-image {
	width: 100%;
	height: auto;
	display: block;
	object-fit: cover;
}

.single-post__content-wrap {
	max-width: 800px;
	margin: 0 auto;
	padding: var(--space-md) 0;
}

/* Header / meta */

.single-post__title {
	margin-bottom: var(--space-xs);
}

.single-post__meta {
	color: var(--color-text);
	font-size: var(--font-size-sm);
	margin-bottom: var(--space-sm);
}

.single-post__meta-sep {
	margin: 0 var(--space-xs);
}

.single-post__category {
	color: var(--color-coral);
}

.single-post__category:hover {
	color: var(--color-coral-hover);
}

.single-post__copy-link {
	display: inline-block;
	background: var(--color-teal);
	color: var(--color-white);
	border: none;
	border-radius: var(--radius);
	padding: var(--space-xs) var(--space-sm);
	font-family: var(--font-body);
	font-size: var(--font-size-sm);
	cursor: pointer;
	transition: var(--transition);
	margin-bottom: var(--space-md);
}

.single-post__copy-link:hover,
.single-post__copy-link.is-copied {
	background: var(--color-coral);
}

/* Content */

.single-post__body {
	margin-bottom: var(--space-lg);
}

.single-post__body img {
	max-width: 100%;
	height: auto;
}

/* Gallery grid */

.post-gallery {
	margin-bottom: var(--space-lg);
}

.gallery-grid {
	display: grid;
	gap: var(--space-xs);
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gallery-grid__item {
	border: none;
	background: none;
	padding: 0;
	margin: 0;
	cursor: pointer;
	line-height: 0;
	transition: var(--transition);
}

.gallery-grid__item:hover {
	opacity: 0.85;
}

.gallery-grid__item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: var(--radius);
}

/* Items past the initial batch are hidden by gallery-more.js (never server-side). */

.gallery-grid__item--collapsed {
	display: none;
}

/* Video tiles */

.gallery-grid__item--video {
	position: relative;
}

.gallery-grid__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 1 / 1;
	background: var(--color-bg);
	border-radius: var(--radius);
	color: var(--color-text);
}

.gallery-grid__placeholder svg {
	width: 2.5rem;
	height: 2.5rem;
	fill: currentColor;
}

.gallery-grid__play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	background: var(--color-coral);
	border-radius: var(--radius-pill);
	color: var(--color-white);
}

.gallery-grid__play svg {
	width: 1.5rem;
	height: 1.5rem;
	fill: currentColor;
	margin-left: 2px; /* optical centering of the triangle */
}

/* "Load more" */

.post-gallery__more {
	margin-top: var(--space-sm);
	text-align: center;
}

/* .more-btn sets display:inline-flex (author rule), which would otherwise beat the
   UA's [hidden]{display:none} — this keeps the button hidden until gallery-more.js
   reveals it. */
.gallery-grid__more[hidden] {
	display: none;
}

/* Tags */

.single-post__tags {
	font-size: var(--font-size-sm);
	color: var(--color-text);
	margin-bottom: var(--space-md);
}

.single-post__tags a {
	color: var(--color-text);
}

.single-post__tags a:hover {
	color: var(--color-coral);
}

/* Post navigation */

.post-navigation {
	display: flex;
	justify-content: space-between;
	gap: var(--space-sm);
	border-top: 1px solid var(--color-bg);
	padding-top: var(--space-md);
	font-family: var(--font-head);
	font-size: var(--font-size-lg);
}

/* Lightbox */

.lightbox {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.9);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1000;
}

.lightbox[hidden] {
	display: none;
}

.lightbox__image,
.lightbox__video {
	max-width: 90vw;
	max-height: 80vh;
	object-fit: contain;
}

.lightbox__video {
	display: block;
}

.lightbox__image[hidden],
.lightbox__video[hidden] {
	display: none;
}

.lightbox__caption {
	position: absolute;
	bottom: var(--space-md);
	left: 0;
	right: 0;
	text-align: center;
	color: var(--color-white);
}

.lightbox__close,
.lightbox__prev,
.lightbox__next {
	position: absolute;
	background: none;
	border: none;
	color: var(--color-white);
	font-size: var(--font-size-2xl);
	cursor: pointer;
	transition: var(--transition);
}

.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover {
	color: var(--color-coral);
}

.lightbox__close {
	top: var(--space-sm);
	right: var(--space-sm);
}

.lightbox__prev {
	left: var(--space-sm);
}

.lightbox__next {
	right: var(--space-sm);
}

body.lightbox-open {
	overflow: hidden;
}

/* Media queries */

@media (min-width: 600px) {
	.gallery-grid--cols-3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.gallery-grid--cols-4 {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (min-width: 768px) {
	.single-post__columns {
		flex-direction: row;
	}
}
