/* MaHe Share Buttons – Frontend Styles
   Keine externen Fonts, kein CDN, kein Tracking.
   -------------------------------------------------- */

.mahe-share-wrap {
    --btn-size: 42px;
    --btn-radius: 50%;
    --gap: 8px;
    margin: 1.75rem 0 0.5rem;
    font-family: inherit;
}

/* Alignment */
.mahe-share--align-left  .mahe-share-list { justify-content: flex-start; }
.mahe-share--align-center .mahe-share-list { justify-content: center; }
.mahe-share--align-right  .mahe-share-list { justify-content: flex-end; }

/* Sizes */
.mahe-share--small  { --btn-size: 34px; --gap: 6px; }
.mahe-share--medium { --btn-size: 42px; --gap: 8px; }
.mahe-share--large  { --btn-size: 52px; --gap: 10px; }

/* Shape */
.mahe-share--round  { --btn-radius: 50%; }
.mahe-share--pill   { --btn-radius: 999px; --btn-size: auto; }
.mahe-share--square { --btn-radius: 6px; }

/* Heading */
.mahe-share-heading {
    margin: 0 0 10px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7280;
}

/* List reset */
.mahe-share-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--gap);
}

.mahe-share-item {
    margin: 0;
    padding: 0;
}

/* Button base */
.mahe-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: var(--btn-size);
    height: var(--btn-size);
    min-width: var(--btn-size);
    padding: 0;
    border: none;
    border-radius: var(--btn-radius);
    background: var(--btn-color, #374151);
    color: #fff;
    text-decoration: none;
    font-size: 0;
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
}

/* Pill: auto width + horizontal padding */
.mahe-share--pill .mahe-share-btn {
    width: auto;
    min-width: unset;
    padding: 0 14px;
    gap: 7px;
}

/* Icon – fixed size, perfectly centered */
.mahe-share-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: calc(var(--btn-size) * 0.46);
    height: calc(var(--btn-size) * 0.46);
    /* prevent flex from stretching the icon container */
    margin: 0;
    padding: 0;
    pointer-events: none;
}

/* Pill icons fixed size */
.mahe-share--pill .mahe-share-icon {
    width: 18px;
    height: 18px;
}

.mahe-share-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Label */
.mahe-share-label {
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1;
    transition: max-width 0.2s ease, opacity 0.2s ease;
}

/* Label: never */
.mahe-share--label-never .mahe-share-label {
    display: none;
}

/* Label: hover – hidden by default, reveal on hover */
.mahe-share--label-hover:not(.mahe-share--pill) .mahe-share-label {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    margin-left: 0;
}
.mahe-share--label-hover:not(.mahe-share--pill) .mahe-share-btn:hover,
.mahe-share--label-hover:not(.mahe-share--pill) .mahe-share-btn:focus-visible {
    width: auto;
    padding: 0 12px 0 0;
    gap: 7px;
}
.mahe-share--label-hover:not(.mahe-share--pill) .mahe-share-btn:hover .mahe-share-label,
.mahe-share--label-hover:not(.mahe-share--pill) .mahe-share-btn:focus-visible .mahe-share-label {
    max-width: 120px;
    opacity: 1;
}

/* Label: always visible (non-pill) */
.mahe-share--label-always:not(.mahe-share--pill) .mahe-share-btn {
    width: auto;
    padding: 0 12px 0 0;
    gap: 7px;
}
.mahe-share--label-always:not(.mahe-share--pill) .mahe-share-label {
    max-width: 120px;
    opacity: 1;
}

/* Pill label always visible */
.mahe-share--pill .mahe-share-label {
    max-width: 120px;
    opacity: 1;
    padding-right: 2px;
}

/* Hover state */
.mahe-share-btn:hover,
.mahe-share-btn:focus-visible {
    filter: brightness(1.12);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.22);
    outline: none;
}

.mahe-share-btn:active {
    transform: translateY(0);
    filter: brightness(0.95);
}

/* Copy confirmation */
.mahe-share-btn.is-copied {
    filter: brightness(0.85);
}
.mahe-share-btn.is-copied .mahe-share-label::after {
    content: ' ✓';
}

/* Responsive: stack tighter on mobile */
@media (max-width: 480px) {
    .mahe-share-wrap {
        --btn-size: 38px;
        --gap: 6px;
    }
    .mahe-share--large {
        --btn-size: 44px;
    }
}
