/* meaghan.land - custom styles */

/* ---- home photo grid ---- */

.photo-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 3px;
}

.photo-grid-tile {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: 2px;
	background: var(--code);
	text-decoration: none;
}

.photo-grid-tile img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: opacity 0.15s ease;
}

.photo-grid-tile:hover img,
.photo-grid-tile:focus-visible img {
	opacity: 0.85;
}

.photo-grid-tile:focus-visible {
	outline: 2px solid var(--link);
	outline-offset: 2px;
}

.tile-badge {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 20px;
	height: 20px;
	color: #ffffff;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.photo-grid-text {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	padding: 0.75em;
	text-align: center;
	font-size: 0.8em;
	line-height: 1.4;
	color: var(--text);
	overflow: hidden;
}

.photo-grid-nav {
	display: flex;
	justify-content: space-between;
	margin-top: 1.5em;
	font-size: 0.9em;
}

.photo-grid-nav a {
	text-decoration: none;
}

/* ---- posts: media-first, swipeable multi-photo carousel ---- */

.e-content img,
.e-content video {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 2px;
}

.e-content p:has(> img:nth-of-type(2)) {
	display: flex;
	align-items: center;
	gap: 4px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: thin;
	-webkit-overflow-scrolling: touch;
}

.e-content p:has(> img:nth-of-type(2)) img {
	flex: 0 0 100%;
	scroll-snap-align: center;
}

/* ---- collections ---- */

.collection-tile .collection-label {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 0.5em;
	padding: 1.8em 0.7em 0.55em;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
	color: #ffffff;
	font-size: 0.85em;
	font-weight: 600;
	line-height: 1.2;
}

.collection-tile .collection-count {
	font-weight: 400;
	font-size: 0.85em;
	opacity: 0.85;
}
