/* Home Blocks - Front office styles
 * All colors and dimensions come from CSS custom properties set inline by the module.
 */

.avblocks-wrapper {
    margin: 1.5rem 0;
    padding: 0;
}

.avblocks-wrapper .container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.avblocks-grid {
    display: grid;
    grid-template-columns: repeat(var(--avb-cols-mobile, 2), minmax(0, 1fr));
    gap: var(--avb-gap, 16px);
    list-style: none;
    margin: 0;
    padding: 0;
}

@media (min-width: 768px) {
    .avblocks-grid {
        grid-template-columns: repeat(var(--avb-cols-desktop, 6), minmax(0, 1fr));
    }
}

.avblocks-item {
    margin: 0;
    padding: 0;
    list-style: none;
}

.avblocks-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    height: 100%;
    min-height: 110px;
    padding: 1.25rem 0.75rem;
    text-align: center;
    text-decoration: none;
    background: var(--avb-bg, #ffffff);
    color: var(--avb-text, #0f2a50);
    border: 1px solid var(--avb-border, #e5e9ef);
    border-radius: var(--avb-radius, 8px);
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.15s ease,
        box-shadow 0.2s ease;
    box-sizing: border-box;
    cursor: pointer;
}

.avblocks-link:hover,
.avblocks-link:focus-visible {
    background: var(--avb-bg-hover, #f4f7fa);
    color: var(--avb-text-hover, #0f2a50);
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    outline: none;
}

.avblocks-link:focus-visible {
    outline: 2px solid var(--avb-text, #0f2a50);
    outline-offset: 2px;
}

.avblocks-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: var(--avb-icon, #0f2a50);
    transition: color 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.avblocks-link:hover .avblocks-icon,
.avblocks-link:focus-visible .avblocks-icon {
    color: var(--avb-icon-hover, #0f2a50);
    transform: scale(1.06);
}

.avblocks-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.avblocks-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.25;
}

.avblocks-title {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.005em;
    word-break: break-word;
}

.avblocks-subtitle {
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.8;
    word-break: break-word;
}

/* --- Highlight variant (e.g. Promotions block) --- */
.avblocks-item--highlight .avblocks-link {
    background: var(--avb-h-bg, #0f2a50);
    color: var(--avb-h-text, #ffffff);
    border-color: var(--avb-h-bg, #0f2a50);
}

.avblocks-item--highlight .avblocks-link:hover,
.avblocks-item--highlight .avblocks-link:focus-visible {
    background: var(--avb-h-bg-hover, #163a6b);
    color: var(--avb-h-text-hover, #ffffff);
    border-color: var(--avb-h-bg-hover, #163a6b);
}

.avblocks-item--highlight .avblocks-icon {
    color: var(--avb-h-icon, #ffffff);
}

.avblocks-item--highlight .avblocks-link:hover .avblocks-icon,
.avblocks-item--highlight .avblocks-link:focus-visible .avblocks-icon {
    color: var(--avb-h-icon-hover, #ffffff);
}

/* --- Mobile fine tuning --- */
@media (max-width: 767px) {
    .avblocks-link {
        min-height: 92px;
        padding: 0.875rem 0.5rem;
    }
    .avblocks-icon {
        width: 36px;
        height: 36px;
    }
    .avblocks-title {
        font-size: 0.8125rem;
    }
    .avblocks-subtitle {
        font-size: 0.6875rem;
    }
}

/* --- Reduced motion accessibility --- */
@media (prefers-reduced-motion: reduce) {
    .avblocks-link,
    .avblocks-icon {
        transition: none;
    }
    .avblocks-link:hover {
        transform: none;
    }
    .avblocks-link:hover .avblocks-icon {
        transform: none;
    }
}
