/* Main container for the tile grid */
.itm-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Default to 4 columns */
    gap: 20px;
    padding: 20px 0;
}

/* Individual tile styling */
.itm-tile {
    position: relative;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px 20px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    cursor: pointer;
}

.itm-tile:hover,
.itm-tile:focus {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    outline: none; /* remove focus ring for this element as we handle it with hover */
}

.itm-tile-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Icon styling */
.itm-icon {
    max-height: 40px;
    width: auto;
    margin-bottom: 10px;
}

/* Title styling */
.itm-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

/* Popover container */
.itm-popover {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 10px; /* Space between tile and popover */
    width: 280px; /* Set a fixed width for the popover */
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    z-index: 1000;
    text-align: left;
}

/* Popover content styling */
.itm-popover-content {
    padding: 20px;
}

.itm-popover-content a {
    color: #0073aa;
    text-decoration: none;
}
.itm-popover-content a:hover {
    text-decoration: underline;
}

/* Responsive Grid */
@media (max-width: 992px) {
    .itm-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .itm-container {
        grid-template-columns: repeat(2, 1fr);
    }
    .itm-popover {
        /* On smaller screens, make popover less wide than the screen */
        width: 250px;
    }
}

@media (max-width: 480px) {
    .itm-container {
        grid-template-columns: 1fr;
    }
    .itm-popover {
       /* Center on mobile */
       left: 50%;
       transform: translateX(-50%);
    }
}
