/**
 * Media Lab – Social Share Buttons
 *
 * CSS Custom Properties (im Theme überschreibbar):
 *   --share-btn-size      Button-Höhe / Icon-only-Breite  (Standard: 1.75rem)
 *   --share-btn-radius    Border-Radius                    (Standard: 0.5rem)
 *   --share-gap           Abstand zwischen Buttons         (Standard: 0.5rem)
 *   --share-label-color   Farbe des äußeren Labels         (Standard: currentColor)
 *   --share-mono-color    Farbe für Stil „Einfarbig"       (Standard: #1f2937)
 *
 * Style-Varianten (Klasse auf .medialab-share):
 *   medialab-share--style-colored   Farbig / Markenfarben (Standard)
 *   medialab-share--style-mono      Einfarbig dunkel
 *   medialab-share--style-outline   Outline in Markenfarben
 *   medialab-share--style-ghost     Minimalistisch / transparent
 *
 * Icon-only (Klasse auf .medialab-share):
 *   medialab-share--icon-only       Button-Label visuell ausblenden (Screen-Reader liest weiterhin)
 */

/* ── Wrapper ────────────────────────────────────────────────────── */

.medialab-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.medialab-share--vertical {
    flex-direction: column;
    align-items: flex-start;
}

/* ── Äußeres Label ──────────────────────────────────────────────── */

.medialab-share__label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--share-label-color, currentColor);
    opacity: 0.7;
    flex-basis: 100%;
}

/* ── Button-Liste ───────────────────────────────────────────────── */

.medialab-share__list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--share-gap, 0.5rem);
    list-style: none;
    margin: 0;
    padding: 0;
}

.medialab-share--vertical .medialab-share__list {
    flex-direction: column;
}

/* ── Button Base ────────────────────────────────────────────────── */

.medialab-share__btn {
    /* Layout */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    height: var(--share-btn-size, 1.75rem); /* ↓ war 2.5rem */
    padding: 0 0.5rem;                       /* ↓ war 0 0.75rem */

    /* Erscheinungsbild */
    border-radius: var(--share-btn-radius, 0.5rem);
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: inherit;
    line-height: 1;
    white-space: nowrap;
    transition: filter 0.15s ease, transform 0.1s ease, background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;

    /* Verhindert Button-Browser-Defaults */
    appearance: none;
    -webkit-appearance: none;
    box-shadow: none;
}

.medialab-share__btn:hover,
.medialab-share__btn:focus-visible {
    filter: brightness(1.12);
    transform: translateY(-1px);
    text-decoration: none;
}

.medialab-share__btn:active {
    transform: translateY(0);
    filter: brightness(0.95);
}

/* ── Icon (SVG) ─────────────────────────────────────────────────── */

.medialab-share__btn svg {
    width: 1rem;    /* ↓ war 1.125rem */
    height: 1rem;
    fill: currentColor;
    flex-shrink: 0;
    display: block;
}

/* ── Button-Label ───────────────────────────────────────────────── */

.medialab-share__btn-label {
    /* Standard: sichtbar */
}

/* ══════════════════════════════════════════════════════════════════
   STYLE-VARIANTEN
   ══════════════════════════════════════════════════════════════════ */

/* ── Colored (Standard) ─────────────────────────────────────────── */

.medialab-share--style-colored .medialab-share__btn {
    background-color: var(--share-color, #374151);
    color: #fff;
    border-color: transparent;
}

.medialab-share--style-colored .medialab-share__btn:hover,
.medialab-share--style-colored .medialab-share__btn:focus-visible {
    color: #fff;
    filter: brightness(1.12);
}

/* Fallback: kein style-Modifier → colored */
.medialab-share:not([class*="--style-"]) .medialab-share__btn {
    background-color: var(--share-color, #374151);
    color: #fff;
    border-color: transparent;
}

/* ── Mono (Einfarbig) ───────────────────────────────────────────── */

.medialab-share--style-mono .medialab-share__btn {
    background-color: var(--share-mono-color, #1f2937);
    color: #fff;
    border-color: transparent;
}

.medialab-share--style-mono .medialab-share__btn:hover,
.medialab-share--style-mono .medialab-share__btn:focus-visible {
    color: #fff;
    filter: brightness(1.2);
}

/* ── Outline ────────────────────────────────────────────────────── */

.medialab-share--style-outline .medialab-share__btn {
    background-color: transparent;
    color: var(--share-color, #374151);
    border-color: var(--share-color, #374151);
}

.medialab-share--style-outline .medialab-share__btn:hover,
.medialab-share--style-outline .medialab-share__btn:focus-visible {
    background-color: var(--share-color, #374151);
    color: #fff;
    filter: none;
    transform: translateY(-1px);
}

/* ── Ghost (Minimalistisch) ─────────────────────────────────────── */

.medialab-share--style-ghost .medialab-share__btn {
    background-color: transparent;
    color: #6b7280;
    border-color: transparent;
}

.medialab-share--style-ghost .medialab-share__btn:hover,
.medialab-share--style-ghost .medialab-share__btn:focus-visible {
    color: var(--share-color, #374151);
    background-color: transparent;
    filter: none;
    transform: translateY(-1px);
}

/* ══════════════════════════════════════════════════════════════════
   ICON-ONLY MODUS
   ══════════════════════════════════════════════════════════════════ */

.medialab-share--icon-only .medialab-share__btn {
    padding: 0;
    width: var(--share-btn-size, 1.75rem); /* ↓ war 2.5rem */
    gap: 0;
}

.medialab-share--icon-only .medialab-share__btn svg {
    width: 1rem;   /* ↓ war 1.25rem */
    height: 1rem;
}

.medialab-share--icon-only .medialab-share__btn-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Icon-only + outline: etwas mehr Luft */
.medialab-share--icon-only.medialab-share--style-outline .medialab-share__btn {
    border-width: 1.5px;
}

/* ── Block-Wrapper (Gutenberg) ──────────────────────────────────── */

.medialab-share-block {
    /* Kein eigenes Padding – das steuert der Block-Spacing im Editor */
}

/* ── Responsive ─────────────────────────────────────────────────── */

@media (max-width: 480px) {
    .medialab-share__btn {
        padding: 0 0.375rem;
        font-size: 0.75rem;
    }
}
