/* ================================================================
   Компонент «Поделиться» — используется вместе с /js/share.js
   Подключать на любой странице, где есть <section class="share">.
   HTML не меняется: иконки и цвета соцсетей берутся из data-network.
   Переменные --accent, --text, --bg — из общих стилей сайта (nav.css).
   ================================================================ */

.share {
    --share-radius: 16px;
    --share-surface: rgba(255, 255, 255, 0.03);
    --share-line: rgba(255, 255, 255, 0.08);

    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    margin-top: 40px;
    padding: 14px 16px;
    border: 1px solid var(--share-line);
    border-radius: var(--share-radius);
    background:
            radial-gradient(320px 120px at 0% 0%, rgba(165, 180, 252, 0.14), transparent 70%),
            linear-gradient(135deg, rgba(165, 180, 252, 0.06), rgba(255, 255, 255, 0.01));
    overflow: hidden;
}

/* тонкая светящаяся линия сверху карточки */
.share::before {
    content: "";
    position: absolute;
    top: 0;
    left: 16px;
    right: 16px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(165, 180, 252, 0.6), transparent);
}

/* ===== Заголовок ===== */

.share__title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: var(--text);
    font-family: 'Cormorant Garamond', serif;
    font-size: 19px;
    font-weight: 600;
    line-height: 1.2;
}

/* круглая иконка «поделиться» перед заголовком */
.share__title::before {
    content: "";
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background:
            url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a5b4fc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='18' cy='5' r='3'/%3E%3Ccircle cx='6' cy='12' r='3'/%3E%3Ccircle cx='18' cy='19' r='3'/%3E%3Cpath d='m8.6 13.5 6.8 4M15.4 6.5l-6.8 4'/%3E%3C/svg%3E") center / 14px no-repeat,
            rgba(165, 180, 252, 0.12);
    box-shadow: inset 0 0 0 1px rgba(165, 180, 252, 0.25);
}

/* ===== Кнопки ===== */

.share__links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.share__link,
.share__native {
    --brand: var(--accent);
    --brand-soft: rgba(165, 180, 252, 0.12);
    --icon: none;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--share-line);
    border-radius: 10px;
    background: var(--share-surface);
    color: #e5e7eb;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition:
            background 0.2s ease,
            border-color 0.2s ease,
            color 0.2s ease,
            transform 0.2s ease,
            box-shadow 0.2s ease;
}

/* иконка — маска, окрашивается цветом соцсети */
.share__link::before,
.share__native::before {
    content: "";
    flex: none;
    width: 15px;
    height: 15px;
    background: var(--brand);
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
}

.share__link:hover,
.share__native:hover {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px -10px var(--brand);
}

.share__link:active,
.share__native:active {
    transform: translateY(0);
}

.share__link:focus-visible,
.share__native:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
}

/* ===== Соцсети: цвет + иконка ===== */

.share__link[data-network="telegram"] {
    --brand: #2aabee;
    --brand-soft: rgba(42, 171, 238, 0.14);
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21.4 3.6 2.9 10.8c-1.3.5-1.2 1.2-.2 1.5l4.7 1.5 1.8 5.6c.2.6.1.9.8.9.5 0 .7-.2 1-.5l2.3-2.2 4.8 3.5c.9.5 1.5.2 1.8-.8l3.2-15.1c.3-1.3-.5-1.9-1.7-1.6zM9.7 14.2l8.6-5.4c.4-.3.8-.1.5.2l-7.2 6.5-.3 3-1.6-4.3z'/%3E%3C/svg%3E");
}

.share__link[data-network="viber"] {
    --brand: #8f6fff;
    --brand-soft: rgba(143, 111, 255, 0.14);
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C7 2 3 5.4 3 10.5c0 2.9 1.3 5.1 3.5 6.6V21l3.2-2.2c.7.1 1.5.2 2.3.2 5 0 9-3.4 9-8.5S17 2 12 2zm4.3 11.6c-.3.6-1.2 1.2-1.8 1.1-2.9-.4-6.3-3.7-6.9-6.6-.1-.6.4-1.5 1-1.8.3-.2.7-.1.9.2l1 1.4c.2.3.2.7-.1.9l-.5.4c.4 1.1 1.4 2.1 2.5 2.5l.4-.5c.2-.3.6-.3.9-.1l1.4 1c.3.2.4.6.2.9z'/%3E%3C/svg%3E");
}

.share__link[data-network="whatsapp"] {
    --brand: #25d366;
    --brand-soft: rgba(37, 211, 102, 0.13);
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 0 0-8.6 15.1L2 22l5-1.3A10 10 0 1 0 12 2zm5.3 14.1c-.2.6-1.3 1.2-1.8 1.2-.5.1-1 .2-3.3-.7-2.8-1.1-4.6-4-4.7-4.2-.1-.2-1.1-1.5-1.1-2.9s.7-2.1 1-2.4c.3-.3.6-.3.8-.3h.6c.2 0 .4 0 .6.5l.9 2.1c.1.2.1.4 0 .6l-.4.6-.4.5c-.1.2-.3.3-.1.6.2.3.8 1.3 1.7 2.1 1.2 1 2.1 1.3 2.4 1.5.3.1.5.1.7-.1l.9-1.1c.2-.3.4-.2.7-.1l2 .9c.3.2.5.2.6.4.1.1.1.7-.1 1.3z'/%3E%3C/svg%3E");
}

.share__link[data-network="facebook"] {
    --brand: #4a8cff;
    --brand-soft: rgba(74, 140, 255, 0.14);
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14 8h3V4h-3c-2.8 0-4.5 1.8-4.5 4.6V11H7v4h2.5v7h4v-7H16l.5-4h-3V8.8c0-.5.3-.8.5-.8z'/%3E%3C/svg%3E");
}

/* «Скопировать ссылку» — нейтральная, со значком цепочки */
.share__copy {
    --brand: #c7cad1;
    --brand-soft: rgba(255, 255, 255, 0.07);
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.7 1.7'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7l1.7-1.7'/%3E%3C/svg%3E");
}

/* системная кнопка «Поделиться» (телефоны) — главная, залитая акцентом */
.share__native {
    --brand: var(--bg);
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15V3M7 8l5-5 5 5'/%3E%3Cpath d='M5 13v6a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6'/%3E%3C/svg%3E");

    border-color: transparent;
    background: linear-gradient(135deg, #c4cdff, var(--accent));
    color: var(--bg);
}

.share__native:hover {
    border-color: transparent;
    background: linear-gradient(135deg, #d4dbff, #b5c1fd);
    color: var(--bg);
    box-shadow: 0 8px 20px -10px var(--accent);
}

.share__native:focus-visible {
    outline-color: var(--accent);
}

/* кнопка «Поделиться» скрыта, пока share.js не убедится, что браузер это умеет */
.share__native[hidden] {
    display: none;
}

/* ===== Телефон: кнопки сеткой на всю ширину ===== */

@media (max-width: 600px) {
    .share {
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
    }

    .share__title {
        font-size: 18px;
    }

    .share__links {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .share__link,
    .share__native {
        width: 100%;
    }

    /* «Поделиться» и «Скопировать ссылку» — во всю строку */
    .share__native,
    .share__copy {
        grid-column: 1 / -1;
    }
}

/* ===== Для тех, кто отключил анимации в системе ===== */

@media (prefers-reduced-motion: reduce) {
    .share__link,
    .share__native {
        transition: none;
    }

    .share__link:hover,
    .share__native:hover {
        transform: none;
    }
}