  /* Flip Tile Component Styles */
		
/* Fix for iOS Safari */
html, body {
	-webkit-text-size-adjust: 100%; /* Prevent font scaling */
	-webkit-tap-highlight-color: transparent; /* Remove tap highlight */
}

/* Container for all tiles */
.pennwest-tile-container {
	display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
    max-width: 1140px;
    margin: 0 auto;
    padding: 20px 0 40px;
	align-content: flex-start;
	min-height: 900px;
}

/* Individual tile */
.pennwest-tile {
	position: relative;
    width: 350px;
    height: 270px;
    perspective: 1000px;
    cursor: pointer;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
	display: block;
}

/* Inner container for 3D flip effect */
.pennwest-tile-inner {
 	position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d; /* Safari */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    will-change: transform; /* Performance hint for browsers */
}

/* Flipped state */
.pennwest-tile.flipped .pennwest-tile-inner {
	transform: rotateY(180deg);
	-webkit-transform: rotateY(180deg);
}

/* Front and back face common styles */
.pennwest-tile-front, .pennwest-tile-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; /* Safari */
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;			
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Front face styles */
.pennwest-tile-front {
    background-size: cover;
    background-position: center;
}

/* Title overlay at the bottom of the front face */
.pennwest-tile-overlay {
    background: rgba(0, 45, 86, 0.7); /* Ë®¶à¶àµ¼º½ blue with opacity */
    color: white;
    padding: 15px 20px;
    font-weight: 600;
    font-size: 1.25rem;
    line-height: 1.3;
    text-align: center;
	width: 100%;
}

/* Back face styles */
.pennwest-tile-back {
    background-color: #003d77; /* New darker blue background */
    color: white; /* White text for all content */
    transform: rotateY(180deg);
    -webkit-transform: rotateY(180deg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
}

/* Content wrapper for the back face */
.pennwest-tile-content {
  	height: 100%;
}

/* Text styles on the back */
.pennwest-tile-back p {
    line-height: 1.5;
    font-size: 18px; /* Explicit font size for consistency across browsers */
    -webkit-text-size-adjust: 100%; /* Prevent text size adjustment in Edge */
    -ms-text-size-adjust: 100%; /* For older Edge versions */
}

/* Button styles */
.pennwest-tile-back .button {
    color: #fff;
    font-weight: 500;
    transition: background-color 0.3s, color 0.3s;
	margin-top: 20px;
}

.pennwest-tile-back .button:hover {
  	background-color: #fff;
    color: #003d77;
}

/* Responsive adjustments */
@media (min-width: 1200px) {
	.pennwest-tile-container {
		min-height: 1100px;
		margin: 0 -45px;
    }
}
			
@media (max-width: 768px) {
    .pennwest-tile-container {
      	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .pennwest-tile {
        height: 250px;
    }
    
    .pennwest-tile-overlay {
        padding: 15px 10px;
        font-size: 1.1rem;
    }
			
	.pennwest-tile-back p {
		font-size: 17px;
	}
			
	.pennwest-tile-back .button {
		margin-top: unset;
	}
}

@media (max-width: 480px) {
    .pennwest-tile-container {
        grid-template-columns: 1fr;
    }
}
