.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.image-gallery .gallery-category {
    display: flex;
    flex-direction: column;
    width: calc(50% - 20px); /* 2 columns with 20px gap */
    background-color: #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s, box-shadow 0.3s;
}

.image-gallery .gallery-category:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6);
}

.gallery-category .header {
    background-color: #282828;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gallery-category .header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.gallery-category .header .see-all-link {
    color: var(--md-typeset-a-color);
    text-decoration: none;
    font-size: 0.9rem;
    /* font-weight: bold; */
}

.gallery-category .header .see-all-link:hover {
    text-decoration: underline;
}

.see-all-link:after {
    content: '›';
    font-size: 1.2rem;
    margin-left: 0.5rem;
    display: inline-block;
    transition: transform 0.3s ease;
}

.see-all-link:hover:after {
    transform: translateX(0.2rem);
}

.gallery-category .image-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 9.5rem;
    overflow: hidden;
}

.gallery-category img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.gallery-category img.loaded {
    opacity: 1;
}

.skeleton-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@media (max-width: 768px) {
    .image-gallery .gallery-category {
        width: 100%;
    }
}

/* Image Gallery Page CSS */

.image-gallery-page-container {
    max-width: 75rem;
    margin: 0 auto;
    /* padding: 0rem; */
}

.image-gallery-page-container h1 {
    font-size: 1.8rem;
    margin-top: 2rem;
    margin-bottom: 1.25rem;
    border-bottom: 0.125rem solid #444;
    padding-bottom: 0.625rem;
    color: #f0f0f0;
}

.category-images {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9375rem;
}

.category-images .image-wrapper {
    position: relative;
    flex: 1 1 calc(50% - 0.9375rem);
    max-width: calc(50% - 0.9375rem);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.6);
    background-color: #222;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    aspect-ratio: 16/9;
}

.category-images .image-wrapper:hover {
    transform: scale(1.05);
    box-shadow: 0 0.375rem 0.75rem rgba(0, 0, 0, 0.8);
}

.category-images img {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.category-images img.loaded {
    opacity: 1;
}

.category-images .skeleton-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

/* Responsive Sizing */
@media screen and (max-width: 48rem) {
    .category-images .image-wrapper {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

.youtube-gallery-container {
    margin-bottom: 2rem;
}

/* YouTube Gallery */
.youtube-gallery {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	max-width: 75rem;
	margin: 0 auto;
}

@media screen and (max-width: 48rem) {
	.youtube-gallery .yt-card {
		flex: 1 1 100%;
		max-width: 100%;
	}
}

.youtube-gallery .yt-card {
	position: relative;
	background-color: #222;
	border-radius: 0.5rem;
	overflow: hidden;
	box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.6);
	aspect-ratio: 16/9;
	/* Flex sizing for responsive 2-up layout */
	flex: 1 1 calc(50% - 0.5rem);
	max-width: calc(50% - 0.5rem);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.youtube-gallery .yt-card:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6);
}

.youtube-gallery .yt-thumb {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: 0;
	opacity: 0;
	transition: opacity 0.3s ease-in-out;
}

.youtube-gallery .yt-thumb.loaded {
	opacity: 1;
}

.youtube-gallery .yt-card::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
	background-size: 200% 100%;
	animation: skeleton-loading 1.5s infinite;
	z-index: 1;
}

.youtube-gallery .yt-card.is-playing::after,
.youtube-gallery .yt-card.has-thumb-loaded::after {
	display: none;
}

.youtube-gallery .yt-overlay {
	z-index: 2;
}

.youtube-gallery .yt-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(0deg, rgba(0,0,0,0.6), rgba(0,0,0,0.2));
}

.youtube-gallery .yt-play {
	background: rgba(0,0,0, 0.25);;
	border: none;
	color: white;
	border-radius: 999px;
	width: 3rem;
	height: 3rem;
	cursor: pointer;
	display: grid;
	place-items: center;
	box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,0.5);
}

.youtube-gallery .yt-play::before {
	content: '';
	display: block;
	width: 0;
	height: 0;
	border-left: 0.9rem solid white;
	border-top: 0.6rem solid transparent;
	border-bottom: 0.6rem solid transparent;
	margin-left: 0.15rem;
}

.youtube-gallery .yt-embed iframe {
	width: 100%;
	height: 100%;
}

.youtube-gallery .yt-card.is-playing .yt-overlay,
.youtube-gallery .yt-card.is-playing .yt-thumb {
	display: none;
}

.youtube-gallery h2.yt-category-title {
	margin-top: 2rem;
	margin-bottom: 0.75rem;
}

/* Lightbox */
.yt-lightbox {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.85);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 9999;
}

.yt-lightbox.is-open {
	display: flex;
}

.yt-lightbox-content {
	position: relative;
	width: 90vw;
	max-width: 75rem;
	aspect-ratio: 16/9;
	background: #000;
	border-radius: 0.5rem;
	overflow: hidden;
}

.yt-lightbox-embed, .yt-lightbox-embed iframe {
	width: 100%;
	height: 100%;
}

.yt-lightbox-close {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	width: 2.5rem;
	height: 2.5rem;
	border: none;
	border-radius: 999px;
	background: rgba(255,255,255,0.15);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,0.5);
	z-index: 2;
}

.yt-lightbox-close::before,
.yt-lightbox-close::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 1.25rem;
	height: 0.125rem;
	background: #fff;
	transform-origin: center;
}

.yt-lightbox-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.yt-lightbox-close::after { transform: translate(-50%, -50%) rotate(-45deg); }