:root {
    --font-primary: "Cerebri Sans", sans-serif, "Font Awesome 5 Free";
    --color-black: rgb(0, 0, 0);

@font-face {
  font-family: 'Cerebri Sans';
  src: url('/fonts/Cerebri-Sans/CerebriSans-Regular.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}

html, body {
	position: relative;
	height: 100%;
	margin: 0;
	padding: 0;
}

body {
	background-color: #eeeeee;
	font-family: "Cerebri Sans", sans-serif;
	font-size: 16px;
	transform: translate3d(0,0,0);
	background: white;
    overflow-y:auto;
    overflow-x:hidden;
}

.headline {
    text-align: center;
    font-size: 2rem;
    font-weight: 600;
    margin: 5%;
    width: 100%;
}

.container-cards {
	position: relative;
	width: 100%;
	max-width: 960px;
	min-height: 100%;
	margin: 0px auto;
	padding: 20px;
	box-sizing: border-box;
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
}

.element-card {
	position: relative;
	width: 10vw;
	height: 25vh;
	transform-style: preserve-3d;
	transform: rotateY(0deg) translateX(0px) translateY(0px);
	transition: all 0.6s cubic-bezier(0.680, -0.550, 0.265, 1.550);
	box-shadow: 4px 4px 20px rgba(0,0,0,0.4);
	margin: 5px;
	cursor: pointer;
	
	&:hover {
		transform: rotateY(45deg) translateX(0px) translateY(0px);
	}

	&.open {
		width: 2*960px;;
		height: 2*960px;;
		transform: rotateY(-180deg) translateX(0px) translateY(0px);
	}
	
	.front-facing {
		transform: rotateY( 0deg ) translateZ( 2px );
		position: absolute;
		top: 0;
		left: 0;
		bottom: 0;
		right: 0;
		background-color: #201f49;
		border: 2px white solid;
		border-radius: 5px;
		.abr {
			width: 100%;
			position: absolute;
			top: 50%;
			left: 0;
			font-size: 42px;
			margin: -35px 0 0 0;
			text-align: center;
			color: white;
		}
		.title {
			width: 100%;
			position: absolute;
			top: 50%;
			left: 0;
			text-transform: uppercase;
			font-size: 12px;
			margin: 15px 0 0 0;
			text-align: center;
			color: white;
		}
	}
	
	.back-facing {
		transform: rotateY( 180deg ) translateZ( 0px );
		display: flex;
		flex-direction: column;
		flex-wrap: nowrap;
		justify-content: center;
		align-items: center;
		position: absolute;
		top: 0;
		left: 0;
		bottom: 0;
		right: 0;
		background-color: #201f49;
		border: 2px white solid;
		border-radius: 5px;
		padding: 20px;
		text-align: center;
		overflow: hidden;
		p {
			font-size: 1.5vh;
			margin: 0;
			color: white;
		}
		a.btn {
			display: inline-block;
			background-color: white;
			padding: 5px 15px;
			margin: 20px 0 0 0;
			color: white;
			background-color: #201f49;
			text-decoration: none;
			border-radius: 3px;
			&:hover, &:focus {
				color: #white;
				background-color: #201f49;
			}
		}
	}

}

/* Media Queries for Responsiveness */

/* Small Devices (phones, 600px and below) */
@media screen and (max-width: 600px) {
    .element-card {
        width: 80vw;   /* Larger card size */
        height: 40vh;  /* Keep the height proportional */
    }

    .front-facing .abr {
        font-size: 32px;   /* Adjust the abbreviation font size */
    }

    .front-facing .title {
        font-size: 14px;   /* Adjust the title font size */
    }

    .atomic-number, .atomic-mass {
        font-size: 14px;   /* Smaller font sizes for numbers */
    }

    .back-facing p {
        font-size: 12px;   /* Adjust the paragraph text size */
    }

    .back-facing a.btn {
        padding: 10px 20px;   /* Make the button larger */
    }
}

/* Medium Devices (tablets, 768px to 1024px) */
@media screen and (max-width: 1024px) and (min-width: 601px) {
    .element-card {
        width: 40vw;   /* Cards take up more space on medium devices */
        height: 40vh;
    }

    .front-facing .abr {
        font-size: 36px;   /* Adjust abbreviation font size */
    }

    .front-facing .title {
        font-size: 16px;   /* Adjust title font size */
    }

    .atomic-number, .atomic-mass {
        font-size: 16px;   /* Adjust number font size */
    }

    .back-facing p {
        font-size: 14px;   /* Increase text size for better readability */
    }

    .back-facing a.btn {
        padding: 8px 15px;   /* Make button size fit better */
    }
}

/* Large Devices (desktop, 1024px and above) */
@media screen and (min-width: 1025px) {
    .element-card {
        width: 10vw;   /* Default card size */
        height: 25vh;
    }

    .front-facing .abr {
        font-size: 42px;
    }

    .front-facing .title {
        font-size: 18px;
    }

    .atomic-number, .atomic-mass {
        font-size: 18px;
    }

    .back-facing p {
        font-size: 16px;
    }

    .back-facing a.btn {
        padding: 10px 20px;
    }
}