.apetun-links {
    --apetun-border: #e3e6e8;
    --apetun-text: #1d2327;
    --apetun-muted: #69727d;
    --apetun-surface: #ffffff;
    --apetun-soft: #f6f7f7;
    --apetun-active: #2f6f4e;
    --apetun-archived: #8a6d1d;
    --apetun-unavailable: #7d3b3b;
    color: var(--apetun-text);
}

.apetun-links__alphabet {
    margin: 0 0 2rem;
    padding: .9rem 1rem;
    border: 1px solid var(--apetun-border);
    border-radius: 12px;
    background: var(--apetun-surface);
}

.apetun-links__alphabet ul {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    list-style: none;
}

.apetun-links__alphabet a,
.apetun-links__alphabet span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.15rem;
    height: 2.15rem;
    padding: 0 .45rem;
    border-radius: 8px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
}

.apetun-links__alphabet a {
    border: 1px solid currentColor;
}

.apetun-links__alphabet a:hover,
.apetun-links__alphabet a:focus-visible {
    transform: translateY(-1px);
}

.apetun-links__alphabet span {
    color: #a7adb3;
    background: var(--apetun-soft);
}

.apetun-links__section {
    margin: 0 0 2.75rem;
    scroll-margin-top: 120px;
}

.apetun-links__section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 1rem;
    padding-bottom: .65rem;
    border-bottom: 1px solid var(--apetun-border);
}

.apetun-links__section-heading h2 {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    line-height: 1;
}

.apetun-links__back {
    font-size: .9rem;
}

.apetun-links__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.15rem;
}

.apetun-links__card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 1.25rem;
    border: 1px solid var(--apetun-border);
    border-radius: 14px;
    background: var(--apetun-surface);
}

.apetun-links__card-topline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .55rem;
    margin-bottom: .75rem;
}

.apetun-links__type,
.apetun-links__status {
    display: inline-flex;
    align-items: center;
    min-height: 1.65rem;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 700;
    line-height: 1.15;
}

.apetun-links__type {
    background: var(--apetun-soft);
    color: var(--apetun-muted);
}

.apetun-links__status--active {
    color: var(--apetun-active);
    border: 1px solid currentColor;
}

.apetun-links__status--archived {
    color: var(--apetun-archived);
    border: 1px solid currentColor;
}

.apetun-links__status--unavailable {
    color: var(--apetun-unavailable);
    border: 1px solid currentColor;
}

.apetun-links__title {
    margin: 0 0 .35rem;
    font-size: 1.15rem;
    line-height: 1.35;
}

.apetun-links__title a {
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.apetun-links__entity {
    margin: 0 0 .75rem;
    color: var(--apetun-muted);
    font-weight: 600;
}

.apetun-links__meta {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem 1.2rem;
    margin: 0 0 .8rem;
    padding: .7rem 0;
    border-top: 1px solid var(--apetun-border);
    border-bottom: 1px solid var(--apetun-border);
}

.apetun-links__meta div {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .3rem;
    min-width: 0;
}

.apetun-links__meta dt,
.apetun-links__meta dd {
    margin: 0;
    font-size: .84rem;
}

.apetun-links__meta dt {
    color: var(--apetun-muted);
    font-weight: 700;
}

.apetun-links__description {
    margin-bottom: 1rem;
    font-size: .95rem;
    line-height: 1.65;
}

.apetun-links__description > :first-child {
    margin-top: 0;
}

.apetun-links__description > :last-child {
    margin-bottom: 0;
}

.apetun-links__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .65rem 1rem;
    margin-top: auto;
    padding-top: .8rem;
    border-top: 1px solid var(--apetun-border);
}

.apetun-links__domain {
    color: var(--apetun-muted);
    font-size: .82rem;
    overflow-wrap: anywhere;
}

.apetun-links__source-link,
.apetun-links__source-missing {
    font-size: .86rem;
    font-weight: 700;
}

.apetun-links__source-missing {
    color: var(--apetun-unavailable);
}

.apetun-links__card--unavailable {
    background: linear-gradient(0deg, rgba(125, 59, 59, .025), rgba(125, 59, 59, .025)), var(--apetun-surface);
}

.apetun-links--empty {
    padding: 1rem 1.15rem;
    border: 1px solid var(--apetun-border);
    border-radius: 12px;
    background: var(--apetun-soft);
}

@media (max-width: 760px) {
    .apetun-links__alphabet {
        padding: .75rem;
    }

    .apetun-links__alphabet ul {
        justify-content: flex-start;
    }

    .apetun-links__grid {
        grid-template-columns: 1fr;
    }

    .apetun-links__back {
        display: none;
    }
}
