

.at-widget-popular-icon {
    margin-right: 6px;
}

.at-widget-count {
    opacity: 0.65;
    font-size: 0.85em;
}

.at-widget-categories--cards {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.at-widget-categories--cards li {
    margin: 0;
}

.at-widget-categories--cards a {
    display: flex;
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 8px;
    min-height: 50px;
    height: 100%;
    padding: 7px 10px;
    background: var(--at-surface, #fff);
    border: 1px solid transparent;
    border-radius: var(--at-container-radius, 16px);
    box-shadow: var(--at-card-shadow);
    text-decoration: none !important;
    box-sizing: border-box;
}

/* Shadow alone (dark-on-dark) doesn't read clearly in dark mode, so give
   this a visible border there — light mode still relies on shadow only. */
html[data-theme="dark"] .at-widget-categories--cards a {
    border-color: var(--at-border);
}

.at-widget-categories--cards a:hover {
    transform: translateY(-2px);
    background: color-mix(in srgb, var(--at-accent) 8%, var(--at-surface, #fff));
    border-color: color-mix(in srgb, var(--at-accent) 30%, transparent);
    box-shadow: var(--at-card-shadow-hover);
}

.at-cat-icon {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    line-height: 1;
    /* Badge backgrounds (ashraf_tools_get_category_card_color()) are always
       pale pastels, regardless of site theme. The icon uses fill:currentColor,
       so without an explicit color here it inherits --at-foreground — which
       is near-white in dark mode — making it nearly invisible against these
       light backgrounds. Pin it to a fixed dark color instead. */
    color: #1a1a2e;
}

.at-cat-icon .ashraf-svg-ico {
    width: 1.1em;
    height: 1.1em;
}

.at-cat-name {
    flex: 1;
    min-width: 0;
    font-weight: 700;
    color: var(--at-foreground, #111);
    font-size: 0.78rem;
    white-space: normal;
    overflow-wrap: break-word;
    line-height: 1.25;
}

.at-cat-count {
    flex: 0 0 auto;
    background: rgba(128, 128, 128, 0.15);
    color: var(--at-muted, #555);
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 999px;
}

.at-widget-view-all {
    display: block;
    margin-top: 10px;
    padding: 10px 12px;
    text-align: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--at-foreground, #111);
    background: var(--at-surface, #fff);
    border: 1px solid transparent;
    border-radius: var(--at-container-radius, 16px);
    box-shadow: var(--at-card-shadow);
    text-decoration: none !important;
}

html[data-theme="dark"] .at-widget-view-all {
    border-color: var(--at-border);
}

.at-widget-view-all:hover {
    transform: translateY(-2px);
    background: color-mix(in srgb, var(--at-accent) 8%, var(--at-surface, #fff));
    border-color: color-mix(in srgb, var(--at-accent) 30%, transparent);
    box-shadow: var(--at-card-shadow-hover);
}
