.software-topics {
    --topic-border: #2a3b56;
    --topic-panel: #152036;
    --topic-secondary: #b9c7de;
}

.software-topics-inner {
    width: min(100%, 1240px);
    margin-inline: auto;
    container-type: inline-size;
}

.archive-content.software-topics-archive,
.archive-content.software-topics-detail {
    padding-top: 10px;
}

.software-topics-heading {
    padding-bottom: 14px;
    border-bottom: 1px solid var(--topic-border);
}

.software-topics-heading h1 {
    font-size: clamp(26px, 3.2vw, 42px);
    line-height: 1.23;
    overflow-wrap: anywhere;
    text-wrap: balance;
}

.software-topic-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(14px, 2vw, 24px);
    margin-block: 20px 28px;
}

@container (min-width: 590px) {
    .software-topic-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@container (min-width: 900px) {
    .software-topic-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.software-topic-card,
.software-topic-hero,
.software-topic-items-detail {
    border: 1px solid var(--topic-border);
    border-radius: 14px;
    background: var(--topic-panel);
}

.software-topic-card {
    display: flex;
    flex-direction: column;
    padding: clamp(12px, 1.6vw, 20px);
}

.software-topic-link {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    border-radius: 8px;
}

.software-topic-list h2 {
    font-size: clamp(18px, 2vw, 24px);
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.software-topic-link p {
    margin-top: 5px;
    color: var(--topic-secondary);
    font-size: 12px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.software-topic-items-detail .software-topic-item-copy p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    margin-top: 12px;
    color: var(--topic-secondary);
    font-size: 13px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.software-topic-item-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin: 9px 0 0;
    color: var(--topic-secondary);
    font-size: 11px;
    line-height: 1.45;
    font-variant-numeric: tabular-nums;
}

.software-topic-item-facts > div {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 5px;
    min-width: 0;
}

.software-topic-item-facts dd {
    margin: 0;
    color: var(--text);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.software-topic-card-footer {
    margin-top: auto;
    padding-top: 12px;
}

.software-topic-card-footer .software-topic-view {
    width: 100%;
    min-height: 44px;
    padding-inline: 12px;
}

.software-topic-link:is(:hover, :focus-visible) h2,
.software-topic-item:is(:hover, :focus-visible) :is(h3, .software-topic-app-name) {
    color: var(--accent);
}

.software-topic-cover {
    position: relative;
    isolation: isolate;
    display: grid;
    align-content: center;
    aspect-ratio: 16 / 9;
    padding: clamp(16px, 3vw, 36px);
    border-radius: 8px;
    background: #12223a;
}

.software-topic-cover img,
.software-topic-cover::after {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
}

.software-topic-cover img {
    object-fit: cover;
}

.software-topic-cover::after {
    content: "";
    background: linear-gradient(90deg, rgb(9 18 34 / 88%), rgb(9 18 34 / 64%));
    pointer-events: none;
}

.software-topic-cover-title {
    position: relative;
    z-index: 1;
    color: #fff;
    font-size: clamp(23px, 3.2vw, 38px);
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.software-topic-card .software-topic-cover {
    aspect-ratio: 2.6 / 1;
    grid-template-rows: minmax(20px, 1fr) auto minmax(20px, 1fr);
    align-content: stretch;
    padding: 12px 16px;
}

.software-topic-card .software-topic-cover-title {
    grid-row: 2;
    align-self: center;
    justify-self: center;
    width: 80%;
    font-size: clamp(20px, 6cqi, 25px);
    line-height: 1.25;
    text-align: center;
}

.software-topic-cover-count {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1;
    padding: 4px 8px;
    border-radius: 0 8px 0 7px;
    background: #294b70;
    color: #dbeaff;
    font-size: 11px;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.software-topic-card .software-topic-cover img {
    object-position: center 42%;
}

.software-topic-cover-default {
    background: linear-gradient(110deg, #14243f, #264569);
}

.software-topic-cover-default::after,
.software-topic-cover-designed::after {
    content: none;
}

.software-topic-hero-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    color: var(--accent);
}

.software-topic-hero-link:hover {
    text-decoration: underline;
}

.software-topic-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, .84fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(18px, 3vw, 42px);
    padding: 44px clamp(16px, 2.8vw, 36px);
}

.software-topic-back {
    position: absolute;
    top: 0;
    right: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 44px;
    padding: 0 13px;
    border-radius: 0 13px 0 10px;
    background: #294b70;
    color: #e6f1ff;
    font-size: 13px;
    font-weight: 600;
}

.software-topic-back:hover {
    background: #365d86;
}

.software-topic-hero-copy {
    min-width: 0;
}

.software-topic-hero-title {
    font-size: clamp(24px, 3vw, 36px);
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.software-topic-intro {
    margin-top: 20px;
    color: var(--topic-secondary);
    font-size: clamp(13px, 1.1vw, 14px);
    line-height: 1.85;
    overflow-wrap: anywhere;
    text-wrap: pretty;
}

.software-topic-hero-link {
    margin-top: 8px;
    font-weight: 650;
}

.software-topic-list {
    margin-top: clamp(22px, 3vw, 38px);
    scroll-margin-top: 12px;
}

.software-topic-list-empty {
    margin-top: 12px;
    color: var(--topic-secondary);
}

.software-topic-items {
    margin: 14px 0 0;
    padding: 0;
    border-top: 1px solid var(--topic-border);
    list-style: none;
}

.software-topic-items li + li {
    border-top: 1px solid var(--topic-border);
}

.software-topic-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding-block: 7px;
}

.software-topic-item:focus-visible {
    border-radius: 4px;
    outline-offset: 2px;
}

.software-topic-app {
    display: flex;
    align-items: center;
    gap: 9px;
}

.software-topic-app img,
.software-topic-app-icon {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 7px;
}

.software-topic-app img {
    object-fit: contain;
}

.software-topic-app-icon {
    display: grid;
    place-items: center;
    background: #203453;
    color: var(--accent);
}

.software-topic-app-name {
    min-width: 0;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.software-topic-rating {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.software-topic-rating :is(.icon, strong) {
    color: #ffd184;
}

.software-topic-rating small {
    color: var(--topic-secondary);
    font-size: 12px;
}

.software-topic-card .software-topic-item {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-content: center;
    justify-items: start;
    gap: 2px 9px;
    min-height: 52px;
    padding-block: 7px;
}

.software-topic-card :is(.software-topic-item-copy, .software-topic-app, .software-topic-item-stats) {
    display: contents;
}

.software-topic-card :is(.software-topic-app img, .software-topic-app-icon) {
    grid-row: 1 / 3;
    align-self: center;
    width: 36px;
    height: 36px;
    border-radius: 7px;
}

.software-topic-card .software-topic-app-icon .icon {
    font-size: 16px;
}

.software-topic-card :is(.software-topic-app-name, .software-topic-rating) {
    grid-column: 2;
}

.software-topic-card .software-topic-app-name {
    font-size: 13px;
    line-height: 1.35;
}

.software-topic-card .software-topic-rating,
.software-topic-card .software-topic-rating small {
    font-size: 11px;
}

.software-topic-heat {
    display: grid;
    align-self: center;
    justify-items: end;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.software-topic-card .software-topic-heat {
    grid-column: 3;
    grid-row: 1 / 3;
}

.software-topic-heat strong {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

.software-topic-heat-value {
    min-inline-size: var(--topic-reading-width, 1ch);
    text-align: end;
}

.software-topic-heat .icon {
    color: #ffad86;
}

.software-topic-items-detail {
    padding-inline: clamp(12px, 2.2vw, 26px);
}

.software-topic-items-detail .software-topic-item {
    grid-template-columns: clamp(92px, 14vw, 168px) minmax(0, 1fr) auto;
    gap: clamp(12px, 2vw, 24px);
    padding-block: clamp(12px, 1.8vw, 20px);
}

.software-topic-items-detail .software-topic-item-stats {
    display: grid;
    justify-items: end;
    gap: 6px;
    font-size: 12px;
}

.software-topic-items-detail .software-topic-rating small,
.software-topic-items-detail .software-topic-heat strong {
    font-size: 11px;
}

.software-topic-item-cover {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    border-radius: 8px;
    object-fit: cover;
}

.software-topic-items-detail .software-topic-item h3 {
    font-size: clamp(15px, 1.7vw, 19px);
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.software-topic-app-heading,
.software-topic-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    min-width: 0;
}

.software-topic-app-heading {
    gap: 5px 9px;
}

.software-topic-badges {
    gap: 5px;
}

.software-topic-rank-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 5px;
    background: #ffc76b;
    color: #472403;
    font-size: 12px;
    font-weight: 750;
    line-height: 1.3;
    white-space: nowrap;
}

.software-topic-rank-badge .icon {
    font-size: 14px;
}

@media (max-width: 760px) {
    .software-topic-hero {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 530px) {
    .software-topic-items-detail .software-topic-item {
        grid-template-columns: 66px minmax(0, 1fr);
        row-gap: 4px;
    }

    .software-topic-item-cover {
        grid-row: span 2;
    }

    .software-topic-items-detail .software-topic-item-stats {
        grid-column: 2;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 4px 12px;
    }
}

@media (max-width: 360px) {
    .software-topic-items-detail .software-topic-rating strong + small {
        display: none;
    }
}
