/* The catalog of links /links (views/Links): the window (brandbook 8.3), tiles of the categories, rows of the links (8.9),
   the sort switch (segments as 8.37), votes and the complaint menu, the form of a new link (8.26), page links (8.31).
   Desktop >= 992px, tablet 577-991px, phone <= 576px (brandbook 10). */

/* --- the window: gradient header, action on the right (8.3) */
.links-window .bk-window__header {
    gap: 8px;
}

.links-window__icon {
    flex: 0 0 auto;
    color: #ffffffcc;
    font-size: 16px;
}

.links-window__title {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

.links-add-button {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 4px 10px;
    border: 1px solid #ffffff59;
    border-radius: 4px;
    background: #ffffff1a;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    transition: background-color .15s, border-color .15s;
}

.links-add-button:hover,
.links-add-button:focus-visible {
    background: #ffffff33;
    border-color: #ffffffb3;
    color: #fff;
    text-decoration: none;
    outline: 0;
}

.links-window__body {
    padding: 12px 16px;
}

.links-window__body .bk-breadcrumb {
    margin: 0;
    padding: 0;
    background: none;
    font-size: 15px;
}

.links-window__summary {
    margin-top: 4px;
    color: #65676b;
    font-size: 13px;
    line-height: 1.34;
}

.links-window__description {
    margin: 8px 0 0;
    color: #65676b;
    font-size: 13px;
    line-height: 1.34;
}

/* --- the categories: tiles in two columns (one on the phone) */
.links-categories {
    column-count: 2;
    column-gap: 16px;
}

.links-category {
    display: inline-block;
    width: 100%;
    margin: 0 0 16px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
    break-inside: avoid;
    animation: links-row-in .35s ease-out backwards;
}

.links-category__head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px 8px;
    border-bottom: 1px solid #edf0f3;
}

.links-category__title {
    flex: 1 1 auto;
    min-width: 0;
}

.links-category__name {
    color: #1c1e21;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.25;
    transition: color .15s;
}

.links-category__name:hover,
.links-category__name:focus-visible {
    color: #3c6690;
    text-decoration: none;
}

.links-category__count {
    flex: 0 0 auto;
    min-width: 32px;
    padding: 2px 8px;
    border-radius: 8px;
    background: #f5f7fa;
    color: #3c6690;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.34;
    text-align: center;
}

.links-category__description {
    margin: 4px 0 0;
    color: #65676b;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.34;
}

.links-category__list {
    margin: 0;
    padding: 4px 0;
    list-style: none;
}

.links-mini {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 16px;
    color: #3c6690;
    font-size: 15px;
    line-height: 1.34;
    transition: background-color .15s;
}

.links-mini:hover,
.links-mini:focus-visible {
    background: #3c669012;
    color: #2b4763;
    text-decoration: none;
}

.links-mini__name {
    min-width: 0;
    overflow-wrap: anywhere;
}

.links-category__all {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px 12px;
    border-top: 1px solid #edf0f3;
    color: #3c6690;
    font-size: 13px;
    font-weight: 600;
}

.links-category__all i {
    transition: transform .15s;
}

.links-category__all:hover {
    color: #2b4763;
    text-decoration: none;
}

.links-category__all:hover i {
    transform: translateX(3px);
}

/* the site sign: favicon or the first letter of the name */
.links-sign {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #3c669012;
    color: #3c6690;
    font-weight: 700;
    line-height: 1;
}

.links-sign img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.links-sign--small {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    border-radius: 4px;
    font-size: 10px;
}

.links-sign--small.has-icon {
    background: none;
}

.links-sign--large {
    width: 40px;
    height: 40px;
    padding: 10px;
    border-radius: 10px;
    font-size: 17px;
}

/* --- the toolbar of a category: the number of the sites and the sort */
.links-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    margin-top: 12px;
}

.links-toolbar__count {
    color: #65676b;
    font-size: 13px;
}

.links-sort {
    display: inline-flex;
    align-items: stretch;
    gap: 8px;
}

.links-sort__label {
    align-self: center;
    color: #65676b;
    font-size: 13px;
}

.links-sort__group {
    display: inline-flex;
    height: 28px;
    border: 1px solid rgba(0, 0, 0, .125);
    border-radius: 4px;
    overflow: hidden;
}

.links-sort__item {
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    color: #65676b;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: background-color .15s, color .15s;
}

.links-sort__item + .links-sort__item {
    border-left: 1px solid rgba(0, 0, 0, .125);
}

a.links-sort__item:hover,
a.links-sort__item:focus-visible {
    background: #3c669012;
    color: #3c6690;
    text-decoration: none;
}

.links-sort__item.is-current {
    background: #3c6690;
    color: #fff;
}

/* --- the links of a category: rows (8.9 "large") */
.links-list {
    margin-bottom: 16px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}

.links-item {
    position: relative;
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid #edf0f3;
    animation: links-row-in .35s ease-out backwards;
}

.links-item:first-child {
    border-top: 0;
}

.links-item::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 3px;
    background: #3c6690;
    transform: scaleY(0);
    transition: transform .2s ease-in-out;
}

.links-item:hover::before {
    transform: scaleY(1);
}

.links-item__body {
    flex: 1 1 auto;
    min-width: 0;
}

.links-item__name {
    color: #1c1e21;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.34;
    overflow-wrap: anywhere;
    transition: color .15s;
}

.links-item__name i {
    margin-left: 4px;
    color: #adb5bd;
    font-size: 11px;
    vertical-align: 1px;
}

.links-item__name:hover,
.links-item__name:focus-visible {
    color: #3c6690;
    text-decoration: none;
}

.links-item__domain {
    margin-top: 2px;
    color: #65676b;
    font-size: 13px;
    line-height: 1.34;
    overflow-wrap: anywhere;
}

.links-item__short {
    margin: 6px 0 0;
    color: #212529;
    font-size: 15px;
    line-height: 1.34;
    overflow-wrap: anywhere;
}

.links-item__text {
    margin: 4px 0 0;
    color: #65676b;
    font-size: 13px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

/* a long description: 3 lines, "Read in full" opens it (bkAnimateHeight) */
.links-item__text.is-clamped {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.links-item__more {
    margin-top: 2px;
    padding: 0;
    border: 0;
    background: none;
    color: #3c6690;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.links-item__more:hover {
    color: #2b4763;
}

.links-item__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    margin-top: 8px;
}

.links-item__meta {
    color: #65676b;
    font-size: 13px;
    line-height: 1.34;
}

.links-item__meta a {
    color: #3c6690;
    font-weight: 600;
}

.links-item__actions {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.links-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border: 0;
    border-radius: 4px;
    background: none;
    color: #65676b;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background-color .15s, color .15s;
}

.links-action:hover,
.links-action:focus-visible,
.links-action.is-open {
    background: #3c669012;
    color: #3c6690;
    text-decoration: none;
    outline: 0;
}

.links-action--icon {
    padding: 0;
}

.links-action--danger:hover,
.links-action--danger:focus-visible {
    background: #fcecee;
    color: #dc3545;
}

.links-action[aria-busy="true"] {
    pointer-events: none;
    opacity: .55;
}

/* the last check of the site instead of the date of adding */
.links-item__status {
    margin-top: 8px;
    color: #65676b;
    font-size: 13px;
    line-height: 1.34;
}

.links-item__status i {
    margin-right: 6px;
    color: #e4a11b;
}

.links-item__status .bk-status-label {
    margin-left: 8px;
}

.links-item__status.is-ok i {
    color: #28a745;
}

.links-item__status.is-none i {
    color: #adb5bd;
}

/* ratings with smilies (brandbook 8.24): the button, then the summary; variables of .fb-feed (lenta.css) - without them
   the menu of smilies has no background */
.links-item__reactions {
    --fb-muted: #65676b;
    --fb-card: #ffffff;
    --fb-bg: #f0f2f5;
    --fb-text: #050505;
    --fb-hover: #f2f2f2;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 32px;
}

.links-report__name {
    font-weight: 600;
}

.links-report__name:empty {
    display: none;
}

/* the window of a link on the page of the categories: the card without its shadow */
.links-card-modal .bk-modal__dialog {
    max-width: 640px;
}

.links-card-modal__body {
    min-height: 120px;
}

.links-card-modal .links-list {
    margin: 0;
    box-shadow: none;
}

.links-card-modal .links-item {
    animation: none;
}

.links-card-modal .links-item::before {
    display: none;
}

.btn-main.js-links-card-go.is-disabled {
    opacity: .7;
    pointer-events: none;
}

/* --- page links (8.31) */
.links-pages {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0 0 16px;
}

.links-pages .bk-pages__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: #fff;
    color: #3c6690;
    font-size: 13px;
    transition: background-color .15s, border-color .15s;
}

.links-pages a.bk-pages__item:hover {
    background: #3c669012;
    border-color: #3c6690;
    text-decoration: none;
}

.links-pages .bk-pages__item.is-current {
    background: #3c6690;
    border-color: #3c6690;
    color: #fff;
    font-weight: 600;
}

.links-pages .bk-pages__gap {
    display: inline-flex;
    align-items: center;
    padding: 0 4px;
    color: #65676b;
}

/* --- the form of a new link (8.26) */
.links-form {
    max-width: 640px;
}

.links-form .bk-notice {
    margin: 0 0 12px;
}

.links-form .bk-field {
    margin-bottom: 12px;
}

.links-form .bk-field__label {
    display: block;
    margin-bottom: 4px;
    color: #65676b;
    font-size: 13px;
}

.links-form .bk-field__optional {
    color: #adb5bd;
}

.links-form textarea.bk-input {
    min-height: 96px;
    resize: vertical;
}

.links-form .bk-field-counter {
    margin-top: 4px;
    color: #65676b;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.links-form .bk-field-counter.is-over {
    color: #b02a37;
    font-weight: 600;
}

/* an error appears / disappears by height with fading (brandbook 8.26) */
.links-form .bk-field-error {
    transition: grid-template-rows .2s ease, opacity .2s ease;
}

.links-form .bk-field-error.is-hidden {
    grid-template-rows: 0fr;
    opacity: 0;
}

.links-form .bk-field-error i {
    margin-right: 4px;
}

.links-form .bk-field-error a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

.links-form__submit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
}

/* the page "the link is added" */
.links-done {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 32px 16px;
    text-align: center;
}

.links-done__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #eaf6ed;
    color: #28a745;
    font-size: 22px;
    animation: bk-pop .3s ease-out;
}

.links-done__text {
    max-width: 440px;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.25;
}

.links-done__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.links-done__actions .btn-main {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
}

.links-empty {
    padding: 32px 16px;
    color: #65676b;
    font-size: 15px;
    text-align: center;
}

/* rows appear one by one (brandbook 9): the delay is set by the page */
@keyframes links-row-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

/* tablet: the categories in two columns still, the toolbar may wrap */
@media (max-width: 991px) {
    .links-categories {
        column-gap: 12px;
    }

    .links-category {
        margin-bottom: 12px;
    }
}

/* phone */
@media (max-width: 576px) {
    .links-categories {
        column-count: 1;
    }

    .links-window__body,
    .links-item {
        padding-right: 12px;
        padding-left: 12px;
    }

    .links-mini,
    .links-category__head,
    .links-category__all {
        padding-right: 12px;
        padding-left: 12px;
    }

    .links-sign--large {
        width: 32px;
        height: 32px;
        padding: 8px;
        border-radius: 8px;
        font-size: 15px;
    }

    .links-sort {
        width: 100%;
    }

    .links-sort__label {
        display: none;
    }

    .links-sort__group {
        flex: 1 1 auto;
    }

    .links-sort__item {
        flex: 1 1 0;
        justify-content: center;
        padding: 0 4px;
    }

    .links-action__text {
        display: none;
    }
}

/* the action of the header: only the icon on narrow screens (8.3) */
@media (max-width: 420px) {
    .links-add-button {
        width: 32px;
        padding: 0;
        justify-content: center;
    }

    .links-add-button__text {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    .links-category,
    .links-item,
    .links-done__icon {
        animation: none;
    }

    .links-item::before,
    .links-form .bk-field-error,
    .links-category__all i,
    .links-add-button,
    .links-action,
    .links-mini {
        transition: none;
    }
}
