/* =====================================================================
 * w1w24.de - Share-Modal (Pack 39)
 *
 * Programmierung & Design: W. Welz
 * Copyright (c) W. Welz, w1w24.de
 *
 * Modaler Teilen-Dialog mit 6 Buttons (Link kopieren, WhatsApp, Facebook,
 * X, E-Mail, Pinterest). Keine externen Dependencies, kein Tracking.
 *
 * Klassen-Praefix "w1-share-" um Konflikte mit anderem CSS zu vermeiden.
 * ===================================================================== */

/* Inline-Buttons im Beitrag und Footer */
.w1-share-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--accent, #d97706);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
    font-family: inherit;
    line-height: 1.2;
}
.w1-share-trigger:hover,
.w1-share-trigger:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    text-decoration: none;
}
.w1-share-trigger:active {
    transform: translateY(0);
}
.w1-share-trigger svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Footer-Variante: dezenter, als Text-Link */
.w1-share-trigger--footer {
    background: transparent;
    color: inherit;
    padding: 4px 0;
    font-weight: 400;
    font-size: 14px;
    border-radius: 0;
}
.w1-share-trigger--footer:hover,
.w1-share-trigger--footer:focus-visible {
    background: transparent;
    box-shadow: none;
    color: var(--accent, #d97706);
    text-decoration: underline;
    transform: none;
}

/* Beitrag-Ende-Variante: zentriert */
.w1-share-section {
    margin: 60px 0 20px;
    padding: 32px 24px;
    background: var(--surface-soft, #faf7f2);
    border-radius: var(--radius, 14px);
    text-align: center;
    border: 1px solid var(--line, #e8e4dc);
}
.w1-share-section__label {
    margin: 0 0 14px;
    font-size: 14px;
    color: var(--muted, #6b6b6b);
    font-weight: 500;
    letter-spacing: .02em;
}

/* ===== Modal ===== */
.w1-share-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}
.w1-share-modal[aria-hidden="false"] {
    display: flex;
}
.w1-share-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 18, 14, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: w1-share-fadein .18s ease;
}
.w1-share-modal__dialog {
    position: relative;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 64px rgba(0,0,0,.25);
    width: 100%;
    max-width: 460px;
    padding: 28px 28px 24px;
    box-sizing: border-box;
    animation: w1-share-zoomin .2s ease;
    font-family: inherit;
}
.w1-share-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.w1-share-modal__title {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    color: #1a1a1a;
}
.w1-share-modal__close {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 6px;
    margin: -6px;
    border-radius: 6px;
    line-height: 0;
    transition: background .15s ease, color .15s ease;
}
.w1-share-modal__close:hover,
.w1-share-modal__close:focus-visible {
    background: #f3f3f3;
    color: #222;
}
.w1-share-modal__close svg {
    width: 22px;
    height: 22px;
}

/* Buttons-Grid */
.w1-share-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}
.w1-share-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 6px;
    background: #f7f5f0;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    color: #2a2a2a;
    font-size: 12px;
    font-weight: 500;
    transition: background .15s ease, transform .12s ease;
    font-family: inherit;
    line-height: 1.2;
}
.w1-share-btn:hover,
.w1-share-btn:focus-visible {
    background: #efece5;
    transform: translateY(-2px);
    color: #2a2a2a;
    text-decoration: none;
}
.w1-share-btn:active {
    transform: translateY(0);
}
.w1-share-btn__icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.w1-share-btn__icon svg {
    width: 22px;
    height: 22px;
}
/* Marken-Farben fuer Icon-Kreise */
.w1-share-btn--copy   .w1-share-btn__icon { background: #6b7280; }
.w1-share-btn--whatsapp .w1-share-btn__icon { background: #25D366; }
.w1-share-btn--facebook .w1-share-btn__icon { background: #1877F2; }
.w1-share-btn--x        .w1-share-btn__icon { background: #000; }
.w1-share-btn--email    .w1-share-btn__icon { background: #8b5cf6; }
.w1-share-btn--pinterest .w1-share-btn__icon { background: #E60023; }

/* URL-Anzeige */
.w1-share-urlbox {
    display: flex;
    align-items: stretch;
    gap: 8px;
    background: #f7f5f0;
    border: 1px solid #e8e4dc;
    border-radius: 10px;
    padding: 4px 4px 4px 12px;
    margin-top: 12px;
    overflow: hidden;
}
.w1-share-urlbox__url {
    flex: 1;
    font-size: 13px;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    align-self: center;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.w1-share-urlbox__btn {
    padding: 8px 16px;
    background: var(--accent, #d97706);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s ease;
    font-family: inherit;
}
.w1-share-urlbox__btn:hover,
.w1-share-urlbox__btn:focus-visible {
    background: #b45309;
}
.w1-share-urlbox__btn--copied {
    background: #059669 !important;
}

/* Toast-Hinweis nach Kopieren */
.w1-share-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1a;
    color: #fff;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
}
.w1-share-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* Mobile Anpassungen */
@media (max-width: 480px) {
    .w1-share-modal__dialog {
        padding: 22px 20px 20px;
        max-width: 100%;
        border-radius: 14px;
    }
    .w1-share-buttons {
        gap: 10px;
    }
    .w1-share-btn {
        padding: 12px 4px;
    }
    .w1-share-section {
        padding: 24px 18px;
        margin: 48px 0 16px;
    }
}

/* Reduzierte Animation respektieren */
@media (prefers-reduced-motion: reduce) {
    .w1-share-modal__backdrop,
    .w1-share-modal__dialog,
    .w1-share-trigger,
    .w1-share-btn,
    .w1-share-toast {
        animation: none !important;
        transition: none !important;
    }
}

@keyframes w1-share-fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes w1-share-zoomin {
    from { opacity: 0; transform: scale(.96) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
