/* ---------- Projects Grid Styles ---------- */

/* Initial state - hidden for manual animation */
main .projects-intro,
main .projects-grid {
	opacity: 0;
}

/* When grid fades in, all children become visible */
main .projects-grid .project-card,
main .projects-grid .project-media,
main .projects-grid .project-content,
main .projects-grid .project-title,
main .projects-grid .project-description,
main .projects-grid .project-tags,
main .projects-grid .project-tag {
	opacity: 1 !important;
}

/* Detail view */
main .project-detail {
	opacity: 1;
}

/* ---------- Original Projects Styles ---------- */

.projects-loading,
.projects-error,
.projects-empty {
	text-align: center;
	padding: 2rem;
	color: var(--cream);
	font-family: var(--font-mono);
}

.projects-error {
	color: var(--orange);
}

.projects-intro {
	margin-bottom: 1rem;
	font-size: 0.9rem;
	color: var(--cream);
}

/* Project Grid Layout */
.projects-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1rem;
	margin-top: 0.5rem;
}

/* Project Card */
.project-card {
	background: var(--dark-grey);
	border-radius: 4px;
	overflow: hidden;
	cursor: pointer;
	transition:
		transform 0.3s ease,
		box-shadow 0.3s ease;
	border: 1px solid var(--mid-grey);
	display: flex;
	flex-direction: column;
}

.project-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Card Media (Video/Image) */
.project-media {
	position: relative;
	width: 100%;
	height: 180px;
	overflow: hidden;
	background: var(--black-grey);
	flex-shrink: 0;
}

.project-video,
.project-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Card Content */
.project-content {
	padding: 0.8rem;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.project-title {
	font-size: 1rem;
	margin: 0 0 0.3rem 0;
	color: var(--cream);
	font-weight: normal;
	font-family: var(--font-mono);
}

.project-date {
	font-size: 0.75rem;
	color: var(--lighter-grey);
	font-family: var(--font-mono);
	display: block;
	margin-bottom: 0.5rem;
}

.project-description {
	font-size: 0.8rem;
	color: var(--cream);
	line-height: 1.4;
	margin-bottom: 0.5rem;
	opacity: 0.85;
}

/* Tech Tags */
.project-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-top: auto;
}

.project-tag {
	background: transparent;
	color: var(--orange);
	border: 1px solid var(--orange);
	font-size: 0.65rem;
	padding: 0.2rem 0.5rem;
	border-radius: 2px;
	font-family: var(--font-mono);
	white-space: nowrap;
}

/* ---------- Project Detail View ---------- */

.project-detail {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	background: var(--dark-grey);
	padding: 1rem;
	border-radius: 4px;
	transition: opacity 0.3s ease;
	opacity: 1;
}

/* Back Button */
.project-back-btn {
	background: transparent;
	border: 1px solid var(--orange);
	color: var(--orange);
	padding: 0.4rem 0.8rem;
	font-family: var(--font-mono);
	font-size: 0.8rem;
	cursor: pointer;
	border-radius: 4px;
	transition: all 0.3s ease;
	align-self: flex-start;
}

.project-back-btn:hover {
	background: var(--orange);
	color: var(--cream);
}

/* Carousel */
.project-carousel {
	position: relative;
	width: fit-content;
	max-width: 100%;
	margin: 0 auto;
	background: #1d2021;
	border-radius: 4px;
	overflow: hidden;
}

.carousel-fullscreen-btn {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	background: rgba(45, 40, 40, 0.8);
	border: none;
	color: var(--cream);
	font-size: 1rem;
	padding: 0.3rem 0.5rem;
	cursor: pointer;
	border-radius: 4px;
	z-index: 15;
	opacity: 0;
	transition:
		opacity 0.3s ease,
		background 0.3s ease;
}

.project-carousel:hover .carousel-fullscreen-btn {
	opacity: 1;
}

.carousel-fullscreen-btn:hover {
	background: var(--orange);
}

.carousel-wrapper {
	position: relative;
	width: fit-content;
}

.carousel-images {
	position: relative;
	display: block;
}

.carousel-image {
	display: block;
	max-width: 100%;
	height: auto;
	opacity: 0;
	position: absolute;
	top: 0;
	left: 0;
	transition: opacity 0.3s ease;
}

.carousel-image:first-child {
	position: relative;
}

.carousel-image.active {
	opacity: 1;
}

.carousel-btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(45, 40, 40, 0.8);
	border: none;
	color: var(--cream);
	font-size: 1rem;
	padding: 0.5rem 0.7rem;
	cursor: pointer;
	z-index: 10;
	transition: all 0.3s ease;
}

.carousel-btn:hover {
	background: var(--orange);
}

.carousel-prev {
	left: 0;
	border-radius: 0 4px 4px 0;
}

.carousel-next {
	right: 0;
	border-radius: 4px 0 0 4px;
}

.carousel-counter {
	position: absolute;
	bottom: 0.5rem;
	right: 0.5rem;
	background: rgba(0, 0, 0, 0.7);
	color: var(--cream);
	font-family: var(--font-mono);
	font-size: 0.7rem;
	padding: 0.2rem 0.5rem;
	border-radius: 2px;
}

/* Project Info */
.project-info {
	padding: 0.5rem 0;
}

.project-info-title {
	font-size: 1.2rem;
	margin: 0 0 0.5rem 0;
	color: var(--cream);
	font-weight: normal;
	font-family: var(--font-mono);
}

.project-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem;
	margin-top: 1rem;
}

.project-info-date {
	font-size: 0.75rem;
	color: var(--lighter-grey);
	font-family: var(--font-mono);
}

.project-link {
	color: var(--orange);
	font-size: 0.8rem;
	font-family: var(--font-mono);
	transition: color 0.3s ease;
}

.project-link:hover {
	color: var(--cream);
}

.project-info-tags {
	margin-bottom: 0.8rem;
}

.project-text {
	font-size: 0.85rem;
	line-height: 1.5;
	color: var(--cream);
	opacity: 0.9;
}

.project-text p {
	margin-bottom: 0.6rem;
}

.project-text p:last-child {
	margin-bottom: 0;
}

/* ---------- Fullscreen Carousel ---------- */

.carousel-fullscreen {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.95);
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.carousel-fullscreen.visible {
	opacity: 1;
}

.carousel-fullscreen-close {
	position: fixed;
	top: 1rem;
	right: 1rem;
	background: rgba(45, 40, 40, 0.8);
	border: none;
	color: var(--cream);
	font-size: 1.5rem;
	padding: 0.5rem 0.8rem;
	cursor: pointer;
	border-radius: 4px;
	transition: background 0.3s ease;
	z-index: 1002;
}

.carousel-fullscreen-close:hover {
	background: var(--orange);
}

.carousel-fullscreen-images {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 90vw;
	height: 80vh;
}

.carousel-fullscreen-image {
	max-width: 90vw;
	max-height: 80vh;
	object-fit: contain;
	opacity: 0;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	transition: opacity 0.3s ease;
}

.carousel-fullscreen-image.active {
	opacity: 1;
}

.carousel-fullscreen-nav {
	position: fixed;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(45, 40, 40, 0.8);
	border: none;
	color: var(--cream);
	font-size: 1.5rem;
	padding: 0.8rem 1rem;
	cursor: pointer;
	border-radius: 4px;
	transition: background 0.3s ease;
	z-index: 1002;
	display: block;
	width: auto;
	height: auto;
}

.carousel-fullscreen-nav:hover {
	background: var(--orange);
}

.carousel-fullscreen-prev {
	left: 1rem;
}

.carousel-fullscreen-next {
	right: 1rem;
}

.carousel-fullscreen-counter {
	position: fixed;
	bottom: 1rem;
	left: 50%;
	transform: translateX(-50%);
	background: rgba(0, 0, 0, 0.7);
	color: var(--cream);
	font-family: var(--font-mono);
	font-size: 0.9rem;
	padding: 0.3rem 0.8rem;
	border-radius: 4px;
	z-index: 1002;
}

/* ---------- Mobile Styles ---------- */
@media (max-width: 600px) {
	.projects-grid {
		grid-template-columns: 1fr;
		gap: 0.8rem;
	}

	.carousel-wrapper {
		height: 180px;
	}

	.project-info-title {
		font-size: 1.1rem;
	}

	.project-meta {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.3rem;
	}

	/* Fullscreen carousel nav at bottom on mobile */
	.carousel-fullscreen-nav {
		top: auto;
		bottom: 3rem;
		transform: none;
	}

	.carousel-fullscreen-prev {
		left: 50%;
		transform: translateX(-120%);
	}

	.carousel-fullscreen-next {
		right: auto;
		left: 50%;
		transform: translateX(20%);
	}
}
