@import "@/src/styles/helpers.scss";

.section {
	@include darkSection;
	@include regularFont;
	@include fullPage;
	padding: 40px 0 $largeGap 0;
	min-height: auto;

	@media (min-width: 768px) {
		padding: $largeGap 0;
	}
}

.container {
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 $mediumGap;

	@media (min-width: 768px) {
		padding: 0 $largeGap;
	}
}

.title {
	font-size: 3em;
	text-align: center;
	margin-bottom: $largeGap;
	color: $white;
	font-weight: 300;

	@media (max-width: 768px) {
		font-size: 2em;
		margin-bottom: $mediumGap;
	}
}

.grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: $mediumGap;

	@media (min-width: 768px) {
		grid-template-columns: repeat(2, 1fr);
		gap: $largeGap;
	}

	@media (min-width: 1280px) {
		grid-template-columns: repeat(3, 1fr);
	}
}

.card {
	background-color: rgba(255, 255, 255, 0.05);
	border-radius: 8px;
	overflow: hidden;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	display: flex;
	flex-direction: column;
	height: 100%;

	&:hover {
		transform: translateY(-8px);
		box-shadow: 0 12px 24px rgba($accent_colour, 0.3);
	}
}

.imageWrapper {
	position: relative;
	width: 100%;
	height: 250px;
	overflow: hidden;
	background-color: rgba(0, 0, 0, 0.3);

	@media (min-width: 768px) {
		height: 280px;
	}
}

.image {
	object-fit: cover;
	transition: transform 0.3s ease;

	.card:hover & {
		transform: scale(1.05);
	}
}

.content {
	padding: $smallGap $mediumGap $mediumGap $mediumGap;
	display: flex;
	flex-direction: column;
	flex-grow: 1;

	@media (max-width: 768px) {
		padding: 10px $smallGap $smallGap $smallGap;
	}
}

.cardTitle {
	font-size: 1.4em;
	margin-bottom: $smallGap;
	color: $white;
	font-weight: 400;
	line-height: 1.3;

	@media (max-width: 768px) {
		font-size: 1.2em;
	}
}

.description {
	font-size: 0.95em;
	line-height: 1.6;
	color: rgba($white, 0.85);
	margin-bottom: $mediumGap;
	flex-grow: 1;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 6;
	-webkit-box-orient: vertical;

	@media (max-width: 768px) {
		font-size: 0.9em;
		-webkit-line-clamp: 5;
	}
}

.links {
	display: flex;
	gap: $smallGap;
	margin-top: auto;
	justify-content: flex-end;
}

.icon {
	color: $white;
	transition: all 0.3s ease;
	width: 2.5em;
	height: 2.5em;
	display: flex;
	align-items: center;
	justify-content: center;

	svg {
		width: 100%;
		height: 100%;
	}

	&:hover {
		color: $accent_colour;
		transform: scale(1.1);
	}

	@media (max-width: 768px) {
		width: 2em;
		height: 2em;
	}
}

.card {
	cursor: pointer;
}

.modalBackdrop {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: rgba(0, 0, 0, 0.85);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1000;
	padding: $mediumGap;
	overflow-y: auto;
}

.modalContent {
	background-color: $black;
	border: 2px solid rgba($white, 0.1);
	border-radius: 12px;
	max-width: 900px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	position: relative;
	animation: modalSlideIn 0.3s ease-out;

	@media (max-width: 768px) {
		max-width: 100%;
		max-height: 95vh;
	}
}

@keyframes modalSlideIn {
	from {
		opacity: 0;
		transform: translateY(-20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.closeButton {
	position: absolute;
	top: $smallGap;
	right: $smallGap;
	background-color: rgba($white, 0.1);
	border: none;
	border-radius: 50%;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 10;
	transition: all 0.3s ease;
	color: $white;

	svg {
		width: 24px;
		height: 24px;
	}

	&:hover {
		background-color: $accent_colour;
		transform: scale(1.1);
	}
}

.modalImageWrapper {
	position: relative;
	width: 100%;
	height: 400px;
	background-color: rgba(0, 0, 0, 0.3);

	@media (max-width: 768px) {
		height: 250px;
	}
}

.modalImage {
	object-fit: cover;
}

.modalBody {
	padding: $largeGap;

	@media (max-width: 768px) {
		padding: $mediumGap;
	}
}

.modalTitle {
	font-size: 2em;
	color: $white;
	margin-bottom: $mediumGap;
	font-weight: 400;

	@media (max-width: 768px) {
		font-size: 1.5em;
	}
}

.modalDescription {
	font-size: 1em;
	line-height: 1.8;
	color: rgba($white, 0.9);
	margin-bottom: $largeGap;
	white-space: pre-wrap;
}
