.akhome-block,
.akhome-block * {
    box-sizing: border-box;
}

.akhome-block {
    --ak-orange: #ff5a1f;
    --ak-orange2: #ff7a1a;
    --ak-dark: #202632;
    --ak-muted: #667085;
    --ak-border: #e8ebef;
    --ak-bg: #f7f8fa;
    --ak-ui-orange: var(--ak-orange, #ff5a1f);
    --ak-ui-orange-2: var(--ak-orange2, #ff7a1a);
    --ak-ui-dark: var(--ak-dark, #202632);
    --ak-ui-white: #fff;
    --ak-ui-card-radius: 20px;
    --ak-ui-card-radius-mobile: 16px;
    --ak-ui-btn-radius: 14px;
    --ak-ui-btn-radius-small: 12px;
    --ak-ui-focus-ring: 0 0 0 4px rgba(255,90,31,.14);
    --ak-ui-card-shadow: 0 12px 28px rgba(32,38,50,.06);
    --ak-ui-hover-shadow: 0 16px 34px rgba(32,38,50,.10), 0 0 24px rgba(255,90,31,.12);
    color: var(--ak-dark);
    width: 100%;
}

.akhome-wrap {
    width: min(var(--ak-container, 1320px), calc(100% - 32px));
    margin: 0 auto;
}

.akhome-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin: 0 0 22px;
}

.akhome-head h2 {
    margin: 0;
    font-size: clamp(24px, 2.1vw, 34px);
    line-height: 1.15;
    font-weight: 850;
    letter-spacing: -.02em;
}

.akhome-head p {
    margin: 8px 0 0;
    color: var(--ak-muted);
    line-height: 1.45;
}

.akhome-link {
    font-weight: 800;
    color: var(--ak-orange);
    text-decoration: none;
}

.akhb {
    padding: 32px 0;
    background: var(--ak-ui-white, #fff);
}

/* v1.0.7 — columns + automatic size.
   Auto mode uses the selected column count and calculates tile width from module width.
   Fixed mode keeps exact tile px size. */
.akhb-grid {
    --akhb-cols-current: var(--akhb-cols-d, 6);
    --akhb-gap-current: var(--akhb-gap, 12px);
    display: flex !important;
    flex-wrap: wrap;
    gap: var(--akhb-gap-current);
    align-items: stretch;
}

.akhb-align-left .akhb-grid {
    justify-content: flex-start;
}

.akhb-align-center .akhb-grid {
    justify-content: center;
}

.akhb-align-right .akhb-grid {
    justify-content: flex-end;
}

/* Auto size: no overflow, no random growth — tile fills its column */
.akhb-size-auto .akhb-tile {
    flex: 0 1 calc((100% - ((var(--akhb-cols-current) - 1) * var(--akhb-gap-current))) / var(--akhb-cols-current));
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
}

/* Fixed size: old precise px behavior */
.akhb-size-fixed .akhb-tile {
    flex: 0 0 var(--akhb-tile, 100px);
    width: var(--akhb-tile, 100px) !important;
    height: var(--akhb-tile, 100px) !important;
    min-width: var(--akhb-tile, 100px) !important;
    min-height: var(--akhb-tile, 100px) !important;
    max-width: var(--akhb-tile, 100px) !important;
    max-height: var(--akhb-tile, 100px) !important;
}

.akhb-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(232,235,239,.95);
    border-radius: var(--ak-ui-card-radius, 20px);
    background: var(--ak-ui-white, #fff);
    box-shadow: var(--ak-ui-card-shadow, 0 12px 28px rgba(32,38,50,.06));
    padding: 0;
    text-decoration: none;
    color: var(--ak-dark);
    font-weight: 850;
    transition:
        transform .18s ease,
        border-color .18s ease,
        box-shadow .18s ease;
    overflow: hidden;
}

.akhb-tile:hover,
.akhb-tile:focus-visible {
    border-color: rgba(255,90,31,.48);
    box-shadow: var(--ak-ui-hover-shadow, 0 16px 34px rgba(32,38,50,.10), 0 0 24px rgba(255,90,31,.12));
    transform: translateY(-2px);
    outline: none;
}

.akhb-tile img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    object-position: center;
}

.akhb-tile span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 10px;
    text-align: center;
    font-size: 14px;
    line-height: 1.15;
    background: var(--ak-ui-white, #fff);
}

@media (max-width: 640px) {
    .akhome-wrap {
        width: min(100% - 24px, 1320px);
    }

    .akhome-head {
        display: block;
    }

    .akhome-link {
        display: inline-flex;
        margin-top: 10px;
    }

    .akhb-grid {
        --akhb-cols-current: var(--akhb-cols-m, 3);
        --akhb-gap-current: var(--akhb-gap-mobile, 10px);
    }

    .akhb-size-fixed .akhb-tile {
        flex-basis: var(--akhb-tile-mobile, 76px);
        width: var(--akhb-tile-mobile, 76px) !important;
        height: var(--akhb-tile-mobile, 76px) !important;
        min-width: var(--akhb-tile-mobile, 76px) !important;
        min-height: var(--akhb-tile-mobile, 76px) !important;
        max-width: var(--akhb-tile-mobile, 76px) !important;
        max-height: var(--akhb-tile-mobile, 76px) !important;
        border-radius: var(--ak-ui-card-radius-mobile, 16px);
    }

    .akhb-size-auto .akhb-tile {
        border-radius: var(--ak-ui-card-radius-mobile, 16px);
    }

    .akhb-tile span {
        padding: 7px;
        font-size: 11px;
    }
}


/* v1.0.8 — homepage equal-height group support.
   Only min-height is synchronized by JS on desktop; mobile keeps natural height. */
@media (min-width: 992px) {
    .akhome-block[data-akh-equal-group] {
        height: auto;
        transition: min-height .18s ease;
    }
}

@media (max-width: 991px) {
    .akhome-block[data-akh-equal-group] {
        min-height: 0 !important;
    }
}


/* v1.0.9 — unified top padding for homepage paired blocks */
.akhome-block.akhb {
    padding-top: 24px !important;
}

@media (max-width: 767px) {
    .akhome-block.akhb {
        padding-top: 22px !important;
    }
}
