/**
 * Pontes Theme — Share Buttons
 * Butoane distribuire articol: Facebook, X, WhatsApp, LinkedIn, Telegram, Email, Copy
 */

/* =========================================================
   SECȚIUNEA SHARE
   ========================================================= */

.share-buttons {
    margin-top: var(--spacing-2xl, 2.5rem);
    padding-top: var(--spacing-xl, 2rem);
    border-top: 1px solid var(--color-gray-300, #ddd);
}

.share-buttons__heading {
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-gray-600, #666);
    margin: 0 0 var(--spacing-md, 1rem) 0;
}

/* =========================================================
   LISTA DE BUTOANE
   ========================================================= */

.share-buttons__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* =========================================================
   BUTON INDIVIDUAL
   ========================================================= */

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.9rem;
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1;
    color: var(--share-color, #555);
    background: transparent;
    border: 1.5px solid color-mix(in srgb, var(--share-color, #555) 35%, transparent);
    border-radius: 2rem;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
                transform 0.12s ease, box-shadow 0.15s ease;
    appearance: none;
    -webkit-appearance: none;
    /* Override the broad theme button rule that makes everything green */
    min-height: unset;
    padding-left: 0.9rem;
    padding-right: 0.9rem;
}

.share-btn:hover {
    background: var(--share-color, #555);
    color: #fff;
    border-color: var(--share-color, #555);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px color-mix(in srgb, var(--share-color, #555) 30%, transparent);
    text-decoration: none;
}

.share-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.share-btn:focus-visible {
    outline: 3px solid var(--color-primary-light, #669900);
    outline-offset: 3px;
    background: var(--share-color, #555);
    color: #fff;
    border-color: var(--share-color, #555);
}

/* =========================================================
   ICON SVG
   ========================================================= */

.share-btn__icon {
    flex-shrink: 0;
    width: 1.1em;
    height: 1.1em;
    display: block;
}

/* Copy button: show clipboard icon by default, hide checkmark */
.share-btn--copy .share-btn__icon--check { display: none; }
.share-btn--copy .share-btn__icon--copy  { display: block; }

/* Copied state: show checkmark, hide clipboard */
.share-btn--copy.is-copied .share-btn__icon--check { display: block; }
.share-btn--copy.is-copied .share-btn__icon--copy  { display: none; }

/* Copied state color */
.share-btn--copy.is-copied {
    --share-color: #2e7d32;
    background: #2e7d32;
    color: #fff;
    border-color: #2e7d32;
}

/* Screen-reader live region (visually hidden) */
.share-btn__sr-live {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =========================================================
   RESPONSIVE — iconuri mici pe mobile
   ========================================================= */

@media (max-width: 480px) {
    .share-btn {
        padding: 0.5rem 0.65rem;
        font-size: 0;            /* Ascunde textul */
        gap: 0;
    }

    .share-btn__icon {
        width: 1.35rem;
        height: 1.35rem;
    }

    /* Textul rămâne în DOM pentru screen readeri (aria-label pe buton îl acoperă oricum) */
    .share-btn__label {
        display: none;
    }
}

@media (min-width: 481px) {
    .share-btn__label {
        display: inline;
    }
}

/* =========================================================
   DARK MODE
   ========================================================= */

body.dark-mode .share-buttons {
    border-top-color: #444;
}

body.dark-mode .share-buttons__heading {
    color: #aaa;
}

body.dark-mode .share-btn {
    color: color-mix(in srgb, var(--share-color, #aaa) 90%, white);
    border-color: color-mix(in srgb, var(--share-color, #aaa) 45%, transparent);
}

body.dark-mode .share-btn:hover,
body.dark-mode .share-btn:focus-visible {
    color: #fff;
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    .share-btn {
        transition: none;
    }
}

/* =========================================================
   PRINT — ascunde butoanele
   ========================================================= */

@media print {
    .share-buttons {
        display: none;
    }
}
