/* Шторка "Поделиться": посты, статьи и другие публичные страницы. */

.share-sheet {
    position: fixed;
    inset: 0;
    z-index: 3200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.share-sheet[hidden] {
    display: none;
}

.share-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16, 18, 22, .56);
    backdrop-filter: blur(2px);
}

.share-sheet__panel {
    position: relative;
    z-index: 1;
    width: min(100%, 560px);
    max-height: min(92vh, 760px);
    overflow-y: auto;
    padding: 22px 24px 20px;
    border: 1px solid var(--border-color);
    border-bottom: 0;
    border-radius: 22px 22px 0 0;
    background: var(--bg-card);
    box-shadow: 0 -18px 60px rgba(16, 18, 22, .24);
    outline: none;
    animation: share-sheet-up .22s ease-out;
}

@keyframes share-sheet-up {
    from { transform: translateY(16px); opacity: .65; }
    to { transform: translateY(0); opacity: 1; }
}

.share-sheet__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.share-sheet__eyebrow {
    margin: 0 0 3px;
    color: var(--color-primary-text);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.share-sheet__head h2 {
    margin: 0;
    font-size: 22px;
    letter-spacing: -.02em;
}

.share-sheet__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
}

.share-sheet__close:hover {
    color: var(--text-primary);
}

.share-sheet__preview {
    display: -webkit-box;
    overflow: hidden;
    margin: 14px 0 16px;
    color: var(--text-secondary);
    font-size: 13.5px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.share-sheet__native {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 46px;
    margin-bottom: 12px;
    border: 0;
    border-radius: 11px;
    background: var(--color-primary);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.share-sheet__native[hidden] {
    display: none;
}

.share-sheet__native:hover {
    background: var(--color-primary-hover);
}

.share-sheet__copy {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.share-sheet__copy input {
    min-width: 0;
    flex: 1;
    height: 40px;
    padding: 0 11px;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font: inherit;
    font-size: 12px;
}

.share-sheet__copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: var(--bg-card);
    color: var(--text-primary);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.share-sheet__copy-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary-text);
}

.share-sheet__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.share-sheet__item {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 48px;
    padding: 6px 9px;
    border: 1px solid var(--border-color);
    border-radius: 11px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.share-sheet__item:hover {
    border-color: var(--share-color, var(--color-primary));
    background: color-mix(in srgb, var(--share-color, var(--color-primary)) 7%, var(--bg-card));
}

.share-sheet__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 8px;
    background: var(--share-color, var(--color-primary));
    color: #fff;
    font-size: 13px;
}

.share-sheet__item--telegram { --share-color: #229ed9; }
.share-sheet__item--whatsapp { --share-color: #25d366; }
.share-sheet__item--vk { --share-color: #0077ff; }
.share-sheet__item--ok { --share-color: #ee8208; }
.share-sheet__item--x { --share-color: #111; }
.share-sheet__item--email { --share-color: #6b7280; }

.share-sheet__status {
    min-height: 18px;
    margin: 12px 0 0;
    color: var(--color-primary-text);
    font-size: 12px;
    text-align: center;
}

.share-sheet__count {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 11px;
    text-align: center;
}

body.share-sheet-open {
    overflow: hidden;
}

@media (min-width: 760px) {
    .share-sheet {
        align-items: center;
    }

    .share-sheet__panel {
        border-bottom: 1px solid var(--border-color);
        border-radius: 22px;
    }
}

@media (max-width: 560px) {
    .share-sheet__panel {
        padding: 18px 16px 16px;
    }

    .share-sheet__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .share-sheet__copy {
        flex-wrap: wrap;
    }

    .share-sheet__copy input {
        flex-basis: 100%;
    }
}

.share-sheet__panel:focus,
.share-sheet__panel:focus-visible {
    outline: none;
}
