/* --- CSS Variables and Root Setup --- */
:root {
    --color-red: #d92027;
    --color-green: #2ecc71;
    --color-blue: #3498db;
    --color-yellow: #f1c40f;
    --font-heading: 'Oswald', sans-serif;
    --font-body: 'Poppins', sans-serif;
    --text-light: #ffffff;
    --text-dark: #2c3e50;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* --- Body and Background --- */
body {
    font-family: var(--font-body);
    background-image: url('/back.jpg');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.6;
}

/* --- Header and Logo --- */
.main-header {
    text-align: center;
    padding: 2rem 1rem;
}

.main-logo {
    max-width: 300px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
    border-radius: 10px; /* Adding rounded corners */
}

/* --- Main Content and Grid --- */
main {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* --- Tile Styling --- */
.tile {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    aspect-ratio: 1 / 1;
    border-radius: 15px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-light);
    background-size: cover;
    background-position: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    
    /* For load-in animation */
    opacity: 0;
    transform: translateY(30px);
}

.tile.visible {
    opacity: 1;
    transform: translateY(0);
}

/* The dark overlay on each tile for text readability */
.tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.7) 100%);
    transition: background 0.4s ease;
}

/* Hover effects */
.tile:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 35px rgba(0,0,0,0.5);
}

.tile:hover::before {
    background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.5) 100%);
}

/* Tile Content (Logo and Title) */
.tile-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.tile-logo {
    max-width: 100px;
    height: auto;
    margin-bottom: 1rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.tile-title {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    text-transform: uppercase;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.8);
}

/* --- Individual Tile Backgrounds & Theme Colors --- */
#tile-gcvisitor {
    background-image: url('/gcvisitor.jpg');
    border-bottom: 5px solid var(--color-red);
}

#tile-sccmha {
    background-image: url('/sccmha-back.jpg');
    border-bottom: 5px solid var(--color-green);
}

#tile-3 {
    
    background-image: url('/babha-ips.jpg');
    border-bottom: 5px solid var(--color-blue);
}

#tile-4 {
    background-image: url('/midland-ips.jpg');
    border-bottom: 5px solid var(--color-blue);
}

#tile-4 .tile-title, #tile-4 .tile-logo {
    color: #ffffff; /* Darker text for better contrast on yellow */
    text-shadow: 1px 1px 4px rgba(255,255,255,0.5);
}


/* --- Footer --- */
footer {
    margin-top: 3rem;
    padding: 2rem 1rem;
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* For Safari */
    border-top: 1px solid rgba(255,255,255,0.2);
}

.footer-content {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.footer-content h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.footer-details {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem 2rem;
    margin-bottom: 1.5rem;
}

.footer-details p {
    margin: 0;
}

.footer-details a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-details a:hover {
    color: var(--color-blue);
}

.hours {
    text-align: left;
    margin: 0 auto;
}

.copyright {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1rem;
}


/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .main-logo {
        max-width: 250px;
    }
    
    .grid-container {
        gap: 1.5rem;
    }
    
    .tile-title {
        font-size: 1.5rem;
    }
    
    .footer-details {
        flex-direction: column;
        gap: 0.5rem;
    }
}


/* --- Heading Container --- */
.heading-container {
    text-align: center;
    padding: 0 1.5rem; /* Add horizontal padding */
}

.heading-container h1 {
    font-family: var(--font-heading);
    font-size: 2.8rem; /* Make it prominent */
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
    margin-bottom: 2rem; /* Space between heading and tiles */
}


/* Inside the @media (max-width: 768px) block */
.heading-container h1 {
    font-size: 2.2rem;
}