/* ===== Home: latest questions ===== */
.home-q-area {
    --hq-surface: #ffffff;
    --hq-surface-2: #f6f5fa;
    --hq-border: rgba(16, 12, 40, 0.08);
    --hq-text: #1f1d2b;
    --hq-muted: #6b6880;
    --hq-accent: var(--color-primary, #49108b);
    --hq-green: #15803d;
    padding: 72px 0;
    background: var(--hq-surface);
}

body.active-dark-mode .home-q-area {
    --hq-surface: #111116;
    --hq-surface-2: #1d1d24;
    --hq-border: rgba(255, 255, 255, 0.08);
    --hq-text: #f3f3f6;
    --hq-muted: #a3a1b3;
    --hq-accent: #a98bf5;
    --hq-green: #4ade80;
}

.home-q-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 24px;
    margin-bottom: 28px;
}

.home-q-area .home-q-title {
    margin: 0 0 6px;
    color: var(--hq-text);
    font-size: 28px;
    font-weight: 800;
}

.home-q-subtitle {
    margin: 0;
    color: var(--hq-muted);
    font-size: 15px;
}

.home-q-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.home-q-ask,
.home-q-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid var(--hq-border);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    transition: border-color 0.2s ease, background-color 0.2s ease, filter 0.2s ease;
}

.home-q-area .home-q-ask {
    border-color: transparent;
    background: var(--color-primary, #49108b);
    color: #fff;
}

body.active-dark-mode .home-q-area .home-q-ask {
    background: #6d3fd1;
}

.home-q-ask:hover {
    filter: brightness(1.1);
}

.home-q-area .home-q-all {
    color: var(--hq-accent);
}

.home-q-all:hover {
    border-color: var(--hq-accent);
    background: color-mix(in srgb, var(--hq-accent) 8%, transparent);
}

/* ----- List ----- */
.home-q-list {
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--hq-border);
    border-radius: 20px;
    background: var(--hq-surface);
    list-style: none;
}

.home-q-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0;
    padding: 18px 22px;
    transition: background-color 0.2s ease;
}

.home-q-item + .home-q-item {
    border-top: 1px solid var(--hq-border);
}

.home-q-item:hover,
.home-q-item:focus-within {
    background: var(--hq-surface-2);
}

/* Answer count: grey when unanswered, green once answered */
.home-q-count {
    display: flex;
    flex: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 58px;
    border: 1px solid var(--hq-border);
    border-radius: 14px;
    color: var(--hq-muted);
    line-height: 1.25;
}

.home-q-count strong {
    color: var(--hq-text);
    font-family: Dana, Dana-fallback, Tahoma, sans-serif;
    font-size: 19px;
    font-weight: 800;
}

.home-q-count small {
    font-size: 11px;
}

.home-q-count.is-answered {
    border-color: color-mix(in srgb, var(--hq-green) 35%, transparent);
    background: color-mix(in srgb, var(--hq-green) 10%, transparent);
    color: var(--hq-green);
}

.home-q-count.is-answered strong {
    color: var(--hq-green);
}

.home-q-body {
    flex: 1;
    min-width: 0;
}

.home-q-name {
    display: -webkit-box;
    margin: 0 0 6px;
    overflow: hidden;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.75;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.home-q-area .home-q-name a {
    color: var(--hq-text);
}

/* The whole row opens the question */
.home-q-name a::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

.home-q-area .home-q-item:hover .home-q-name a {
    color: var(--hq-accent);
}

.home-q-name a:focus-visible {
    outline: none;
}

.home-q-item:has(.home-q-name a:focus-visible) {
    outline: 3px solid color-mix(in srgb, var(--hq-accent) 45%, transparent);
    outline-offset: -3px;
}

.home-q-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    color: var(--hq-muted);
    font-size: 13px;
}

.home-q-meta,
.home-q-meta *:not(i) {
    font-family: Dana, Dana-fallback, Tahoma, sans-serif;
}

.home-q-meta i {
    margin-left: 3px;
}

.home-q-author,
.home-q-cat {
    position: relative;
    z-index: 2; /* above the row-wide link */
}

.home-q-author {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.home-q-area .home-q-author {
    color: var(--hq-text);
}

.home-q-area .home-q-author:hover {
    color: var(--hq-accent);
}

.home-q-author img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
}

.home-q-cat {
    padding: 1px 9px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--hq-accent) 10%, transparent);
    font-size: 12px;
    font-weight: 700;
}

.home-q-area .home-q-cat {
    color: var(--hq-accent);
}

.home-q-go {
    flex: none;
    color: var(--hq-muted);
    transition: color 0.2s ease, transform 0.2s ease;
}

.home-q-item:hover .home-q-go {
    color: var(--hq-accent);
    transform: translateX(-4px);
}

@media (max-width: 575px) {
    .home-q-area {
        padding: 48px 0;
    }

    .home-q-area .home-q-title {
        font-size: 23px;
    }

    .home-q-actions {
        width: 100%;
    }

    .home-q-ask,
    .home-q-all {
        flex: 1;
        justify-content: center;
    }

    .home-q-item {
        align-items: flex-start;
        gap: 12px;
        padding: 14px 16px;
    }

    .home-q-count {
        width: 52px;
        height: 50px;
    }

    .home-q-name {
        font-size: 15px;
    }

    .home-q-go {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-q-item,
    .home-q-go {
        transition: none;
    }

    .home-q-item:hover .home-q-go {
        transform: none;
    }
}
