/*
 * GD Top Level Tile widget
 * Depends on gd-colors.css for --gd-* custom properties.
 * Depends on gd-header.css for the title (.gd-header--card-title / --color-dark).
 * Depends on gd-image.css for the background image (.gd-image, rounded).
 *
 * The "tab" cutout is drawn by overlaying sand-imagebox-up.svg on top of the
 * image (not below it) — same technique as the old Elementor image-box
 * tiles: a full-size layer over the image, with the shape graphic anchored
 * near the bottom via background-position/-size, so it appears to "eat
 * into" the bottom edge of the photo.
 *
 * The shape is applied via mask-image (not background-image) so its color
 * is controllable via the --gd-tile-shape-color custom property (set inline
 * per tile/group from the "Shape Color" widget control) instead of being
 * baked into the SVG file.
 */

.gd-top-level-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 205px;
    margin: 0 auto;
    margin-bottom: 2rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
    background: transparent;
}

.gd-top-level-tile__image {
    position: relative;
    width: 100%;
    height: 140px;
    overflow: hidden;
    border-radius: var(--gd-image-radius, 1.25rem);
    margin-bottom: 0.5rem;
}

.gd-top-level-tile__image > .gd-image {
    height: 100%;
}

/* Zoom happens on the image itself, INSIDE the already-clipped, static
   border (overflow: hidden above never moves/scales) — not on the tile as
   a whole. This keeps the ::after mask (the tab cutout) completely static
   during hover, avoiding the clipping/flicker glitch that occurred when the
   whole tile (mask + overflow clip together) was scaled via transform. */
.gd-top-level-tile__image .gd-image__img {
    transition: transform 0.3s ease;
}

.gd-top-level-tile:hover .gd-top-level-tile__image .gd-image__img {
    transform: scale(1.08);
}

.gd-top-level-tile__image--placeholder {
    background-color: var(--gd-dark-blueish-grey, #3B4F5B);
}

.gd-top-level-tile__image::after {
    content: '';
    position: absolute;
    inset: 0;
    -webkit-mask-image: url('../images/sand-imagebox-up.svg');
    mask-image: url('../images/sand-imagebox-up.svg');
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: 50% 102%;
    mask-position: 50% 102%;
    -webkit-mask-size: 72% auto;
    mask-size: 72% auto;
    background-color: var(--gd-tile-shape-color, var(--gd-light-grey));
    pointer-events: none;
}

/* move content upwards */
.gd-top-level-tile__content {
    margin-top: -1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.gd-top-level-tile__icon {
    width: 32px;
    height: 32px;
    margin-bottom: 0.8rem;
    background-color: var(--gd-blue);
    -webkit-mask-image: url('../images/gd-top-level-tile-icon-placeholder.svg');
    mask-image: url('../images/gd-top-level-tile-icon-placeholder.svg');
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.gd-top-level-tile__title .gd-header {
    text-align: center;
    transition: color 0.2s ease;
}

.gd-top-level-tile:hover .gd-top-level-tile__title .gd-header {
    color: var(--gd-blue);
}



