/* --- Tile Layout --- */

/* The main container for the grid */
.tile-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 20px auto;
}

.tile {
    background-color: var(--primary);
    padding: 20px 10px;
    text-align: center;
    text-decoration: none;
    color: #333;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 145px;
    width: 145px;
    
    /* --- Sizing & Overflow Rules --- */
    aspect-ratio: 1 / 1;    /* ✨ RE-ADDED: This forces a perfect 1:1 square aspect ratio. */
    overflow: hidden;       /* ✨ ADDED: Crucial for hiding any content that doesn't fit. */
}

.tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

/* Icon styling */
.tile i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: var(--black-zv);
}

/* Text styling */
.tile p {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--black-zv);
    margin: 0;
    line-height: 1.4;             /* ✨ ADDED: Improves readability for multi-line text. */
    overflow-wrap: break-word;    /* ✨ ADDED: Forces long words to wrap and prevents overflow. */
}

/* For tablets: 2 columns */
@media (max-width: 768px) {
    .tile-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* For mobile phones: 1 column */
@media (max-width: 350px) {
    .tile-container {
        grid-template-columns: 1fr;
    }
}