/* BB Icon Grid + Tile styles (editor + front-end) */

.bb-icon-grid {
    display: grid;
    gap: var(--bb-grid-gap, 24px);
    grid-template-columns: repeat(var(--bb-grid-cols, 4), 1fr);
    align-items: stretch;
}

/* Tablet breakpoint */
@media (max-width: 900px) {
    .bb-icon-grid {
        grid-template-columns: repeat(var(--bb-grid-cols-tablet, 2), 1fr);
    }
}

/* Mobile breakpoint */
@media (max-width: 600px) {
    .bb-icon-grid {
        grid-template-columns: repeat(var(--bb-grid-cols-mobile, 1), 1fr);
    }
}

/* Ensure inner block root fills the grid cell */
.bb-icon-grid > .wp-block {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

/* Shape presets */
.bb-icon-grid[data-shape="landscape"] .bb-icon-feature {
    aspect-ratio: 16 / 9;
}
.bb-icon-grid[data-shape="square"] .bb-icon-feature {
    aspect-ratio: 1 / 1;
}
.bb-icon-grid[data-shape="portrait"] .bb-icon-feature {
    aspect-ratio: 3 / 4;
}

/* Card base */
.bb-icon-feature {
    width: 100%;
    overflow: hidden;
    border-radius: var(--bb-grid-radius, 12px);
    box-sizing: border-box;
    position: relative;
    background-color: #f3f3f3;
    background-size: cover;
    background-position: center center;
}

/* Tile-specific: dark overlay + centered content */
.bb-icon-tile .bb-tile-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.22) 0%, rgba(0,0,0,0.42) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}

.bb-tile-content {
    text-align: center;
    color: #fff;
    max-width: 90%;
}

.bb-tile-content h3 {
    margin: 0 0 8px 0;
    font-size: 28px;
    line-height: 1.05;
    font-weight: 700;
}

.bb-tile-content p {
    margin: 0 0 14px 0;
    color: rgba(255,255,255,0.9);
}

/* Button */
.bb-tile-button-wrap {
    display: flex;
    justify-content: center;
}
.bb-tile-button {
    display: inline-block;
    background: #f4b225;
    color: #111;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
}

/* Accessibility focus state */
.bb-icon-feature:focus-within .bb-tile-button,
.bb-tile-button:focus {
    outline: 3px solid rgba(21,156,228,0.25);
    outline-offset: 4px;
}

/* If equal-height requested, ensure children fill cell */
.bb-icon-grid[data-equal-height="1"] .bb-icon-feature {
    display: flex;
    flex-direction: column;
}

/* Editor helper: make sure editor preview doesn't navigate */
.editor-styles-wrapper .bb-icon-tile .bb-tile-button { pointer-events: none; }